Imported from libpng-0.85.tar

This commit is contained in:
Guy Schalnat
1995-12-19 03:22:19 -06:00
committed by Glenn Randers-Pehrson
parent 0f71645dfe
commit 6d76471acd
24 changed files with 3505 additions and 2324 deletions

124
pngconf.h
View File

@@ -1,10 +1,10 @@
/* pngconf.c - machine configurable file for libpng
libpng 1.0 beta 2 - version 0.81
libpng 1.0 beta 2 - version 0.85
For conditions of distribution and use, see copyright notice in png.h
Copyright (c) 1995 Guy Eric Schalnat, Group 42, Inc.
August 24, 1995
December 19, 1995
*/
/* Any machine specific code is near the front of this file, so if you
@@ -27,7 +27,7 @@
Unless this gets smaller then the size of a row (compressed),
it should not make much difference how big this is. */
#define PNG_ZBUF_SIZE 32768
#define PNG_ZBUF_SIZE 8192
/* While libpng currently uses zlib for it's compression, it has been designed
to stand on it's own. Towards this end, there are two defines that are
@@ -48,6 +48,14 @@
#define PNG_MAX_ALLOC_64K
#endif
/* this protects us against compilers which run on a windowing system
and thus don't have or would rather us not use the stdio types:
stdin, stdout, and stderr. The only one currently used is stderr
in png_error() and png_warning(). #defining PNG_NO_STDIO will
prevent these from being compiled and used. */
/* #define PNG_NO_STDIO */
/* this macro protects us against machines that don't have function
prototypes. If your compiler does not handle function prototypes,
define this macro. I've always been able to use _NO_PROTO as the
@@ -60,7 +68,7 @@
#else
#ifdef _NO_PROTO
#define PNGARG(arglist)
#define PNGARG(arglist) ()
#else
#define PNGARG(arglist) arglist
#endif /* _NO_PROTO */
@@ -129,6 +137,19 @@
#endif /* PNG_INTERNAL */
/* the following uses const char * instead of char * for error
and warning message functions, so some compilers won't complain.
If you want to use const, define PNG_USE_CONST here. It is not
normally defined to make configuration easier, as it is not a
critical part of the code.
*/
#ifdef PNG_USE_CONST
# define PNG_CONST const
#else
# define PNG_CONST
#endif
/* The following defines give you the ability to remove code
from the library that you will not be using. I wish I
could figure out how to automate this, but I can't do
@@ -144,7 +165,7 @@
*/
/* Any transformations you will not be using can be undef'ed here */
#define PNG_PROGRESSIVE_READ_SUPPORTED
#define PNG_READ_INTERLACING_SUPPORTED
#define PNG_READ_EXPAND_SUPPORTED
#define PNG_READ_SHIFT_SUPPORTED
@@ -214,25 +235,105 @@ typedef unsigned char png_byte;
change (I'm not sure if you will or not, so I thought I'd be safe) */
typedef size_t png_size_t;
/* The following is needed for medium model support. It cannot be in the
PNG_INTERNAL section. Needs modification for other compilers besides
/* The following is needed for medium model support. It cannot be in the
PNG_INTERNAL section. Needs modification for other compilers besides
MSC. Model independent support declares all arrays that might be very
large using the far keyword. The Zlib version used must also support
model independent data. As of version Zlib .95, the necessary changes
model independent data. As of version Zlib .95, the necessary changes
have been made in Zlib. The USE_FAR_KEYWORD define triggers other
changes that are needed. Most of the far keyword changes are hidden
inside typedefs with suffix "f". Tim Wegner */
#if defined(FAR) && defined(M_I86MM) /* MSC Medium model */
# define USE_FAR_KEYWORD
/* SJT: Separate compiler dependencies */
/* SJT: problem here is that zlib.h always defines FAR */
#ifdef __BORLANDC__
#if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
#define LDATA 1
#else
#define LDATA 0
#endif
#if !defined(__WIN32__) && !defined(__FLAT__)
#define PNG_MAX_MALLOC_64K
#if (LDATA != 1)
#ifndef FAR
#define FAR __far
#endif
#define USE_FAR_KEYWORD
#endif /* LDATA != 1 */
/* SJT: Possibly useful for moving data out of default segment.
Uncomment it if you want. Could also define FARDATA as const
if your compiler supports it.
# define FARDATA FAR
*/
#endif /* __WIN32__, __FLAT__ */
#endif /* __BORLANDC__ */
/* SJT: Suggest testing for specific compiler first before
testing for FAR. The Watcom compiler defines both __MEDIUM__
and M_I86MM, making reliance oncertain keywords suspect
*/
/* MSC Medium model */
#if defined(FAR)
# if defined(M_I86MM)
# define USE_FAR_KEYWORD
# define FARDATA FAR /* SJT: added */
# endif
#endif
/* SJT: default case */
#ifndef FAR
# define FAR
#endif
/* SJT: At this point FAR is always defined */
/* not used anymore, but kept for compatability */
typedef unsigned char FAR png_bytef;
/* SJT: */
#ifndef FARDATA
#define FARDATA
#endif
/* End medium model changes to be in zconf.h */
/* SJT: More typedefs */
typedef void FAR * png_voidp;
/* SJT: Add typedefs for pointers */
typedef png_byte FAR * png_bytep;
typedef png_uint_32 FAR * png_uint_32p;
typedef png_int_32 FAR * png_int_32p;
typedef png_uint_16 FAR * png_uint_16p;
typedef png_int_16 FAR * png_int_16p;
typedef PNG_CONST char FAR * png_const_charp;
typedef char FAR * png_charp;
/* SJT: Pointers to pointers; i.e. arrays */
typedef png_byte FAR * FAR * png_bytepp;
typedef png_uint_32 FAR * FAR * png_uint_32pp;
typedef png_int_32 FAR * FAR * png_int_32pp;
typedef png_uint_16 FAR * FAR * png_uint_16pp;
typedef png_int_16 FAR * FAR * png_int_16pp;
typedef PNG_CONST char FAR * FAR * png_const_charpp;
typedef char FAR * FAR * png_charpp;
/* SJT: libpng typedefs for types in zlib. If Zlib changes
or another compression library is used, then change these.
Eliminates need to change all the source files.
*/
typedef charf * png_zcharp;
typedef charf * FAR * png_zcharpp;
typedef z_stream * png_zstreamp; /* zlib won't accept far z_stream */
/* User may want to use these so not in PNG_INTERNAL. Any library functions
that are passed far data must be model independent. */
#if defined(USE_FAR_KEYWORD) /* memory model independent fns */
@@ -240,6 +341,7 @@ typedef unsigned char FAR png_bytef;
# define png_strcat _fstrcat
# define png_strlen _fstrlen
# define png_strcmp _fstrcmp
# define png_memcmp _fmemcmp /* SJT: added */
# define png_memcpy _fmemcpy
# define png_memset _fmemset
#else /* use the usual functions */
@@ -247,11 +349,11 @@ typedef unsigned char FAR png_bytef;
# define png_strcat strcat
# define png_strlen strlen
# define png_strcmp strcmp
# define png_memcmp memcmp /* SJT: added */
# define png_memcpy memcpy
# define png_memset memset
#endif
/* End of memory model independent support */
#endif /* PNGCONF_H */