#! /bin/sh
#
# This is a shell script that converts tiff-v3.4beta016 to tiff-v3.4beta018
#
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 Makefile.in<<'EOF-EOF-EOF'
2c2
< #	$Header: /usr/people/sam/tiff/RCS/Makefile.in,v 1.24 1995/07/08 00:01:56 sam Exp $
---
> #	$Header: /usr/people/sam/tiff/RCS/Makefile.in,v 1.25 1995/07/19 01:53:48 sam Exp $
257a258
> 	    html/v3.4beta018.html		\
EOF-EOF-EOF
Patch config.guess<<'EOF-EOF-EOF'
127c127
<     *:IRIX:*:*)
---
>     *:IRIX*:*:*)
EOF-EOF-EOF
Patch config.site<<'EOF-EOF-EOF'
1c1
< # $Header: /usr/people/sam/tiff/RCS/config.site,v 1.3 1995/06/30 04:43:04 sam Exp $
---
> # $Header: /usr/people/sam/tiff/RCS/config.site,v 1.5 1995/07/17 14:53:35 sam Exp $
60a61,63
> # NB: JPEG support requires release 5 or later of the IJG code,
> #     which you can find on the Internet at ftp.uu.net:/graphics/jpeg/.
> #
66a70,73
> # NB: Deflate support requires version 0.92 or later of the libgz
> #     library written by Jean-loup Gailly and Mark Adler.  The library
> #     was last found at ftp://ftp.uu.net/graphics/png/code/zlib-0.93.tar.gz.
> #
68c75
< #LIBGZ="-L \${ZIPDIR} -llibgz"		# libgz library to load
---
> #LIBGZ="-L \${ZIPDIR} -lgz"		# libgz library to load
EOF-EOF-EOF
Patch configure<<'EOF-EOF-EOF'
2c2
< #	$Header: /usr/people/sam/tiff/RCS/configure,v 1.12 1995/07/03 16:05:40 sam Exp $
---
> #	$Header: /usr/people/sam/tiff/RCS/configure,v 1.15 1995/07/17 14:57:08 sam Exp $
144c144
< 	echo "This is TIFF configure $Revision: 1.12 $"
---
> 	echo "This is TIFF configure $Revision: 1.15 $"
381,382c381,404
< ISGCC=no; CCOMPILER=
< for i in $CC gcc cc ncc dcc xlc gcc2; do
---
> CCOMPILER=
> for i in $CC gcc cc ncc dcc xlc c89 gcc2; do
>     if isGNU $i; then
> 	ISGCC=yes
>     else
> 	ISGCC=no
>     fi
>     #
>     # Guess special options needed to get an
>     # ANSI C compiler and/or similar.  Should
>     # probably be combined with above checks
>     # so we only select an ANSI C compiler.
>     #
>     if [ -z "$ENVOPTS" ]; then
> 	case $ISGCC-$TARGET in
> 	no-*-irix*)	C_ANSI=-ansi;;
> 	no-*-hp*)	C_ANSI="-Aa -D_HPUX_SOURCE -Dhpux";;
> 	no-*-apollo-*)	C_ANSI="-A nansi";;
> 	*-sco*)		C_ANSI="-Dsco";;
> 	*-aix*)		C_ANSI="-Dunix -qlanglvl=ansi -qsrcmsg" ;;
> 	esac
>     else
> 	C_ANSI="$ENVOPTS"
>     fi
384,387c406
<     ($i -o dummy $ENVOPTS dummy.c) >/dev/null 2>&5 && {
< 	if isGNU $i; then
< 	    ISGCC=yes
< 	fi
---
>     ($i -o dummy $C_ANSI dummy.c) >/dev/null 2>&5 && {
389a409,411
> 	if [ -z "$ENVOPTS" ]; then
> 	    ENVOPTS="$C_ANSI"
> 	fi
413,426d434
< #
< # Guess special options needed to get an
< # ANSI C compiler and/or similar.  Should
< # probably be combined with above checks
< # so we only select an ANSI C compiler.
< #
< if [ -z "$ENVOPTS" ]; then
<     case $ISGCC-$TARGET in
<     no-*-irix*)		ENVOPTS=-ansi;;
<     no-*-hp*)		ENVOPTS="-Aa -D_HPUX_SOURCE -Dhpux";;
<     no-*-apollo-*)	ENVOPTS="-A nansi";;
<     *-sco*)		ENVOPTS="-Dsco";;
<     esac
< fi
724c732
< #ifdef __osf__
---
> #if defined(__osf__) || defined(_AIX)
942c950
<     *-irix5*)
---
>     *-irix*)
EOF-EOF-EOF
Patch dist/tiff.alpha<<'EOF-EOF-EOF'
1c1
< define ALPHA 016
---
> define ALPHA 018
EOF-EOF-EOF
Patch html/Makefile.in<<'EOF-EOF-EOF'
1c1
< #	$Header: /usr/people/sam/tiff/html/RCS/Makefile.in,v 1.3 1995/06/30 23:28:32 sam Exp $
---
> #	$Header: /usr/people/sam/tiff/html/RCS/Makefile.in,v 1.4 1995/07/19 01:54:06 sam Exp $
64a65,66
> 	v3.4beta016.html	\
> 	v3.4beta018.html	\
EOF-EOF-EOF
Patch html/index.html<<'EOF-EOF-EOF'
15c15
< <B>Latest Software</B>: <A HREF="v3.4beta016.html">v3.4beta016</A><BR>
---
> <B>Latest Software</B>: <A HREF="v3.4beta018.html">v3.4beta018</A><BR>
84c84
< Last updated: $Date: 1995/07/07 02:34:32 $
---
> Last updated: $Date: 1995/07/19 01:54:06 $
EOF-EOF-EOF
Patch libtiff/Makefile.in<<'EOF-EOF-EOF'
1c1
< #	$Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.in,v 1.19 1995/07/05 21:09:18 sam Exp $
---
> #	$Header: /usr/people/sam/tiff/libtiff/RCS/Makefile.in,v 1.20 1995/07/17 19:26:25 sam Exp $
70d69
< INCS	= tiff.h tiffio.h
261a261,262
> INCS	= ${SRCDIR}/tiff.h ${SRCDIR}/tiffio.h
> 
264a266
> 	    f=`basename $$i`; \
266c268
< 		-src ${SRCDIR}/$$i -O $$i; \
---
> 		-src $$i -O $$f; \
EOF-EOF-EOF
Patch libtiff/mkg3states.c<<'EOF-EOF-EOF'
1c1
< /* "$Header: /usr/people/sam/tiff/libtiff/RCS/mkg3states.c,v 1.30 1995/06/07 17:19:51 sam Exp $ */
---
> /* "$Header: /usr/people/sam/tiff/libtiff/RCS/mkg3states.c,v 1.31 1995/07/17 01:27:30 sam Exp $ */
28,45c28,31
<    Copyright (C) 1990, 1995  Frank D. Cringle.
< 
< This file is part of viewfax - g3/g4 fax processing software.
<      
< viewfax is free software; you can redistribute it and/or modify it
< under the terms of the GNU General Public License as published by the
< Free Software Foundation; either version 2 of the License, or (at your
< option) any later version.
<      
< This program is distributed in the hope that it will be useful, but
< WITHOUT ANY WARRANTY; without even the implied warranty of
< MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
< General Public License for more details.
<      
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
< 
---
>  * Decoder support is derived, with permission, from the code
>  * in Frank Cringle's viewfax program;
>  *      Copyright (C) 1990, 1995  Frank D. Cringle.
>  */
EOF-EOF-EOF
Patch libtiff/tif_aux.c<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_aux.c,v 1.30 1995/06/06 23:49:31 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_aux.c,v 1.31 1995/07/18 23:13:19 sam Exp $ */
77a78
> int
188a190
> int
EOF-EOF-EOF
Patch libtiff/tif_dir.c<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dir.c,v 1.150 1995/06/30 14:32:37 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_dir.c,v 1.151 1995/07/19 00:39:31 sam Exp $ */
72c72
< 	if (*v > td->td_samplesperpixel)
---
> 	if ((uint16) *v > td->td_samplesperpixel)
80c80
< 	td->td_extrasamples = *v;
---
> 	td->td_extrasamples = (uint16) *v;
EOF-EOF-EOF
Patch libtiff/tif_fax3.c<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_fax3.c,v 1.127 1995/06/30 15:29:02 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_fax3.c,v 1.128 1995/07/17 01:27:30 sam Exp $ */
200c200
< Fax3PrematureEOL(const char* module, TIFF* tif, uint32 a0)
---
> Fax3BadLength(const char* module, TIFF* tif, uint32 a0, uint32 lastx)
202,203c202,205
< 	TIFFWarning(module, "%s: Premature EOL at scanline %d (x %lu)",
< 	    tif->tif_name, tif->tif_row, (u_long) a0);
---
> 	TIFFWarning(module, "%s: %s at scanline %d (got %lu, expected %lu)",
> 	    tif->tif_name,
> 	    a0 < lastx ? "Premature EOL" : "Line length mismatch",
> 	    tif->tif_row, (u_long) a0, (u_long) lastx);
205c207
< #define	prematureEOL(a0)	Fax3PrematureEOL(module, tif, a0)
---
> #define	badlength(a0,lastx)	Fax3BadLength(module, tif, a0, lastx)
1206c1208,1209
< 		fprintf(fd, "  Consecutive Bad Fax Lines: %u\n", sp->badfaxrun);
---
> 		fprintf(fd, "  Consecutive Bad Fax Lines: %lu\n",
> 		    (u_long) sp->badfaxrun);
EOF-EOF-EOF
Patch libtiff/tif_fax3.h<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_fax3.h,v 1.25 1995/07/06 18:03:52 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_fax3.h,v 1.26 1995/07/17 01:27:30 sam Exp $ */
264a265
> 	badlength(a0, lastx);						\
298d298
< 		prematureEOL(a0);					\
321d320
< 		prematureEOL(a0);					\
468,469d466
< 	    else							\
< 		prematureEOL(a0);					\
EOF-EOF-EOF
Patch libtiff/tif_getimage.c<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_getimage.c,v 1.37 1995/06/20 23:40:24 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_getimage.c,v 1.38 1995/07/17 01:27:18 sam Exp $ */
1496a1497
> 	TIFFRGBValue c;
1499d1499
< 	    TIFFRGBValue c;
1625a1626
> 	TIFFRGBValue c;
1629d1629
< 	    TIFFRGBValue c;
EOF-EOF-EOF
Patch libtiff/tif_lzw.c<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_lzw.c,v 1.68 1995/06/30 15:29:02 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_lzw.c,v 1.69 1995/07/19 00:39:31 sam Exp $ */
175,177c175,177
< #define	NextCode(tif, sp, bp, code, get) {				\
< 	if ((sp)->dec_bitsleft < nbits) {				\
< 		TIFFWarning(tif->tif_name,				\
---
> #define	NextCode(_tif, _sp, _bp, _code, _get) {				\
> 	if ((_sp)->dec_bitsleft < nbits) {				\
> 		TIFFWarning(_tif->tif_name,				\
179,180c179,180
< 		    tif->tif_curstrip);					\
< 		code = CODE_EOI;					\
---
> 		    _tif->tif_curstrip);				\
> 		_code = CODE_EOI;					\
182,183c182,183
< 		get(sp, bp, code);					\
< 		(sp)->dec_bitsleft -= nbits;				\
---
> 		_get(_sp,_bp,_code);					\
> 		(_sp)->dec_bitsleft -= nbits;				\
EOF-EOF-EOF
Patch libtiff/tif_open.c<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_open.c,v 1.57 1995/06/06 23:49:31 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_open.c,v 1.58 1995/07/17 01:27:01 sam Exp $ */
178c178
< 	{ int one = 1; char* cp = (char*)&one; bigendian = (*cp == 0); }
---
> 	{ union { int i; char c[4]; } u; u.i = 1; bigendian = u.c[0] == 0; }
EOF-EOF-EOF
Patch libtiff/tif_print.c<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_print.c,v 1.62 1995/06/30 05:46:47 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_print.c,v 1.64 1995/07/19 00:39:31 sam Exp $ */
72c72
< 	int i, j;
---
> 	uint16 i;
224c224
< 				fprintf(fd, "assoc-alpha", sep);
---
> 				fprintf(fd, "%sassoc-alpha", sep);
227c227
< 				fprintf(fd, "unassoc-alpha", sep);
---
> 				fprintf(fd, "%sunassoc-alpha", sep);
252c252
< 		char *cp;
---
> 		char* cp;
398,399c398,399
< 				fprintf(fd, "   %5d: %5u %5u %5u\n",
< 				    i,
---
> 				fprintf(fd, "   %5lu: %5u %5u %5u\n",
> 				    l,
429,431c429,431
< 				fprintf(fd, "    %2d: %5u",
< 				    i, td->td_transferfunction[0][l]);
< 				for (j = 1; j < td->td_samplesperpixel; j++)
---
> 				fprintf(fd, "    %2lu: %5u",
> 				    l, td->td_transferfunction[0][l]);
> 				for (i = 1; i < td->td_samplesperpixel; i++)
433c433
< 					    td->td_transferfunction[j][l]);
---
> 					    td->td_transferfunction[i][l]);
458,459c458,459
< 			fprintf(fd, "    %3d: [%8lu, %8lu]\n",
< 			    i,
---
> 			fprintf(fd, "    %3lu: [%8lu, %8lu]\n",
> 			    (u_long) s,
EOF-EOF-EOF
Patch libtiff/tif_write.c<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_write.c,v 1.69 1995/06/27 00:54:41 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_write.c,v 1.70 1995/07/18 17:55:31 sam Exp $ */
363a364,366
> #define	isUnspecified(td, v) \
>     (td->v == (uint32) -1 || (td)->td_imagelength == 0)
> 
367c370
< 	register TIFFDirectory *td = &tif->tif_dir;
---
> 	TIFFDirectory* td = &tif->tif_dir;
369,370c372,378
< 	td->td_stripsperimage = td->td_nstrips =
< 	    (isTiled(tif) ? TIFFNumberOfTiles(tif) : TIFFNumberOfStrips(tif));
---
> 	if (isTiled(tif))
> 		td->td_stripsperimage = isUnspecified(td, td_tilelength) ?
> 		    td->td_samplesperpixel : TIFFNumberOfTiles(tif);
> 	else
> 		td->td_stripsperimage = isUnspecified(td, td_rowsperstrip) ?
> 		    td->td_samplesperpixel : TIFFNumberOfStrips(tif);
> 	td->td_nstrips = td->td_stripsperimage;
388a397
> #undef isUnspecified
EOF-EOF-EOF
Patch libtiff/tif_zip.c<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_zip.c,v 1.3 1995/06/30 15:29:02 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/libtiff/RCS/tif_zip.c,v 1.4 1995/07/17 14:38:12 sam Exp $ */
39c39
<  * is best found using archie (e.g. look for zlib-0.92.tar.gz).
---
>  * was last found at ftp://ftp.uu.net/graphics/png/code/zlib-0.93.tar.gz.
EOF-EOF-EOF
Patch tools/fax2tiff.c<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/tools/RCS/fax2tiff.c,v 1.36 1995/06/06 23:45:26 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/tools/RCS/fax2tiff.c,v 1.37 1995/07/17 01:36:52 sam Exp $ */
42c42,49
< TIFF	faxTIFF;
---
> #ifndef EXIT_SUCCESS
> #define EXIT_SUCCESS	0
> #endif
> #ifndef EXIT_FAILURE
> #define EXIT_FAILURE	1
> #endif
> 
> TIFF	*faxTIFF;
54a62,75
> static tsize_t
> DummyReadProc(thandle_t fd, tdata_t buf, tsize_t size)
> {
> 	(void) fd; (void) buf; (void) size;
> 	return (0);
> }
> 
> static tsize_t
> DummyWriteProc(thandle_t fd, tdata_t buf, tsize_t size)
> {
> 	(void) fd; (void) buf; (void) size;
> 	return (size);
> }
> 
59a81
> 	TIFFErrorHandler whandler;
71,79c93,108
< 	_TIFFmemset(&faxTIFF, 0, sizeof (faxTIFF));
< 	TIFFSetField(&faxTIFF, TIFFTAG_IMAGEWIDTH,	XSIZE);
< 	TIFFSetField(&faxTIFF, TIFFTAG_SAMPLESPERPIXEL,	1);
< 	TIFFSetField(&faxTIFF, TIFFTAG_BITSPERSAMPLE,	1);
< 	TIFFSetField(&faxTIFF, TIFFTAG_FILLORDER,	FILLORDER_LSB2MSB);
< 	TIFFSetField(&faxTIFF, TIFFTAG_PLANARCONFIG,	PLANARCONFIG_CONTIG);
< 	TIFFSetField(&faxTIFF, TIFFTAG_PHOTOMETRIC,	PHOTOMETRIC_MINISWHITE);
< 	TIFFSetField(&faxTIFF, TIFFTAG_YRESOLUTION,	196.);
< 	TIFFSetField(&faxTIFF, TIFFTAG_RESOLUTIONUNIT,	RESUNIT_INCH);
---
> 	/* smuggle a descriptor out of the library */
> 	faxTIFF = TIFFClientOpen("(FakeInput)", "w", (thandle_t) -1,
> 				 DummyReadProc, DummyWriteProc,
> 				 NULL, NULL, NULL, NULL, NULL);
> 	if (faxTIFF == NULL)
> 		return (EXIT_FAILURE);
> 	faxTIFF->tif_mode = O_RDONLY;
> 
> 	TIFFSetField(faxTIFF, TIFFTAG_IMAGEWIDTH,	XSIZE);
> 	TIFFSetField(faxTIFF, TIFFTAG_SAMPLESPERPIXEL,	1);
> 	TIFFSetField(faxTIFF, TIFFTAG_BITSPERSAMPLE,	1);
> 	TIFFSetField(faxTIFF, TIFFTAG_FILLORDER,	FILLORDER_LSB2MSB);
> 	TIFFSetField(faxTIFF, TIFFTAG_PLANARCONFIG,	PLANARCONFIG_CONTIG);
> 	TIFFSetField(faxTIFF, TIFFTAG_PHOTOMETRIC,	PHOTOMETRIC_MINISWHITE);
> 	TIFFSetField(faxTIFF, TIFFTAG_YRESOLUTION,	196.);
> 	TIFFSetField(faxTIFF, TIFFTAG_RESOLUTIONUNIT,	RESUNIT_INCH);
81c110
< 	faxTIFF.tif_scanlinesize = TIFFScanlineSize(&faxTIFF);
---
> 	faxTIFF->tif_scanlinesize = TIFFScanlineSize(faxTIFF);
87c116
< 			TIFFSetField(&faxTIFF,
---
> 			TIFFSetField(faxTIFF,
91c120
< 			TIFFSetField(&faxTIFF,
---
> 			TIFFSetField(faxTIFF,
95c124
< 			TIFFSetField(&faxTIFF,
---
> 			TIFFSetField(faxTIFF,
99c128
< 			TIFFSetField(&faxTIFF,
---
> 			TIFFSetField(faxTIFF,
103c132
< 			TIFFSetField(&faxTIFF,
---
> 			TIFFSetField(faxTIFF,
107c136
< 			TIFFSetField(&faxTIFF,
---
> 			TIFFSetField(faxTIFF,
130c159
< 				return (-2);
---
> 			    return EXIT_FAILURE;
156c185
< 			return (-2);
---
> 			return (EXIT_FAILURE);
158,164c187,193
< 	faxTIFF.tif_readproc = out->tif_readproc;	/* XXX */
< 	faxTIFF.tif_writeproc = out->tif_writeproc;	/* XXX */
< 	faxTIFF.tif_seekproc = out->tif_seekproc;	/* XXX */
< 	faxTIFF.tif_closeproc = out->tif_closeproc;	/* XXX */
< 	faxTIFF.tif_sizeproc = out->tif_sizeproc;	/* XXX */
< 	faxTIFF.tif_mapproc = out->tif_mapproc;		/* XXX */
< 	faxTIFF.tif_unmapproc = out->tif_unmapproc;	/* XXX */
---
> 	faxTIFF->tif_readproc = out->tif_readproc;	/* XXX */
> 	faxTIFF->tif_writeproc = out->tif_writeproc;	/* XXX */
> 	faxTIFF->tif_seekproc = out->tif_seekproc;	/* XXX */
> 	faxTIFF->tif_closeproc = out->tif_closeproc;	/* XXX */
> 	faxTIFF->tif_sizeproc = out->tif_sizeproc;	/* XXX */
> 	faxTIFF->tif_mapproc = out->tif_mapproc;	/* XXX */
> 	faxTIFF->tif_unmapproc = out->tif_unmapproc;	/* XXX */
171c200
< 	TIFFSetField(&faxTIFF, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX3);
---
> 	TIFFSetField(faxTIFF, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX3);
179,181c208,210
< 		faxTIFF.tif_fd = fileno(in);
< 		faxTIFF.tif_clientdata = (thandle_t) faxTIFF.tif_fd;
< 		faxTIFF.tif_name = argv[optind];
---
> 		faxTIFF->tif_fd = fileno(in);
> 		faxTIFF->tif_clientdata = (thandle_t) faxTIFF->tif_fd;
> 		faxTIFF->tif_name = argv[optind];
204c233
< 			TIFFGetField(&faxTIFF, TIFFTAG_YRESOLUTION, &yres);
---
> 			TIFFGetField(faxTIFF, TIFFTAG_YRESOLUTION, &yres);
211c240,242
< 		rows = copyFaxFile(&faxTIFF, out);
---
> 		if (!verbose)
> 		    whandler = TIFFSetWarningHandler(NULL);
> 		rows = copyFaxFile(faxTIFF, out);
212a244,245
> 		if (!verbose)
> 		    (void) TIFFSetWarningHandler(whandler);
232c265
< 	return (0);
---
> 	return (EXIT_SUCCESS);
250a284
> 	(*tifin->tif_setupdecode)(tifin);
326c360
< 	exit(-1);
---
> 	exit(EXIT_FAILURE);
EOF-EOF-EOF
Patch tools/tiff2bw.c<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/tools/RCS/tiff2bw.c,v 1.18 1995/07/01 01:16:55 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/tools/RCS/tiff2bw.c,v 1.19 1995/07/19 00:39:51 sam Exp $ */
34c34
< 
---
> #include <ctype.h>
66c66
< 	register int red = RED, green = GREEN, blue = BLUE;
---
> 	register uint32 red = RED, green = GREEN, blue = BLUE;
EOF-EOF-EOF
Patch tools/tiffcmp.c<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/tools/RCS/tiffcmp.c,v 1.26 1995/06/06 23:45:26 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/tools/RCS/tiffcmp.c,v 1.27 1995/07/19 00:39:51 sam Exp $ */
122,123c122,123
< 	int s, size1;
< 	uint32 row;
---
> 	tsize_t size1;
> 	uint32 s, row;
432c432
< 			int i;
---
> 			uint16 i;
EOF-EOF-EOF
Patch tools/tiffdump.c<<'EOF-EOF-EOF'
1c1
< /* $Header: /usr/people/sam/tiff/tools/RCS/tiffdump.c,v 1.43 1995/07/03 15:09:29 sam Exp $ */
---
> /* $Header: /usr/people/sam/tiff/tools/RCS/tiffdump.c,v 1.44 1995/07/19 00:39:51 sam Exp $ */
62c62
< #include "tiff.h"
---
> #include "tiffio.h"
173,176d172
< static	void TIFFSwabShort(uint16 *);
< static	void TIFFSwabLong(uint32 *);
< static	void TIFFSwabArrayOfShort(uint16 *, unsigned long);
< static	void TIFFSwabArrayOfLong(uint32 *, unsigned long);
656,703d651
< 	}
< }
< 
< static void
< TIFFSwabShort(uint16* wp)
< {
< 	register unsigned char *cp = (unsigned char *)wp;
< 	int t;
< 
< 	t = cp[1]; cp[1] = cp[0]; cp[0] = t;
< }
< 
< static void
< TIFFSwabLong(uint32* lp)
< {
< 	register unsigned char *cp = (unsigned char *)lp;
< 	int t;
< 
< 	t = cp[3]; cp[3] = cp[0]; cp[0] = t;
< 	t = cp[2]; cp[2] = cp[1]; cp[1] = t;
< }
< 
< static void
< TIFFSwabArrayOfShort(uint16* wp, unsigned long n)
< {
< 	register unsigned char *cp;
< 	register int t;
< 
< 	/* XXX unroll loop some */
< 	while (n-- > 0) {
< 		cp = (unsigned char *)wp;
< 		t = cp[1]; cp[1] = cp[0]; cp[0] = t;
< 		wp++;
< 	}
< }
< 
< static void
< TIFFSwabArrayOfLong(uint32* lp, unsigned long n)
< {
< 	register unsigned char *cp;
< 	register int t;
< 
< 	/* XXX unroll loop some */
< 	while (n-- > 0) {
< 		cp = (unsigned char *)lp;
< 		t = cp[3]; cp[3] = cp[0]; cp[0] = t;
< 		t = cp[2]; cp[2] = cp[1]; cp[1] = t;
< 		lp++;
EOF-EOF-EOF
NewFile html/v3.4beta018.html<<'EOF-EOF-EOF'
<HTML>
<HEAD>
<TITLE>
Changes in TIFF v3.4beta018
</TITLE>
</HEAD>

<BODY>

<BASEFONT SIZE=4>
<B><FONT SIZE=+3>T</FONT>IFF <FONT SIZE=+2>C</FONT>HANGE <FONT SIZE=+2>I</FONT>NFORMATION</B>
<BASEFONT SIZE=3>

<UL>
<HR SIZE=4 WIDTH=65% ALIGN=left>
<B>Current Version</B>: v3.4beta018<BR>
<B>Previous Version</B>: <A HREF=v3.4beta016.html>v3.4beta016</A><BR>
<B>Master FTP Site</B>: <A HREF="ftp://ftp.sgi.com/graphics/tiff">ftp.sgi.com (192.48.153.1), directory graphics/tiff</A><BR>
<HR SIZE=4 WIDTH=65% ALIGN=left>
</UL>

<P>
This document describes the changes made to the software between the
<I>previous</I> and <I>current</I> 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.
The following information is located here:
<UL>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
</UL>

<P><HR WIDTH=65% ALIGN=right>

<A NAME="configure"><B><FONT SIZE=+3>C</FONT>HANGES IN THE SOFTWARE CONFIGURATION:</B></A>

<UL>
<LI>configure now recognizes IRIX 6.x systems
<LI>configure now uses <TT>ENVOPTS</TT> when searching for an ANSI
   C compiler; this fixes a problem configuring the software under
   HP/UX with the native C compiler
<LI>configure now correctly recognizes memory-mapped files are supported
   under AIX
</UL>

<P><HR WIDTH=65% ALIGN=right>

<A NAME="libtiff"><B><FONT SIZE=+3>C</FONT>HANGES IN LIBTIFF:</B></A>

<UL>
<LI><TT>make install</TT> now properly installs the include files
<LI>some portability fixes from Bjorn Brox
<LI>the G3/G4 codec now warns about decoded rows that are longer than
    the image/tile width
<LI>changes from Frank Cringle to make the library work with the
    gcc-specific bounds checking software
<LI>miscellaneous fixes to <TT>TIFFPrintDirectory</TT>
<LI>bug fix to correct a problem where <TT>TIFFWriteRawStrip</TT>
    could not be used to automatically grow an image's length
</UL>

<P><HR WIDTH=65% ALIGN=right>

<A NAME="tools"><B><FONT SIZE=+3>C</FONT>HANGES IN THE TOOLS:</B></A>

<UL>
<LI>fixes from Frank Cringle to update <TT>fax2tiff</TT>
<LI>portability fixes to <TT>tiff2bw</TT> and <TT>tiffcmp</TT>
<LI><TT>tiffdump</TT> now uses the byte swapping routines in the library
</UL>

<A HREF="index.html"><IMG SRC="images/back.gif"></A> TIFF home page.<BR>

<HR>

<ADDRESS>
<A HREF="sam.html">Sam Leffler</A> / <A HREF="mailto:sam@engr.sgi.com">sam@engr.sgi.com</A>
Last updated $Date: 1995/07/19 01:54:02 $.
</ADDRESS>

</BODY>
</HTML>
EOF-EOF-EOF