#! /bin/sh # # This is a shell script that converts hylafax-v4.0pl0 to hylafax-v4.0pl1 # TOP=. findBinary() { IFS=: for i in $PATH; do test -x $i/$1 && return done echo "Fatal error: this shell script requires $2." exit 1 } findBinary patch "Larry Wall's patch program" Patch() { echo "Patch $1:" patch -s $TOP/$1 } NewFile() { echo "New file $1" cat >$TOP/$1 } NewDir() { echo "New directory $1" mkdir "$TOP/$1" } RmDir() { echo "Remove directory $1" rm -rf $TOP/$1.orig mv $TOP/$1 $TOP/$1.orig } RmFile() { echo "Remove $1" rm -f $TOP/$1.orig mv $TOP/$1 $TOP/$1.orig } Patch README<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/README Thu Aug 29 20:24:23 1996 --- hylafax-v4.0pl1/README Tue Nov 26 15:20:16 1996 *************** *** 1,4 **** ! $Id: README,v 1.140 1996/08/27 23:21:50 sam Rel $ HylaFAX, Version 4.0 (release) ------------------------------ --- 1,4 ---- ! $Id: README,v 1.141 1996/10/31 19:10:46 sam Rel $ HylaFAX, Version 4.0 (release) ------------------------------ *************** *** 140,150 **** Chris Munonye Rob Newberry Dag Nygren Jonas Olsson Dave Packer Damon Permezel David Pike Amir Plivatsky Andy Rabagliati ! Eric Rescorla Marshall Rose Daniel Rosenblatt ! Joel Rosi-Schwartz Tim Rylance Joseph E. Sacco ! Thomas A. Szybist Brent Townshend Peter White ! Steve Williams Scott Woodard David Vrona ! Paul Vixie Christian Zahl (and surely others). Also, a special thanks to Ed McCreight for helping me understand the stuff "between the lines" that's necessary to --- 140,151 ---- Chris Munonye Rob Newberry Dag Nygren Jonas Olsson Dave Packer Damon Permezel David Pike Amir Plivatsky Andy Rabagliati ! Eric Rescorla Matthew Rice Tim Rice ! Marshall Rose Daniel Rosenblatt Joel Rosi-Schwartz ! Tim Rylance Joseph E. Sacco Thomas A. Szybist ! Brent Townshend Peter White Steve Williams ! Scott Woodard David Vrona Paul Vixie ! Christian Zahl (and surely others). Also, a special thanks to Ed McCreight for helping me understand the stuff "between the lines" that's necessary to EOF-EOF-EOF Patch VERSION<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/VERSION Thu Aug 29 20:24:22 1996 --- hylafax-v4.0pl1/VERSION Tue Nov 26 15:20:16 1996 *************** *** 1 **** ! 4.0pl0 --- 1 ---- ! 4.0pl1 EOF-EOF-EOF Patch config.site<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/config.site Thu Aug 29 20:24:25 1996 --- hylafax-v4.0pl1/config.site Tue Nov 26 15:20:18 1996 *************** *** 1,4 **** ! # $Id: config.site,v 1.37 1996/08/19 18:00:44 sam Rel $ # # HylaFAX Facsimile Software # --- 1,4 ---- ! # $Id: config.site,v 1.40 1996/11/23 17:28:45 sam Rel $ # # HylaFAX Facsimile Software # *************** *** 54,59 **** --- 54,60 ---- #REGEX="yes" # use distributed regular expression package #ZLIB="yes" # use distributed zlib distribution #UTMP="utmpx" # type of utmp+wtmp handling (auto|utmp|utmpx) + #DBLIB="no" # use distributed libdb distribution # # Directory parameters. *************** *** 163,168 **** --- 164,186 ---- #REGEXINC="/usr/include" # place to find regex.h # + # The LIBDB hashed database package is (currently) used + # only by the MLA tools that are not publicly available + # but which are built from within this source tree. In + # the future the fax software may use the libdb software + # for the remote client capabilities database (so these + # hooks are included now). + # + # The source for the LIBDB hashed database package + # is not required to build this software, but the package + # is required to link against. If the copy of the software + # that is included in this distribution is not to be used + # then set DBLIB=no and supply the following definitions. + # + #LIBDB=" " # linkage convention for libdb package + #DBLIBINC="/usr/include" # place to find db.h + + # # Parameters to control various workarounds for system bugs. # # These parameters are normally set in configure based on *************** *** 182,187 **** --- 200,206 ---- #CONFIG_BADGETOPTPROTO="no" # system has incorrect getopt func decl #CONFIG_SOCKARGLENTYPE="unsigned long" # call-by-ref arg type for socket funcs #CONFIG_BADSELECTPROTO="no" # system has way old select func decl + #CONFIG_MAXGID="5999" # maximum permissable GID # # Dynamic Shared Object (DSO) support. *************** *** 206,211 **** --- 225,232 ---- #MAKELQUOTE="<" # make include syntax #MAKERQUOTE=">" # make include syntax #SETMAKE='MAKE = ${MAKE}' # define if make does not setup $MAKE + #MKDEPCOPTS="" # C compiler opts to supply w/ -M + #MKDEPCXXOPTS="" # C++ compiler opts to supply w/ -M # # General system stuff used by the distribution. EOF-EOF-EOF Patch configure<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/configure Thu Aug 29 20:24:24 1996 --- hylafax-v4.0pl1/configure Tue Nov 26 15:20:17 1996 *************** *** 1,5 **** #!/bin/sh ! # $Id: configure,v 1.390 1996/08/30 02:56:20 sam Rel $ # # HylaFAX Facsimile Software # --- 1,5 ---- #!/bin/sh ! # $Id: configure,v 1.401 1996/11/23 17:28:45 sam Rel $ # # HylaFAX Facsimile Software # *************** *** 77,82 **** --- 77,85 ---- REGEX=yes LIBREGEX='-L${DEPTH}/regex -lregex' REGEXINC='${DEPTH}/${TOPSRCDIR}/regex' + DBLIB=no + LIBDB="-L/usr/local/lib -ldb" + DBLIBINC=/usr/local/include : ${MAKE=make} # make to use # screws up the test of `-f -' *************** *** 91,96 **** --- 94,100 ---- CXX CXXFILE DATE + DBLIBINC ENVOPTS GCOPTS GCXXOPTS *************** *** 99,104 **** --- 103,110 ---- MAKEINCLUDE MAKELQUOTE MAKERQUOTE + MKDEPCOPTS + MKDEPCXXOPTS PROTOTYPES RANLIB REGEXINC *************** *** 124,129 **** --- 130,136 ---- CP CMP COL + DBLIB DEFVRES DPSRIP PATH_DPSRIP DSO *************** *** 152,157 **** --- 159,165 ---- LIBREGEX LIBTIFF LIBZ + LIBDB LLDOPTS LN LN_S *************** *** 324,330 **** -target|--target) ac_prev=TARGET;; -target=*|--target=*) TARGET="$ac_optarg" ;; -version|--version) ! echo "This is HylaFAX configure $Revision: 1.390 $" exit 0 ;; -help|--help) usage; exit 0;; --- 332,338 ---- -target|--target) ac_prev=TARGET;; -target=*|--target=*) TARGET="$ac_optarg" ;; -version|--version) ! echo "This is HylaFAX configure $Revision: 1.401 $" exit 0 ;; -help|--help) usage; exit 0;; *************** *** 485,490 **** --- 493,499 ---- OTIFFINC="$TIFFINC"; OLIBTIFF="$LIBTIFF" OZLIBINC="$ZLIBINC"; OLIBZ="$LIBZ" OREGEXINC="$REGEXINC"; OLIBREGEX="$LIBREGEX" + ODBLIBINC="$DBLIBINC"; OLIBDB="$LIBDB" . ./config.cache capture . ./config.cache # NB: these are calculated each time from scratch *************** *** 493,498 **** --- 502,508 ---- TIFFINC="$OTIFFINC"; LIBTIFF="$OLIBTIFF" ZLIBINC="$OZLIBINC"; LIBZ="$OLIBZ" REGEXINC="$OREGEXINC"; LIBREGEX="$OLIBREGEX" + DBLIBINC="$ODBLIBINC"; LIBDB="$OLIBDB" fi identifyTarget() *************** *** 609,615 **** -I*) echo "$i" | sed 's;^-I;-I../;' ;; *) echo "../$i" ;; esac ! done) | tr '\012' ' '` | sed -e 's;[ ][ ]*$;;' -e 's;/[.]$;;' } # --- 619,626 ---- -I*) echo "$i" | sed 's;^-I;-I../;' ;; *) echo "../$i" ;; esac ! done) | tr '\012' ' '` | \ ! sed -e 's;/[.]/;/;g' -e 's;[ ][ ]*$;;' -e 's;/[.]$;;' } # *************** *** 624,629 **** --- 635,641 ---- conftestmmap confx confy confMakefile + conf.db core dummy dummy.C *************** *** 862,868 **** main(int argc, char* argv) { exit(0); } EOF capture cat dummy.c ! if capture "$CCOMPILER -c -M dummy.c | grep '^dummy.o[ ]*:[ ]*dummy.c'"; then Note "Looks like $CCOMPILER supports the -M option for generating make dependencies." MKDEPEND='\${SHELL} \${PORT}/mkdepend' else --- 874,880 ---- main(int argc, char* argv) { exit(0); } EOF capture cat dummy.c ! if capture "$CCOMPILER -c -M $MKDEPCOPTS dummy.c | grep '^dummy.o[ ]*:[ ]*dummy.c'"; then Note "Looks like $CCOMPILER supports the -M option for generating make dependencies." MKDEPEND='\${SHELL} \${PORT}/mkdepend' else *************** *** 1260,1265 **** --- 1272,1278 ---- OTIFFINC="${TIFFINC}"; x="`relativize ${TIFFINC}`"; TIFFINC="$x" OZLIBINC="${ZLIBINC}"; x="`relativize ${ZLIBINC}`"; ZLIBINC="$x" OREGEXINC="${REGEXINC}"; x="`relativize ${REGEXINC}`"; REGEXINC="$x" + ODBLIBINC="${DBLIBINC}"; x="`relativize ${DBLIBINC}`"; DBLIBINC="$x" makeDefs xdefs # *************** *** 1444,1455 **** fi CheckForLibrary crypt -lc || { # ! # FreeBSD-2.1 in particular needs this. ! # ! if CheckForLibrary crypt -lcrypt; then ! Note "Looks like -lcrypt is needed for crypt." ! MACHDEPLIBS="$MACHDEPLIBS -lcrypt" ! fi } CheckForLibrary strftime -lc || { # --- 1457,1473 ---- fi CheckForLibrary crypt -lc || { # ! # FreeBSD-2.1 in particular needs -lcrypt. ! # SCO sometime has -lcrypt_d (domestic) and ! # sometimes -lcrypt_i (import?) ! # ! for i in -lcrypt -lcrypt_d -lcrypt_i; do ! if CheckForLibrary crypt $i; then ! Note "Looks like $i is needed for crypt." ! MACHDEPLIBS="$MACHDEPLIBS $i" ! break; ! fi ! done } CheckForLibrary strftime -lc || { # *************** *** 1834,1839 **** --- 1852,1858 ---- test "$CONFIG_SOCKARGLENTYPE" || { # int vs unsigned long vs ... case $TARGET in # XXX fill in for busted systems + *-univel-*) CONFIG_SOCKARGLENTYPE=size_t;; *) CONFIG_SOCKARGLENTYPE=int;; esac } *************** *** 1841,1846 **** --- 1860,1887 ---- Note "... using $CONFIG_SOCKARGLENTYPE for call-by-reference socket length params" echo "#define CONFIG_SOCKARGLENTYPE $CONFIG_SOCKARGLENTYPE" fi + # + # Select the maximum fax UID. This value is stored + # in the GID of files so must be constrained by any + # system limitations. The maximum value is used for + # anonymous logins. The default value of 60002 comes + # from NFS/nobody usage on various systems. + # + test "$CONFIG_MAXGID" || { + case $TARGET in + *-sco*) CONFIG_MAXGID=60000;; + *-hpux*) CONFIG_MAXGID=60000;; + *) CONFIG_MAXGID=60002;; # default + esac + } + if [ "$CONFIG_MAXGID" ]; then + if [ "$CONFIG_MAXGID" -le 60002 ]; then + Note "... constrain client IDs to be <= $CONFIG_MAXGID" + echo "#define CONFIG_MAXGID $CONFIG_MAXGID" + else + Note "... max client ID too large ($CONFIG_MAXGID); using default" + fi + fi } # *************** *** 2854,2859 **** --- 2895,2991 ---- Note "Done checking ZLIB support." fi + # NB: only check if we have the MLA tools + if [ -f $SRCDIR/MLA/VERSION -a $DBLIB = no ]; then + Note "" + Note "Checking LIBDB support." + # + # Verify library is compatible. + # + cat>t.c< + #include + #include + #include + #include "db.h" + main() + { + DBT key, data; + const char d[] = "some random string"; + const char k[] = "mykey"; + DB* db = dbopen("conf.db", O_RDWR|O_CREAT, 0644, DB_HASH, NULL); + if (db == NULL) { + printf("Cannot create hashed database file conf.db\n"); + exit(-1); + } + key.data = (void*) k; + key.size = sizeof (k); + data.data = (void*) d; + data.size = sizeof (d); + if ((*db->put)(db, &key, &data, 0) != 0) { + printf("Error writing hashed db record\n"); + exit(-1); + } + (void) (*db->close)(db); + db = dbopen("conf.db", O_RDONLY, 0644, DB_HASH, NULL); + if (db == NULL) { + printf("Cannot reopen hashed database file conf.db\n"); + exit(-1); + } + data.data = (void*) NULL; + data.size = 0; + if ((*db->get)(db, &key, &data, 0) != 0) { + printf("Error reading hashed db record\n"); + exit(-1); + } + if (data.size != sizeof (d) || memcmp(data.data, d, data.size) != 0) { + printf("Hashed db record mismatch: size %u data \"%s\"\n", + data.size, data.data ? data.data : "(null)"); + exit(-1); + } + (*db->close)(db); + exit(0); + } + EOF + capture cat t.c + if runMake t "t:; \${CC} \${CVERSION} -I${ODBLIBINC} t.c ${LIBDB} ${MACHDEPLIBS}" && capture ./a.out; then + Note "Using LIBDB include files from $ODBLIBINC" + Note "Using pre-built LIBDB library $LIBDB" + else + cat 1>&2 <&2 + cat 1>&2 < as the program to exec for a data call." else ! PATH_GETTY=`findApp ttymon /usr/lib/saf:/usr/libexec:/sbin:$PATH` test -z "$PATH_GETTY" && \ PATH_GETTY=`findApp getty /usr/libexec:/sbin:$PATH` test -z "$PATH_GETTY" && \ --- 3296,3308 ---- if CheckForDefine _PATH_GETTY paths.h; then Note "Using _PATH_GETTY from as the program to exec for a data call." else ! # ! # NB: use findFile instead of findApp because on some ! # systems this file is mode 544; so if configure ! # is run by an unprivileged user the file will not ! # be located. ! # ! PATH_GETTY=`findFile ttymon /usr/lib/saf:/usr/libexec:/sbin:$PATH` test -z "$PATH_GETTY" && \ PATH_GETTY=`findApp getty /usr/libexec:/sbin:$PATH` test -z "$PATH_GETTY" && \ *************** *** 3240,3245 **** --- 3378,3384 ---- " case $TARGET in *-aix*) LOCKDIRS="/etc/locks $LOCKDIRS";; + *-sco*) LOCKDIRS="/usr/spool/uucp $LOCKDIRS";; esac DIR_LOCKS= for i in $LOCKDIRS; do *************** *** 3349,3354 **** --- 3488,3494 ---- EOF PATH_PSRIP=/usr/local/bin/gs + PATH_GSRIP=$PATH_PSRIP fi } *************** *** 3785,3793 **** promptForParameter $i; done fi checkForExecutable $PATH_SENDMAIL checkForExecutable $PATH_GETTY ! printConfig; prompt "Are these ok [yes]?"; read ok test -z "$ok" && ok=yes case "$ok" in [1-9]|1[0-9]) promptForParameter $ok;; --- 3925,3934 ---- promptForParameter $i; done fi + printConfig checkForExecutable $PATH_SENDMAIL checkForExecutable $PATH_GETTY ! prompt "Are these ok [yes]?"; read ok test -z "$ok" && ok=yes case "$ok" in [1-9]|1[0-9]) promptForParameter $ok;; *************** *** 3910,3915 **** --- 4051,4057 ---- x="`relativize ${LIBTIFF}`"; LIBTIFF="$x" x="`relativize ${LIBZ}`"; LIBZ="$x" x="`relativize ${LIBREGEX}`"; LIBREGEX="$x" + x="`relativize ${LIBDB}`"; LIBDB="$x" # NB: these should be sorted alphabetically $RM confsed2; dumpvars "$VAR2" DEFPAGESIZE | sort > confsed2 *************** *** 4027,4032 **** --- 4169,4175 ---- test $PORT = yes && SedConfigFiles port/Makefile test $ZLIB = yes && SedConfigFiles zlib/Makefile test $REGEX = yes && SedConfigFiles regex/Makefile + test $DBLIB = yes && SedConfigFiles dblib/Makefile test $AFM = yes && SedConfigFiles afm/Makefile if [ $HTML = yes ]; then HTMLDIRS=" *************** *** 4044,4051 **** -e "s;[^ ]*\.html;$i/&;g" \ -e "s;[^ ]*\.sh;$i/&;g"` done - test -d $SRCDIR/html/tools/MLA && SedConfigFiles html/tools/MLA/Makefile fi if [ "$MAKEDEPINCLUDE" != "sinclude" ]; then Note "Setting up make dependency files." --- 4187,4194 ---- -e "s;[^ ]*\.html;$i/&;g" \ -e "s;[^ ]*\.sh;$i/&;g"` done fi + test -f $SRCDIR/MLA/VERSION && SedConfigFiles MLA/Makefile if [ "$MAKEDEPINCLUDE" != "sinclude" ]; then Note "Setting up make dependency files." *************** *** 4075,4085 **** test $PORT = yes && DEPEND="$DEPEND port" test $ZLIB = yes && DEPEND="$DEPEND zlib" test $REGEX = yes && DEPEND="$DEPEND regex" test $AFM = yes && DEPEND="$DEPEND afm" if [ $HTML = yes ]; then DEPEND="$DEPEND html html/tools" - test -d $SRCDIR/html/tools/MLA && DEPEND="$DEPEND html/tools/MLA" fi test -d $SRCDIR/faxview -a -d faxview && DEPEND="$DEPEND faxview" for i in $DEPEND; do test -f $i/Makedepend || cp /dev/null $i/Makedepend --- 4218,4229 ---- test $PORT = yes && DEPEND="$DEPEND port" test $ZLIB = yes && DEPEND="$DEPEND zlib" test $REGEX = yes && DEPEND="$DEPEND regex" + test $DBLIB = yes && DEPEND="$DEPEND dblib" test $AFM = yes && DEPEND="$DEPEND afm" if [ $HTML = yes ]; then DEPEND="$DEPEND html html/tools" fi + test -f $SRCDIR/MLA/VERSION && DEPEND="$DEPEND MLA" test -d $SRCDIR/faxview -a -d faxview && DEPEND="$DEPEND faxview" for i in $DEPEND; do test -f $i/Makedepend || cp /dev/null $i/Makedepend EOF-EOF-EOF Patch defs.in<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/defs.in Thu Aug 29 20:24:25 1996 --- hylafax-v4.0pl1/defs.in Tue Nov 26 15:20:19 1996 *************** *** 1,4 **** ! # $Id: defs.in,v 1.19 1996/06/24 02:57:39 sam Rel $ # # @WARNING@ # --- 1,4 ---- ! # $Id: defs.in,v 1.22 1996/10/13 17:26:38 sam Rel $ # # @WARNING@ # *************** *** 164,169 **** --- 164,179 ---- ZLIBINC = @ZLIBINC@ LIBZ = @LIBZ@ # + # libdb-related definitions. The source for the libdb library + # is not required to build this software, but you must have + # the libdb library installed somewhere on your system to link + # against. If the default "-L /usr/local/lib -ldb" is + # insufficient to locate the library you can setup a config.local + # file that defines LIBDB and/or DBINC (used to find db.h) + # + DBLIBINC = @DBLIBINC@ + LIBDB = @LIBDB@ + # # regex-related definitions. The source for the POSIX regular # expression package is not required to build this software, # but you must have the resulting library installed somewhere *************** *** 261,268 **** # lot of makefiles already use the nondescript LMKDEPFLAGS for C language # mkdepend options, so we initialize LMKDEPCFLAGS with ${LMKDEPFLAGS}. # ! MKDEPENDC++ = ${MKDEPEND} ${MKDEPC++FLAGS} -c "${C++F} ${C++FILE} -M" ! MKDEPENDC = ${MKDEPEND} ${MKDEPCFLAGS} -c "${CCF} -M" MKDEPC++FLAGS = ${VMKDEPC++FLAGS} ${LMKDEPC++FLAGS} ${GMKDEPC++FLAGS} MKDEPCFLAGS = ${VMKDEPCFLAGS} ${LMKDEPCFLAGS} ${GMKDEPCFLAGS} --- 271,279 ---- # lot of makefiles already use the nondescript LMKDEPFLAGS for C language # mkdepend options, so we initialize LMKDEPCFLAGS with ${LMKDEPFLAGS}. # ! MKDEPENDC++ = ${MKDEPEND} ${MKDEPC++FLAGS} -c \ ! "${C++F} ${C++FILE} -c -M @MKDEPCXXOPTS@" ! MKDEPENDC = ${MKDEPEND} ${MKDEPCFLAGS} -c "${CCF} -c -M @MKDEPCOPTS@" MKDEPC++FLAGS = ${VMKDEPC++FLAGS} ${LMKDEPC++FLAGS} ${GMKDEPC++FLAGS} MKDEPCFLAGS = ${VMKDEPCFLAGS} ${LMKDEPCFLAGS} ${GMKDEPCFLAGS} EOF-EOF-EOF Patch dist/hylafax.alpha<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/dist/hylafax.alpha Mon Aug 19 11:29:19 1996 --- hylafax-v4.0pl1/dist/hylafax.alpha Mon Sep 30 15:28:33 1996 *************** *** 1 **** ! define ALPHA 021 --- 1 ---- ! define ALPHA 022 EOF-EOF-EOF Patch dist/hylafax.spec<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/dist/hylafax.spec Thu Aug 29 20:24:26 1996 --- hylafax-v4.0pl1/dist/hylafax.spec Tue Dec 3 12:02:01 1996 *************** *** 1,4 **** ! # $Id: hylafax.spec,v 1.43 1996/08/27 23:16:10 sam Rel $ # # HylaFAX Facsimile Software # --- 1,4 ---- ! # $Id: hylafax.spec,v 1.44 1996/12/03 20:01:57 sam Exp $ # # HylaFAX Facsimile Software # *************** *** 26,32 **** # OF THIS SOFTWARE. # define CUR_MAJ_VERS 1006 # Major Version number ! define CUR_MIN_VERS 009 # Minor Version number define CUR_VERS ${CUR_MAJ_VERS}${CUR_MIN_VERS}${ALPHA} define FAX_NAME "HylaFAX" --- 26,32 ---- # OF THIS SOFTWARE. # define CUR_MAJ_VERS 1006 # Major Version number ! define CUR_MIN_VERS 010 # Minor Version number define CUR_VERS ${CUR_MAJ_VERS}${CUR_MIN_VERS}${ALPHA} define FAX_NAME "HylaFAX" EOF-EOF-EOF Patch distrules<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/distrules Thu Aug 29 20:24:26 1996 --- hylafax-v4.0pl1/distrules Tue Nov 26 15:20:19 1996 *************** *** 1,4 **** ! # $Id: distrules,v 1.314 1996/08/26 19:40:57 sam Rel $ # # HylaFAX Facsimile Software # --- 1,4 ---- ! # $Id: distrules,v 1.315 1996/09/30 22:28:09 sam Rel $ # # HylaFAX Facsimile Software # *************** *** 143,148 **** --- 143,149 ---- html/v4.0beta018.html \ html/v4.0beta020.html \ html/v4.0beta021.html \ + html/v4.0beta022.html \ html/Modems/Supra/class2.html \ html/Modems/Supra/class1.html \ html/Modems/Hayes/hayes.html \ EOF-EOF-EOF Patch etc/faxsetup.sh.in<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/etc/faxsetup.sh.in Thu Aug 29 20:24:38 1996 --- hylafax-v4.0pl1/etc/faxsetup.sh.in Tue Nov 26 15:20:33 1996 *************** *** 1,5 **** #! @SCRIPT_SH@ ! # $Id: faxsetup.sh.in,v 1.28 1996/08/28 19:22:52 sam Rel $ # # @WARNING@ # --- 1,5 ---- #! @SCRIPT_SH@ ! # $Id: faxsetup.sh.in,v 1.32 1996/11/26 23:18:54 sam Rel $ # # @WARNING@ # *************** *** 382,388 **** # Setup the password file manipulation functions according # to whether we have System-V style support through the # passmgmt program, or BSD style support through the chpass ! # program. If neither are found, we setup functions that # will cause us to abort if we need to munge the password file. # # NB: some systems override these function definitions through --- 382,389 ---- # Setup the password file manipulation functions according # to whether we have System-V style support through the # passmgmt program, or BSD style support through the chpass ! # program, or for SCO boxes through pwconv, or SVR4 style support ! # through useradd. If none are found, we setup functions that # will cause us to abort if we need to munge the password file. # # NB: some systems override these function definitions through *************** *** 418,423 **** --- 419,434 ---- { return 0 # entries are always locked } + elif [ -f /etc/pwconv ]; then # could be a SCO box + addPasswd() + { + echo "${1}:NOLOGIN:${2}:${3}:Facsimile Agent:${4}:" >> ${PASSWD} + /etc/pwconv + } + lockPasswd() + { + return 0 # entries are always locked + } elif [ -f /usr/sbin/useradd -o -f /etc/useradd ]; then addPasswd() { *************** *** 1254,1260 **** } INETDCONF=`PickFile $INETDCONF /etc/inetd.conf /etc/inet/inetd.conf` ! ALIASES=`PickFile $ALIASES /etc/aliases` SERVICES=`PickFile $SERVICES /etc/inet/services` test -f /etc/master.passwd && PASSWD=/etc/master.passwd --- 1265,1271 ---- } INETDCONF=`PickFile $INETDCONF /etc/inetd.conf /etc/inet/inetd.conf` ! ALIASES=`PickFile $ALIASES /etc/aliases /etc/ucbmail/aliases /usr/mmdf/table/alias.user /usr/mmdf/table/alias.n` SERVICES=`PickFile $SERVICES /etc/inet/services` test -f /etc/master.passwd && PASSWD=/etc/master.passwd *************** *** 1541,1546 **** --- 1552,1585 ---- isOK $x && fixupFaxUser fi machdepPasswdWork + + # + # Verify existence, permission and ownership of sensitive files. + # XXX there are other files too + # + HOSTS=$DIR_SPOOL/etc/hosts + test -f $HOSTS || { + cat<$HOSTS + echo "127.0.0.1" >>$HOSTS + } + # + # Too complicated to check contents: + # simply force correct protection and ownership + # + $CHOWN $faxUID $HOSTS; $CHGRP $faxGID $HOSTS + $CHMOD 600 $HOSTS fi # *************** *** 1737,1744 **** if newaliases 2>/dev/null; then echo "Rebuilt $ALIASES database." else ! echo "Can not find newaliases to rebuild $ALIASES;" ! echo "you will have to do it yourself." fi fi fi --- 1776,1788 ---- if newaliases 2>/dev/null; then echo "Rebuilt $ALIASES database." else ! # could be a SCO machine running mmdf ! if test -x /usr/mmdf/table/dbmbuild ; then ! su mmdf -c "/usr/mmdf/table/dbmbuild" ! else ! echo "Can not find newaliases to rebuild $ALIASES;" ! echo "you will have to do it yourself." ! fi fi fi fi *************** *** 1881,1887 **** isNotOK() { x="$1" ! test -n "$x" -a "$x" != y -a "$x" != yes } CONFIG=$DIR_SPOOL/etc/config # faxq config file --- 1925,1931 ---- isNotOK() { x="$1" ! test "$x" != y -a "$x" != yes } CONFIG=$DIR_SPOOL/etc/config # faxq config file *************** *** 1898,1904 **** JUNK="$JUNK $PROMPTS" $RM $PROMPTS ! while isNotOK $ok; do if [ "$ok" != skip ]; then test -f $PROMPTS || compilePrompts>$PROMPTS<$PROMPTS< 0 && cover[0] != '/') { ! fd = ::open((char*) tildeExpand("~/" | cover), O_RDONLY); if (fd < 0) ! fd = ::open((char*) (fxStr(FAX_LIBDATA) | "/" | cover), O_RDONLY); } else ! fd = ::open((char*) cover, O_RDONLY); if (fd < 0) { printError( "Could not locate prototype cover sheet \"%s\"", ! (char*) cover); return; } printf("%%!PS-Adobe-2.0 EPSF-2.0\n"); --- 233,246 ---- { int fd; if (cover.length() > 0 && cover[0] != '/') { ! fd = Sys::open(tildeExpand("~/" | cover), O_RDONLY); if (fd < 0) ! fd = Sys::open(fxStr(FAX_LIBDATA) | "/" | cover, O_RDONLY); } else ! fd = Sys::open(cover, O_RDONLY); if (fd < 0) { printError( "Could not locate prototype cover sheet \"%s\"", ! (const char*) cover); return; } printf("%%!PS-Adobe-2.0 EPSF-2.0\n"); *************** *** 265,271 **** int n; while ((n = read(fd, buf, sizeof (buf))) > 0) fwrite(buf, n, 1, stdout); ! ::close(fd); printf("end\n"); } --- 271,277 ---- int n; while ((n = read(fd, buf, sizeof (buf))) > 0) fwrite(buf, n, 1, stdout); ! Sys::close(fd); printf("end\n"); } *************** *** 358,364 **** { time_t t = time(0); char date[128]; ! strftime(date, sizeof (date), "%a %b %d %Y, %H:%M %Z", localtime(&t)); coverDef("todays-date", date); } --- 364,370 ---- { time_t t = time(0); char date[128]; ! strftime(date, sizeof (date), dateFmt, localtime(&t)); coverDef("todays-date", date); } EOF-EOF-EOF Patch faxd/ClassModem.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/ClassModem.c++ Thu Aug 29 20:25:40 1996 --- hylafax-v4.0pl1/faxd/ClassModem.c++ Tue Nov 26 15:21:29 1996 *************** *** 1,4 **** ! /* $Id: ClassModem.c++,v 1.31 1996/08/29 19:04:28 sam Rel $ */ /* * Copyright (c) 1994-1996 Sam Leffler * Copyright (c) 1994-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: ClassModem.c++,v 1.32 1996/11/20 03:20:11 sam Rel $ */ /* * Copyright (c) 1994-1996 Sam Leffler * Copyright (c) 1994-1996 Silicon Graphics, Inc. *************** *** 218,223 **** --- 218,225 ---- { "ERROR", 5, ClassModem::AT_NOTHING, ClassModem::ERROR, ClassModem::CALLTYPE_ERROR }, { "+FHNG:", 6, + ClassModem::AT_NOTHING, ClassModem::NOCARRIER, ClassModem::CALLTYPE_ERROR }, + { "+FHS:", 5, ClassModem::AT_NOTHING, ClassModem::NOCARRIER, ClassModem::CALLTYPE_ERROR }, { "FAX", 3, ClassModem::AT_CONNECT, ClassModem::OK, ClassModem::CALLTYPE_FAX }, EOF-EOF-EOF Patch faxd/ClassModem.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/ClassModem.h Thu Aug 29 20:25:27 1996 --- hylafax-v4.0pl1/faxd/ClassModem.h Tue Nov 26 15:21:16 1996 *************** *** 1,4 **** ! /* $Id: ClassModem.h,v 1.12 1996/06/24 03:00:19 sam Rel $ */ /* * Copyright (c) 1994-1996 Sam Leffler * Copyright (c) 1994-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: ClassModem.h,v 1.13 1996/10/02 04:24:31 sam Rel $ */ /* * Copyright (c) 1994-1996 Sam Leffler * Copyright (c) 1994-1996 Silicon Graphics, Inc. *************** *** 71,76 **** --- 71,80 ---- #define ESC_DELAY (0x80|0x04) // delay period of time #define ESC_WAITFOR (0x80|0x08) // wait for modem response #define ESC_FLUSH (0x80|0x10) // flush input queue + + #ifdef OFF + #undef OFF // workaround for SCO + #endif /* * This is an abstract class that defines the interface to EOF-EOF-EOF Patch faxd/HDLCFrame.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/HDLCFrame.h Thu Aug 29 20:25:32 1996 --- hylafax-v4.0pl1/faxd/HDLCFrame.h Tue Nov 26 15:21:20 1996 *************** *** 1,4 **** ! /* $Id: HDLCFrame.h,v 1.16 1996/06/24 03:00:35 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: HDLCFrame.h,v 1.17 1996/09/25 17:23:05 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 43,48 **** --- 43,49 ---- operator u_char*(); // Return base of buffer u_char& operator[](u_int i) const; // NB: no bounds checking + u_char& operator[](int i) const; // NB: no bounds checking fxBool moreFrames() const; // more frames follow fxBool isOK() const; // frame has good FCS *************** *** 74,79 **** --- 75,81 ---- inline HDLCFrame::operator u_char*() { return base; } inline u_char& HDLCFrame::operator[](u_int i) const { return base[i]; } + inline u_char& HDLCFrame::operator[](int i) const { return base[i]; } inline fxBool HDLCFrame::moreFrames() const { return ((*this)[1]&0x08) == 0; } EOF-EOF-EOF Patch faxd/Makefile.IRIXdso<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/Makefile.IRIXdso Thu Aug 29 20:25:24 1996 --- hylafax-v4.0pl1/faxd/Makefile.IRIXdso Tue Nov 26 15:21:14 1996 *************** *** 1,4 **** ! # $Id: Makefile.IRIXdso,v 1.12 1996/06/24 03:00:36 sam Rel $ # # HylaFAX Facsimile Software # --- 1,4 ---- ! # $Id: Makefile.IRIXdso,v 1.13 1996/10/05 00:01:56 sam Rel $ # # HylaFAX Facsimile Software # *************** *** 29,40 **** # # DSO-specific rules for the faxd directory. # - # Force the path used by rld to resolve DSO's. If we don't - # force this here for faxgetty, then we'll have to install - # the DSO's in a public location so that it'll be found at - # runtime (when faxgetty is spawned by init). - # - LLDOPTS = -rpath ${SPOOL}/bin:${LIBEXEC} LDIRT += libfaxserver.a libfaxserver.${DSO}: ${SERVER_OBJS} ${MODEM_OBJS} --- 29,34 ---- EOF-EOF-EOF Patch faxd/ModemServer.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/ModemServer.c++ Thu Aug 29 20:25:47 1996 --- hylafax-v4.0pl1/faxd/ModemServer.c++ Tue Nov 26 15:21:36 1996 *************** *** 1,4 **** ! /* $Id: ModemServer.c++,v 1.37 1996/08/02 18:09:09 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: ModemServer.c++,v 1.38 1996/11/22 00:05:04 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 171,177 **** } } ! const char* ModemServer::stateNames[8] = { "BASE", "RUNNING", "MODEMWAIT", --- 171,177 ---- } } ! const char* ModemServer::stateNames[9] = { "BASE", "RUNNING", "MODEMWAIT", *************** *** 179,187 **** "GETTYWAIT", "SENDING", "ANSWERING", ! "RECEIVING" }; ! const char* ModemServer::stateStatus[8] = { "Initializing server and modem", // BASE "Running and idle", // RUNNING "Waiting for modem to come ready", // MODEMWAIT --- 179,188 ---- "GETTYWAIT", "SENDING", "ANSWERING", ! "RECEIVING", ! "LISTENING" }; ! const char* ModemServer::stateStatus[9] = { "Initializing server and modem", // BASE "Running and idle", // RUNNING "Waiting for modem to come ready", // MODEMWAIT *************** *** 190,195 **** --- 191,197 ---- "Sending facsimile", // SENDING "Answering the phone", // ANSWERING "Receiving facsimile", // RECEIVING + "Listening to rings from modem", // LISTENING }; /* *************** *** 241,247 **** * incoming call spawns a getty process that the priority will * be reset in the child before the getty is exec'd. */ ! static const int schedCtlParams[8][2] = { { NDPRI, 0 }, // BASE { NDPRI, 0 }, // RUNNING { NDPRI, 0 }, // MODEMWAIT --- 243,249 ---- * incoming call spawns a getty process that the priority will * be reset in the child before the getty is exec'd. */ ! static const int schedCtlParams[9][2] = { { NDPRI, 0 }, // BASE { NDPRI, 0 }, // RUNNING { NDPRI, 0 }, // MODEMWAIT *************** *** 250,255 **** --- 252,258 ---- { NDPRI, NDPHIMIN }, // SENDING { NDPRI, NDPHIMIN }, // ANSWERING { NDPRI, NDPHIMIN }, // RECEIVING + { NDPRI, 0 }, // LISTENING }; #elif HAS_PRIOCNTL extern "C" { *************** *** 260,266 **** static struct SchedInfo { const char* clname; // scheduling class name int params[3]; // scheduling class parameters ! } schedInfo[8] = { { "TS", { TS_NOCHANGE, TS_NOCHANGE } }, // BASE { "TS", { TS_NOCHANGE, TS_NOCHANGE } }, // RUNNING { "TS", { TS_NOCHANGE, TS_NOCHANGE } }, // MODEMWAIT --- 263,269 ---- static struct SchedInfo { const char* clname; // scheduling class name int params[3]; // scheduling class parameters ! } schedInfo[9] = { { "TS", { TS_NOCHANGE, TS_NOCHANGE } }, // BASE { "TS", { TS_NOCHANGE, TS_NOCHANGE } }, // RUNNING { "TS", { TS_NOCHANGE, TS_NOCHANGE } }, // MODEMWAIT *************** *** 269,274 **** --- 272,278 ---- { "RT", { RT_NOCHANGE, RT_NOCHANGE, RT_NOCHANGE } },// SENDING { "RT", { RT_NOCHANGE, RT_NOCHANGE, RT_NOCHANGE } },// ANSWERING { "RT", { RT_NOCHANGE, RT_NOCHANGE, RT_NOCHANGE } },// RECEIVING + { "TS", { TS_NOCHANGE, TS_NOCHANGE } }, // LISTENING }; #elif HAS_RTPRIO /* *************** *** 280,286 **** #define RTPRIO_HIGH 120 #endif ! static const int rtprioParams[8] = { RTPRIO_RTOFF, // BASE RTPRIO_RTOFF, // RUNNING RTPRIO_RTOFF, // MODEMWAIT --- 284,290 ---- #define RTPRIO_HIGH 120 #endif ! static const int rtprioParams[9] = { RTPRIO_RTOFF, // BASE RTPRIO_RTOFF, // RUNNING RTPRIO_RTOFF, // MODEMWAIT *************** *** 289,294 **** --- 293,299 ---- RTPRIO_HIGH, // SENDING RTPRIO_HIGH, // ANSWERING RTPRIO_HIGH, // RECEIVING + RTPRIO_RTOFF, // LISTENING }; #endif EOF-EOF-EOF Patch faxd/ModemServer.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/ModemServer.h Thu Aug 29 20:25:33 1996 --- hylafax-v4.0pl1/faxd/ModemServer.h Tue Nov 26 15:21:22 1996 *************** *** 1,4 **** ! /* $Id: ModemServer.h,v 1.23 1996/07/10 22:18:02 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: ModemServer.h,v 1.25 1996/11/22 00:05:04 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 41,46 **** --- 41,49 ---- #ifdef tcsetattr #undef tcsetattr // workaround for SCO #endif + #ifdef tcgetattr + #undef tcgetattr // workaround for SCO + #endif class FaxMachineInfo; class FaxMachineLog; *************** *** 88,95 **** void setDialRules(const char* name); void setModemSpeakerVolume(SpeakerVolume); // state-related stuff ! static const char* stateNames[8]; ! static const char* stateStatus[8]; fxBool openDevice(const char* dev); fxBool reopenDevice(); --- 91,98 ---- void setDialRules(const char* name); void setModemSpeakerVolume(SpeakerVolume); // state-related stuff ! static const char* stateNames[9]; ! static const char* stateStatus[9]; fxBool openDevice(const char* dev); fxBool reopenDevice(); *************** *** 109,115 **** GETTYWAIT = 4, SENDING = 5, ANSWERING = 6, ! RECEIVING = 7 }; ModemServerState state; fxBool abortCall; // abort current send/receive --- 112,119 ---- GETTYWAIT = 4, SENDING = 5, ANSWERING = 6, ! RECEIVING = 7, ! LISTENING = 8 }; ModemServerState state; fxBool abortCall; // abort current send/receive EOF-EOF-EOF Patch faxd/faxApp.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/faxApp.c++ Thu Aug 29 20:25:49 1996 --- hylafax-v4.0pl1/faxd/faxApp.c++ Tue Nov 26 15:21:38 1996 *************** *** 1,4 **** ! /* $Id: faxApp.c++,v 1.29 1996/07/24 21:17:02 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: faxApp.c++,v 1.32 1996/11/22 01:33:16 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 470,473 **** --- 470,506 ---- } (void) setsid(); #endif + } + + /* + * Private version of fxassert for server processes. + * The default library routine sends the message to + * stderr and then calls abort(). This typically + * does not work for a server because stderr is not + * attached to anything (so the message is lost) and + * abort will not generate a core dump because the + * process has an effective uid and/or gid different + * from the real uid/gid. + * + * If (the undocumented configuration parameter) + * CONFIG_WAITONASSERT is set to a non-zero value + * then instead of dumping core the process will + * pause indefinitely so that a debugger can be + * attached. + */ + extern "C" void + _fxassert(const char* msg, const char* file, int line) + { + fprintf(stderr, "Assertion failed \"%s\", file \"%s\" line %d.\n", + msg, file, line); + logError("Assertion failed \"%s\", file \"%s\" line %d.\n", + msg, file, line); + #if CONFIG_WAITONASSERT + for (;;) // wait for a debugger to attach + pause(); + #else + faxApp::setRealIDs(); // reset so we get a core dump + abort(); + #endif + /*NOTREACHED*/ } EOF-EOF-EOF Patch faxd/faxApp.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/faxApp.h Thu Aug 29 20:25:35 1996 --- hylafax-v4.0pl1/faxd/faxApp.h Tue Nov 26 15:21:24 1996 *************** *** 1,4 **** ! /* $Id: faxApp.h,v 1.18 1996/06/24 03:00:48 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: faxApp.h,v 1.19 1996/11/22 01:33:16 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 41,47 **** protected: int openFIFO(const char* fifoName, int mode, fxBool okToExist = FALSE); - void setRealIDs(); public: faxApp(); virtual ~faxApp(); --- 41,46 ---- *************** *** 49,54 **** --- 48,54 ---- static const fxStr fifoName; static void setupPermissions(void); + static void setRealIDs(); static void detachFromTTY(void); static void fatal(const char* fmt ...); EOF-EOF-EOF Patch faxd/faxGettyApp.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/faxGettyApp.c++ Thu Aug 29 20:25:49 1996 --- hylafax-v4.0pl1/faxd/faxGettyApp.c++ Tue Nov 26 15:21:38 1996 *************** *** 1,4 **** ! /* $Id: faxGettyApp.c++,v 1.54 1996/08/03 00:43:08 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: faxGettyApp.c++,v 1.55 1996/11/22 00:05:04 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 48,53 **** --- 48,57 ---- /* * HylaFAX Spooling and Command Agent. */ + AnswerTimeoutHandler::AnswerTimeoutHandler() {} + AnswerTimeoutHandler::~AnswerTimeoutHandler() {} + void AnswerTimeoutHandler::timerExpired(long, long) + { faxGettyApp::instance().answerCleanup(); } const fxStr faxGettyApp::recvDir = FAX_RECVDIR; *************** *** 166,310 **** } /* ! * Answer the telephone in response to data from the modem ! * (e.g. a "RING" message) or an explicit command from the ! * user (sending an "ANSWER" command through the FIFO). */ void ! faxGettyApp::answerPhone(AnswerType atype, fxBool force) { if (lockModem()) { sendModemStatus("B"); ! changeState(ANSWERING); ! CallerID cid; ! CallType ctype = ClassModem::CALLTYPE_UNKNOWN; ! if (force || modemWaitForRings(ringsBeforeAnswer, ctype, cid)) { ! beginSession(FAXNumber); ! sendModemStatus("I" | getCommID()); ! if (cid.number != "" || cid.name != "") { ! traceServer("ANSWER: CID NUMBER \"%s\" NAME \"%s\"", ! (const char*) cid.number, (const char*) cid.name); ! faxApp::sendModemStatus(getModemDeviceID(), "C\"%s\"%s\"", ! (const char*) cid.number, (const char*) cid.name); ! } ! /* ! * Answer the phone according to atype. If this is ! * ``any'', then pick a more specific type. If ! * adaptive-answer is enabled and ``any'' is requested, ! * then rotate through the set of possibilities. ! */ ! fxBool callResolved; ! fxBool advanceRotary = TRUE; ! fxStr emsg; ! if (!isCIDOk(cid.number)) { // check Caller ID if present ! /* ! * Call was rejected based on Caller ID information. ! */ ! traceServer("ANSWER: CID REJECTED"); ! callResolved = FALSE; ! advanceRotary = FALSE; ! } else if (ctype != ClassModem::CALLTYPE_UNKNOWN) { ! /* ! * Distinctive ring or other means has already identified ! * the type of call. If we're to answer the call in a ! * different way, then treat this as an error and don't ! * answer the phone. Otherwise answer according to the ! * deduced call type. ! */ ! if (atype != ClassModem::ANSTYPE_ANY && ctype != atype) { ! traceServer("ANSWER: Call deduced as %s," ! "but told to answer as %s; call ignored", ! ClassModem::callTypes[ctype], ! ClassModem::answerTypes[atype]); ! callResolved = FALSE; ! advanceRotary = FALSE; ! } else { ! // NB: answer based on ctype, not atype ! ctype = modemAnswerCall(ctype, emsg); ! callResolved = processCall(ctype, emsg); ! } ! } else if (atype == ClassModem::ANSTYPE_ANY) { ! /* ! * Normal operation; answer according to the settings ! * for the rotary and adaptive answer capabilities. ! */ ! int r = answerRotor; ! do { ! callResolved = answerCall(answerRotary[r], ctype, emsg); ! r = (r+1) % answerRotorSize; ! } while (!callResolved && adaptiveAnswer && r != answerRotor); ! } else { ! /* ! * Answer for a specific type of call but w/o ! * any existing call type information such as ! * distinctive ring. ! */ ! callResolved = answerCall(atype, ctype, emsg); ! } ! /* ! * Call resolved. If we were able to recognize the call ! * type and setup a session, then reset the answer rotary ! * state if there is a bias toward a specific answer type. ! * Otherwise, if the call failed, advance the rotor to ! * the next answer type in preparation for the next call. ! */ ! if (callResolved) { ! if (answerBias != (u_int) -1) ! answerRotor = answerBias; ! } else if (advanceRotary) { ! if (adaptiveAnswer) ! answerRotor = 0; ! else ! answerRotor = (answerRotor+1) % answerRotorSize; ! } ! sendModemStatus("I"); ! endSession(); ! } else ! modemFlushInput(); /* ! * If we still have a handle on the modem, then force a ! * hangup and discard the handle. We do this explicitly ! * because some modems are impossible to safely hangup in the ! * event of a problem. Forcing a close on the device so that ! * the modem will see DTR drop (hopefully) should clean up any ! * bad state its in. We then immediately try to setup the modem ! * again so that we can be ready to answer incoming calls again. ! * ! * NB: the modem may have been discarded if a child process ! * was invoked to handle the inbound call. ! */ ! if (modemReady()) { ! modemHangup(); ! discardModem(TRUE); } ! fxBool isSetup; ! if (isModemLocked() || lockModem()) { ! isSetup = setupModem(); ! unlockModem(); ! } else ! isSetup = FALSE; ! if (isSetup) ! changeState(RUNNING); else ! changeState(MODEMWAIT, pollModemWait); ! } else { /* ! * The modem is in use to call out, or by way of an incoming ! * call. If we're not sending or receiving, discard our handle ! * on the modem and change to MODEMWAIT state where we wait ! * for the modem to come available again. ! */ ! if (force) // eliminate noise messages ! traceServer("ANSWER: Can not lock modem device"); ! if (state != SENDING && state != ANSWERING && state != RECEIVING) { ! discardModem(FALSE); ! changeState(LOCKWAIT, pollLockWait); ! sendModemStatus("U"); } } } /* * Answer a call according to the specified answer type * and return the deduced call type. If we are to use an * external application to deduce and possibly handle the --- 170,393 ---- } /* ! * Begin listening for ring status messages from the modem. ! * The modem is locked and we mark it as busy to the queuer ! * (just as if we were answering a call). We listen for one ! * ring status message and, if successful, keep the modem ! * locked and change state so that further input will be ! * consumed. */ void ! faxGettyApp::listenBegin() { if (lockModem()) { + changeState(LISTENING); sendModemStatus("B"); ! ringsHeard = 0; ! listenForRing(); ! } else if (state != SENDING && state != ANSWERING && state != RECEIVING) { /* ! * The modem is in use to call out, or some other process ! * has grabbed the lock to handle the incoming call. ! * Discard our handle on the modem and change to LOCKWAIT ! * state where we wait for the modem to come available again. ! */ ! traceServer("ANSWER: Can not lock modem device"); ! discardModem(FALSE); ! changeState(LOCKWAIT, pollLockWait); ! sendModemStatus("U"); ! } ! } ! ! /* ! * Consume a ring status message from the modem. We assume ! * the modem is locked and that input is present. If we don't ! * see a ring then we exit LISTENING state and reset our ! * handle on the modem. If the number of rings received ! * matches ringsBeforeAnswer then we answer the phone. ! */ ! void ! faxGettyApp::listenForRing() ! { ! Dispatcher::instance().stopTimer(&answerHandler); ! ! CallerID cid; ! CallType ctype = ClassModem::CALLTYPE_UNKNOWN; ! if (modemWaitForRings(1, ctype, cid)) { ! if (cid.number != "" || cid.name != "") { ! traceServer("ANSWER: CID NUMBER \"%s\" NAME \"%s\"", ! (const char*) cid.number, (const char*) cid.name); ! faxApp::sendModemStatus(getModemDeviceID(), "C\"%s\"%s\"", ! (const char*) cid.number, (const char*) cid.name); } ! ++ringsHeard; ! if (ringsBeforeAnswer && ringsHeard >= ringsBeforeAnswer) ! answerPhone(ClassModem::ANSTYPE_ANY, ctype, cid); else ! // NB: 10 second timeout should be plenty ! Dispatcher::instance().startTimer(10, 0, &answerHandler); ! } else ! answerCleanup(); ! } ! ! /* ! * Handle a user request to answer the phone. ! * Note that this can come in when we are in ! * many different states. ! */ ! void ! faxGettyApp::answerPhoneCmd(AnswerType atype) ! { ! CallerID cid; ! CallType ctype = ClassModem::CALLTYPE_UNKNOWN; ! if (state == LISTENING) { ! /* ! * We were listening to rings when an answer command ! * was received. The modem is already locked so just ! * cancel any timeout and answer the call. ! */ ! Dispatcher::instance().stopTimer(&answerHandler); ! answerPhone(atype, ctype, cid); ! } else if (lockModem()) { ! /* ! * The modem is ours, notifier the queuer and answer. ! */ ! sendModemStatus("B"); ! answerPhone(atype, ctype, cid); ! } else if (state != ANSWERING && state != RECEIVING) { ! /* ! * The modem is in use to call out, or some other process ! * has grabbed the lock to handle the incoming call. ! * Discard our handle on the modem and change to LOCKWAIT ! * state where we wait for the modem to come available again. ! */ ! discardModem(FALSE); ! changeState(LOCKWAIT, pollLockWait); ! sendModemStatus("U"); ! } ! } ! ! /* ! * Answer the telephone in response to data from the modem ! * (e.g. a "RING" message) or an explicit command from the ! * user (sending an "ANSWER" command through the FIFO). ! */ ! void ! faxGettyApp::answerPhone(AnswerType atype, CallType ctype, const CallerID& cid) ! { ! changeState(ANSWERING); ! beginSession(FAXNumber); ! sendModemStatus("I" | getCommID()); ! /* ! * Answer the phone according to atype. If this is ! * ``any'', then pick a more specific type. If ! * adaptive-answer is enabled and ``any'' is requested, ! * then rotate through the set of possibilities. ! */ ! fxBool callResolved; ! fxBool advanceRotary = TRUE; ! fxStr emsg; ! if (!isCIDOk(cid.number)) { // check Caller ID if present ! /* ! * Call was rejected based on Caller ID information. ! */ ! traceServer("ANSWER: CID REJECTED"); ! callResolved = FALSE; ! advanceRotary = FALSE; ! } else if (ctype != ClassModem::CALLTYPE_UNKNOWN) { /* ! * Distinctive ring or other means has already identified ! * the type of call. If we're to answer the call in a ! * different way, then treat this as an error and don't ! * answer the phone. Otherwise answer according to the ! * deduced call type. ! */ ! if (atype != ClassModem::ANSTYPE_ANY && ctype != atype) { ! traceServer("ANSWER: Call deduced as %s," ! "but told to answer as %s; call ignored", ! ClassModem::callTypes[ctype], ! ClassModem::answerTypes[atype]); ! callResolved = FALSE; ! advanceRotary = FALSE; ! } else { ! // NB: answer based on ctype, not atype ! ctype = modemAnswerCall(ctype, emsg); ! callResolved = processCall(ctype, emsg); } + } else if (atype == ClassModem::ANSTYPE_ANY) { + /* + * Normal operation; answer according to the settings + * for the rotary and adaptive answer capabilities. + */ + int r = answerRotor; + do { + callResolved = answerCall(answerRotary[r], ctype, emsg); + r = (r+1) % answerRotorSize; + } while (!callResolved && adaptiveAnswer && r != answerRotor); + } else { + /* + * Answer for a specific type of call but w/o + * any existing call type information such as + * distinctive ring. + */ + callResolved = answerCall(atype, ctype, emsg); + } + /* + * Call resolved. If we were able to recognize the call + * type and setup a session, then reset the answer rotary + * state if there is a bias toward a specific answer type. + * Otherwise, if the call failed, advance the rotor to + * the next answer type in preparation for the next call. + */ + if (callResolved) { + if (answerBias != (u_int) -1) + answerRotor = answerBias; + } else if (advanceRotary) { + if (adaptiveAnswer) + answerRotor = 0; + else + answerRotor = (answerRotor+1) % answerRotorSize; } + sendModemStatus("I"); + endSession(); + answerCleanup(); } /* + * Cleanup after answering a call or listening for ring status + * messages from the modem (when ringsBeforeAnswer is zero). + * + * If we still have a handle on the modem, then force a hangup + * and discard the handle. We do this explicitly because some + * modems are impossible to safely hangup in the event of a + * problem. Forcing a close on the device so that the modem + * will see DTR drop (hopefully) should clean up any bad state + * its in. We then immediately try to setup the modem again + * so that we can be ready to answer incoming calls again. + * + * NB: the modem may have been discarded if a child process + * was invoked to handle the inbound call. + */ + void + faxGettyApp::answerCleanup() + { + if (modemReady()) { + modemHangup(); + discardModem(TRUE); + } + fxBool isSetup; + if (isModemLocked() || lockModem()) { + isSetup = setupModem(); + unlockModem(); + } else + isSetup = FALSE; + if (isSetup) + changeState(RUNNING); + else + changeState(MODEMWAIT, pollModemWait); + } + + /* * Answer a call according to the specified answer type * and return the deduced call type. If we are to use an * external application to deduce and possibly handle the *************** *** 506,528 **** ringsBeforeAnswer = rings; if (modemReady()) { int fd = getModemFd(); ! IOHandler* h = ! Dispatcher::instance().handler(fd, Dispatcher::ReadMask); ! if (rings > 0 && h == NULL) { ! Dispatcher::instance().link(fd, Dispatcher::ReadMask, this); ! /* ! * Systems that have a tty driver based on SVR4 streams ! * frequently don't implement select properly in that if ! * output is collected by another process (e.g. cu, tip, ! * kermit) quickly we do not reliably get woken up. On ! * these systems however the close on the tty usually ! * causes us to wakeup from select for an exceptional ! * condition on the descriptor--and this is good enough ! * for us to do the work we need. ! */ ! Dispatcher::instance().link(fd, Dispatcher::ExceptMask, this); ! } else if (rings == 0 && h != NULL) ! Dispatcher::instance().unlink(fd); } } --- 589,606 ---- ringsBeforeAnswer = rings; if (modemReady()) { int fd = getModemFd(); ! Dispatcher::instance().link(fd, Dispatcher::ReadMask, this); ! /* ! * Systems that have a tty driver based on SVR4 streams ! * frequently don't implement select properly in that if ! * output is collected by another process (e.g. cu, tip, ! * kermit) quickly we do not reliably get woken up. On ! * these systems however the close on the tty usually ! * causes us to wakeup from select for an exceptional ! * condition on the descriptor--and this is good enough ! * for us to do the work we need. ! */ ! Dispatcher::instance().link(fd, Dispatcher::ExceptMask, this); } } *************** *** 670,676 **** if (fd == devfifo) return FIFOInput(fd); else { ! answerPhone(ClassModem::ANSTYPE_ANY, FALSE); return (0); } } --- 748,757 ---- if (fd == devfifo) return FIFOInput(fd); else { ! if (state == LISTENING) ! listenForRing(); ! else ! listenBegin(); return (0); } } *************** *** 686,700 **** traceServer("ANSWER %s", cp[1] != '\0' ? cp+1 : "any"); if (cp[1] != '\0') { if (streq(cp+1, "fax")) ! answerPhone(ClassModem::ANSTYPE_FAX, TRUE); else if (streq(cp+1, "data")) ! answerPhone(ClassModem::ANSTYPE_DATA, TRUE); else if (streq(cp+1, "voice")) ! answerPhone(ClassModem::ANSTYPE_VOICE, TRUE); else if (streq(cp+1, "extern")) ! answerPhone(ClassModem::ANSTYPE_EXTERN, TRUE); } else ! answerPhone(answerRotary[0], TRUE); break; case 'C': // configuration control traceServer("CONFIG \"%s\"", cp+1); --- 767,781 ---- traceServer("ANSWER %s", cp[1] != '\0' ? cp+1 : "any"); if (cp[1] != '\0') { if (streq(cp+1, "fax")) ! answerPhoneCmd(ClassModem::ANSTYPE_FAX); else if (streq(cp+1, "data")) ! answerPhoneCmd(ClassModem::ANSTYPE_DATA); else if (streq(cp+1, "voice")) ! answerPhoneCmd(ClassModem::ANSTYPE_VOICE); else if (streq(cp+1, "extern")) ! answerPhoneCmd(ClassModem::ANSTYPE_EXTERN); } else ! answerPhoneCmd(answerRotary[0]); break; case 'C': // configuration control traceServer("CONFIG \"%s\"", cp+1); EOF-EOF-EOF Patch faxd/faxGettyApp.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/faxGettyApp.h Thu Aug 29 20:25:35 1996 --- hylafax-v4.0pl1/faxd/faxGettyApp.h Tue Nov 26 15:21:24 1996 *************** *** 1,4 **** ! /* $Id: faxGettyApp.h,v 1.28 1996/06/24 03:00:48 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: faxGettyApp.h,v 1.29 1996/11/22 00:05:04 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 34,39 **** --- 34,46 ---- class UUCPLock; class Getty; + class AnswerTimeoutHandler : public IOHandler { + public: + AnswerTimeoutHandler(); + ~AnswerTimeoutHandler(); + void timerExpired(long, long); + }; + class faxGettyApp : public FaxServer, public faxApp { public: struct stringtag { *************** *** 56,63 **** --- 63,72 ---- fxStr readyState; // modem ready state to send queuer int devfifo; // fifo device interface UUCPLock* modemLock; // UUCP interlock + AnswerTimeoutHandler answerHandler; // for timing out inbound calls u_short ringsBeforeAnswer; // # rings to wait + u_short ringsHeard; // # rings received fxStr qualifyCID; // if set, no answer w/o acceptable cid time_t lastCIDModTime; // last mod time of CID patterns file RegExArray* cidPats; // recv cid patterns *************** *** 103,110 **** const char* args, fxStr &emsg, fxBool keepLock, fxBool keepModem = FALSE); void setRingsBeforeAnswer(int rings); ! void answerPhone(AnswerType, fxBool force); fxBool answerCall(AnswerType atype, CallType& ctype, fxStr& emsg); // miscellaneous stuff fxBool sendModemStatus(const char* msg); // FIFO-related stuff --- 112,125 ---- const char* args, fxStr &emsg, fxBool keepLock, fxBool keepModem = FALSE); void setRingsBeforeAnswer(int rings); ! void listenBegin(); ! void listenForRing(); ! void answerPhoneCmd(AnswerType); ! void answerPhone(AnswerType, CallType, const CallerID&); ! void answerCleanup(); fxBool answerCall(AnswerType atype, CallType& ctype, fxStr& emsg); + + friend void AnswerTimeoutHandler::timerExpired(long, long); // miscellaneous stuff fxBool sendModemStatus(const char* msg); // FIFO-related stuff EOF-EOF-EOF Patch faxd/faxQueueApp.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/faxQueueApp.c++ Thu Aug 29 20:25:50 1996 --- hylafax-v4.0pl1/faxd/faxQueueApp.c++ Tue Nov 26 15:21:39 1996 *************** *** 1,4 **** ! /* $Id: faxQueueApp.c++,v 1.131 1996/08/21 21:02:47 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: faxQueueApp.c++,v 1.134 1996/11/22 00:00:49 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 1548,1554 **** faxQueueApp::setSuspend(Job& job) { job.state = FaxRequest::state_suspended; - job.stopKillTimer(); // no kill timer while suspended traceJob(job, "SUSPEND"); Trigger::post(Trigger::JOB_SUSPEND, job); job.insert(*suspendq.next); --- 1548,1553 ---- *************** *** 1660,1665 **** --- 1659,1665 ---- job.startKillTimer(req.killtime); setReadyToRun(job); } + updateRequest(req, job); return (TRUE); } *************** *** 1680,1686 **** /* * Suspend a job by removing it from whatever * queue it's currently on and/or stopping any ! * timer. If the job has an active subprocess * then the process is optionally sent a signal * and we wait for the process to stop before * returning to the caller. --- 1680,1686 ---- /* * Suspend a job by removing it from whatever * queue it's currently on and/or stopping any ! * timers. If the job has an active subprocess * then the process is optionally sent a signal * and we wait for the process to stop before * returning to the caller. *************** *** 1731,1736 **** --- 1731,1737 ---- break; } job.remove(); // remove from old queue + job.stopKillTimer(); // clear kill timer return (TRUE); } *************** *** 1887,1914 **** { Job* job = Job::getJobByID(jobid); if (job) { ! switch (job->state) { ! case FaxRequest::state_done: // done, cannot reschedule ! jobError(*job, "Cannot resubmit a completed job"); ! return (FALSE); ! case FaxRequest::state_suspended: // resubmit to the scheduler job->remove(); // remove from suspend queue ! // XXX need better mechanism ! FaxRequest* req; req = readRequest(*job);// XXX for __GNUC__ ! if (!req) { setDead(*job); // XXX??? ! return (FALSE); ! } ! job->update(*req); // update job state from file ! fxBool ok; ok = submitJob(*job, *req);// XXX for __GNUC__ ! if (ok) ! updateRequest(*req, *job); // update state for clients ! delete req; // NB: unlock qfile ! return (ok); ! default: // other, nothing to do ! return (TRUE); ! } ! /*NOTREACHED*/ } /* * Create a job from a queue file and add it --- 1888,1908 ---- { Job* job = Job::getJobByID(jobid); if (job) { ! fxBool ok = FALSE; ! if (job->state == FaxRequest::state_suspended) { job->remove(); // remove from suspend queue ! FaxRequest* req = readRequest(*job);// XXX need better mechanism ! if (req) { ! job->update(*req); // update job state from file ! ok = submitJob(*job, *req); // resubmit to scheduler ! delete req; // NB: unlock qfile ! } else setDead(*job); // XXX??? ! } else if (job->state == FaxRequest::state_done) ! jobError(*job, "Cannot resubmit a completed job"); ! else ! ok = TRUE; // other, nothing to do ! return (ok); } /* * Create a job from a queue file and add it *************** *** 1965,2024 **** } /* - * Alter parameters of a job queued for execution. - * Note that it is not possible to alter the parameters - * of jobs that are actively being processed. - * - * XXX This interface is used only for temporarily - * XXX supporting the old client-server protocol. - */ - fxBool - faxQueueApp::alterJob(const char* s) - { - const char cmd = *s++; - const char* cp = strchr(s, ' '); - if (!cp) { - traceServer("ALTER JOB: Malformed request \"%s\", no jobid.", s); - return (FALSE); - } - fxStr jobid(s, cp-s); - Job* job = Job::getJobByID(jobid); - if (!job) { - traceServer("ALTER JOB: JOB " | jobid | " not found."); - return (FALSE); - } - // NB: cannot process active jobs though this interface (XXX) - if (job->state == FaxRequest::state_active || !suspendJob(*job, FALSE)) { - jobError(*job, "Cannot alter job in active or done state."); - return (FALSE); - } - while (isspace(*cp)) - cp++; - fxBool status = TRUE; - switch (cmd) { - case 'K': // kill time - job->killtime = atoi(cp); - break; - case 'M': // modem device to use - job->device = cp; - break; - case 'P': // change priority - job->pri = atoi(cp); - break; - case 'T': // time-to-send - job->tts = atoi(cp); - break; - // page dimensions/document contents XXX??? - default: - traceServer("ALTER JOB: Unknown request \"%s\".", s); - status = FALSE; - break; - } - submitJob(jobid); // return to scheduler - return (status); - } - - /* * Process the expiration of a job's time-to-send timer. * The job is moved to the ready-to-run queues and the * scheduler is poked. --- 1959,1964 ---- *************** *** 2482,2492 **** case 'D': // cancel an existing trigger traceServer("DELETE %s", args); status = Trigger::cancel(args); - break; - case 'J': // alter job parameter(s) - traceServer("ALTER JOB %s", args); - if (status = alterJob(args)) - pokeScheduler(); break; case 'R': // remove job traceServer("REMOVE JOB %s", args); --- 2422,2427 ---- EOF-EOF-EOF Patch faxd/faxQueueApp.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/faxQueueApp.h Thu Aug 29 20:25:35 1996 --- hylafax-v4.0pl1/faxd/faxQueueApp.h Tue Nov 26 15:21:24 1996 *************** *** 1,4 **** ! /* $Id: faxQueueApp.h,v 1.50 1996/07/16 01:36:17 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: faxQueueApp.h,v 1.51 1996/11/22 00:00:49 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 197,203 **** void blockJob(Job&, FaxRequest&, const char*); void delayJob(Job&, FaxRequest&, const char*, time_t); void rejectJob(Job& job, FaxRequest& req, const fxStr& reason); - fxBool alterJob(const char*); fxBool submitJob(const fxStr& jobid, fxBool checkState = FALSE); fxBool suspendJob(const fxStr& jobid, fxBool abortActive); void rejectSubmission(Job&, FaxRequest&, const fxStr& reason); --- 197,202 ---- EOF-EOF-EOF Patch faxd/tagtest.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/tagtest.c++ Thu Aug 29 20:25:52 1996 --- hylafax-v4.0pl1/faxd/tagtest.c++ Tue Nov 26 15:21:41 1996 *************** *** 1,4 **** ! /* $Id: tagtest.c++,v 1.24 1996/06/24 03:00:54 sam Rel $ */ /* * Copyright (c) 1994-1996 Sam Leffler * Copyright (c) 1994-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: tagtest.c++,v 1.25 1996/11/20 01:58:10 sam Rel $ */ /* * Copyright (c) 1994-1996 Sam Leffler * Copyright (c) 1994-1996 Silicon Graphics, Inc. *************** *** 335,340 **** --- 335,351 ---- { vfprintf(stderr, fmt, ap); fputs(".\n", stderr); + } + + // NB: must duplicate this to avoid pulling faxApp&co. + + extern "C" void + _fxassert(const char* msg, const char* file, int line) + { + fprintf(stderr, "Assertion failed \"%s\", file \"%s\" line %d.\n", + msg, file, line); + abort(); + /*NOTREACHED*/ } const char* appName; EOF-EOF-EOF Patch faxd/trigtest.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxd/trigtest.c++ Thu Aug 29 20:25:52 1996 --- hylafax-v4.0pl1/faxd/trigtest.c++ Tue Nov 26 15:21:41 1996 *************** *** 12,18 **** --- 12,20 ---- #include #include #include + extern "C" { #include + } #include "config.h" EOF-EOF-EOF Patch faxmail/mailfax.sh-sendmail<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/faxmail/mailfax.sh-sendmail Thu Aug 29 20:25:55 1996 --- hylafax-v4.0pl1/faxmail/mailfax.sh-sendmail Tue Nov 26 15:21:44 1996 *************** *** 9,15 **** # mailer definition (or similar): # # Mfax, P=/usr/local/lib/fax/mailfax, F=DFMShu, M=100000, ! # A=mailfax $h $f # # and add the following address rewriting rule to rule set 0: # --- 9,15 ---- # mailer definition (or similar): # # Mfax, P=/usr/local/lib/fax/mailfax, F=DFMShu, M=100000, ! # A=mailfax $u $h $f # # and add the following address rewriting rule to rule set 0: # EOF-EOF-EOF Patch hfaxd/Admin.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/hfaxd/Admin.c++ Thu Aug 29 20:25:58 1996 --- hylafax-v4.0pl1/hfaxd/Admin.c++ Tue Nov 26 15:21:46 1996 *************** *** 1,4 **** ! /* $Id: Admin.c++,v 1.4 1996/06/24 03:01:38 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: Admin.c++,v 1.5 1996/11/15 01:29:27 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. *************** *** 143,149 **** FILE* fp = fdopen(fd, "w"); if (fp) { fprintf(fp, "%d %d %d %d %d 5 1\n" ! , when.tm_year , when.tm_mon , when.tm_mday , when.tm_hour --- 143,149 ---- FILE* fp = fdopen(fd, "w"); if (fp) { fprintf(fp, "%d %d %d %d %d 5 1\n" ! , when.tm_year+1900 , when.tm_mon , when.tm_mday , when.tm_hour *************** *** 156,162 **** } else if (Sys::rename(templ, fixPathname(shutdownFile)) < 0) { reply(550, "%srename %s.", msg, strerror(errno)); } else { ! reply(200, "System shutdown scheduled for %.24s.\n", asctime(&when)); return; } --- 156,162 ---- } else if (Sys::rename(templ, fixPathname(shutdownFile)) < 0) { reply(550, "%srename %s.", msg, strerror(errno)); } else { ! reply(200, "System shutdown scheduled for %.24s.", asctime(&when)); return; } EOF-EOF-EOF Patch hfaxd/FileSystem.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/hfaxd/FileSystem.c++ Thu Aug 29 20:25:59 1996 --- hylafax-v4.0pl1/hfaxd/FileSystem.c++ Tue Nov 26 15:21:47 1996 *************** *** 1,4 **** ! /* $Id: FileSystem.c++,v 1.30 1996/08/21 22:52:04 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: FileSystem.c++,v 1.32 1996/11/15 20:17:37 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. *************** *** 29,35 **** */ #include "HylaFAXServer.h" #include "Sys.h" ! #include "tiff.h" #include #include --- 29,35 ---- */ #include "HylaFAXServer.h" #include "Sys.h" ! #include "tiffio.h" #include #include *************** *** 157,162 **** --- 157,166 ---- HylaFAXServer::isVisibleTRUE, HylaFAXServer::listDirectory, HylaFAXServer::listUnixFile, HylaFAXServer::nlstDirectory, HylaFAXServer::nlstUnixFile, }, + { "/log/", FALSE, FALSE, FALSE, 0, + HylaFAXServer::isVisibleTRUE, + HylaFAXServer::listDirectory, HylaFAXServer::listUnixFile, + HylaFAXServer::nlstDirectory, HylaFAXServer::nlstUnixFile, }, { "/recvq/", FALSE, FALSE, TRUE, 0, HylaFAXServer::isVisibleRecvQFile, HylaFAXServer::listRecvQ, HylaFAXServer::listRecvQFile, *************** *** 165,174 **** HylaFAXServer::isVisibleTRUE, HylaFAXServer::listDirectory, HylaFAXServer::listUnixFile, HylaFAXServer::nlstDirectory, HylaFAXServer::nlstUnixFile, }, - { "/log/", TRUE, FALSE, FALSE, 0, - HylaFAXServer::isVisibleTRUE, - HylaFAXServer::listDirectory, HylaFAXServer::listUnixFile, - HylaFAXServer::nlstDirectory, HylaFAXServer::nlstUnixFile, }, { "/pollq/", FALSE, TRUE, TRUE, 0, HylaFAXServer::isVisibleRecvQFile, HylaFAXServer::listRecvQ, HylaFAXServer::listRecvQFile, --- 169,174 ---- *************** *** 721,726 **** --- 721,743 ---- fprintf(fd, "%s", filename); } + static fxBool + isTIFF(const TIFFHeader& h) + { + if (h.tiff_magic != TIFF_BIGENDIAN && h.tiff_magic != TIFF_LITTLEENDIAN) + return (FALSE); + union { + int32 i; + char c[4]; + } u; + u.i = 1; + uint16 version = h.tiff_version; + // byte swap version stamp if opposite byte order + if ((u.c[0] == 0) ^ (h.tiff_magic == TIFF_BIGENDIAN)) + TIFFSwabShort(&version); + return (version == TIFF_VERSION); + } + fxBool HylaFAXServer::docType(const char* docname, FaxSendOp& op) { *************** *** 736,744 **** int cc = Sys::read(fd, (char*) &b, sizeof (b)); if (cc > 2 && b.buf[0] == '%' && b.buf[1] == '!') op = FaxRequest::send_postscript; ! else if (cc > sizeof (b.h) && b.h.tiff_version == TIFF_VERSION && ! (b.h.tiff_magic == TIFF_BIGENDIAN || ! b.h.tiff_magic == TIFF_LITTLEENDIAN)) op = FaxRequest::send_tiff; else op = FaxRequest::send_data; --- 753,759 ---- int cc = Sys::read(fd, (char*) &b, sizeof (b)); if (cc > 2 && b.buf[0] == '%' && b.buf[1] == '!') op = FaxRequest::send_postscript; ! else if (cc > sizeof (b.h) && isTIFF(b.h)) op = FaxRequest::send_tiff; else op = FaxRequest::send_data; EOF-EOF-EOF Patch hfaxd/HylaFAXServer.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/hfaxd/HylaFAXServer.c++ Thu Aug 29 20:26:00 1996 --- hylafax-v4.0pl1/hfaxd/HylaFAXServer.c++ Tue Nov 26 15:21:48 1996 *************** *** 1,4 **** ! /* $Id: HylaFAXServer.c++,v 1.33 1996/07/25 20:52:57 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: HylaFAXServer.c++,v 1.35 1996/11/21 23:58:25 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. *************** *** 79,93 **** */ time_t now = Sys::now(); struct tm gmt = *gmtime(&now); ! struct tm* tm = localtime(&now); ! gmt.tm_isdst = tm->tm_isdst; ! gmtoff = mktime(&gmt) - mktime(tm); #if HAS_TM_ZONE /* * BSD/OS doesn't support the global timezone * information so setup substitutes here. */ ! tzname[0] = tm->tm_zone; tzname[1] = NULL; #endif --- 79,93 ---- */ time_t now = Sys::now(); struct tm gmt = *gmtime(&now); ! struct tm tm = *localtime(&now); ! gmt.tm_isdst = tm.tm_isdst; ! gmtoff = mktime(&gmt) - mktime(&tm); #if HAS_TM_ZONE /* * BSD/OS doesn't support the global timezone * information so setup substitutes here. */ ! tzname[0] = tm.tm_zone; tzname[1] = NULL; #endif *************** *** 281,286 **** --- 281,287 ---- if (fd != NULL) { struct tm tm; int deny, disc; + memset(&tm, 0, sizeof (tm)); int n = fscanf(fd, "%d %d %d %d %d %d %d\n", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &deny, &disc); *************** *** 288,301 **** tm.tm_year -= 1900; tm.tm_isdst = -1; time_t shut = mktime(&tm); ! denyTime = shut - 3600 * (deny / 100) + 60 * (deny % 100); ! discTime = shut - 3600 * (disc / 100) + 60 * (disc % 100); ! ! shutdownMsg = ""; ! char buf[1024]; ! while (fgets(buf, sizeof (buf), fd)) ! shutdownMsg.append(buf); ! ok = TRUE; } else logError("%s: shutdown file format error", (const char*) shutdownFile); --- 289,313 ---- tm.tm_year -= 1900; tm.tm_isdst = -1; time_t shut = mktime(&tm); ! if (shut != (time_t) -1) { ! denyTime = shut - 3600 * (deny / 100) + 60 * (deny % 100); ! discTime = shut - 3600 * (disc / 100) + 60 * (disc % 100); ! ! shutdownMsg = ""; ! char buf[1024]; ! while (fgets(buf, sizeof (buf), fd)) ! shutdownMsg.append(buf); ! ok = TRUE; ! } else ! logError("%s: Invalid shutdown time, mktime conversion failed;" ! "Year=%d Mon=%d Day=%d Hour=%d Min=%d" ! , (const char*) shutdownFile ! , tm.tm_year+1900 ! , tm.tm_mon ! , tm.tm_mday ! , tm.tm_hour ! , tm.tm_min ! ); } else logError("%s: shutdown file format error", (const char*) shutdownFile); EOF-EOF-EOF Patch hfaxd/InetFaxServer.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/hfaxd/InetFaxServer.c++ Thu Aug 29 20:26:00 1996 --- hylafax-v4.0pl1/hfaxd/InetFaxServer.c++ Tue Nov 26 15:21:48 1996 *************** *** 1,4 **** ! /* $Id: InetFaxServer.c++,v 1.25 1996/07/29 21:36:15 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: InetFaxServer.c++,v 1.27 1996/10/31 21:47:31 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. *************** *** 33,42 **** --- 33,44 ---- #include #include + extern "C" { #include #include #include + } InetSuperServer::InetSuperServer(const char* p, int bl) : SuperServer("INET", bl) *************** *** 300,306 **** static fxBool setupPassiveDataSocket(int pdata, struct sockaddr_in& pasv_addr) { ! int len = sizeof (pasv_addr); return ( Socket::bind(pdata, &pasv_addr, sizeof (pasv_addr)) >= 0 && Socket::getsockname(pdata, &pasv_addr, &len) >= 0 && --- 302,308 ---- static fxBool setupPassiveDataSocket(int pdata, struct sockaddr_in& pasv_addr) { ! Socket::socklen_t len = sizeof (pasv_addr); return ( Socket::bind(pdata, &pasv_addr, sizeof (pasv_addr)) >= 0 && Socket::getsockname(pdata, &pasv_addr, &len) >= 0 && EOF-EOF-EOF Patch hfaxd/InetFaxServer.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/hfaxd/InetFaxServer.h Thu Aug 29 20:26:00 1996 --- hylafax-v4.0pl1/hfaxd/InetFaxServer.h Tue Nov 26 15:21:48 1996 *************** *** 1,4 **** ! /* $Id: InetFaxServer.h,v 1.10 1996/06/24 03:01:42 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: InetFaxServer.h,v 1.11 1996/10/31 19:07:16 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. *************** *** 27,34 **** #define _InetFaxServer_ #include "HylaFAXServer.h" ! #include struct hostent; --- 27,35 ---- #define _InetFaxServer_ #include "HylaFAXServer.h" ! extern "C" { #include + } struct hostent; EOF-EOF-EOF Patch hfaxd/Login.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/hfaxd/Login.c++ Thu Aug 29 20:26:01 1996 --- hylafax-v4.0pl1/hfaxd/Login.c++ Tue Nov 26 15:21:49 1996 *************** *** 1,4 **** ! /* $Id: Login.c++,v 1.10 1996/06/24 03:01:43 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: Login.c++,v 1.11 1996/11/11 02:14:56 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. *************** *** 114,123 **** * is a ``-''. */ if (pass[0] == '-') { ! state |= S_LREPLIES; pass++; } else ! state &= ~S_LREPLIES; if (pass[0] == '\0' || strcmp(crypt(pass, passwd), passwd) != 0) { if (++loginAttempts >= maxLoginAttempts) { reply(530, "Login incorrect (closing connection)."); --- 114,123 ---- * is a ``-''. */ if (pass[0] == '-') { ! state &= ~S_LREPLIES; pass++; } else ! state |= S_LREPLIES; if (pass[0] == '\0' || strcmp(crypt(pass, passwd), passwd) != 0) { if (++loginAttempts >= maxLoginAttempts) { reply(530, "Login incorrect (closing connection)."); EOF-EOF-EOF Patch hfaxd/OldProtocol.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/hfaxd/OldProtocol.c++ Thu Aug 29 20:26:01 1996 --- hylafax-v4.0pl1/hfaxd/OldProtocol.c++ Tue Nov 26 15:21:49 1996 *************** *** 1,4 **** ! /* $Id: OldProtocol.c++,v 1.32 1996/08/21 21:03:44 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: OldProtocol.c++,v 1.35 1996/11/21 23:59:41 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. *************** *** 46,55 **** --- 46,57 ---- #include #include + extern "C" { #include #include #include + } #define FAX_OSERVICE "fax" // old protocol service name #define FAX_ODEFPORT 4557 // old protocol default port *************** *** 606,626 **** void OldProtocolServer::alterJobGroup##param(const char* tag) \ { applyToJobGroup(tag, "alter", OldProtocolServer::reallyAlterJob##param); } void OldProtocolServer::reallyAlterJobTTS(Job& job, const char* spec) { time_t now = Sys::now(); time_t t = cvtTime(spec, localtime(&now), "time-to-send"); ! fxStr emsg; ! if (sendQueuerACK(emsg, "JT%s %lu", (const char*) job.jobid, (u_long) t)) { ! sendClient("altered", job.jobid); ! } else if (lockJob(job, LOCK_EX|LOCK_NB, emsg)) { job.tts = t; ! job.writeQFile(); ! unlockJob(job); ! sendClient("altered", job.jobid); ! } else ! sendClient("jobLocked", job.jobid); } DEFINE_Alter(TTS) --- 608,653 ---- void OldProtocolServer::alterJobGroup##param(const char* tag) \ { applyToJobGroup(tag, "alter", OldProtocolServer::reallyAlterJob##param); } + fxBool + OldProtocolServer::alterSuspend(Job& job) + { + if (job.state == FaxRequest::state_active) { + sendClient("jobLocked", job.jobid); // NB: maintain old semantics + return (FALSE); + } + fxStr emsg; + if (!sendQueuerACK(emsg, "X%s", (const char*) job.jobid)) { + sendError("Unable to suspend job: %s", (const char*) emsg); + return (FALSE); + } + return (TRUE); + } + + void + OldProtocolServer::alterResubmit(Job& job) + { + fxStr emsg; + const char* jobid = job.jobid; + if (updateJobOnDisk(job, emsg)) { // update q file + if (sendQueuerACK(emsg, "S%s", jobid)) // resubmit job + sendClient("altered", jobid); + else + sendError("Could not resubmit job: %s", (const char*) emsg); + } else { + sendError("Could not update job state: %s", (const char*) emsg); + (void) sendQueuer(emsg, "S%s", jobid); + } + } + void OldProtocolServer::reallyAlterJobTTS(Job& job, const char* spec) { time_t now = Sys::now(); time_t t = cvtTime(spec, localtime(&now), "time-to-send"); ! if (alterSuspend(job)) { job.tts = t; ! alterResubmit(job); ! } } DEFINE_Alter(TTS) *************** *** 629,644 **** { time_t now = Sys::now(); time_t t = cvtTime(spec, localtime(&now), "kill-time"); ! fxStr emsg; ! if (sendQueuerACK(emsg, "JK%s %lu", (const char*) job.jobid, (u_long) t)) { ! sendClient("altered", job.jobid); ! } else if (lockJob(job, LOCK_EX|LOCK_NB, emsg)) { job.killtime = t; ! job.writeQFile(); ! unlockJob(job); ! sendClient("altered", job.jobid); ! } else ! sendClient("jobLocked", job.jobid); } DEFINE_Alter(KillTime) --- 656,665 ---- { time_t now = Sys::now(); time_t t = cvtTime(spec, localtime(&now), "kill-time"); ! if (alterSuspend(job)) { job.killtime = t; ! alterResubmit(job); ! } } DEFINE_Alter(KillTime) *************** *** 645,660 **** void OldProtocolServer::reallyAlterJobModem(Job& job, const char* device) { ! fxStr emsg; ! if (sendQueuerACK(emsg, "JM%s %s", (const char*) job.jobid, device)) { ! sendClient("altered", job.jobid); ! } else if (lockJob(job, LOCK_EX|LOCK_NB, emsg)) { job.modem = device; ! job.writeQFile(); ! unlockJob(job); ! sendClient("altered", job.jobid); ! } else ! sendClient("jobLocked", job.jobid); } DEFINE_Alter(Modem) --- 666,675 ---- void OldProtocolServer::reallyAlterJobModem(Job& job, const char* device) { ! if (alterSuspend(job)) { job.modem = device; ! alterResubmit(job); ! } } DEFINE_Alter(Modem) *************** *** 661,676 **** void OldProtocolServer::reallyAlterJobPriority(Job& job, const char* priority) { ! fxStr emsg; ! if (sendQueuerACK(emsg, "JP%s %s", (const char*) job.jobid, priority)) { ! sendClient("altered", job.jobid); ! } else if (lockJob(job, LOCK_EX|LOCK_NB, emsg)) { job.usrpri = atoi(priority); ! job.writeQFile(); ! unlockJob(job); ! sendClient("altered", job.jobid); ! } else ! sendClient("jobLocked", job.jobid); } DEFINE_Alter(Priority) --- 676,685 ---- void OldProtocolServer::reallyAlterJobPriority(Job& job, const char* priority) { ! if (alterSuspend(job)) { job.usrpri = atoi(priority); ! alterResubmit(job); ! } } DEFINE_Alter(Priority) *************** *** 677,690 **** void OldProtocolServer::reallyAlterJobMaxDials(Job& job, const char* max) { ! fxStr emsg; ! if (lockJob(job, LOCK_EX|LOCK_NB, emsg)) { job.maxdials = atoi(max); ! job.writeQFile(); ! unlockJob(job); ! sendClient("altered", job.jobid); ! } else ! sendClient("jobLocked", job.jobid); } DEFINE_Alter(MaxDials) --- 686,695 ---- void OldProtocolServer::reallyAlterJobMaxDials(Job& job, const char* max) { ! if (alterSuspend(job)) { job.maxdials = atoi(max); ! alterResubmit(job); ! } } DEFINE_Alter(MaxDials) *************** *** 691,703 **** void OldProtocolServer::reallyAlterJobNotification(Job& job, const char* note) { ! fxStr emsg; ! if (lockJob(job, LOCK_EX|LOCK_NB, emsg)) { job.checkNotifyValue(note); ! unlockJob(job); ! sendClient("altered", job.jobid); ! } else ! sendClient("jobLocked", job.jobid); } DEFINE_Alter(Notification) --- 696,705 ---- void OldProtocolServer::reallyAlterJobNotification(Job& job, const char* note) { ! if (alterSuspend(job)) { job.checkNotifyValue(note); ! alterResubmit(job); ! } } DEFINE_Alter(Notification) *************** *** 750,758 **** #define DEFINE_Op(op) \ void OldProtocolServer::##op##Job(const char* tag) \ ! { applyToJob(tag, "##op##", OldProtocolServer::do##op); } \ void OldProtocolServer::##op##JobGroup(const char* tag) \ ! { applyToJobGroup(tag, "##op##", OldProtocolServer::do##op); } void OldProtocolServer::doremove(Job& job, const char*) { --- 752,760 ---- #define DEFINE_Op(op) \ void OldProtocolServer::##op##Job(const char* tag) \ ! { applyToJob(tag, fxQUOTE(op), OldProtocolServer::do##op); }\ void OldProtocolServer::##op##JobGroup(const char* tag) \ ! { applyToJobGroup(tag, fxQUOTE(op), OldProtocolServer::do##op); } void OldProtocolServer::doremove(Job& job, const char*) { EOF-EOF-EOF Patch hfaxd/OldProtocol.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/hfaxd/OldProtocol.h Thu Aug 29 20:26:02 1996 --- hylafax-v4.0pl1/hfaxd/OldProtocol.h Tue Nov 26 15:21:50 1996 *************** *** 1,4 **** ! /* $Id: OldProtocol.h,v 1.10 1996/06/24 03:01:44 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: OldProtocol.h,v 1.11 1996/11/21 23:59:41 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. *************** *** 69,74 **** --- 69,76 ---- void (OldProtocolServer::*f)(Job&, const char*)); void applyToJobGroup(const char* tag, const char* op, void (OldProtocolServer::*f)(Job&, const char*)); + fxBool alterSuspend(Job&); + void alterResubmit(Job&); void alterJobTTS(const char*); void alterJobGroupTTS(const char*); void reallyAlterJobTTS(Job& job, const char* spec); EOF-EOF-EOF Patch hfaxd/SNPPServer.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/hfaxd/SNPPServer.c++ Thu Aug 29 20:26:03 1996 --- hylafax-v4.0pl1/hfaxd/SNPPServer.c++ Tue Nov 26 15:21:51 1996 *************** *** 1,4 **** ! /* $Id: SNPPServer.c++,v 1.24 1996/07/23 23:20:09 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: SNPPServer.c++,v 1.25 1996/10/29 21:30:42 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. *************** *** 40,50 **** --- 40,52 ---- #include #endif + extern "C" { #include #include #include #include + } SNPPSuperServer::SNPPSuperServer(const char* p, int bl) : SuperServer("SNPP", bl) EOF-EOF-EOF Patch hfaxd/UnixFaxServer.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/hfaxd/UnixFaxServer.c++ Thu Aug 29 20:26:04 1996 --- hylafax-v4.0pl1/hfaxd/UnixFaxServer.c++ Tue Nov 26 15:21:53 1996 *************** *** 1,4 **** ! /* $Id: UnixFaxServer.c++,v 1.13 1996/06/24 03:01:49 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: UnixFaxServer.c++,v 1.14 1996/09/30 21:05:19 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. *************** *** 154,160 **** int s = accept(pdata, (struct sockaddr*) &from, &fromlen); if (s < 0) { reply(425, "Cannot open data connection."); ! (void) ::close(pdata); pdata = -1; return (NULL); } --- 154,160 ---- int s = accept(pdata, (struct sockaddr*) &from, &fromlen); if (s < 0) { reply(425, "Cannot open data connection."); ! (void) Sys::close(pdata); pdata = -1; return (NULL); } EOF-EOF-EOF Patch hfaxd/hfaxd.conf<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/hfaxd/hfaxd.conf Thu Aug 29 20:26:06 1996 --- hylafax-v4.0pl1/hfaxd/hfaxd.conf Tue Nov 26 15:21:54 1996 *************** *** 9,15 **** # LogFacility: daemon # syslog facility (want this 1st)) ServerTracing: 0x001 # just server operation ! #IdleTime: 900 # initial client idle timeout (secs) #MaxIdleTimeout: 7200 # max client idle timeout (secs) #MaxLoginAttempts: 5 # max # login attempts before disconnect #MaxAdminAttempts: 5 # max # admin attempts before disconnect --- 9,15 ---- # LogFacility: daemon # syslog facility (want this 1st)) ServerTracing: 0x001 # just server operation ! #IdleTimeout: 900 # initial client idle timeout (secs) #MaxIdleTimeout: 7200 # max client idle timeout (secs) #MaxLoginAttempts: 5 # max # login attempts before disconnect #MaxAdminAttempts: 5 # max # admin attempts before disconnect EOF-EOF-EOF Patch hfaxd/manifest.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/hfaxd/manifest.h Thu Aug 29 20:26:06 1996 --- hylafax-v4.0pl1/hfaxd/manifest.h Tue Nov 26 15:21:54 1996 *************** *** 1,4 **** ! /* $Id: manifest.h,v 1.5 1996/06/24 03:01:51 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: manifest.h,v 1.7 1996/11/23 17:28:21 sam Rel $ */ /* * Copyright (c) 1995-1996 Sam Leffler * Copyright (c) 1995-1996 Silicon Graphics, Inc. *************** *** 38,44 **** --- 38,48 ---- * of files and use the group protection bits for * access control. */ + #if defined(CONFIG_MAXGID) && CONFIG_MAXGID < 60002 + #define FAXUID_MAX CONFIG_MAXGID // constrain to system limit + #else #define FAXUID_MAX 60002 // fits in unsigned 16-bit value + #endif #define FAXUID_ANON FAXUID_MAX // UID of anonymous user /* EOF-EOF-EOF Patch html/Makefile.in<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/html/Makefile.in Thu Aug 29 20:26:32 1996 --- hylafax-v4.0pl1/html/Makefile.in Tue Nov 26 15:22:19 1996 *************** *** 1,4 **** ! # $Id: Makefile.in,v 1.46 1996/08/26 19:40:48 sam Rel $ # # @WARNING@ # --- 1,4 ---- ! # $Id: Makefile.in,v 1.47 1996/09/30 22:27:57 sam Rel $ # # @WARNING@ # *************** *** 100,105 **** --- 100,106 ---- ${SRCDIR}/v4.0beta018.html \ ${SRCDIR}/v4.0beta020.html \ ${SRCDIR}/v4.0beta021.html \ + ${SRCDIR}/v4.0beta022.html \ ${SRCDIR}/version.html \ ${SRCDIR}/Majordomo/help.html \ ${SRCDIR}/Modems/Hayes/hayes.html \ EOF-EOF-EOF Patch html/acknowledge.html<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/html/acknowledge.html Thu Aug 29 20:26:43 1996 --- hylafax-v4.0pl1/html/acknowledge.html Tue Nov 26 15:22:33 1996 *************** *** 36,46 **** Chris Munonye Rob Newberry Dag Nygren Jonas Olsson Dave Packer Damon Permezel David Pike Amir Plivatsky Andy Rabagliati ! Eric Rescorla Marshall Rose Daniel Rosenblatt ! Joel Rosi-Schwartz Tim Rylance Joseph E. Sacco ! Thomas A. Szybist Brent Townshend Peter White ! Steve Williams Scott Woodard David Vrona ! Paul Vixie Christian Zahl (and surely others). Also, a special thanks to Ed McCreight for --- 36,47 ---- Chris Munonye Rob Newberry Dag Nygren Jonas Olsson Dave Packer Damon Permezel David Pike Amir Plivatsky Andy Rabagliati ! Eric Rescorla Matthew Rice Tim Rice ! Marshall Rose Daniel Rosenblatt Joel Rosi-Schwartz ! Tim Rylance Joseph E. Sacco Thomas A. Szybist ! Brent Townshend Peter White Steve Williams ! Scott Woodard David Vrona Paul Vixie ! Christian Zahl (and surely others). Also, a special thanks to Ed McCreight for *************** *** 208,214 ****
Sam Leffler / sam@engr.sgi.com. ! Last updated $Date: 1996/08/16 21:03:37 $.
--- 209,215 ----
Sam Leffler / sam@engr.sgi.com. ! Last updated $Date: 1996/10/31 19:10:01 $.
EOF-EOF-EOF Patch html/building.html<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/html/building.html Thu Aug 29 20:26:33 1996 --- hylafax-v4.0pl1/html/building.html Tue Nov 26 15:22:20 1996 *************** *** 754,759 **** --- 754,760 ---- #! /bin/sh ROOT=${1-/hylafax} CGI=${2-/cgi-bin} + PATTERN="@[a-zA-Z][a-zA-Z]*@" patch() { *************** *** 2111,2116 **** --- 2112,2221 ---- It may be preferrable to set SCRIPT_SH=/bin/ksh though it is not necessary. +

SCO Guidance

+ + These notes pertain to SCO 3.2 v4.2; they may also be relevant to other + versions. + +

+ With gcc 2.7.2.1 one gcc include file needs to be patched to + include missing function prototypes: + +

+ *** /usr/local/lib/gcc-lib/i486-unknown-sco3.2v4.2/2.7.2.1/include/sys/signal.h Thu Sep 5 18:26:45 1996 + --- /usr/local/lib/gcc-lib/i486-unknown-sco3.2v4.2/2.7.2.1/include/sys/signal.h.old Thu Sep 5 18:28:56 1996 + *************** + *** 214,221 **** + #else + int kill(short, int); + #endif + ! int (*ssignal(int, int(*)(int)))(int); + ! void (*sigset(int, SIG_TYP))(int); + + int sigpause(int); /* These 4 are SVID functions as well */ + int sighold(int); + --- 214,221 ---- + #else + int kill(short, int); + #endif + ! int (*ssignal(int, int(*)(int)))(); + ! void (*sigset(int, SIG_TYP))(); + + int sigpause(int); /* These 4 are SVID functions as well */ + int sighold(int); + + +

+ When running configure disable the use of ranlib by specifying + -with-RANLIB=true on the command line or in a config.local + file. + +

+ Some of SCO's system include files have incorrect function prototypes + that cause compilation to fail; other include files are not properly + setup to deal with their being included multiple times. + The following diffs may be applied to the problematic system include files + or one may create patched copies of these files in a private + sys directory under the top level of the HylaFAX build tree. + +

+ *** /usr/include/sys/stat.h Wed Mar 9 00:00:00 1994 + --- sys/stat.h Thu Sep 5 18:45:25 1996 + *************** + *** 147,153 **** + extern int lstat(const char *, struct stat *); + extern int fstat(int, struct stat *); + extern int mkdir(const char *, mode_t); + ! extern int mkfifo(char *, mode_t); + extern mode_t umask(mode_t); + #ifdef __cplusplus + }; + --- 147,153 ---- + extern int lstat(const char *, struct stat *); + extern int fstat(int, struct stat *); + extern int mkdir(const char *, mode_t); + ! extern int mkfifo(const char *, mode_t); + extern mode_t umask(mode_t); + #ifdef __cplusplus + }; + *** /usr/include/sys/time.h Fri Mar 27 05:05:45 1992 + --- sys/time.h Thu Sep 5 19:42:08 1996 + *************** + *** 32,41 **** + --- 32,44 ---- + #ifndef __sys_time_h__ + #define __sys_time_h__ + + + #ifndef _STRUCT_TIMEVAL_ + + #define _STRUCT_TIMEVAL_ + struct timeval { + long tv_sec; /* seconds */ + long tv_usec;/* and microseconds */ + }; + + #endif /* _STRUCT_TIMEVAL_ */ + + struct timezone { + int tz_minuteswest; /* minutes west of Greenwich */ + *** /usr/include/sys/select.h Wed Mar 9 00:00:00 1994 + --- sys/select.h Thu Sep 5 19:41:13 1996 + *************** + *** 38,47 **** + --- 38,50 ---- + /* + * Structure used to specify timeout in select(2) system call. + */ + + #ifndef _STRUCT_TIMEVAL_ + + #define _STRUCT_TIMEVAL_ + struct timeval { + long tv_sec; /* seconds */ + long tv_usec; /* and microseconds */ + }; + + #endif /* _STRUCT_TIMEVAL_ */ + + #ifndef _INKERNEL + #ifdef _NO_PROTOTYPE + +

Solaris Guidance

Under (at least) Solaris 2.3 *************** *** 2275,2280 **** --- 2380,2437 ---- have not tried to build with the port/syslog.c support included with HylaFAX; though it should be equivalent). +

UnixWare Guidance

+ + One system include file needs to be patched to correct + function prototypes: + + + *** /usr/include/netdb.h Mon Dec 11 05:25:35 1995 + --- netdb.h Wed Oct 30 14:05:35 1996 + *************** + *** 90,105 **** + + #ifdef __STDC__ + + ! extern struct hostent *gethostbyname(char *); + extern struct hostent *gethostbyaddr(char *, int, int); + extern struct hostent *gethostent(void); + extern struct netent *getnetbyname(char *); + extern struct netent *getnetbyaddr(long, int); + extern struct netent *getnetent(void); + ! extern struct servent *getservbyname(char *, char *); + extern struct servent *getservbyport(int, char *); + extern struct servent *getservent(void); + ! extern struct protoent *getprotobyname(char *); + extern struct protoent *getprotobynumber(int); + extern struct protoent *getprotoent(void); + extern int endhostent(void); + --- 90,105 ---- + + #ifdef __STDC__ + + ! extern struct hostent *gethostbyname(const char *); + extern struct hostent *gethostbyaddr(char *, int, int); + extern struct hostent *gethostent(void); + extern struct netent *getnetbyname(char *); + extern struct netent *getnetbyaddr(long, int); + extern struct netent *getnetent(void); + ! extern struct servent *getservbyname(const char *, const char *); + extern struct servent *getservbyport(int, char *); + extern struct servent *getservent(void); + ! extern struct protoent *getprotobyname(const char *); + extern struct protoent *getprotobynumber(int); + extern struct protoent *getprotoent(void); + extern int endhostent(void); + + +

+ On some versions the configuration parameter + CONFIG_SOCKARGLENTYPE needs to be set to size_t + to force the argument type for call-by-reference parameters + to the socket-related system calls; this should automatically be + done by configure. +

*************** *** 2291,2297 ****

Sam Leffler / sam@engr.sgi.com. ! Last updated $Date: 1996/08/26 19:40:31 $.
--- 2448,2454 ----
Sam Leffler / sam@engr.sgi.com. ! Last updated $Date: 1996/11/15 16:08:13 $.
EOF-EOF-EOF Patch html/index.html<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/html/index.html Thu Aug 29 20:26:33 1996 --- hylafax-v4.0pl1/html/index.html Tue Nov 26 15:22:21 1996 *************** *** 11,21 **** ! ! --- 11,21 ----
Latest Distribution:v4.0pl0
Latest Release:v4.0pl0 (Version 4.0 patch level 0)
Master FTP Site:
! ! *************** *** 103,109 ****
Sam Leffler / sam@engr.sgi.com. ! Last updated: $Date: 1996/08/19 19:02:08 $
--- 103,109 ----
Sam Leffler / sam@engr.sgi.com. ! Last updated: $Date: 1996/09/30 22:27:57 $
EOF-EOF-EOF Patch man/faxcover.1<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/man/faxcover.1 Thu Aug 29 20:26:19 1996 --- hylafax-v4.0pl1/man/faxcover.1 Tue Nov 26 15:22:07 1996 *************** *** 1,4 **** ! .\" $Id: faxcover.1,v 1.30 1996/06/24 03:04:08 sam Rel $ .\" .\" HylaFAX Facsimile Software .\" --- 1,4 ---- ! .\" $Id: faxcover.1,v 1.31 1996/11/14 19:38:40 sam Rel $ .\" .\" HylaFAX Facsimile Software .\" *************** *** 28,34 **** .if n .po 0 .ds Fx \fIHyla\s-1FAX\s+1\fP .ds Ps P\s-2OST\s+2S\s-2CRIPT\s+2 ! .TH FAXCOVER 1 "June 25, 1993" .SH NAME faxcover \- generate a \*(Ps cover page for an outgoing facsimile .SH SYNOPSIS --- 28,34 ---- .if n .po 0 .ds Fx \fIHyla\s-1FAX\s+1\fP .ds Ps P\s-2OST\s+2S\s-2CRIPT\s+2 ! .TH FAXCOVER 1 "November 14, 1996" .SH NAME faxcover \- generate a \*(Ps cover page for an outgoing facsimile .SH SYNOPSIS *************** *** 168,173 **** --- 168,180 ---- If no template file is located, .I faxcover will terminate without generating a cover page. + .TP 12 + .BI \-D " format" + Use + .I format + as the formatting specification passed to + .IR strftime (3) + when generating the time and date placed on the cover page. .TP 12 .BI \-f " name" Use EOF-EOF-EOF Patch man/faxinfo.1m<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/man/faxinfo.1m Thu Aug 29 20:26:20 1996 --- hylafax-v4.0pl1/man/faxinfo.1m Tue Nov 26 15:22:08 1996 *************** *** 1,4 **** ! .\" $Id: faxinfo.1m,v 1.3 1996/06/24 03:04:09 sam Rel $ .\" .\" HylaFAX Facsimile Software .\" --- 1,4 ---- ! .\" $Id: faxinfo.1m,v 1.4 1996/11/15 20:20:21 sam Rel $ .\" .\" HylaFAX Facsimile Software .\" *************** *** 27,37 **** .\" .if n .po 0 .ds Fx \fIHyla\s-1FAX\s+1\fP ! .TH FAXINFO 1M "May 8, 1996" .SH NAME faxinfo \- print information about a received facsimile .SH SYNOPSIS .B ${SBIN}/faxinfo .I file.tif .SH DESCRIPTION .I faxinfo --- 27,40 ---- .\" .if n .po 0 .ds Fx \fIHyla\s-1FAX\s+1\fP ! .TH FAXINFO 1M "November 15, 1996" .SH NAME faxinfo \- print information about a received facsimile .SH SYNOPSIS .B ${SBIN}/faxinfo + [ + .B \-n + ] .I file.tif .SH DESCRIPTION .I faxinfo *************** *** 57,62 **** --- 60,69 ---- mail generated by the .IR faxrcvd (1M) script when a facsimile is received by \*(Fx. + .PP + The + .B \-n + option suppresses the printing of the filename. .SH NOTES The information that .I faxinfo EOF-EOF-EOF Patch man/sendfax.1<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/man/sendfax.1 Thu Aug 29 20:26:27 1996 --- hylafax-v4.0pl1/man/sendfax.1 Tue Nov 26 15:22:15 1996 *************** *** 1,4 **** ! .\" $Id: sendfax.1,v 1.50 1996/07/26 21:03:49 sam Rel $ .\" .\" HylaFAX Facsimile Software .\" --- 1,4 ---- ! .\" $Id: sendfax.1,v 1.51 1996/11/14 19:38:40 sam Rel $ .\" .\" HylaFAX Facsimile Software .\" *************** *** 565,570 **** --- 565,571 ---- Cover-Regarding string \- cover page regarding string Cover-Template string \- cover page template filename Cover-Voice string \- cover page voice number string + DateFormat string \- cover page date format string DesiredEC boolean \- desired use of \s-1ECM\s+1 DesiredMST string \- desired minimum scanling time to use DesiredSpeed integer \- desired signalling rate to use *************** *** 639,644 **** --- 640,651 ---- .B Cover-Voice The voice number string to pass to the cover sheet program when auto-generating cover pages. + .TP 16 + .B DateFormat + The + .IR strftime (3) + format string to pass to the cover page command when auto-generating + cover pages. .TP 16 .B DesiredEC Whether or not to request the use of the optional EOF-EOF-EOF Patch port/irix/so_locations<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/port/irix/so_locations Thu Aug 29 20:26:15 1996 --- hylafax-v4.0pl1/port/irix/so_locations Tue Nov 26 15:22:03 1996 *************** *** 1,20 **** ! # $Id: so_locations,v 1.6 1996/06/24 03:04:55 sam Rel $ # # Layout for HylaFAX DSO's. # ! # These values were calculated under IRIX 5.3 with patches ! # 894 and 1116; you may need to update them for a different ! # system (make this file writable and rebuild the software). # ! libfaxserver.so \ ! :st = .text 0x5ff20000, 0x00040000:\ ! :st = .data 0x5ff60000, 0x00010000:\ ! libz.so \ ! :st = .text 0x5ff70000, 0x00010000:\ ! :st = .data 0x5ff80000, 0x00010000:\ ! libfaxutil.so \ ! :st = .text 0x5ff90000, 0x00060000:\ ! :st = .data 0x5fff0000, 0x00010000:\ ! --- 1,22 ---- ! # $Id: so_locations,v 1.7 1996/11/15 00:00:52 sam Rel $ # # Layout for HylaFAX DSO's. # ! # These values were calculated under IRIX 6.2; you may need ! # to update them for a different system (to do that make this ! # file writable and rebuild the software with -update_registry ! # instead of -check_registry when building the DSO's). # ! # NB: padding was added to the text segments of libfaxutil.so ! # and libfaxserver.so so that purify can add its code w/o ! # overflowing into the following data segment ! # libz.so \ ! :st = .text 0x5ffe0000, 0x00010000:\ ! :st = .data 0x5fff0000, 0x00010000: libfaxutil.so \ ! :st = .text 0x5ff60000, 0x00070000:\ ! :st = .data 0x5ffd0000, 0x00010000: ! libfaxserver.so \ ! :st = .text 0x5ff00000, 0x00050000:\ ! :st = .data 0x5ff50000, 0x00010000: EOF-EOF-EOF Patch port/syslog.c<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/port/syslog.c Thu Aug 29 20:26:14 1996 --- hylafax-v4.0pl1/port/syslog.c Tue Nov 26 15:22:02 1996 *************** *** 41,47 **** #include #include #include ! #include #include #include #include --- 41,47 ---- #include #include #include ! #include #include #include #include EOF-EOF-EOF Patch util/Array.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/util/Array.c++ Thu Aug 29 20:24:40 1996 --- hylafax-v4.0pl1/util/Array.c++ Tue Nov 26 15:20:35 1996 *************** *** 1,4 **** ! /* $Id: Array.c++,v 1.16 1996/06/24 03:05:37 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: Array.c++,v 1.18 1996/10/04 00:09:16 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 59,65 **** fxArray::~fxArray() { ! delete (void*)data; } void --- 59,66 ---- fxArray::~fxArray() { ! if (data) ! free((void*) data); } void *************** *** 169,175 **** fxArray::getmem() { if (maxi == 0) { ! delete (void*)data; data = 0; } else { if (data) --- 170,177 ---- fxArray::getmem() { if (maxi == 0) { ! if (data) ! free((void*) data); data = 0; } else { if (data) *************** *** 295,301 **** ? malloc(elementsize) : smallbuffer; qsortInternal(posn,posn+len-1,tmp); ! if (tmp != smallbuffer) delete tmp; } void --- 297,303 ---- ? malloc(elementsize) : smallbuffer; qsortInternal(posn,posn+len-1,tmp); ! if (tmp != smallbuffer) free(tmp); } void EOF-EOF-EOF Patch util/Class2Params.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/util/Class2Params.c++ Thu Aug 29 20:24:41 1996 --- hylafax-v4.0pl1/util/Class2Params.c++ Tue Nov 26 15:20:36 1996 *************** *** 1,4 **** ! /* $Id: Class2Params.c++,v 1.32 1996/08/08 19:20:34 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: Class2Params.c++,v 1.33 1996/09/30 21:03:43 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 62,68 **** addParam(char* cp, u_int v) { if (v != (u_int)-1) { ! ::sprintf(cp, ",%u", v); while (*cp != '\0') cp++; } else { *cp++ = ','; --- 62,68 ---- addParam(char* cp, u_int v) { if (v != (u_int)-1) { ! sprintf(cp, ",%u", v); while (*cp != '\0') cp++; } else { *cp++ = ','; *************** *** 78,84 **** char* cp = buf; if (vr != (u_int) -1) { ! ::sprintf(cp, "%u", vr); while (*cp != '\0') cp++; } cp = addParam(cp, br); --- 78,84 ---- char* cp = buf; if (vr != (u_int) -1) { ! sprintf(cp, "%u", vr); while (*cp != '\0') cp++; } cp = addParam(cp, br); *************** *** 418,424 **** void Class2Params::decodePage(const char* s) { ! u_int v = (u_int) ::strtoul(s, NULL, 16); vr = (v>>0) & 1; wd = (v>>1) & 7; ln = (v>>4) & 3; --- 418,424 ---- void Class2Params::decodePage(const char* s) { ! u_int v = (u_int) strtoul(s, NULL, 16); vr = (v>>0) & 1; wd = (v>>1) & 7; ln = (v>>4) & 3; EOF-EOF-EOF Patch util/PageSize.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/util/PageSize.c++ Thu Aug 29 20:24:45 1996 --- hylafax-v4.0pl1/util/PageSize.c++ Tue Nov 26 15:20:40 1996 *************** *** 1,4 **** ! /* $Id: PageSize.c++,v 1.22 1996/08/21 22:05:16 sam Rel $ */ /* * Copyright (c) 1993-1996 Sam Leffler * Copyright (c) 1993-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: PageSize.c++,v 1.23 1996/09/30 21:03:43 sam Rel $ */ /* * Copyright (c) 1993-1996 Sam Leffler * Copyright (c) 1993-1996 Silicon Graphics, Inc. *************** *** 148,157 **** size_t len = strlen(name); for (int i = 0, n = pageInfo->length(); i < n; i++) { const PageInfo& pi = (*pageInfo)[i]; ! if (::strncasecmp(pi.abbr, name, len) == 0) return π for (const char* cp = pi.name; *cp != '\0'; cp++) ! if (tolower(*cp) == c && ::strncasecmp(cp, name, len) == 0) return π } return (NULL); --- 148,157 ---- size_t len = strlen(name); for (int i = 0, n = pageInfo->length(); i < n; i++) { const PageInfo& pi = (*pageInfo)[i]; ! if (strncasecmp(pi.abbr, name, len) == 0) return π for (const char* cp = pi.name; *cp != '\0'; cp++) ! if (tolower(*cp) == c && strncasecmp(cp, name, len) == 0) return π } return (NULL); EOF-EOF-EOF Patch util/RegEx.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/util/RegEx.c++ Thu Aug 29 20:24:46 1996 --- hylafax-v4.0pl1/util/RegEx.c++ Tue Nov 26 15:20:40 1996 *************** *** 1,4 **** ! /* $Id: RegEx.c++,v 1.12 1996/06/24 03:05:57 sam Rel $ */ /* * Copyright (c) 1994-1996 Sam Leffler * Copyright (c) 1994-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: RegEx.c++,v 1.13 1996/09/30 21:03:43 sam Rel $ */ /* * Copyright (c) 1994-1996 Sam Leffler * Copyright (c) 1994-1996 Silicon Graphics, Inc. *************** *** 30,36 **** #include RegEx::RegEx(const char* pat, int len, int flags) ! : _pattern(pat, len == 0 ? ::strlen(pat) : len) { init(flags); } --- 30,36 ---- #include RegEx::RegEx(const char* pat, int len, int flags) ! : _pattern(pat, len == 0 ? strlen(pat) : len) { init(flags); } EOF-EOF-EOF Patch util/SendFaxClient.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/util/SendFaxClient.c++ Thu Aug 29 20:24:46 1996 --- hylafax-v4.0pl1/util/SendFaxClient.c++ Tue Nov 26 15:20:41 1996 *************** *** 1,4 **** ! /* $Id: SendFaxClient.c++,v 1.61 1996/08/21 22:05:16 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: SendFaxClient.c++,v 1.62 1996/11/14 19:56:33 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 203,208 **** --- 203,209 ---- else av[ac++] = coverCmd; addarg(av, ac, "-C", job.getCoverTemplate()); + addarg(av, ac, "-D", dateFormat); addarg(av, ac, "-c", job.getCoverComments()); addarg(av, ac, "-f", senderName); addarg(av, ac, "-l", job.getCoverLocation()); *************** *** 501,506 **** --- 502,508 ---- { "covercmd", &SendFaxClient::coverCmd, FAX_CLIENTBIN "/" "faxcover" }, { "from", &SendFaxClient::from, NULL }, + { "dateformat", &SendFaxClient::dateFormat, NULL }, }; void EOF-EOF-EOF Patch util/SendFaxClient.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/util/SendFaxClient.h Thu Aug 29 20:24:57 1996 --- hylafax-v4.0pl1/util/SendFaxClient.h Tue Nov 26 15:20:51 1996 *************** *** 1,4 **** ! /* $Id: SendFaxClient.h,v 1.24 1996/06/24 03:06:01 sam Rel $ */ /* * Copyright (c) 1993-1996 Sam Leffler * Copyright (c) 1993-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: SendFaxClient.h,v 1.25 1996/11/14 19:56:33 sam Rel $ */ /* * Copyright (c) 1993-1996 Sam Leffler * Copyright (c) 1993-1996 Silicon Graphics, Inc. *************** *** 61,66 **** --- 61,67 ---- fxStr senderName; // sender's full name fxStr coverCmd; // cover page program name u_int totalPages; // total pages in submitted documents + fxStr dateFormat; // date format string for cover page static const SF_stringtag strings[]; protected: EOF-EOF-EOF Patch util/SendFaxJob.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/util/SendFaxJob.c++ Thu Aug 29 20:24:47 1996 --- hylafax-v4.0pl1/util/SendFaxJob.c++ Tue Nov 26 15:20:41 1996 *************** *** 1,4 **** ! /* $Id: SendFaxJob.c++,v 1.19 1996/08/21 22:05:16 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: SendFaxJob.c++,v 1.21 1996/09/30 20:50:30 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 159,167 **** case 0: sendTagLine = TRUE; break; } } else if (FaxConfig::findTag(tag, (const FaxConfig::tags*) numbers, N(numbers), ix)) { ! (*this).*numbers[ix].p = ::atoi(value); } else if (FaxConfig::findTag(tag, (const FaxConfig::tags*) floats, N(floats), ix)) { ! (*this).*floats[ix].p = ::atof(value); } else if (streq(tag, "autocoverpage")) setAutoCoverPage(FaxConfig::getBoolean(value)); else if (streq(tag, "notify") || streq(tag, "notification")) --- 159,167 ---- case 0: sendTagLine = TRUE; break; } } else if (FaxConfig::findTag(tag, (const FaxConfig::tags*) numbers, N(numbers), ix)) { ! (*this).*numbers[ix].p = atoi(value); } else if (FaxConfig::findTag(tag, (const FaxConfig::tags*) floats, N(floats), ix)) { ! (*this).*floats[ix].p = atof(value); } else if (streq(tag, "autocoverpage")) setAutoCoverPage(FaxConfig::getBoolean(value)); else if (streq(tag, "notify") || streq(tag, "notification")) *************** *** 458,464 **** IFPARM("MINBR", minsp, (u_int) -1) IFPARM("BEGBR", desiredbr, (u_int) -1) IFPARM("BEGST", desiredst, (u_int) -1) ! IFPARM("USEECM", desiredec, (u_int) -1) if (desireddf != (u_int) -1) { CHECKPARM("DATAFORMAT", desireddf == 0 ? "g31d" : --- 458,465 ---- IFPARM("MINBR", minsp, (u_int) -1) IFPARM("BEGBR", desiredbr, (u_int) -1) IFPARM("BEGST", desiredst, (u_int) -1) ! if (desiredec != (u_int) -1) ! CHECKPARM("USEECM", (fxBool) desiredec) if (desireddf != (u_int) -1) { CHECKPARM("DATAFORMAT", desireddf == 0 ? "g31d" : EOF-EOF-EOF Patch util/StackBuffer.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/util/StackBuffer.c++ Thu Aug 29 20:24:47 1996 --- hylafax-v4.0pl1/util/StackBuffer.c++ Tue Nov 26 15:20:42 1996 *************** *** 1,4 **** ! /* $Id: StackBuffer.c++,v 1.15 1996/06/24 03:06:03 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: StackBuffer.c++,v 1.16 1996/10/03 23:40:40 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 36,42 **** fxStackBuffer::~fxStackBuffer() { ! if (base != buf) delete base; } fxStackBuffer::fxStackBuffer(const fxStackBuffer& other) --- 36,42 ---- fxStackBuffer::~fxStackBuffer() { ! if (base != buf) free(base); } fxStackBuffer::fxStackBuffer(const fxStackBuffer& other) EOF-EOF-EOF Patch util/StackBuffer.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/util/StackBuffer.h Thu Aug 29 20:24:58 1996 --- hylafax-v4.0pl1/util/StackBuffer.h Tue Nov 26 15:20:53 1996 *************** *** 1,4 **** ! /* $Id: StackBuffer.h,v 1.14 1996/06/24 03:06:04 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: StackBuffer.h,v 1.15 1996/09/25 17:22:27 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 59,64 **** --- 59,65 ---- operator const char*() const; // Return base of buffer operator const unsigned char*() const;// Return base of buffer char& operator[](u_int i) const; // Return character in buffer + char& operator[](int i) const; // Return character in buffer protected: char buf[1000]; char* next; *************** *** 83,86 **** --- 84,88 ---- { return (unsigned char*)base; } inline u_int fxStackBuffer::getLength() const { return next - base; } inline char& fxStackBuffer::operator[](u_int ix) const { return base[ix]; } + inline char& fxStackBuffer::operator[](int ix) const { return base[ix]; } #endif /* _StackBuffer_ */ EOF-EOF-EOF Patch util/Str.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/util/Str.c++ Thu Aug 29 20:24:48 1996 --- hylafax-v4.0pl1/util/Str.c++ Tue Nov 26 15:20:42 1996 *************** *** 1,4 **** ! /* $Id: Str.c++,v 1.29 1996/08/22 18:12:02 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: Str.c++,v 1.32 1996/10/04 02:05:37 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 36,45 **** { slength = l+1; if (l>0) { ! data = new char[slength]; } else data = &emptyString; - memset(data,0,slength); } fxStr::fxStr(const char *s) --- 36,45 ---- { slength = l+1; if (l>0) { ! data = (char*) malloc(slength); ! memset(data,0,slength); } else data = &emptyString; } fxStr::fxStr(const char *s) *************** *** 46,52 **** { u_int l = strlen(s)+1; if (l>1) { ! data = new char[l]; memcpy(data,s,l); } else { data = &emptyString; --- 46,52 ---- { u_int l = strlen(s)+1; if (l>1) { ! data = (char*) malloc(l); memcpy(data,s,l); } else { data = &emptyString; *************** *** 57,68 **** fxStr::fxStr(const char *s, u_int len) { if (len>0) { ! data = new char[len+1]; memcpy(data,s,len); } else data = &emptyString; slength = len+1; - data[len] = 0; } fxStr::fxStr(const fxStr&s) --- 57,68 ---- fxStr::fxStr(const char *s, u_int len) { if (len>0) { ! data = (char*) malloc(len+1); memcpy(data,s,len); + data[len] = 0; } else data = &emptyString; slength = len+1; } fxStr::fxStr(const fxStr&s) *************** *** 69,75 **** { slength = s.slength; if (slength > 1) { ! data = new char[slength]; memcpy(data,s.data,slength); } else { data = &emptyString; --- 69,75 ---- { slength = s.slength; if (slength > 1) { ! data = (char*) malloc(slength); memcpy(data,s.data,slength); } else { data = &emptyString; *************** *** 80,86 **** { slength = t.slength; if (t.slength>1) { ! data = new char[slength]; memcpy(data,t.data,slength); } else { data = &emptyString; --- 80,86 ---- { slength = t.slength; if (t.slength>1) { ! data = (char*) malloc(slength); memcpy(data,t.data,slength); } else { data = &emptyString; *************** *** 93,99 **** if (!format) format = "%d"; sprintf(buffer,format,a); slength = strlen(buffer) + 1; ! data = new char[slength]; memcpy(data,buffer,slength); } --- 93,99 ---- if (!format) format = "%d"; sprintf(buffer,format,a); slength = strlen(buffer) + 1; ! data = (char*) malloc(slength); memcpy(data,buffer,slength); } *************** *** 103,109 **** if (!format) format = "%ld"; sprintf(buffer,format,a); slength = strlen(buffer) + 1; ! data = new char[slength]; memcpy(data,buffer,slength); } --- 103,109 ---- if (!format) format = "%ld"; sprintf(buffer,format,a); slength = strlen(buffer) + 1; ! data = (char*) malloc(slength); memcpy(data,buffer,slength); } *************** *** 114,120 **** sprintf(buffer,format,a); slength = strlen(buffer) + 1; fxAssert(slength>1, "Str::Str(float): bogus conversion"); ! data = new char[slength]; memcpy(data,buffer,slength); } --- 114,120 ---- sprintf(buffer,format,a); slength = strlen(buffer) + 1; fxAssert(slength>1, "Str::Str(float): bogus conversion"); ! data = (char*) malloc(slength); memcpy(data,buffer,slength); } *************** *** 125,131 **** sprintf(buffer,format,a); slength = strlen(buffer) + 1; fxAssert(slength>1, "Str::Str(double): bogus conversion"); ! data = new char[slength]; // XXX assume slength>1 memcpy(data,buffer,slength); } --- 125,131 ---- sprintf(buffer,format,a); slength = strlen(buffer) + 1; fxAssert(slength>1, "Str::Str(double): bogus conversion"); ! data = (char*) malloc(slength); // XXX assume slength>1 memcpy(data,buffer,slength); } *************** *** 132,138 **** fxStr::~fxStr() { assert(data); ! if (data != &emptyString) delete data; } fxStr --- 132,138 ---- fxStr::~fxStr() { assert(data); ! if (data != &emptyString) free(data); } fxStr *************** *** 141,147 **** char buf[4096]; va_list ap; va_start(ap, fmt); ! ::vsprintf(buf, fmt, ap); va_end(ap); return fxStr(buf); } --- 141,147 ---- char buf[4096]; va_list ap; va_start(ap, fmt); ! vsprintf(buf, fmt, ap); va_end(ap); return fxStr(buf); } *************** *** 150,156 **** fxStr::vformat(const char* fmt, va_list ap) { char buf[4096]; ! ::vsprintf(buf, fmt, ap); return fxStr(buf); } --- 150,156 ---- fxStr::vformat(const char* fmt, va_list ap) { char buf[4096]; ! vsprintf(buf, fmt, ap); return fxStr(buf); } *************** *** 293,299 **** if (slength > 1) { if (chars > 0) { if (chars >= slength) ! data = (char *)realloc(data,chars+1); } else { assert(data != &emptyString); free(data); --- 293,299 ---- if (slength > 1) { if (chars > 0) { if (chars >= slength) ! data = (char*) realloc(data,chars+1); } else { assert(data != &emptyString); free(data); *************** *** 302,308 **** } else { assert(data == &emptyString); if (chars) ! data = new char[chars+1]; } } --- 302,308 ---- } else { assert(data == &emptyString); if (chars) ! data = (char*) malloc(chars+1); } } *************** *** 310,319 **** void fxStr::resize(u_int chars, fxBool) { resizeInternal(chars); ! if (chars>=slength) ! memset(data+slength, 0, chars+1-slength); slength = chars+1; - data[chars] = 0; } void fxStr::setMaxLength(u_int len) --- 310,327 ---- void fxStr::resize(u_int chars, fxBool) { resizeInternal(chars); ! if (chars != 0) { ! if (slength == 1) // NB: special case for emptyString ! memset(data, 0, chars+1); ! else { ! if (chars >= slength) // zero expanded data segment ! memset(data+slength, 0, chars+1-slength); ! else // null terminate shortened string ! data[chars] = 0; ! } ! } else ! ; // now points to emptyString slength = chars+1; } void fxStr::setMaxLength(u_int len) *************** *** 671,677 **** if (slength <= sizeof(indata)) { data = &indata[0]; } else { ! data = new char[slength]; } memcpy(data,d1,l1); memcpy(data+l1,d2,l2); --- 679,685 ---- if (slength <= sizeof(indata)) { data = &indata[0]; } else { ! data = (char*) malloc(slength); } memcpy(data,d1,l1); memcpy(data+l1,d2,l2); *************** *** 684,690 **** if (slength <= sizeof (indata)) { data = &indata[0]; } else { ! data = new char[slength]; } memcpy(data, other.data, slength); data[slength] = 0; --- 692,698 ---- if (slength <= sizeof (indata)) { data = &indata[0]; } else { ! data = (char*) malloc(slength); } memcpy(data, other.data, slength); data[slength] = 0; *************** *** 692,698 **** fxTempStr::~fxTempStr() { ! if (data != indata) delete data; } fxTempStr& operator|(const fxTempStr& ts, const fxStr &b) --- 700,706 ---- fxTempStr::~fxTempStr() { ! if (data != indata) free(data); } fxTempStr& operator|(const fxTempStr& ts, const fxStr &b) EOF-EOF-EOF Patch util/Str.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/util/Str.h Thu Aug 29 20:24:58 1996 --- hylafax-v4.0pl1/util/Str.h Tue Nov 26 15:20:53 1996 *************** *** 1,4 **** ! /* $Id: Str.h,v 1.19 1996/06/24 03:06:04 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: Str.h,v 1.20 1996/09/25 17:22:27 sam Rel $ */ /* * Copyright (c) 1990-1996 Sam Leffler * Copyright (c) 1991-1996 Silicon Graphics, Inc. *************** *** 114,119 **** --- 114,122 ---- char& operator[](u_int i) const { fxAssert(i 2 && streq(argv[1], "-n")) { + showFilename = FALSE; + argc--, argv++; + } if (argc != 2) { ! fprintf(stderr, "usage: %s [-n] file.tif\n", appName); return (-1); } ! if (showFilename) ! printf("%s:\n", argv[1]); TIFFSetErrorHandler(NULL); TIFFSetWarningHandler(NULL); TIFF* tif = TIFFOpen(argv[1], "r"); EOF-EOF-EOF Patch util/faxrcvd.sh<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/util/faxrcvd.sh Thu Aug 29 20:25:04 1996 --- hylafax-v4.0pl1/util/faxrcvd.sh Tue Nov 26 15:20:58 1996 *************** *** 1,5 **** #! /bin/sh ! # $Id: faxrcvd.sh,v 1.30 1996/06/24 03:06:19 sam Rel $ # # HylaFAX Facsimile Software # --- 1,5 ---- #! /bin/sh ! # $Id: faxrcvd.sh,v 1.32 1996/11/15 20:45:07 sam Rel $ # # HylaFAX Facsimile Software # *************** *** 54,59 **** --- 54,68 ---- INFO=$SBIN/faxinfo FAX2PS=$TIFFBIN/fax2ps TOADDR=FaxMaster + # + # There is no good portable way to find out the fully qualified + # domain name (FQDN) of the host or the TCP port for the hylafax + # service so we fudge here. Folks may want to tailor this to + # their needs; e.g. add a domain or use localhost so the loopback + # interface is used. + # + HOSTNAME=`hostname` # XXX no good way to find FQDN + PORT=4559 # XXX no good way to lookup service FILE="$1" DEVICE="$2" *************** *** 74,80 **** echo "From: The HylaFAX Receive Agent " echo "Subject: facsimile received from $SENDER"; echo "" ! $INFO $FILE echo "ReceivedOn: $DEVICE" if [ "$MSG" ]; then echo "" --- 83,89 ---- echo "From: The HylaFAX Receive Agent " echo "Subject: facsimile received from $SENDER"; echo "" ! echo "$FILE (ftp://$HOSTNAME:$PORT/$FILE):"; $INFO -n $FILE echo "ReceivedOn: $DEVICE" if [ "$MSG" ]; then echo "" *************** *** 94,100 **** echo " No transcript available." fi else ! echo "CommID: c$COMMID" fi if [ -n "$SENDTO" ]; then echo "" --- 103,109 ---- echo " No transcript available." fi else ! echo "CommID: c$COMMID (ftp://$HOSTNAME:$PORT/log/c$COMMID)" fi if [ -n "$SENDTO" ]; then echo "" *************** *** 110,116 **** echo "From: The HylaFAX Receive Agent " echo "Subject: facsimile received from $SENDER"; echo "" ! $INFO $FILE echo "ReceivedOn: $DEVICE" if [ "$MSG" ]; then echo "" --- 119,125 ---- echo "From: The HylaFAX Receive Agent " echo "Subject: facsimile received from $SENDER"; echo "" ! echo "$FILE (ftp://$HOSTNAME:$PORT/$FILE):"; $INFO -n $FILE echo "ReceivedOn: $DEVICE" if [ "$MSG" ]; then echo "" *************** *** 130,136 **** echo " No transcript available." fi else ! echo "CommID: c$COMMID" fi echo "" echo "--$MIMEBOUNDARY" --- 139,145 ---- echo " No transcript available." fi else ! echo "CommID: c$COMMID (ftp://$HOSTNAME:$PORT/log/c$COMMID)" fi echo "" echo "--$MIMEBOUNDARY" EOF-EOF-EOF Patch util/typetest.c++<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/util/typetest.c++ Thu Aug 29 20:25:09 1996 --- hylafax-v4.0pl1/util/typetest.c++ Tue Nov 26 15:21:04 1996 *************** *** 1,4 **** ! /* $Id: typetest.c++,v 1.8 1996/07/31 17:37:40 sam Rel $ */ /* * Copyright (c) 1994-1996 Sam Leffler * Copyright (c) 1994-1996 Silicon Graphics, Inc. --- 1,4 ---- ! /* $Id: typetest.c++,v 1.9 1996/09/30 21:03:43 sam Rel $ */ /* * Copyright (c) 1994-1996 Sam Leffler * Copyright (c) 1994-1996 Silicon Graphics, Inc. *************** *** 47,53 **** fileType(const char* filename) { struct stat sb; ! int fd = ::open(filename, O_RDONLY); if (fd < 0) { fprintf(stderr, "%s: Can not open file\n", filename); return (NULL); --- 47,53 ---- fileType(const char* filename) { struct stat sb; ! int fd = open(filename, O_RDONLY); if (fd < 0) { fprintf(stderr, "%s: Can not open file\n", filename); return (NULL); *************** *** 54,70 **** } if (fstat(fd, &sb) < 0) { fprintf(stderr, "%s: Can not stat file\n", filename); ! ::close(fd); return (NULL); } if ((sb.st_mode & S_IFMT) != S_IFREG) { fprintf(stderr, "%s: Not a regular file\n", filename); ! ::close(fd); return (NULL); } char buf[512]; int cc = read(fd, buf, sizeof (buf)); ! ::close(fd); if (cc == 0) { fprintf(stderr, "%s: Empty file\n", filename); return (NULL); --- 54,70 ---- } if (fstat(fd, &sb) < 0) { fprintf(stderr, "%s: Can not stat file\n", filename); ! close(fd); return (NULL); } if ((sb.st_mode & S_IFMT) != S_IFREG) { fprintf(stderr, "%s: Not a regular file\n", filename); ! close(fd); return (NULL); } char buf[512]; int cc = read(fd, buf, sizeof (buf)); ! close(fd); if (cc == 0) { fprintf(stderr, "%s: Empty file\n", filename); return (NULL); EOF-EOF-EOF Patch zlib/ChangeLog<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/ChangeLog Thu Aug 29 20:25:14 1996 --- hylafax-v4.0pl1/zlib/ChangeLog Tue Nov 26 15:21:08 1996 *************** *** 1,6 **** --- 1,25 ---- ChangeLog file for zlib + Changes in 1.0.4 (24 Jul 96) + - In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF + bit, so the decompressor could decompress all the correct data but went + on to attempt decompressing extra garbage data. This affected minigzip too. + - zlibVersion and gzerror return const char* (needed for DLL) + - port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno) + - use z_error only for DEBUG (avoid problem with DLLs) + + Changes in 1.0.3 (2 Jul 96) + - use z_streamp instead of z_stream *, which is now a far pointer in MSDOS + small and medium models; this makes the library incompatible with previous + versions for these models. (No effect in large model or on other systems.) + - return OK instead of BUF_ERROR if previous deflate call returned with + avail_out as zero but there is nothing to do + - added memcmp for non STDC compilers + - define NO_DUMMY_DECL for more Mac compilers (.h files merged incorrectly) + - define __32BIT__ if __386__ or i386 is defined (pb. with Watcom and SCO) + - better check for 16-bit mode MSC (avoids problem with Symantec) + Changes in 1.0.2 (23 May 96) - added Windows DLL support - added a function zlibVersion (for the DLL support) EOF-EOF-EOF Patch zlib/README<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/README Thu Aug 29 20:25:15 1996 --- hylafax-v4.0pl1/zlib/README Tue Nov 26 15:21:09 1996 *************** *** 1,4 **** ! zlib 1.0.2 is a general purpose data compression library. All the code is reentrant (thread safe). The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate --- 1,4 ---- ! zlib 1.0.4 is a general purpose data compression library. All the code is reentrant (thread safe). The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate *************** *** 18,39 **** Questions about zlib should be sent to or, if this fails, to the addresses given below in the Copyright section. ! The changes made in version 1.0.2 are documented in the file ChangeLog. ! The main changes since 0.99 are: ! - fix array overlay in deflate.c which sometimes caused bad compressed data ! - fix inflate bug with empty stored block ! - fix MSDOS medium model which was broken in 0.99 ! - fix deflateParams() which could generated bad compressed data. ! - added an INDEX file ! - new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32), ! Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas) ! - several portability improvements ! - added algorithm.doc ! - added Windows DLL support ! - added a function zlibVersion (for the DLL support) A Perl interface to zlib written by Paul Marquess is in the CPAN (Comprehensive Perl Archive Network) sites, such as: ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/Compress/Compress-Zlib* --- 18,35 ---- Questions about zlib should be sent to or, if this fails, to the addresses given below in the Copyright section. + The zlib home page is http://quest.jpl.nasa.gov/zlib/ ! The changes made in version 1.0.4 are documented in the file ChangeLog. ! The main changes since 1.0.3 are: ! - In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF ! bit, so the decompressor could decompress all the correct data but went ! on to attempt decompressing extra garbage data. This affected minigzip too. ! - zlibVersion and gzerror return const char* (needed for DLL) ! - port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno) + A Perl interface to zlib written by Paul Marquess is in the CPAN (Comprehensive Perl Archive Network) sites, such as: ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/Compress/Compress-Zlib* *************** *** 46,52 **** - For 64-bit Iris, deflate.c must be compiled without any optimization. With -O, one libpng test fails. The test works in 32 bit mode (with ! the -32 compiler flag). - zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works when compiled with cc. --- 42,48 ---- - For 64-bit Iris, deflate.c must be compiled without any optimization. With -O, one libpng test fails. The test works in 32 bit mode (with ! the -32 compiler flag). The compiler bug has been reported to SGI. - zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works when compiled with cc. *************** *** 57,63 **** - To build a Windows DLL version, include in a DLL project zlib.def, zlib.rc and all .c files except example.c and minigzip.c; compile with -DZLIB_DLL For help on building a zlib DLL, contact Alessandro Iacopetti ! Acknowledgments: --- 53,62 ---- - To build a Windows DLL version, include in a DLL project zlib.def, zlib.rc and all .c files except example.c and minigzip.c; compile with -DZLIB_DLL For help on building a zlib DLL, contact Alessandro Iacopetti ! http://lisa.unial.it/iaco , ! or contact Brad Clarke . ! ! - gzdopen is not supported on RISCOS Acknowledgments: EOF-EOF-EOF Patch zlib/deflate.c<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/deflate.c Thu Aug 29 20:25:15 1996 --- hylafax-v4.0pl1/zlib/deflate.c Tue Nov 26 15:21:09 1996 *************** *** 47,57 **** * */ ! /* $Id: deflate.c,v 1.3 1996/06/20 19:00:35 sam Rel $ */ #include "deflate.h" ! char deflate_copyright[] = " deflate 1.0.2 Copyright 1995-1996 Jean-loup Gailly "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot --- 47,57 ---- * */ ! /* $Id: deflate.c,v 1.4 1996/09/30 19:10:25 sam Rel $ */ #include "deflate.h" ! char deflate_copyright[] = " deflate 1.0.4 Copyright 1995-1996 Jean-loup Gailly "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot *************** *** 62,76 **** /* =========================================================================== * Function prototypes. */ local void fill_window OF((deflate_state *s)); ! local int deflate_stored OF((deflate_state *s, int flush)); ! local int deflate_fast OF((deflate_state *s, int flush)); ! local int deflate_slow OF((deflate_state *s, int flush)); local void lm_init OF((deflate_state *s)); local uInt longest_match OF((deflate_state *s, IPos cur_match)); local void putShortMSB OF((deflate_state *s, uInt b)); ! local void flush_pending OF((z_stream *strm)); ! local int read_buf OF((z_stream *strm, charf *buf, unsigned size)); #ifdef ASMV void match_init OF((void)); /* asm code initialization */ #endif --- 62,86 ---- /* =========================================================================== * Function prototypes. */ + typedef enum { + need_more, /* block not completed, need more input or more output */ + block_done, /* block flush performed */ + finish_started, /* finish started, need only more output at next deflate */ + finish_done /* finish done, accept no more input or output */ + } block_state; + + typedef block_state (*compress_func) OF((deflate_state *s, int flush)); + /* Compression function. Returns the block state after the call. */ + local void fill_window OF((deflate_state *s)); ! local block_state deflate_stored OF((deflate_state *s, int flush)); ! local block_state deflate_fast OF((deflate_state *s, int flush)); ! local block_state deflate_slow OF((deflate_state *s, int flush)); local void lm_init OF((deflate_state *s)); local uInt longest_match OF((deflate_state *s, IPos cur_match)); local void putShortMSB OF((deflate_state *s, uInt b)); ! local void flush_pending OF((z_streamp strm)); ! local int read_buf OF((z_streamp strm, charf *buf, unsigned size)); #ifdef ASMV void match_init OF((void)); /* asm code initialization */ #endif *************** *** 97,105 **** * See deflate.c for comments about the MIN_MATCH+1. */ - typedef int (*compress_func) OF((deflate_state *s, int flush)); - /* Compressing function */ - /* Values for max_lazy_match, good_match and max_chain_length, depending on * the desired pack level (0..9). The values given below have been tuned to * exclude worst case performance for pathological files. Better values may be --- 107,112 ---- *************** *** 169,175 **** /* ========================================================================= */ int deflateInit_(strm, level, version, stream_size) ! z_stream *strm; int level; const char *version; int stream_size; --- 176,182 ---- /* ========================================================================= */ int deflateInit_(strm, level, version, stream_size) ! z_streamp strm; int level; const char *version; int stream_size; *************** *** 182,188 **** /* ========================================================================= */ int deflateInit2_(strm, level, method, windowBits, memLevel, strategy, version, stream_size) ! z_stream *strm; int level; int method; int windowBits; --- 189,195 ---- /* ========================================================================= */ int deflateInit2_(strm, level, method, windowBits, memLevel, strategy, version, stream_size) ! z_streamp strm; int level; int method; int windowBits; *************** *** 249,255 **** if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || s->pending_buf == Z_NULL) { ! strm->msg = ERR_MSG(Z_MEM_ERROR); deflateEnd (strm); return Z_MEM_ERROR; } --- 256,262 ---- if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || s->pending_buf == Z_NULL) { ! strm->msg = (char*)ERR_MSG(Z_MEM_ERROR); deflateEnd (strm); return Z_MEM_ERROR; } *************** *** 265,271 **** /* ========================================================================= */ int deflateSetDictionary (strm, dictionary, dictLength) ! z_stream *strm; const Bytef *dictionary; uInt dictLength; { --- 272,278 ---- /* ========================================================================= */ int deflateSetDictionary (strm, dictionary, dictLength) ! z_streamp strm; const Bytef *dictionary; uInt dictLength; { *************** *** 304,310 **** /* ========================================================================= */ int deflateReset (strm) ! z_stream *strm; { deflate_state *s; --- 311,317 ---- /* ========================================================================= */ int deflateReset (strm) ! z_streamp strm; { deflate_state *s; *************** *** 334,340 **** /* ========================================================================= */ int deflateParams(strm, level, strategy) ! z_stream *strm; int level; int strategy; { --- 341,347 ---- /* ========================================================================= */ int deflateParams(strm, level, strategy) ! z_streamp strm; int level; int strategy; { *************** *** 388,394 **** * (See also read_buf()). */ local void flush_pending(strm) ! z_stream *strm; { unsigned len = strm->state->pending; --- 395,401 ---- * (See also read_buf()). */ local void flush_pending(strm) ! z_streamp strm; { unsigned len = strm->state->pending; *************** *** 408,421 **** /* ========================================================================= */ int deflate (strm, flush) ! z_stream *strm; int flush; { int old_flush; /* value of flush param for previous deflate call */ deflate_state *s; ! if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; ! s = strm->state; if (strm->next_out == Z_NULL || --- 415,430 ---- /* ========================================================================= */ int deflate (strm, flush) ! z_streamp strm; int flush; { int old_flush; /* value of flush param for previous deflate call */ deflate_state *s; ! if (strm == Z_NULL || strm->state == Z_NULL || ! flush > Z_FINISH || flush < 0) { ! return Z_STREAM_ERROR; ! } s = strm->state; if (strm->next_out == Z_NULL || *************** *** 447,460 **** if (s->strstart != 0) { putShortMSB(s, (uInt)(strm->adler >> 16)); putShortMSB(s, (uInt)(strm->adler & 0xffff)); - strm->adler = 1L; } } /* Flush as much pending output as possible */ if (s->pending != 0) { flush_pending(strm); ! if (strm->avail_out == 0) return Z_OK; /* Make sure there is something to do and avoid duplicate consecutive * flushes. For repeated and useless calls with Z_FINISH, we keep --- 456,478 ---- if (s->strstart != 0) { putShortMSB(s, (uInt)(strm->adler >> 16)); putShortMSB(s, (uInt)(strm->adler & 0xffff)); } + strm->adler = 1L; } /* Flush as much pending output as possible */ if (s->pending != 0) { flush_pending(strm); ! if (strm->avail_out == 0) { ! /* Since avail_out is 0, deflate will be called again with ! * more output space, but possibly with both pending and ! * avail_in equal to zero. There won't be anything to do, ! * but this is not an error situation so make sure we ! * return OK instead of BUF_ERROR at next call of deflate: ! */ ! s->last_flush = -1; ! return Z_OK; ! } /* Make sure there is something to do and avoid duplicate consecutive * flushes. For repeated and useless calls with Z_FINISH, we keep *************** *** 474,495 **** */ if (strm->avail_in != 0 || s->lookahead != 0 || (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { ! int quit; ! if (flush == Z_FINISH) { s->status = FINISH_STATE; } ! quit = (*(configuration_table[s->level].func))(s, flush); ! ! if (quit || strm->avail_out == 0) return Z_OK; ! /* If flush != Z_NO_FLUSH && avail_out == 0, the next call ! * of deflate should use the same flush parameter to make sure ! * that the flush is complete. So we don't have to output an ! * empty block here, this will be done at next call. This also ! * ensures that for a very small output buffer, we emit at most ! * one empty block. ! */ ! if (flush != Z_NO_FLUSH && flush != Z_FINISH) { if (flush == Z_PARTIAL_FLUSH) { _tr_align(s); } else { /* FULL_FLUSH or SYNC_FLUSH */ --- 492,518 ---- */ if (strm->avail_in != 0 || s->lookahead != 0 || (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { ! block_state bstate; ! ! bstate = (*(configuration_table[s->level].func))(s, flush); ! if (bstate == finish_started || bstate == finish_done) { s->status = FINISH_STATE; } ! if (bstate == need_more || bstate == finish_started) { ! if (strm->avail_out == 0) { ! s->last_flush = -1; /* avoid BUF_ERROR next call, see above */ ! } ! return Z_OK; ! /* If flush != Z_NO_FLUSH && avail_out == 0, the next call ! * of deflate should use the same flush parameter to make sure ! * that the flush is complete. So we don't have to output an ! * empty block here, this will be done at next call. This also ! * ensures that for a very small output buffer, we emit at most ! * one empty block. ! */ ! } ! if (bstate == block_done) { if (flush == Z_PARTIAL_FLUSH) { _tr_align(s); } else { /* FULL_FLUSH or SYNC_FLUSH */ *************** *** 502,508 **** } } flush_pending(strm); ! if (strm->avail_out == 0) return Z_OK; } } Assert(strm->avail_out > 0, "bug2"); --- 525,534 ---- } } flush_pending(strm); ! if (strm->avail_out == 0) { ! s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */ ! return Z_OK; ! } } } Assert(strm->avail_out > 0, "bug2"); *************** *** 523,529 **** /* ========================================================================= */ int deflateEnd (strm) ! z_stream *strm; { int status; --- 549,555 ---- /* ========================================================================= */ int deflateEnd (strm) ! z_streamp strm; { int status; *************** *** 544,551 **** /* ========================================================================= */ int deflateCopy (dest, source) ! z_stream *dest; ! z_stream *source; { if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) { return Z_STREAM_ERROR; --- 570,577 ---- /* ========================================================================= */ int deflateCopy (dest, source) ! z_streamp dest; ! z_streamp source; { if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) { return Z_STREAM_ERROR; *************** *** 570,576 **** * (See also flush_pending()). */ local int read_buf(strm, buf, size) ! z_stream *strm; charf *buf; unsigned size; { --- 596,602 ---- * (See also flush_pending()). */ local int read_buf(strm, buf, size) ! z_streamp strm; charf *buf; unsigned size; { *************** *** 916,933 **** /* Same but force premature exit if necessary. */ #define FLUSH_BLOCK(s, eof) { \ FLUSH_BLOCK_ONLY(s, eof); \ ! if (s->strm->avail_out == 0) return 1; \ } /* =========================================================================== * Copy without compression as much as possible from the input stream, return ! * true if processing was terminated prematurely (no more input or output ! * space). This function does not insert new strings in the dictionary ! * since uncompressible data is probably not useful. This function is used * only for the level=0 compression option. * NOTE: this function should be optimized to avoid extra copying. */ ! local int deflate_stored(s, flush) deflate_state *s; int flush; { --- 942,959 ---- /* Same but force premature exit if necessary. */ #define FLUSH_BLOCK(s, eof) { \ FLUSH_BLOCK_ONLY(s, eof); \ ! if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \ } /* =========================================================================== * Copy without compression as much as possible from the input stream, return ! * the current block state. ! * This function does not insert new strings in the dictionary since ! * uncompressible data is probably not useful. This function is used * only for the level=0 compression option. * NOTE: this function should be optimized to avoid extra copying. */ ! local block_state deflate_stored(s, flush) deflate_state *s; int flush; { *************** *** 939,945 **** s->block_start >= (long)s->w_size, "slide too late"); fill_window(s); ! if (s->lookahead == 0 && flush == Z_NO_FLUSH) return 1; if (s->lookahead == 0) break; /* flush the current block */ } --- 965,971 ---- s->block_start >= (long)s->w_size, "slide too late"); fill_window(s); ! if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more; if (s->lookahead == 0) break; /* flush the current block */ } *************** *** 961,977 **** } } FLUSH_BLOCK(s, flush == Z_FINISH); ! return 0; /* normal exit */ } /* =========================================================================== ! * Compress as much as possible from the input stream, return true if ! * processing was terminated prematurely (no more input or output space). * This function does not perform lazy evaluation of matches and inserts * new strings in the dictionary only for unmatched strings or for short * matches. It is used only for the fast compression options. */ ! local int deflate_fast(s, flush) deflate_state *s; int flush; { --- 987,1003 ---- } } FLUSH_BLOCK(s, flush == Z_FINISH); ! return flush == Z_FINISH ? finish_done : block_done; } /* =========================================================================== ! * Compress as much as possible from the input stream, return the current ! * block state. * This function does not perform lazy evaluation of matches and inserts * new strings in the dictionary only for unmatched strings or for short * matches. It is used only for the fast compression options. */ ! local block_state deflate_fast(s, flush) deflate_state *s; int flush; { *************** *** 986,993 **** */ if (s->lookahead < MIN_LOOKAHEAD) { fill_window(s); ! if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) return 1; ! if (s->lookahead == 0) break; /* flush the current block */ } --- 1012,1020 ---- */ if (s->lookahead < MIN_LOOKAHEAD) { fill_window(s); ! if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { ! return need_more; ! } if (s->lookahead == 0) break; /* flush the current block */ } *************** *** 1055,1061 **** if (bflush) FLUSH_BLOCK(s, 0); } FLUSH_BLOCK(s, flush == Z_FINISH); ! return 0; /* normal exit */ } /* =========================================================================== --- 1082,1088 ---- if (bflush) FLUSH_BLOCK(s, 0); } FLUSH_BLOCK(s, flush == Z_FINISH); ! return flush == Z_FINISH ? finish_done : block_done; } /* =========================================================================== *************** *** 1063,1069 **** * evaluation for matches: a match is finally adopted only if there is * no better match at the next window position. */ ! local int deflate_slow(s, flush) deflate_state *s; int flush; { --- 1090,1096 ---- * evaluation for matches: a match is finally adopted only if there is * no better match at the next window position. */ ! local block_state deflate_slow(s, flush) deflate_state *s; int flush; { *************** *** 1079,1086 **** */ if (s->lookahead < MIN_LOOKAHEAD) { fill_window(s); ! if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) return 1; ! if (s->lookahead == 0) break; /* flush the current block */ } --- 1106,1114 ---- */ if (s->lookahead < MIN_LOOKAHEAD) { fill_window(s); ! if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) { ! return need_more; ! } if (s->lookahead == 0) break; /* flush the current block */ } *************** *** 1158,1164 **** } s->strstart++; s->lookahead--; ! if (s->strm->avail_out == 0) return 1; } else { /* There is no previous match to compare with, wait for * the next step to decide. --- 1186,1192 ---- } s->strstart++; s->lookahead--; ! if (s->strm->avail_out == 0) return need_more; } else { /* There is no previous match to compare with, wait for * the next step to decide. *************** *** 1175,1180 **** s->match_available = 0; } FLUSH_BLOCK(s, flush == Z_FINISH); ! return 0; } - --- 1203,1207 ---- s->match_available = 0; } FLUSH_BLOCK(s, flush == Z_FINISH); ! return flush == Z_FINISH ? finish_done : block_done; } EOF-EOF-EOF Patch zlib/deflate.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/deflate.h Thu Aug 29 20:25:16 1996 --- hylafax-v4.0pl1/zlib/deflate.h Tue Nov 26 15:21:09 1996 *************** *** 8,14 **** subject to change. Applications should only use zlib.h. */ ! /* $Id: deflate.h,v 1.2 1996/03/12 20:12:53 sam Rel $ */ #ifndef _DEFLATE_H #define _DEFLATE_H --- 8,14 ---- subject to change. Applications should only use zlib.h. */ ! /* $Id: deflate.h,v 1.3 1996/09/30 19:10:25 sam Rel $ */ #ifndef _DEFLATE_H #define _DEFLATE_H *************** *** 80,86 **** */ typedef struct internal_state { ! z_stream *strm; /* pointer back to this zlib stream */ int status; /* as the name implies */ Bytef *pending_buf; /* output still pending */ Bytef *pending_out; /* next pending byte to output to the stream */ --- 80,86 ---- */ typedef struct internal_state { ! z_streamp strm; /* pointer back to this zlib stream */ int status; /* as the name implies */ Bytef *pending_buf; /* output still pending */ Bytef *pending_out; /* next pending byte to output to the stream */ EOF-EOF-EOF Patch zlib/infblock.c<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/infblock.c Thu Aug 29 20:25:16 1996 --- hylafax-v4.0pl1/zlib/infblock.c Tue Nov 26 15:21:09 1996 *************** *** 63,69 **** void inflate_blocks_reset(s, z, c) inflate_blocks_statef *s; ! z_stream *z; uLongf *c; { if (s->checkfn != Z_NULL) --- 63,69 ---- void inflate_blocks_reset(s, z, c) inflate_blocks_statef *s; ! z_streamp z; uLongf *c; { if (s->checkfn != Z_NULL) *************** *** 87,93 **** inflate_blocks_statef *inflate_blocks_new(z, c, w) ! z_stream *z; check_func c; uInt w; { --- 87,93 ---- inflate_blocks_statef *inflate_blocks_new(z, c, w) ! z_streamp z; check_func c; uInt w; { *************** *** 115,121 **** #endif int inflate_blocks(s, z, r) inflate_blocks_statef *s; ! z_stream *z; int r; { uInt t; /* temporary storage */ --- 115,121 ---- #endif int inflate_blocks(s, z, r) inflate_blocks_statef *s; ! z_streamp z; int r; { uInt t; /* temporary storage */ *************** *** 381,387 **** int inflate_blocks_free(s, z, c) inflate_blocks_statef *s; ! z_stream *z; uLongf *c; { inflate_blocks_reset(s, z, c); --- 381,387 ---- int inflate_blocks_free(s, z, c) inflate_blocks_statef *s; ! z_streamp z; uLongf *c; { inflate_blocks_reset(s, z, c); EOF-EOF-EOF Patch zlib/infblock.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/infblock.h Thu Aug 29 20:25:17 1996 --- hylafax-v4.0pl1/zlib/infblock.h Tue Nov 26 15:21:10 1996 *************** *** 12,34 **** typedef struct inflate_blocks_state FAR inflate_blocks_statef; extern inflate_blocks_statef * inflate_blocks_new OF(( ! z_stream *z, check_func c, /* check function */ uInt w)); /* window size */ extern int inflate_blocks OF(( inflate_blocks_statef *, ! z_stream *, int)); /* initial return code */ extern void inflate_blocks_reset OF(( inflate_blocks_statef *, ! z_stream *, uLongf *)); /* check value on output */ extern int inflate_blocks_free OF(( inflate_blocks_statef *, ! z_stream *, uLongf *)); /* check value on output */ extern void inflate_set_dictionary OF(( --- 12,34 ---- typedef struct inflate_blocks_state FAR inflate_blocks_statef; extern inflate_blocks_statef * inflate_blocks_new OF(( ! z_streamp z, check_func c, /* check function */ uInt w)); /* window size */ extern int inflate_blocks OF(( inflate_blocks_statef *, ! z_streamp , int)); /* initial return code */ extern void inflate_blocks_reset OF(( inflate_blocks_statef *, ! z_streamp , uLongf *)); /* check value on output */ extern int inflate_blocks_free OF(( inflate_blocks_statef *, ! z_streamp , uLongf *)); /* check value on output */ extern void inflate_set_dictionary OF(( EOF-EOF-EOF Patch zlib/infcodes.c<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/infcodes.c Thu Aug 29 20:25:17 1996 --- hylafax-v4.0pl1/zlib/infcodes.c Tue Nov 26 15:21:10 1996 *************** *** 60,66 **** uInt bl, bd; inflate_huft *tl; inflate_huft *td; /* need separate declaration for Borland C++ */ ! z_stream *z; { inflate_codes_statef *c; --- 60,66 ---- uInt bl, bd; inflate_huft *tl; inflate_huft *td; /* need separate declaration for Borland C++ */ ! z_streamp z; { inflate_codes_statef *c; *************** *** 80,86 **** int inflate_codes(s, z, r) inflate_blocks_statef *s; ! z_stream *z; int r; { uInt j; /* temporary storage */ --- 80,86 ---- int inflate_codes(s, z, r) inflate_blocks_statef *s; ! z_streamp z; int r; { uInt j; /* temporary storage */ *************** *** 240,246 **** void inflate_codes_free(c, z) inflate_codes_statef *c; ! z_stream *z; { ZFREE(z, c); Tracev((stderr, "inflate: codes free\n")); --- 240,246 ---- void inflate_codes_free(c, z) inflate_codes_statef *c; ! z_streamp z; { ZFREE(z, c); Tracev((stderr, "inflate: codes free\n")); EOF-EOF-EOF Patch zlib/infcodes.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/infcodes.h Thu Aug 29 20:25:17 1996 --- hylafax-v4.0pl1/zlib/infcodes.h Tue Nov 26 15:21:10 1996 *************** *** 14,27 **** extern inflate_codes_statef *inflate_codes_new OF(( uInt, uInt, inflate_huft *, inflate_huft *, ! z_stream *)); extern int inflate_codes OF(( inflate_blocks_statef *, ! z_stream *, int)); extern void inflate_codes_free OF(( inflate_codes_statef *, ! z_stream *)); --- 14,27 ---- extern inflate_codes_statef *inflate_codes_new OF(( uInt, uInt, inflate_huft *, inflate_huft *, ! z_streamp )); extern int inflate_codes OF(( inflate_blocks_statef *, ! z_streamp , int)); extern void inflate_codes_free OF(( inflate_codes_statef *, ! z_streamp )); EOF-EOF-EOF Patch zlib/inffast.c<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/inffast.c Thu Aug 29 20:25:18 1996 --- hylafax-v4.0pl1/zlib/inffast.c Tue Nov 26 15:21:10 1996 *************** *** 32,38 **** inflate_huft *tl; inflate_huft *td; /* need separate declaration for Borland C++ */ inflate_blocks_statef *s; ! z_stream *z; { inflate_huft *t; /* temporary pointer */ uInt e; /* extra bits or operation */ --- 32,38 ---- inflate_huft *tl; inflate_huft *td; /* need separate declaration for Borland C++ */ inflate_blocks_statef *s; ! z_streamp z; { inflate_huft *t; /* temporary pointer */ uInt e; /* extra bits or operation */ EOF-EOF-EOF Patch zlib/inffast.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/inffast.h Thu Aug 29 20:25:18 1996 --- hylafax-v4.0pl1/zlib/inffast.h Tue Nov 26 15:21:11 1996 *************** *** 14,17 **** inflate_huft *, inflate_huft *, inflate_blocks_statef *, ! z_stream *)); --- 14,17 ---- inflate_huft *, inflate_huft *, inflate_blocks_statef *, ! z_streamp )); EOF-EOF-EOF Patch zlib/inflate.c<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/inflate.c Thu Aug 29 20:25:18 1996 --- hylafax-v4.0pl1/zlib/inflate.c Tue Nov 26 15:21:11 1996 *************** *** 49,55 **** int inflateReset(z) ! z_stream *z; { uLong c; --- 49,55 ---- int inflateReset(z) ! z_streamp z; { uLong c; *************** *** 65,71 **** int inflateEnd(z) ! z_stream *z; { uLong c; --- 65,71 ---- int inflateEnd(z) ! z_streamp z; { uLong c; *************** *** 81,87 **** int inflateInit2_(z, w, version, stream_size) ! z_stream *z; int w; const char *version; int stream_size; --- 81,87 ---- int inflateInit2_(z, w, version, stream_size) ! z_streamp z; int w; const char *version; int stream_size; *************** *** 138,144 **** int inflateInit_(z, version, stream_size) ! z_stream *z; const char *version; int stream_size; { --- 138,144 ---- int inflateInit_(z, version, stream_size) ! z_streamp z; const char *version; int stream_size; { *************** *** 150,156 **** #define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++) int inflate(z, f) ! z_stream *z; int f; { int r; --- 150,156 ---- #define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++) int inflate(z, f) ! z_streamp z; int f; { int r; *************** *** 272,278 **** int inflateSetDictionary(z, dictionary, dictLength) ! z_stream *z; const Bytef *dictionary; uInt dictLength; { --- 272,278 ---- int inflateSetDictionary(z, dictionary, dictLength) ! z_streamp z; const Bytef *dictionary; uInt dictLength; { *************** *** 280,285 **** --- 280,286 ---- if (z == Z_NULL || z->state == Z_NULL || z->state->mode != DICT0) return Z_STREAM_ERROR; + if (adler32(1L, dictionary, dictLength) != z->adler) return Z_DATA_ERROR; z->adler = 1L; *************** *** 295,301 **** int inflateSync(z) ! z_stream *z; { uInt n; /* number of bytes to look at */ Bytef *p; /* pointer to bytes */ --- 296,302 ---- int inflateSync(z) ! z_streamp z; { uInt n; /* number of bytes to look at */ Bytef *p; /* pointer to bytes */ EOF-EOF-EOF Patch zlib/inftrees.c<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/inftrees.c Thu Aug 29 20:25:19 1996 --- hylafax-v4.0pl1/zlib/inftrees.c Tue Nov 26 15:21:11 1996 *************** *** 6,12 **** #include "zutil.h" #include "inftrees.h" ! char inflate_copyright[] = " inflate 1.0.2 Copyright 1995-1996 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot --- 6,12 ---- #include "zutil.h" #include "inftrees.h" ! char inflate_copyright[] = " inflate 1.0.4 Copyright 1995-1996 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot *************** *** 30,36 **** uIntf *, /* list of extra bits for non-simple codes */ inflate_huft * FAR*,/* result: starting table */ uIntf *, /* maximum lookup bits (returns actual) */ ! z_stream *)); /* for zalloc function */ local voidpf falloc OF(( voidpf, /* opaque pointer (not used) */ --- 30,36 ---- uIntf *, /* list of extra bits for non-simple codes */ inflate_huft * FAR*,/* result: starting table */ uIntf *, /* maximum lookup bits (returns actual) */ ! z_streamp )); /* for zalloc function */ local voidpf falloc OF(( voidpf, /* opaque pointer (not used) */ *************** *** 103,109 **** uIntf *e; /* list of extra bits for non-simple codes */ inflate_huft * FAR *t; /* result: starting table */ uIntf *m; /* maximum lookup bits, returns actual */ ! z_stream *zs; /* for zalloc function */ /* Given a list of code lengths and a maximum table size, make a set of tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR if the given code set is incomplete (the tables are still built in this --- 103,109 ---- uIntf *e; /* list of extra bits for non-simple codes */ inflate_huft * FAR *t; /* result: starting table */ uIntf *m; /* maximum lookup bits, returns actual */ ! z_streamp zs; /* for zalloc function */ /* Given a list of code lengths and a maximum table size, make a set of tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR if the given code set is incomplete (the tables are still built in this *************** *** 302,308 **** uIntf *c; /* 19 code lengths */ uIntf *bb; /* bits tree desired/actual depth */ inflate_huft * FAR *tb; /* bits tree result */ ! z_stream *z; /* for zfree function */ { int r; --- 302,308 ---- uIntf *c; /* 19 code lengths */ uIntf *bb; /* bits tree desired/actual depth */ inflate_huft * FAR *tb; /* bits tree result */ ! z_streamp z; /* for zfree function */ { int r; *************** *** 327,333 **** uIntf *bd; /* distance desired/actual bit depth */ inflate_huft * FAR *tl; /* literal/length tree result */ inflate_huft * FAR *td; /* distance tree result */ ! z_stream *z; /* for zfree function */ { int r; --- 327,333 ---- uIntf *bd; /* distance desired/actual bit depth */ inflate_huft * FAR *tl; /* literal/length tree result */ inflate_huft * FAR *td; /* distance tree result */ ! z_streamp z; /* for zfree function */ { int r; *************** *** 442,448 **** int inflate_trees_free(t, z) inflate_huft *t; /* table to free */ ! z_stream *z; /* for zfree function */ /* Free the malloc'ed tables built by huft_build(), which makes a linked list of the tables it made, with the links in a dummy first entry of each table. */ --- 442,448 ---- int inflate_trees_free(t, z) inflate_huft *t; /* table to free */ ! z_streamp z; /* for zfree function */ /* Free the malloc'ed tables built by huft_build(), which makes a linked list of the tables it made, with the links in a dummy first entry of each table. */ EOF-EOF-EOF Patch zlib/inftrees.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/inftrees.h Thu Aug 29 20:25:19 1996 --- hylafax-v4.0pl1/zlib/inftrees.h Tue Nov 26 15:21:11 1996 *************** *** 35,41 **** uIntf *, /* 19 code lengths */ uIntf *, /* bits tree desired/actual depth */ inflate_huft * FAR *, /* bits tree result */ ! z_stream *)); /* for zalloc, zfree functions */ extern int inflate_trees_dynamic OF(( uInt, /* number of literal/length codes */ --- 35,41 ---- uIntf *, /* 19 code lengths */ uIntf *, /* bits tree desired/actual depth */ inflate_huft * FAR *, /* bits tree result */ ! z_streamp )); /* for zalloc, zfree functions */ extern int inflate_trees_dynamic OF(( uInt, /* number of literal/length codes */ *************** *** 45,51 **** uIntf *, /* distance desired/actual bit depth */ inflate_huft * FAR *, /* literal/length tree result */ inflate_huft * FAR *, /* distance tree result */ ! z_stream *)); /* for zalloc, zfree functions */ extern int inflate_trees_fixed OF(( uIntf *, /* literal desired/actual bit depth */ --- 45,51 ---- uIntf *, /* distance desired/actual bit depth */ inflate_huft * FAR *, /* literal/length tree result */ inflate_huft * FAR *, /* distance tree result */ ! z_streamp )); /* for zalloc, zfree functions */ extern int inflate_trees_fixed OF(( uIntf *, /* literal desired/actual bit depth */ *************** *** 55,59 **** extern int inflate_trees_free OF(( inflate_huft *, /* tables to free */ ! z_stream *)); /* for zfree function */ --- 55,59 ---- extern int inflate_trees_free OF(( inflate_huft *, /* tables to free */ ! z_streamp )); /* for zfree function */ EOF-EOF-EOF Patch zlib/infutil.c<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/infutil.c Thu Aug 29 20:25:19 1996 --- hylafax-v4.0pl1/zlib/infutil.c Tue Nov 26 15:21:11 1996 *************** *** 22,28 **** /* copy as much as possible from the sliding window to the output area */ int inflate_flush(s, z, r) inflate_blocks_statef *s; ! z_stream *z; int r; { uInt n; --- 22,28 ---- /* copy as much as possible from the sliding window to the output area */ int inflate_flush(s, z, r) inflate_blocks_statef *s; ! z_streamp z; int r; { uInt n; EOF-EOF-EOF Patch zlib/infutil.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/infutil.h Thu Aug 29 20:25:20 1996 --- hylafax-v4.0pl1/zlib/infutil.h Tue Nov 26 15:21:12 1996 *************** *** 91,97 **** /* copy as much as possible from the sliding window to the output area */ extern int inflate_flush OF(( inflate_blocks_statef *, ! z_stream *, int)); struct internal_state {int dummy;}; /* for buggy compilers */ --- 91,97 ---- /* copy as much as possible from the sliding window to the output area */ extern int inflate_flush OF(( inflate_blocks_statef *, ! z_streamp , int)); struct internal_state {int dummy;}; /* for buggy compilers */ EOF-EOF-EOF Patch zlib/trees.c<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/trees.c Thu Aug 29 20:25:20 1996 --- hylafax-v4.0pl1/zlib/trees.c Tue Nov 26 15:21:12 1996 *************** *** 29,35 **** * Addison-Wesley, 1983. ISBN 0-201-06672-6. */ ! /* $Id: trees.c,v 1.3 1996/06/20 19:00:35 sam Rel $ */ #include "deflate.h" --- 29,35 ---- * Addison-Wesley, 1983. ISBN 0-201-06672-6. */ ! /* $Id: trees.c,v 1.4 1996/09/30 19:10:25 sam Rel $ */ #include "deflate.h" *************** *** 154,160 **** #else /* DEBUG */ # define send_code(s, c, tree) \ ! { if (verbose>1) fprintf(stderr,"\ncd %3d ",(c)); \ send_bits(s, tree[c].Code, tree[c].Len); } #endif --- 154,160 ---- #else /* DEBUG */ # define send_code(s, c, tree) \ ! { if (verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \ send_bits(s, tree[c].Code, tree[c].Len); } #endif EOF-EOF-EOF Patch zlib/zconf.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/zconf.h Thu Aug 29 20:25:20 1996 --- hylafax-v4.0pl1/zlib/zconf.h Tue Nov 26 15:21:12 1996 *************** *** 3,9 **** * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* $Id: zconf.h,v 1.3 1996/06/20 19:00:35 sam Rel $ */ #ifndef _ZCONF_H #define _ZCONF_H --- 3,9 ---- * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* $Id: zconf.h,v 1.4 1996/09/30 19:10:25 sam Rel $ */ #ifndef _ZCONF_H #define _ZCONF_H *************** *** 49,56 **** #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) # define WIN32 #endif ! #if (defined(__GNUC__) || defined(WIN32)) && !defined(__32BIT__) ! # define __32BIT__ #endif #if defined(__MSDOS__) && !defined(MSDOS) # define MSDOS --- 49,58 ---- #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) # define WIN32 #endif ! #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) ! # ifndef __32BIT__ ! # define __32BIT__ ! # endif #endif #if defined(__MSDOS__) && !defined(MSDOS) # define MSDOS *************** *** 80,88 **** # endif #endif ! #ifdef __MWERKS__ /* Metrowerks CodeWarrior declares fileno() in unix.h */ ! # include ! # define NO_DUMMY_DECL /* buggy compiler merges all .h files incorrectly */ #endif /* Maximum value for memLevel in deflateInit2 */ --- 82,90 ---- # endif #endif ! /* Some Mac compilers merge all .h files incorrectly: */ ! #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) ! # define NO_DUMMY_DECL #endif /* Maximum value for memLevel in deflateInit2 */ *************** *** 145,156 **** #endif #ifndef FAR # define FAR - #endif - /* The Watcom compiler defines M_I86SM and __SMALL__ even in 32 bit mode */ - #if defined(__WATCOMC__) && defined(__386__) && defined(SMALL_MEDIUM) - # undef FAR - # define FAR - # undef SMALL_MEDIUM #endif typedef unsigned char Byte; /* 8 bits */ --- 147,152 ---- EOF-EOF-EOF Patch zlib/zlib.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/zlib.h Thu Aug 29 20:25:21 1996 --- hylafax-v4.0pl1/zlib/zlib.h Tue Nov 26 15:21:12 1996 *************** *** 1,5 **** /* zlib.h -- interface of the 'zlib' general purpose compression library ! version 1.0.2, May 23rd, 1996. Copyright (C) 1995-1996 Jean-loup Gailly and Mark Adler --- 1,5 ---- /* zlib.h -- interface of the 'zlib' general purpose compression library ! version 1.0.4, Jul 24th, 1996. Copyright (C) 1995-1996 Jean-loup Gailly and Mark Adler *************** *** 37,43 **** #include "zconf.h" ! #define ZLIB_VERSION "1.0.2" /* The 'zlib' compression library provides in-memory compression and --- 37,43 ---- #include "zconf.h" ! #define ZLIB_VERSION "1.0.4" /* The 'zlib' compression library provides in-memory compression and *************** *** 89,94 **** --- 89,96 ---- uLong reserved; /* reserved for future use */ } z_stream; + typedef z_stream FAR *z_streamp; + /* The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out *************** *** 166,172 **** /* basic functions */ ! extern char EXPORT *zlibVersion OF((void)); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. --- 168,174 ---- /* basic functions */ ! extern const char * EXPORT zlibVersion OF((void)); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. *************** *** 174,180 **** */ /* ! extern int EXPORT deflateInit OF((z_stream *strm, int level)); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. --- 176,182 ---- */ /* ! extern int EXPORT deflateInit OF((z_streamp strm, int level)); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. *************** *** 196,202 **** */ ! extern int EXPORT deflate OF((z_stream *strm, int flush)); /* Performs one or both of the following actions: --- 198,204 ---- */ ! extern int EXPORT deflate OF((z_streamp strm, int flush)); /* Performs one or both of the following actions: *************** *** 239,246 **** parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). ! If the parameter flush is set to Z_FINISH, all pending input is processed, ! all pending output is flushed and deflate returns with Z_STREAM_END if there was enough output space; if deflate returns with Z_OK, this function must be called again with Z_FINISH and more output space (updated avail_out) but no more input data, until it returns with Z_STREAM_END or an error. After --- 241,248 ---- parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). ! If the parameter flush is set to Z_FINISH, pending input is processed, ! pending output is flushed and deflate returns with Z_STREAM_END if there was enough output space; if deflate returns with Z_OK, this function must be called again with Z_FINISH and more output space (updated avail_out) but no more input data, until it returns with Z_STREAM_END or an error. After *************** *** 265,271 **** */ ! extern int EXPORT deflateEnd OF((z_stream *strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any --- 267,273 ---- */ ! extern int EXPORT deflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any *************** *** 280,286 **** /* ! extern int EXPORT inflateInit OF((z_stream *strm)); Initializes the internal stream state for decompression. The fields zalloc, zfree and opaque must be initialized before by the caller. If --- 282,288 ---- /* ! extern int EXPORT inflateInit OF((z_streamp strm)); Initializes the internal stream state for decompression. The fields zalloc, zfree and opaque must be initialized before by the caller. If *************** *** 295,301 **** */ ! extern int EXPORT inflate OF((z_stream *strm, int flush)); /* Performs one or both of the following actions: --- 297,303 ---- */ ! extern int EXPORT inflate OF((z_streamp strm, int flush)); /* Performs one or both of the following actions: *************** *** 350,356 **** */ ! extern int EXPORT inflateEnd OF((z_stream *strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any --- 352,358 ---- */ ! extern int EXPORT inflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any *************** *** 368,374 **** */ /* ! extern int EXPORT deflateInit2 OF((z_stream *strm, int level, int method, int windowBits, --- 370,376 ---- */ /* ! extern int EXPORT deflateInit2 OF((z_streamp strm, int level, int method, int windowBits, *************** *** 426,432 **** deflate(). */ ! extern int EXPORT deflateSetDictionary OF((z_stream *strm, const Bytef *dictionary, uInt dictLength)); /* --- 428,434 ---- deflate(). */ ! extern int EXPORT deflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* *************** *** 455,462 **** be done by deflate(). */ ! extern int EXPORT deflateCopy OF((z_stream *dest, ! z_stream *source)); /* Sets the destination stream as a complete copy of the source stream. If the source stream is using an application-supplied history buffer, a new --- 457,464 ---- be done by deflate(). */ ! extern int EXPORT deflateCopy OF((z_streamp dest, ! z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. If the source stream is using an application-supplied history buffer, a new *************** *** 478,484 **** destination. */ ! extern int EXPORT deflateReset OF((z_stream *strm)); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate all the internal compression state. --- 480,486 ---- destination. */ ! extern int EXPORT deflateReset OF((z_streamp strm)); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate all the internal compression state. *************** *** 489,495 **** stream state was inconsistent (such as zalloc or state being NULL). */ ! extern int EXPORT deflateParams OF((z_stream *strm, int level, int strategy)); /* Dynamically update the compression level and compression strategy. This can be used to switch between compression and straight copy of --- 491,497 ---- stream state was inconsistent (such as zalloc or state being NULL). */ ! extern int EXPORT deflateParams OF((z_streamp strm, int level, int strategy)); /* Dynamically update the compression level and compression strategy. This can be used to switch between compression and straight copy of *************** *** 508,514 **** */ /* ! extern int EXPORT inflateInit2 OF((z_stream *strm, int windowBits)); This is another version of inflateInit with more compression options. The --- 510,516 ---- */ /* ! extern int EXPORT inflateInit2 OF((z_streamp strm, int windowBits)); This is another version of inflateInit with more compression options. The *************** *** 542,548 **** inflate(). */ ! extern int EXPORT inflateSetDictionary OF((z_stream *strm, const Bytef *dictionary, uInt dictLength)); /* --- 544,550 ---- inflate(). */ ! extern int EXPORT inflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* *************** *** 561,567 **** inflate(). */ ! extern int EXPORT inflateSync OF((z_stream *strm)); /* Skips invalid compressed data until the special marker (see deflate() above) can be found, or until all available input is skipped. No output --- 563,569 ---- inflate(). */ ! extern int EXPORT inflateSync OF((z_streamp strm)); /* Skips invalid compressed data until the special marker (see deflate() above) can be found, or until all available input is skipped. No output *************** *** 576,582 **** until success or end of the input data. */ ! extern int EXPORT inflateReset OF((z_stream *strm)); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate all the internal decompression state. --- 578,584 ---- until success or end of the input data. */ ! extern int EXPORT inflateReset OF((z_streamp strm)); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate all the internal decompression state. *************** *** 690,696 **** error number (see function gzerror below). */ ! extern char EXPORT *gzerror OF((gzFile file, int *errnum)); /* Returns the error message for the last error which occurred on the given compressed file. errnum is set to zlib error number. If an --- 692,698 ---- error number (see function gzerror below). */ ! extern const char * EXPORT gzerror OF((gzFile file, int *errnum)); /* Returns the error message for the last error which occurred on the given compressed file. errnum is set to zlib error number. If an *************** *** 746,759 **** /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ ! extern int EXPORT deflateInit_ OF((z_stream *strm, int level, const char *version, int stream_size)); ! extern int EXPORT inflateInit_ OF((z_stream *strm, const char *version, int stream_size)); ! extern int EXPORT deflateInit2_ OF((z_stream *strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)); ! extern int EXPORT inflateInit2_ OF((z_stream *strm, int windowBits, const char *version, int stream_size)); #define deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) --- 748,761 ---- /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ ! extern int EXPORT deflateInit_ OF((z_streamp strm, int level, const char *version, int stream_size)); ! extern int EXPORT inflateInit_ OF((z_streamp strm, const char *version, int stream_size)); ! extern int EXPORT deflateInit2_ OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)); ! extern int EXPORT inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); #define deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) EOF-EOF-EOF Patch zlib/zutil.c<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/zutil.c Thu Aug 29 20:25:21 1996 --- hylafax-v4.0pl1/zlib/zutil.c Tue Nov 26 15:21:12 1996 *************** *** 3,9 **** * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* $Id: zutil.c,v 1.3 1996/06/20 19:00:35 sam Rel $ */ #include --- 3,9 ---- * For conditions of distribution and use, see copyright notice in zlib.h */ ! /* $Id: zutil.c,v 1.4 1996/09/30 19:10:25 sam Rel $ */ #include *************** *** 28,38 **** ""}; ! char *zlibVersion() { return ZLIB_VERSION; } void z_error (m) char *m; { --- 28,39 ---- ""}; ! const char *zlibVersion() { return ZLIB_VERSION; } + #ifdef DEBUG void z_error (m) char *m; { *************** *** 39,44 **** --- 40,46 ---- fprintf(stderr, "%s\n", m); exit(1); } + #endif #ifndef HAVE_MEMCPY *************** *** 53,58 **** --- 55,73 ---- } while (--len != 0); } + int zmemcmp(s1, s2, len) + Bytef* s1; + Bytef* s2; + uInt len; + { + uInt j; + + for (j = 0; j < len; j++) { + if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; + } + return 0; + } + void zmemzero(dest, len) Bytef* dest; uInt len; *************** *** 138,151 **** return; } ptr = opaque; /* just to make some compilers happy */ ! z_error("zcfree: ptr not found"); } #endif #endif /* __TURBOC__ */ ! #if defined(M_I86) && !(defined(__WATCOMC__) && defined(__386__)) ! /* Microsoft C */ # define MY_ZCALLOC --- 153,166 ---- return; } ptr = opaque; /* just to make some compilers happy */ ! Assert(0, "zcfree: ptr not found"); } #endif #endif /* __TURBOC__ */ ! #if defined(M_I86) && !defined(__32BIT__) ! /* Microsoft C in 16-bit mode */ # define MY_ZCALLOC EOF-EOF-EOF Patch zlib/zutil.h<<'EOF-EOF-EOF' *** hylafax-v4.0pl0/zlib/zutil.h Thu Aug 29 20:25:21 1996 --- hylafax-v4.0pl1/zlib/zutil.h Tue Nov 26 15:21:13 1996 *************** *** 8,14 **** subject to change. Applications should only use zlib.h. */ ! /* $Id: zutil.h,v 1.3 1996/06/20 19:00:35 sam Rel $ */ #ifndef _Z_UTIL_H #define _Z_UTIL_H --- 8,14 ---- subject to change. Applications should only use zlib.h. */ ! /* $Id: zutil.h,v 1.4 1996/09/30 19:10:25 sam Rel $ */ #ifndef _Z_UTIL_H #define _Z_UTIL_H *************** *** 15,21 **** #include "zlib.h" ! #if defined(MSDOS) || defined(VMS) || defined(CRAY) || defined(WIN32) # include # include #else --- 15,21 ---- #include "zlib.h" ! #if defined(MSDOS)||defined(VMS)||defined(CRAY)||defined(WIN32)||defined(RISCOS) # include # include #else *************** *** 40,49 **** extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ ! #define ERR_MSG(err) (char*)z_errmsg[Z_NEED_DICT-(err)] #define ERR_RETURN(strm,err) \ ! return (strm->msg = ERR_MSG(err), (err)) /* To be used only when the state is known to be valid */ /* common constants */ --- 40,49 ---- extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ ! #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] #define ERR_RETURN(strm,err) \ ! return (strm->msg = (char*)ERR_MSG(err), (err)) /* To be used only when the state is known to be valid */ /* common constants */ *************** *** 116,122 **** # define OS_CODE 0x0a #endif ! #ifdef _BEOS_ # define fdopen(fd,mode) NULL /* No fdopen() */ #endif --- 116,122 ---- # define OS_CODE 0x0a #endif ! #if defined(_BEOS_) || defined(RISCOS) # define fdopen(fd,mode) NULL /* No fdopen() */ #endif *************** *** 163,168 **** --- 163,169 ---- # endif #else extern void zmemcpy OF((Bytef* dest, Bytef* source, uInt len)); + extern int zmemcmp OF((Bytef* s1, Bytef* s2, uInt len)); extern void zmemzero OF((Bytef* dest, uInt len)); #endif *************** *** 172,177 **** --- 173,179 ---- # ifndef verbose # define verbose 0 # endif + extern void z_error OF((char *m)); # define Assert(cond,msg) {if(!(cond)) z_error(msg);} # define Trace(x) fprintf x # define Tracev(x) {if (verbose) fprintf x ;} *************** *** 189,196 **** typedef uLong (*check_func) OF((uLong check, const Bytef *buf, uInt len)); - - extern void z_error OF((char *m)); voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); void zcfree OF((voidpf opaque, voidpf ptr)); --- 191,196 ---- EOF-EOF-EOF NewFile html/v4.0beta022.html<<'EOF-EOF-EOF' Changes in HylaFAX v4.0beta022 (aka v4.0pl1) HYLAFAX CHANGE INFORMATION

This document describes the changes made to the software between the previous and current versions (see above). If you don't find something listed here, then it was not done in this timeframe, or it was not considered important enough to be mentioned.

Latest Distribution:v4.0pl1
Latest Release:v4.0pl1 (Version 4.0 patch level 1)
Master FTP Site:
This was a patch distribution made to correct problems found after the v4.0pl0 release. The majority of the changes included in this patch address portability problems.


CHANGES:
  • configure now looks for crypt in -lcrypt_d and -lcrypt_i (for FreeBSD 2.1)
  • a bug was fixed in faxq whereby the on-disk job description file was not updated to reflect the current in-memory state; this caused jobs to be left in a ``suspended'' state if faxq was prematurely terminated
  • a bug in faxsetup's handling of certain prompts was corrected
  • faxsetup now does some consistency checking of the etc/hosts file in the spooling area
  • faxsetup handles SCO systems better
  • some code was added to deal with language changes introduced in the latest ANSI C++ draft specification (and implemented in the SGI 7.1 compilers)
  • extraneous use of the :: scope operator was removed to avoid problems with systems that use C preprocessor directives to define certain antiquated functions (e.g. atoi)
  • changes were made to deal with systems where tcgetattr is a #define (e.g. SCO)
  • a bug was fixed that caused sendfax to send the USEECM protocol directive with an improper (wrongly typed) argument
  • a bug was fixed in the text to PostScript conversion support that appeared on systems where char is a signed quantity
  • a bug in faxconfig that caused invalid requests to be sent to the scheduler was fixed
  • the zlib support has been updated to version 1.0.4; this fixes certain portability problems
  • make dependency handling was fixed for certain compilers
  • workarounds were made to deal with systems that have certain C include files that are not setup for use in C++ programs
  • a new -D option was added to faxcover to set the strftime format string used to generate the time & date string
  • a new DateFormat configuration parameter was added to sendfax to specify a format string to pass to the cover page program when auto-generating cover pages
  • a bug was fixed in hfaxd in the recognition off little-endian TIFF images
  • a bug was fixed in hfaxd that resulted in the SHUT command writing an invalid time to the shutdown file
  • hfaxd now checks the time value specified in the shutdown file more carefully
  • job parameter alteration was fixed in the old protocol emulation
  • a new CONFIG_MAXGID configuration parameter was added to constrain the maximum fax UID assigned to clients
  • the maximum fax UID was changed to 60000 for HP and SCO systems; this fixes a problem where anonymous clients were unable to access submitted documents
  • faxgetty was changed to monitor modem status messages even when RingsBeforeAnswer is set to zero
  • unprivileged clients may now access files in the log subdirectory in the spooling area (per-file readability depends on the setting of LogFileMode); this makes it possible to use WWW browsers to retrieve session logs through hfaxd
HylaFAX table of contents.

Sam Leffler / sam@engr.sgi.com Last updated $Date: 1996/11/23 18:33:46 $.
EOF-EOF-EOF