Commit 714c830e authored by Dhanannjay Deo's avatar Dhanannjay Deo Committed by Ben Boeckel

vtktiff: remove old import

parent 4a25e5c6
PROJECT(VTKTIFF)
INCLUDE_REGULAR_EXPRESSION("^(tif|fax|port|uv|vtk|tconf|t4|mk|z).*$")
INCLUDE_DIRECTORIES(BEFORE ${VTKTIFF_SOURCE_DIR})
INCLUDE_DIRECTORIES(BEFORE ${VTKTIFF_BINARY_DIR})
# library object files common to compression and decompression
SET(common_SRCS
tif_aux.c tif_close.c
tif_codec.c tif_compress.c tif_dir.c tif_dirinfo.c tif_dirread.c
tif_dirwrite.c tif_dumpmode.c tif_error.c tif_fax3.c tif_flush.c
tif_getimage.c tif_jpeg.c tif_luv.c tif_lzw.c tif_next.c
tif_ojpeg.c tif_open.c tif_packbits.c tif_pixarlog.c tif_predict.c
tif_print.c tif_read.c tif_strip.c tif_swab.c tif_thunder.c tif_tile.c
tif_version.c tif_warning.c
tif_write.c tif_zip.c tif_color.c tif_extension.c )
ADD_DEFINITIONS( -DJPEG_SUPPORT -DZIP_SUPPORT -D_HPUX_SOURCE)
IF(WIN32)
IF(BUILD_SHARED_LIBS)
SET(TIFFDLL 1)
ELSE()
SET(TIFFSTATIC 1)
ENDIF()
ENDIF()
IF (BORLAND)
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-8004 -w-8057")
ENDIF ()
IF(NOT UNIX)
ADD_DEFINITIONS( -DTIF_PLATFORM_CONSOLE )
SET(common_SRCS ${common_SRCS} tif_win32.c fax3sm_winnt.c)
IF(BUILD_SHARED_LIBS)
IF (NOT BORLAND)
IF(NOT MINGW)
SET(common_SRCS ${common_SRCS} vtktiff.def)
ENDIF()
ENDIF()
ENDIF()
ELSE ()
SET(common_SRCS ${common_SRCS} tif_unix.c tif_fax3sm.c)
IF(NOT CMAKE_CROSSCOMPILING)
ADD_EXECUTABLE(vtkmkg3states mkg3states.c)
vtk_compile_tools_target(vtkmkg3states)
ADD_CUSTOM_COMMAND(
OUTPUT ${VTKTIFF_BINARY_DIR}/tif_fax3sm.c
COMMAND vtkmkg3states
ARGS -c const ${VTKTIFF_BINARY_DIR}/tif_fax3sm.c
DEPENDS vtkmkg3states)
ENDIF()
ENDIF ()
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
# Check if header file exists and add it to the list.
CHECK_INCLUDE_FILES("assert.h" HAVE_ASSERT_H)
CHECK_INCLUDE_FILES("dlfcn.h" HAVE_DLFCN_H)
CHECK_INCLUDE_FILES("fcntl.h" HAVE_FCNTL_H)
CHECK_INCLUDE_FILES("inttypes.h" HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES("limits.h" HAVE_LIMITS_H)
CHECK_INCLUDE_FILES("malloc.h" HAVE_MALLOC_H)
CHECK_INCLUDE_FILES("memory.h" HAVE_MEMORY_H)
CHECK_INCLUDE_FILES("search.h" HAVE_SEARCH_H)
CHECK_INCLUDE_FILES("stdint.h" HAVE_STDINT_H)
CHECK_INCLUDE_FILES("stdlib.h" HAVE_STDLIB_H)
CHECK_INCLUDE_FILES("string.h" HAVE_STRING_H)
CHECK_INCLUDE_FILES("strings.h" HAVE_STRINGS_H)
CHECK_INCLUDE_FILES("sys/stat.h" HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILES("sys/time.h" HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILES("sys/types.h" HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES("unistd.h" HAVE_UNISTD_H)
CHECK_INCLUDE_FILES("windows.h" HAVE_WINDOWS_H)
CHECK_INCLUDE_FILES("strings.h" HAVE_STRINGS_H)
CHECK_INCLUDE_FILES("ieeefp.h" HAVE_IEEEFP_H)
CHECK_FUNCTION_EXISTS(floor HAVE_FLOOR)
CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
CHECK_FUNCTION_EXISTS(isascii HAVE_ISASCII)
CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE)
CHECK_FUNCTION_EXISTS(memset HAVE_MEMSET)
CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
CHECK_FUNCTION_EXISTS(pow HAVE_POW)
CHECK_FUNCTION_EXISTS(sqrt HAVE_SQRT)
CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
CHECK_FUNCTION_EXISTS(strchr HAVE_STRCHR)
CHECK_FUNCTION_EXISTS(strrchr HAVE_STRRCHR)
CHECK_FUNCTION_EXISTS(strstr HAVE_STRSTR)
CHECK_FUNCTION_EXISTS(strtol HAVE_STRTOL)
CHECK_FUNCTION_EXISTS(strtoul HAVE_STRTOUL)
INCLUDE(CheckTypeSize)
CHECK_TYPE_SIZE("int" SIZEOF_INT)
CHECK_TYPE_SIZE("long" SIZEOF_LONG)
CONFIGURE_FILE(${VTKTIFF_SOURCE_DIR}/tiffDllConfig.h.in
${VTKTIFF_BINARY_DIR}/tiffDllConfig.h)
CONFIGURE_FILE(${VTKTIFF_SOURCE_DIR}/tif_config.h.in
${VTKTIFF_BINARY_DIR}/tif_config.h)
VTK_ADD_LIBRARY(vtktiff ${common_SRCS})
TARGET_LINK_LIBRARIES( vtktiff ${vtkzlib_LIBRARIES} ${vtkjpeg_LIBRARIES} )
# link against the math library
IF(UNIX)
TARGET_LINK_LIBRARIES(vtktiff -lm)
ENDIF()
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
INSTALL(FILES
${VTKTIFF_BINARY_DIR}/tiffDllConfig.h
${VTKTIFF_SOURCE_DIR}/tiffvers.h
${VTKTIFF_SOURCE_DIR}/vtk_tiff_mangle.h
${VTKTIFF_SOURCE_DIR}/tiff.h
${VTKTIFF_SOURCE_DIR}/tiffio.h
${VTKTIFF_SOURCE_DIR}/tconf.h
${VTKTIFF_SOURCE_DIR}/tiffconf.h
DESTINATION ${VTK_INSTALL_INCLUDE_DIR}/vtktiff
COMPONENT Development)
ENDIF()
Header
TIFF Software Distribution
--------------------------
This file is just a placeholder; all the documentation is now in
HTML in the html directory. To view the documentation point your
favorite WWW viewer at html/index.html; e.g.
netscape html/index.html
If you don't have an HTML viewer then you can read the HTML source
or fetch a PostScript version of this documentation from the directory
ftp://ftp.remotesensing.org/pub/libtiff/
If you can't hack either of these options then basically what you
want to do is:
% ./configure
% make
% su
# make install
More information, email contacts, and mailing list information can be
found online at http://www.libtiff.org/.
Use and Copyright
-----------------
Silicon Graphics has seen fit to allow us to give this work away. It
is free. There is no support or guarantee of any sort as to its
operations, correctness, or whatever. If you do anything useful with
all or parts of it you need to honor the copyright notices. I would
also be interested in knowing about it and, hopefully, be acknowledged.
The legal way of saying that is:
Copyright (c) 1988-1997 Sam Leffler
Copyright (c) 1991-1997 Silicon Graphics, Inc.
Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee, provided
that (i) the above copyright notices and this permission notice appear in
all copies of the software and related documentation, and (ii) the names of
Sam Leffler and Silicon Graphics may not be used in any advertising or
publicity relating to the software without the specific, prior written
permission of Sam Leffler and Silicon Graphics.
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
OF THIS SOFTWARE.
This directory contains a subset of libtiff from www.libtiff.org
Modifications
-------------
* It uses CMake
some "gamma" local variable has been renamed to gamma2 to avoid shadowing
gamma BSD function.
#! /bin/sh
# Header
if test -r tiff.alpha; then
ALPHA=`cat tiff.alpha`; rm -f tiff.alpha
echo "$ALPHA" | awk '{ printf "define ALPHA %1d\n", $3+1}' > tiff.alpha
else
echo "define ALPHA 001" >tiff.alpha
fi
#! /bin/sh
# Header
#
# TIFF Software
#
# Copyright (c) 1994-1996 Sam Leffler
# Copyright (c) 1994-1996 Silicon Graphics, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
# all copies of the software and related documentation, and (ii) the names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
#
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#
rm -f tiff.version
awk '
{ print "define TIFF_VNUM \"" $1 " (" $2 ")\"" }
' ../VERSION > tiff.version
# Header
#
# TIFF Software
#
# Copyright (c) 1994-1997 Sam Leffler
# Copyright (c) 1994-1997 Silicon Graphics, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and
# its documentation for any purpose is hereby granted without fee, provided
# that (i) the above copyright notices and this permission notice appear in
# all copies of the software and related documentation, and (ii) the names of
# Sam Leffler and Silicon Graphics may not be used in any advertising or
# publicity relating to the software without the specific, prior written
# permission of Sam Leffler and Silicon Graphics.
#
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
#
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
#
define CUR_MAJ_VERS 1006 # Major Version number
define CUR_MIN_VERS 001 # Minor Version number
define CUR_VERS ${CUR_MAJ_VERS}${CUR_MIN_VERS}${ALPHA}
define TIFF_NAME "TIFF"
include tiff.version
include tiff.alpha
product tiff
id "${TIFF_NAME} Tools, Version ${TIFF_VNUM}"
inplace
image sw
id "${TIFF_NAME} Software"
version "${CUR_VERS}"
subsys tools default
id "${TIFF_NAME} Tools & Library DSO"
exp "tiff.sw.tools"
endsubsys
subsys dev
id "${TIFF_NAME} Developement Software"
exp "tiff.sw.dev"
endsubsys
endimage
image man
id "${TIFF_NAME} Documentation"
version "${CUR_VERS}"
subsys tools default
id "${TIFF_NAME} Tools Manual Pages"
exp "tiff.man.tools"
endsubsys
subsys dev
id "${TIFF_NAME} Library Manual Pages"
exp "tiff.man.dev"
endsubsys
subsys html
id "${TIFF_NAME} HTML Materials"
exp "tiff.man.html"
endsubsys
endimage
endproduct
This diff is collapsed.
This diff is collapsed.
/*
* Warning, this file was automatically created by the TIFF configure script
* VERSION: v3.5.7
* RELEASE:
* DATE: Mon Dec 17 13:18:52 EST 2001
* TARGET: i686-pc-linux-gnu
* CCOMPILER: /usr/bin/gcc3-3.0.1-3)
*/
#ifndef _PORT_
#define _PORT_ 1
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/types.h>
#define HOST_FILLORDER FILLORDER_MSB2LSB
#ifdef VTK_WORDS_BIGENDIAN
#define HOST_BIGENDIAN 1
#else
#define HOST_BIGENDIAN 0
#endif
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
typedef double dblparam_t;
#ifdef __STRICT_ANSI__
#define INLINE __inline__
#else
#define INLINE inline
#endif
#define GLOBALDATA(TYPE,NAME) extern TYPE NAME
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
#include <vtktiff/tiffDllConfig.h>
/* Compile with -DTIFFDLL for Windows DLL support */
#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
#endif
#if defined(TIFFDLL)
# if defined(_WINDOWS) || defined(WINDOWS)
# ifdef FAR
# undef FAR
# endif
# include <windows.h>
# define TEXPORT WINAPI
# ifdef WIN32
# define TEXPORTVA WINAPIV
# else
# define TEXPORTVA FAR _cdecl _export
# endif
# endif
# if defined (__BORLANDC__)
# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
# include <windows.h>
/*
# define TEXPORT __declspec(dllexport) WINAPI
# define TEXPORTRVA __declspec(dllexport) WINAPIV
*/
# define TEXPORT _cdecl _export
# define TEXPORTRVA _cdecl _export
# else
# if defined (_Windows) && defined (__DLL__)
# define TEXPORT _export
# define TEXPORTVA _export
# endif
# endif
# endif
#endif
#ifndef TEXPORT
# define TEXPORT
#endif
#ifndef TEXPORTVA
# define TEXPORTVA
#endif
#ifndef TEXTERN
# define TEXTERN extern
#endif
#ifndef FAR
# define FAR
#endif
This diff is collapsed.
/* Header */
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
/*
* TIFF Library Macintosh-specific routines.
*
* These routines use only Toolbox and high-level File Manager traps.
* They make no calls to the THINK C "unix" compatibility library. Also,
* malloc is not used directly but it is still referenced internally by
* the ANSI library in rare cases. Heap fragmentation by the malloc ring
* buffer is therefore minimized.
*
* O_RDONLY and O_RDWR are treated identically here. The tif_mode flag is
* checked in TIFFWriteCheck().
*
* Create below fills in a blank creator signature and sets the file type
* to 'TIFF'. It is much better for the application to do this by Create'ing
* the file first and TIFFOpen'ing it later.
* ---------
* This code has been "Carbonized", and may not work with older MacOS versions.
* If so, grab the tif_apple.c out of an older libtiff distribution, like
* 3.5.5 from www.libtiff.org.
*/
#include "tiffiop.h"
#include <Errors.h>
#include <Files.h>
#include <Memory.h>
#include <Script.h>
#if defined(__PPCC__) || defined(__SC__) || defined(__MRC__) || defined(applec)
#define CtoPstr c2pstr
#endif
static tsize_t
_tiffReadProc(thandle_t fd, tdata_t buf, tsize_t size)
{
return (FSRead((short) fd, (long*) &size, (char*) buf) == noErr ?
size : (tsize_t) -1);
}
static tsize_t
_tiffWriteProc(thandle_t fd, tdata_t buf, tsize_t size)
{
return (FSWrite((short) fd, (long*) &size, (char*) buf) == noErr ?
size : (tsize_t) -1);
}
static toff_t
_tiffSeekProc(thandle_t fd, toff_t off, int whence)
{
long fpos, size;
if (GetEOF((short) fd, &size) != noErr)
return EOF;
(void) GetFPos((short) fd, &fpos);
switch (whence) {
case SEEK_CUR:
if (off + fpos > size)
SetEOF((short) fd, off + fpos);
if (SetFPos((short) fd, fsFromMark, off) != noErr)
return EOF;
break;
case SEEK_END:
if (off > 0)
SetEOF((short) fd, off + size);
if (SetFPos((short) fd, fsFromStart, off + size) != noErr)
return EOF;
break;
case SEEK_SET:
if (off > size)
SetEOF((short) fd, off);
if (SetFPos((short) fd, fsFromStart, off) != noErr)
return EOF;
break;
}
return (toff_t)(GetFPos((short) fd, &fpos) == noErr ? fpos : EOF);
}
static int
_tiffMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize)
{
return (0);
}
static void
_tiffUnmapProc(thandle_t fd, tdata_t base, toff_t size)
{
}
static int
_tiffCloseProc(thandle_t fd)
{
return (FSClose((short) fd));
}
static toff_t
_tiffSizeProc(thandle_t fd)
{
long size;
if (GetEOF((short) fd, &size) != noErr) {
TIFFErrorExt(fd, "_tiffSizeProc", "%s: Cannot get file size");
return (-1L);
}
return ((toff_t) size);
}
/*
* Open a TIFF file descriptor for read/writing.
*/
TIFF*
TIFFFdOpen(int fd, const char* name, const char* mode)
{
TIFF* tif;
tif = TIFFClientOpen(name, mode, (thandle_t) fd,
_tiffReadProc, _tiffWriteProc, _tiffSeekProc, _tiffCloseProc,
_tiffSizeProc, _tiffMapProc, _tiffUnmapProc);
if (tif)
tif->tif_fd = fd;
return (tif);
}
static void ourc2pstr( char* inString )
{
int sLen = strlen( inString );
BlockMoveData( inString, &inString[1], sLen );
inString[0] = sLen;
}
/*
* Open a TIFF file for read/writing.
*/
TIFF*
TIFFOpen(const char* name, const char* mode)
{
static const char module[] = "TIFFOpen";
Str255 pname;
FInfo finfo;
short fref;
OSErr err;
FSSpec fSpec;
strcpy((char*) pname, name);
ourc2pstr((char*) pname);
err = FSMakeFSSpec( 0, 0, pname, &fSpec );
switch (_TIFFgetMode(mode, module)) {
default:
return ((TIFF*) 0);
case O_RDWR | O_CREAT | O_TRUNC:
if (FSpGetFInfo(&fSpec, &finfo) == noErr)
FSpDelete(&fSpec);
/* fall through */
case O_RDWR | O_CREAT:
if ((err = FSpGetFInfo(&fSpec, &finfo)) == fnfErr) {
if (FSpCreate(&fSpec, ' ', 'TIFF', smSystemScript) != noErr)
goto badCreate;
if (FSpOpenDF(&fSpec, fsRdWrPerm, &fref) != noErr)
goto badOpen;
} else if (err == noErr) {
if (FSpOpenDF(&fSpec, fsRdWrPerm, &fref) != noErr)
goto badOpen;
} else
goto badOpen;
break;
case O_RDONLY:
if (FSpOpenDF(&fSpec, fsRdPerm, &fref) != noErr)
goto badOpen;
break;
case O_RDWR:
if (FSpOpenDF(&fSpec, fsRdWrPerm, &fref) != noErr)
goto badOpen;
break;
}
return (TIFFFdOpen((int) fref, name, mode));
badCreate:
TIFFErrorExt(0, module, "%s: Cannot create", name);
return ((TIFF*) 0);
badOpen:
TIFFErrorExt(0, module, "%s: Cannot open", name);
return ((TIFF*) 0);
}
void
_TIFFmemset(tdata_t p, int v, tsize_t c)
{
memset(p, v, (size_t) c);
}
void
_TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c)
{
memcpy(d, s, (size_t) c);
}
int
_TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c)
{
return (memcmp(p1, p2, (size_t) c));
}
tdata_t
_TIFFmalloc(tsize_t s)
{
return (NewPtr((size_t) s));
}
void
_TIFFfree(tdata_t p)
{
DisposePtr(p);
}
tdata_t
_TIFFrealloc(tdata_t p, tsize_t s)
{
Ptr n = p;
SetPtrSize(p, (size_t) s);
if (MemError() && (n = NewPtr((size_t) s)) != NULL) {
BlockMove(p, n, GetPtrSize(p));
DisposePtr(p);
}
return ((tdata_t) n);
}
static void
appleWarningHandler(const char* module, const char* fmt, va_list ap)
{
if (module != NULL)
fprintf(stderr, "%s: ", module);
fprintf(stderr, "Warning, ");
vfprintf(stderr, fmt, ap);
fprintf(stderr, ".\n");
}
TIFFErrorHandler _TIFFwarningHandler = appleWarningHandler;
static void
appleErrorHandler(const char* module, const char* fmt, va_list ap)
{
if (module != NULL)
fprintf(stderr, "%s: ", module);
vfprintf(stderr, fmt, ap);
fprintf(stderr, ".\n");
}
TIFFErrorHandler _TIFFerrorHandler = appleErrorHandler;
/* "Header" */
/*
* Copyright (c) 1988-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,