updated for new version of png (dirkpitt)

ver1_5_1
Hank Ramsey 2005-01-20 07:30:26 +00:00
parent cb33fb3d50
commit 00704755ba
2 changed files with 464 additions and 139 deletions

View File

@ -1,15 +1,14 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.2.1 - December 12, 2001
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
* libpng version 1.2.8 - December 3, 2004
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.2.1 - December 12, 2001: Glenn
* libpng versions 0.97, January 1998, through 1.2.8 - December 3, 2004: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@ -81,6 +80,37 @@
* 1.2.1beta1-4 3 10201 3.1.2.1beta1-4
* 1.2.1rc1-2 3 10201 3.1.2.1rc1-2
* 1.2.1 3 10201 3.1.2.1
* 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6
* 1.0.13beta1 10 10013 10.so.0.1.0.13beta1
* 1.0.13rc1 10 10013 10.so.0.1.0.13rc1
* 1.2.2rc1 12 10202 12.so.0.1.2.2rc1
* 1.0.13 10 10013 10.so.0.1.0.13
* 1.2.2 12 10202 12.so.0.1.2.2
* 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6
* 1.2.3 12 10203 12.so.0.1.2.3
* 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3
* 1.0.14rc1 13 10014 10.so.0.1.0.14rc1
* 1.2.4rc1 13 10204 12.so.0.1.2.4rc1
* 1.0.14 10 10014 10.so.0.1.0.14
* 1.2.4 13 10204 12.so.0.1.2.4
* 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2
* 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3
* 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3
* 1.0.15 10 10015 10.so.0.1.0.15
* 1.2.5 13 10205 12.so.0.1.2.5
* 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4
* 1.0.16 10 10016 10.so.0.1.0.16
* 1.2.6 13 10206 12.so.0.1.2.6
* 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2
* 1.0.17rc1 10 10017 12.so.0.1.0.17rc1
* 1.2.7rc1 13 10207 12.so.0.1.2.7rc1
* 1.0.17 10 10017 12.so.0.1.0.17
* 1.2.7 13 10207 12.so.0.1.2.7
* 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5
* 1.0.18rc1-5 10 10018 12.so.0.1.0.18rc1-5
* 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5
* 1.0.18 10 10018 12.so.0.1.0.18
* 1.2.8 13 10208 12.so.0.1.2.8
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@ -100,8 +130,8 @@
* in binary compatibility (e.g., when a new feature is added).
*
* See libpng.txt or libpng.3 for more information. The PNG specification
* is available as RFC 2083 <ftp://ftp.uu.net/graphics/png/documents/>
* and as a W3C Recommendation <http://www.w3.org/TR/REC.png.html>
* is available as a W3C Recommendation and as an ISO Specification,
* <http://www.w3.org/TR/2003/REC-PNG-20031110/
*/
/*
@ -110,10 +140,17 @@
* If you modify libpng you may insert additional notices immediately following
* this sentence.
*
* libpng versions 1.0.7, July 1, 2000, through 1.2.1, December 12, 2001, are
* Copyright (c) 2000, 2001 Glenn Randers-Pehrson, and are
* libpng versions 1.2.6, August 15, 2004, through 1.2.8, December 3, 2004, are
* Copyright (c) 2004 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
*
* Cosmin Truta
*
* libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are
* Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.0.6
* with the following individuals added to the list of Contributing Authors
* with the following individuals added to the list of Contributing Authors:
*
* Simon-Pierre Cadieux
* Eric S. Raymond
@ -129,8 +166,8 @@
* the user.
*
* libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
* Distributed according to the same disclaimer and license as libpng-0.96,
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-0.96,
* with the following individuals added to the list of Contributing Authors:
*
* Tom Lane
@ -215,13 +252,13 @@
* Y2K compliance in libpng:
* =========================
*
* December 12, 2001
* December 3, 2004
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
* This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.2.1 are Y2K compliant. It is my belief that earlier
* upward through 1.2.8 are Y2K compliant. It is my belief that earlier
* versions were also Y2K compliant.
*
* Libpng only has three year fields. One is a 2-byte unsigned integer
@ -277,43 +314,81 @@
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.2.1"
#define PNG_LIBPNG_VER_STRING "1.2.8"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.2.8 - December 3, 2004 (header)\n"
#define PNG_LIBPNG_VER_SONUM 3
#define PNG_LIBPNG_VER_DLLNUM %DLLNUM%
#define PNG_LIBPNG_VER_SONUM 0
#define PNG_LIBPNG_VER_DLLNUM 13
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 2
#define PNG_LIBPNG_VER_RELEASE 1
#define PNG_LIBPNG_VER_RELEASE 8
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
#define PNG_LIBPNG_VER_BUILD 0
/* Release Status */
#define PNG_LIBPNG_BUILD_ALPHA 1
#define PNG_LIBPNG_BUILD_BETA 2
#define PNG_LIBPNG_BUILD_RC 3
#define PNG_LIBPNG_BUILD_STABLE 4
#define PNG_LIBPNG_BUILD_TYPEMASK 7
#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with STABLE only */
#define PNG_LIBPNG_BUILD_TYPE 4
#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7
/* Release-Specific Flags */
#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with
PNG_LIBPNG_BUILD_STABLE only */
#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with
PNG_LIBPNG_BUILD_SPECIAL */
#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
PNG_LIBPNG_BUILD_PRIVATE */
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
* We must not include leading zeros.
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */
#define PNG_LIBPNG_VER 10201 /* 1.2.1 */
#define PNG_LIBPNG_VER 10208 /* 1.2.8 */
#ifndef PNG_VERSION_INFO_ONLY
/* include the compression library's header */
#include "zlib.h"
#endif
/* include all user configurable info, including optional assembler routines */
#include "pngconf.h"
/*
* Added at libpng-1.2.8 */
/* Ref MSDN: Private as priority over Special
* VS_FF_PRIVATEBUILD File *was not* built using standard release
* procedures. If this value is given, the StringFileInfo block must
* contain a PrivateBuild string.
*
* VS_FF_SPECIALBUILD File *was* built by the original company using
* standard release procedures but is a variation of the standard
* file of the same version number. If this value is given, the
* StringFileInfo block must contain a SpecialBuild string.
*/
#if defined(PNG_USER_PRIVATEBUILD)
# define PNG_LIBPNG_BUILD_TYPE PNG_LIBPNG_BUILD_BASE_TYPE | \
PNG_LIBPNG_BUILD_PRIVATE
#else
# if defined(PNG_LIBPNG_SPECIALBUILD)
# define PNG_LIBPNG_BUILD_TYPE PNG_LIBPNG_BUILD_BASE_TYPE | \
PNG_LIBPNG_BUILD_SPECIAL
# else
# define PNG_LIBPNG_BUILD_TYPE PNG_LIBPNG_BUILD_BASE_TYPE
# endif
#endif
#ifndef PNG_VERSION_INFO_ONLY
/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
#ifdef __cplusplus
extern "C" {
@ -366,7 +441,7 @@ extern "C" {
*/
#ifdef PNG_USE_GLOBAL_ARRAYS
PNG_EXPORT_VAR (const char) png_libpng_ver[18];
/* need room for 99.99.99beta99z*/
/* need room for 99.99.99beta99z */
#else
#define png_libpng_ver png_get_header_ver(NULL)
#endif
@ -592,7 +667,7 @@ typedef struct png_info_struct
png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
/* The following is informational only on read, and not used on writes. */
png_byte channels; /* number of data channels per pixel (1, 2, 3, 4)*/
png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */
png_byte pixel_depth; /* number of bits per pixel */
png_byte spare_byte; /* to align the data, and for future use */
png_byte signature[8]; /* magic bytes read by libpng from start of file */
@ -816,7 +891,11 @@ typedef png_info FAR * png_infop;
typedef png_info FAR * FAR * png_infopp;
/* Maximum positive integer used in PNG is (2^31)-1 */
#define PNG_MAX_UINT ((png_uint_32)0x7fffffffL)
#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL)
#define PNG_UINT_32_MAX ((png_uint_32)(-1))
#define PNG_SIZE_MAX ((png_size_t)(-1))
/* PNG_MAX_UINT is deprecated; use PNG_UINT_31_MAX instead. */
#define PNG_MAX_UINT PNG_UINT_31_MAX
/* These describe the color_type field in png_info. */
/* color type masks */
@ -882,7 +961,7 @@ typedef png_info FAR * FAR * png_infopp;
#define PNG_KEYWORD_MAX_LENGTH 79
/* Maximum number of entries in PLTE/sPLT/tRNS arrays */
#define PNG_MAX_PALETTE_LENGTH 256
#define PNG_MAX_PALETTE_LENGTH 256
/* These determine if an ancillary chunk's data has been successfully read
* from the PNG header, or if the application has filled in the corresponding
@ -1001,7 +1080,7 @@ struct png_struct_def
png_voidp error_ptr; /* user supplied struct for error functions */
png_rw_ptr write_data_fn; /* function for writing output data */
png_rw_ptr read_data_fn; /* function for reading input data */
png_voidp io_ptr; /* ptr to application struct for I/O functions*/
png_voidp io_ptr; /* ptr to application struct for I/O functions */
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
png_user_transform_ptr read_user_transform_fn; /* user read transform */
@ -1215,7 +1294,11 @@ struct png_struct_def
defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
/* changed from png_byte to png_uint_32 at version 1.2.0 */
#ifdef PNG_1_0_X
png_byte mng_features_permitted;
#else
png_uint_32 mng_features_permitted;
#endif /* PNG_1_0_X */
#endif
/* New member added in libpng-1.0.7 */
@ -1228,13 +1311,13 @@ struct png_struct_def
png_byte filter_type;
#endif
#if defined(PNG_DEBUG) && defined(PNG_USE_PNGGCCRD)
#if defined(PNG_1_0_X) || (defined(PNG_DEBUG) && defined(PNG_USE_PNGGCCRD))
/* New member added in libpng-1.0.10, ifdef'ed out in 1.2.0 */
png_uint_32 row_buf_size;
#endif
/* New members added in libpng-1.2.0 */
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
#if !defined(PNG_1_0_X) && defined(PNG_ASSEMBLER_CODE_SUPPORTED)
png_byte mmx_bitdepth_threshold;
png_uint_32 mmx_rowbytes_threshold;
png_uint_32 asm_flags;
@ -1247,15 +1330,33 @@ struct png_struct_def
png_free_ptr free_fn; /* function for freeing memory */
#endif
/* New member added in libpng-1.0.13 and 1.2.0 */
png_bytep big_row_buf; /* buffer to save current (unfiltered) row */
#if defined(PNG_READ_DITHER_SUPPORTED)
/* The following three members were added at version 1.0.14 and 1.2.4 */
png_bytep dither_sort; /* working sort array */
png_bytep index_to_palette; /* where the original index currently is */
/* in the palette */
png_bytep palette_to_index; /* which original index points to this */
/* palette color */
#endif
/* New members added in libpng-1.0.16 and 1.2.6 */
png_byte compression_type;
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
png_uint_32 user_width_max;
png_uint_32 user_height_max;
#endif
};
/* This prevents a compiler error in png_get_copyright() in png.c if png.c
and png.h are both at version 1.2.1
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef png_structp version_1_2_1;
typedef png_structp version_1_2_8;
typedef png_struct FAR * FAR * png_structpp;
@ -1297,11 +1398,15 @@ extern PNG_EXPORT(png_structp,png_create_write_struct)
PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
png_error_ptr error_fn, png_error_ptr warn_fn));
#ifdef PNG_WRITE_SUPPORTED
extern PNG_EXPORT(png_uint_32,png_get_compression_buffer_size)
PNGARG((png_structp png_ptr));
#endif
#ifdef PNG_WRITE_SUPPORTED
extern PNG_EXPORT(void,png_set_compression_buffer_size)
PNGARG((png_structp png_ptr, png_uint_32 size));
#endif
/* Reset the compression stream */
extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr));
@ -1339,7 +1444,9 @@ extern PNG_EXPORT(png_infop,png_create_info_struct)
/* Initialize the info structure (old interface - DEPRECATED) */
extern PNG_EXPORT(void,png_info_init) PNGARG((png_infop info_ptr));
#define png_info_init(info_ptr) png_info_init_3(&info_ptr, sizeof(png_info));
#undef png_info_init
#define png_info_init(info_ptr) png_info_init_3(&info_ptr,\
png_sizeof(png_info));
extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr,
png_size_t png_info_struct_size));
@ -1349,9 +1456,11 @@ extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr,
extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr,
png_infop info_ptr));
#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
/* read the information before the actual image data. */
extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr,
png_infop info_ptr));
#endif
#if defined(PNG_TIME_RFC1123_SUPPORTED)
extern PNG_EXPORT(png_charp,png_convert_to_rfc1123)
@ -1419,12 +1528,17 @@ extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr));
#endif
#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
/* Add a filler byte to 24-bit RGB images. */
/* Add a filler byte to 8-bit Gray or 24-bit RGB images. */
extern PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr,
png_uint_32 filler, int flags));
/* The values of the PNG_FILLER_ defines should NOT be changed */
#define PNG_FILLER_BEFORE 0
#define PNG_FILLER_AFTER 1
/* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */
#if !defined(PNG_1_0_X)
extern PNG_EXPORT(void,png_set_add_alpha) PNGARG((png_structp png_ptr,
png_uint_32 filler, int flags));
#endif
#endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
@ -1514,18 +1628,24 @@ extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr));
extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr,
png_infop info_ptr));
/* read a one or more rows of image data.*/
#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
/* read one or more rows of image data. */
extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr,
png_bytepp row, png_bytepp display_row, png_uint_32 num_rows));
#endif
/* read a row of data.*/
#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
/* read a row of data. */
extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr,
png_bytep row,
png_bytep display_row));
#endif
#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
/* read the whole image into memory at once. */
extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr,
png_bytepp image));
#endif
/* write a row of image data */
extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr,
@ -1543,9 +1663,11 @@ extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr,
extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr,
png_infop info_ptr));
#ifndef PNG_NO_SEQUENTIAL_READ_SUPPORTED
/* read the end of the PNG file. */
extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr,
png_infop info_ptr));
#endif
/* free any memory associated with the png_info_struct */
extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr,
@ -1563,9 +1685,6 @@ extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr,
extern PNG_EXPORT(void,png_destroy_write_struct)
PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr));
/* free any memory used in info_ptr struct (old method - NOT DLL EXPORTED) */
extern void png_write_destroy_info PNGARG((png_infop info_ptr));
/* free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */
extern void png_write_destroy PNGARG((png_structp png_ptr));
@ -1807,9 +1926,26 @@ extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr,
extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr,
png_uint_32 size));
#if defined(PNG_1_0_X)
# define png_malloc_warn png_malloc
#else
/* Added at libpng version 1.2.4 */
extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr,
png_uint_32 size));
#endif
/* frees a pointer allocated by png_malloc() */
extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr));
#if defined(PNG_1_0_X)
/* Function to allocate memory for zlib. */
extern PNG_EXPORT(voidpf,png_zalloc) PNGARG((voidpf png_ptr, uInt items,
uInt size));
/* Function to free memory for zlib */
extern PNG_EXPORT(void,png_zfree) PNGARG((voidpf png_ptr, voidpf ptr));
#endif
/* Free data that was allocated internally */
extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr,
png_infop info_ptr, png_uint_32 free_me, int num));
@ -1858,19 +1994,19 @@ extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr,
/* Fatal error in PNG image of libpng - can't continue */
extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr,
png_const_charp error));
png_const_charp error_message));
/* The same, but the chunk name is prepended to the error string. */
extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr,
png_const_charp error));
png_const_charp error_message));
/* Non-fatal error in libpng. Can continue, but may have a problem. */
extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr,
png_const_charp message));
png_const_charp warning_message));
/* Non-fatal error in libpng, chunk name is prepended to message. */
extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr,
png_const_charp message));
png_const_charp warning_message));
/* The png_set_<chunk> functions are for storing values in the png_info_struct.
* Similarly, the png_get_<chunk> calls are used to read values from the
@ -2217,6 +2353,10 @@ extern PNG_EXPORT(void, png_set_unknown_chunk_location)
extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp
png_ptr, png_infop info_ptr, png_unknown_chunkpp entries));
#endif
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep
chunk_name));
#endif
/* Png_free_data() will turn off the "valid" flag for anything it frees.
If you need to turn it off for a chunk that your application has freed,
@ -2299,17 +2439,23 @@ extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp
png_ptr, png_uint_32 mng_features_permitted));
#endif
/* For use in png_set_keep_unknown, added to version 1.2.6 */
#define PNG_HANDLE_CHUNK_AS_DEFAULT 0
#define PNG_HANDLE_CHUNK_NEVER 1
#define PNG_HANDLE_CHUNK_IF_SAFE 2
#define PNG_HANDLE_CHUNK_ALWAYS 3
/* Added to version 1.2.0 */
#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01 /* not user-settable */
#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02 /* not user-settable */
#define PNG_ASM_FLAG_MMX_SUPPORT_COMPILED 0x01 /* not user-settable */
#define PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU 0x02 /* not user-settable */
#define PNG_ASM_FLAG_MMX_READ_COMBINE_ROW 0x04
#define PNG_ASM_FLAG_MMX_READ_INTERLACE 0x08
#define PNG_ASM_FLAG_MMX_READ_FILTER_SUB 0x10
#define PNG_ASM_FLAG_MMX_READ_FILTER_UP 0x20
#define PNG_ASM_FLAG_MMX_READ_FILTER_AVG 0x40
#define PNG_ASM_FLAG_MMX_READ_FILTER_PAETH 0x80
#define PNG_ASM_FLAGS_INITIALIZED 0x80000000 /* not user-settable */
#define PNG_ASM_FLAGS_INITIALIZED 0x80000000 /* not user-settable */
#define PNG_MMX_READ_FLAGS ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \
| PNG_ASM_FLAG_MMX_READ_INTERLACE \
@ -2327,7 +2473,7 @@ extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp
#define PNG_SELECT_READ 1
#define PNG_SELECT_WRITE 2
#if !defined(PNG_1_0_X)
/* pngget.c */
extern PNG_EXPORT(png_uint_32,png_get_mmx_flagmask)
PNGARG((int flag_select, int *compilerID));
@ -2357,8 +2503,10 @@ extern PNG_EXPORT(void,png_set_mmx_thresholds)
PNGARG((png_structp png_ptr, png_byte mmx_bitdepth_threshold,
png_uint_32 mmx_rowbytes_threshold));
#endif /* PNG_1_0_X */
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
#if !defined(PNG_1_0_X)
/* png.c, pnggccrd.c, or pngvcrd.c */
extern PNG_EXPORT(int,png_mmx_support) PNGARG((void));
@ -2369,10 +2517,19 @@ extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
png_ptr, png_uint_32 strip_mode));
#endif
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
#endif /* PNG_1_0_X */
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.2.1 - December 12, 2001 (header)\n"
/* Added at libpng-1.2.6 */
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
extern PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp
png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max));
extern PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_structp
png_ptr));
extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp
png_ptr));
#endif
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
/* With these routines we avoid an integer divide, which will be slower on
@ -2465,6 +2622,14 @@ extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
#define PNG_RGB_TO_GRAY_ERR 0x200000L
#define PNG_RGB_TO_GRAY_WARN 0x400000L
#define PNG_RGB_TO_GRAY 0x600000L /* two bits, RGB_TO_GRAY_ERR|WARN */
/* 0x800000L Unused */
#define PNG_ADD_ALPHA 0x1000000L /* Added to libpng-1.2.7 */
/* 0x2000000L unused */
/* 0x4000000L unused */
/* 0x8000000L unused */
/* 0x10000000L unused */
/* 0x20000000L unused */
/* 0x40000000L unused */
/* flags for png_create_struct */
#define PNG_STRUCT_PNG 0x0001
@ -2497,12 +2662,17 @@ extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
#define PNG_FLAG_LIBRARY_MISMATCH 0x20000L
#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000L
#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000L
/* For use in png_set_keep_unknown, png_handle_as_unknown */
#define HANDLE_CHUNK_AS_DEFAULT 0
#define HANDLE_CHUNK_NEVER 1
#define HANDLE_CHUNK_IF_SAFE 2
#define HANDLE_CHUNK_ALWAYS 3
#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000L
#define PNG_FLAG_ADD_ALPHA 0x200000L /* Added to libpng-1.2.8 */
#define PNG_FLAG_STRIP_ALPHA 0x400000L /* Added to libpng-1.2.8 */
/* 0x800000L unused */
/* 0x1000000L unused */
/* 0x2000000L unused */
/* 0x4000000L unused */
/* 0x8000000L unused */
/* 0x10000000L unused */
/* 0x20000000L unused */
/* 0x40000000L unused */
#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
PNG_FLAG_CRC_ANCILLARY_NOWARN)
@ -2514,10 +2684,24 @@ extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
PNG_FLAG_CRC_CRITICAL_MASK)
/* save typing and make code easier to understand */
#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \
abs((int)((c1).green) - (int)((c2).green)) + \
abs((int)((c1).blue) - (int)((c2).blue)))
/* Added to libpng-1.2.6 JB */
#define PNG_ROWBYTES(pixel_bits, width) \
((pixel_bits) >= 8 ? \
((width) * (((png_uint_32)(pixel_bits)) >> 3)) : \
(( ((width) * ((png_uint_32)(pixel_bits))) + 7) >> 3) )
/* PNG_OUT_OF_RANGE returns true if value is outside the range
ideal-delta..ideal+delta. Each argument is evaluated twice.
"ideal" and "delta" should be constants, normally simple
integers, "value" a variable. Added to libpng-1.2.6 JB */
#define PNG_OUT_OF_RANGE(value, ideal, delta) \
( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) )
/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
/* place to hold the signature string for a PNG file. */
@ -2600,13 +2784,16 @@ PNG_EXTERN png_int_32 png_get_int_32 PNGARG((png_bytep buf));
PNG_EXTERN png_uint_32 png_get_uint_32 PNGARG((png_bytep buf));
PNG_EXTERN png_uint_16 png_get_uint_16 PNGARG((png_bytep buf));
#endif /* !PNG_READ_BIG_ENDIAN_SUPPORTED */
PNG_EXTERN png_uint_32 png_get_uint_31 PNGARG((png_structp png_ptr,
png_bytep buf));
/* Initialize png_ptr struct for reading, and allocate any other memory.
* (old interface - DEPRECATED - use png_create_read_struct instead).
*/
extern PNG_EXPORT(void,png_read_init) PNGARG((png_structp png_ptr));
#undef png_read_init
#define png_read_init(png_ptr) png_read_init_3(&png_ptr, \
PNG_LIBPNG_VER_STRING, sizeof(png_struct));
PNG_LIBPNG_VER_STRING, png_sizeof(png_struct));
extern PNG_EXPORT(void,png_read_init_3) PNGARG((png_structpp ptr_ptr,
png_const_charp user_png_ver, png_size_t png_struct_size));
extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr,
@ -2617,8 +2804,9 @@ extern PNG_EXPORT(void,png_read_init_2) PNGARG((png_structp png_ptr,
* (old interface - DEPRECATED - use png_create_write_struct instead).
*/
extern PNG_EXPORT(void,png_write_init) PNGARG((png_structp png_ptr));
#undef png_write_init
#define png_write_init(png_ptr) png_write_init_3(&png_ptr, \
PNG_LIBPNG_VER_STRING, sizeof(png_struct));
PNG_LIBPNG_VER_STRING, png_sizeof(png_struct));
extern PNG_EXPORT(void,png_write_init_3) PNGARG((png_structpp ptr_ptr,
png_const_charp user_png_ver, png_size_t png_struct_size));
extern PNG_EXPORT(void,png_write_init_2) PNGARG((png_structp png_ptr,
@ -2640,12 +2828,44 @@ PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr,
PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr,
png_infop info_ptr));
#ifndef PNG_1_0_X
/* Function to allocate memory for zlib. */
PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size));
/* Function to free memory for zlib */
PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr));
#ifdef PNG_SIZE_T
/* Function to convert a sizeof an item to png_sizeof item */
PNG_EXTERN png_size_t PNGAPI png_convert_size PNGARG((size_t size));
#endif
/* Next four functions are used internally as callbacks. PNGAPI is required
* but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3. */
PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr,
png_bytep data, png_size_t length));
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr,
png_bytep buffer, png_size_t length));
#endif
PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr,
png_bytep data, png_size_t length));
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
#if !defined(PNG_NO_STDIO)
PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr));
#endif
#endif
#else /* PNG_1_0_X */
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr,
png_bytep buffer, png_size_t length));
#endif
#endif /* PNG_1_0_X */
/* Reset the CRC variable */
PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr));
@ -2686,6 +2906,7 @@ PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr,
PNG_EXTERN void png_flush PNGARG((png_structp png_ptr));
#endif
/* Place a 32-bit number into a buffer in PNG byte order (big-endian).
* The only currently known PNG chunks that use signed numbers are
* the ancillary extension chunks, oFFs and pCAL.
@ -2808,6 +3029,11 @@ PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr,
png_charp text));
#endif
#if defined(PNG_TEXT_SUPPORTED) /* Added at version 1.0.14 and 1.2.4 */
PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr,
png_infop info_ptr, png_textp text_ptr, int num_text));
#endif
#if defined(PNG_WRITE_oFFs_SUPPORTED)
PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr,
png_int_32 x_offset, png_int_32 y_offset, int unit_type));
@ -3108,11 +3334,6 @@ PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
png_uint_32 length));
#endif
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
PNG_EXTERN int png_handle_as_unknown PNGARG((png_structp png_ptr, png_bytep
chunk_name));
#endif
PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
png_infop info_ptr, png_uint_32 length));
@ -3134,8 +3355,6 @@ PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr));
PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr,
png_uint_32 length));
PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr));
PNG_EXTERN void png_push_fill_buffer PNGARG((png_structp png_ptr,
png_bytep buffer, png_size_t length));
PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr));
PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr,
png_bytep buffer, png_size_t buffer_length));

View File

@ -1,8 +1,9 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng 1.2.1 - December 12, 2001
* libpng version 1.2.8 - December 3, 2004
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*/
@ -16,6 +17,54 @@
#ifndef PNGCONF_H
#define PNGCONF_H
#define PNG_1_2_X
/*
* PNG_USER_CONFIG has to be defined on the compiler command line. This
* includes the resource compiler for Windows DLL configurations.
*/
#ifdef PNG_USER_CONFIG
#include "pngusr.h"
#endif
/*
* Added at libpng-1.2.8
*
* If you create a private DLL you need to define in "pngusr.h" the followings:
* #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of
* the DLL was built>
* e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons."
* #define PNG_USER_DLLFNAME_POSTFIX <two-letter postfix that serve to
* distinguish your DLL from those of the official release. These
* correspond to the trailing letters that come after the version
* number and must match your private DLL name>
* e.g. // private DLL "libpng13gx.dll"
* #define PNG_USER_DLLFNAME_POSTFIX "gx"
*
* The following macros are also at your disposal if you want to complete the
* DLL VERSIONINFO structure.
* - PNG_USER_VERSIONINFO_COMMENTS
* - PNG_USER_VERSIONINFO_COMPANYNAME
* - PNG_USER_VERSIONINFO_LEGALTRADEMARKS
*/
#ifdef __STDC__
#ifdef SPECIALBUILD
# pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\
are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.")
#endif
#ifdef PRIVATEBUILD
# pragma message("PRIVATEBUILD is deprecated. Use\
PNG_USER_PRIVATEBUILD instead.")
# define PNG_USER_PRIVATEBUILD PRIVATEBUILD
#endif
#endif /* __STDC__ */
#ifndef PNG_VERSION_INFO_ONLY
/* End of material added to libpng-1.2.8 */
/* This is the size of the compression buffer, and thus the size of
* an IDAT chunk. Make this whatever size you feel is best for your
* machine. One of these will be allocated per png_struct. When this
@ -47,7 +96,7 @@
/* Enabled by default in 1.2.0. You can disable this if you don't need to
support PNGs that are embedded in MNG datastreams */
#ifndef PNG_NO_MNG_FEATURES
#if !defined(PNG_1_0_X) && !defined(PNG_NO_MNG_FEATURES)
# ifndef PNG_MNG_FEATURES_SUPPORTED
# define PNG_MNG_FEATURES_SUPPORTED
# endif
@ -78,12 +127,12 @@
* (no define) -- building static library, or building an
* application and linking to the static lib
* 'Cygwin' defines/defaults:
* PNG_BUILD_DLL -- building the dll
* (no define) -- building an application, linking to the dll
* PNG_STATIC -- building the static lib, or building an application
* that links to the static lib.
* ALL_STATIC -- building various static libs, or building an application
* that links to the static libs.
* PNG_BUILD_DLL -- (ignored) building the dll
* (no define) -- (ignored) building an application, linking to the dll
* PNG_STATIC -- (ignored) building the static lib, or building an
* application that links to the static lib.
* ALL_STATIC -- (ignored) building various static libs, or building an
* application that links to the static libs.
* Thus,
* a cygwin user should define either PNG_BUILD_DLL or PNG_STATIC, and
* this bit of #ifdefs will define the 'correct' config variables based on
@ -94,7 +143,15 @@
* ALL_STATIC (since we can't #undef something outside our namespace)
* PNG_BUILD_DLL
* PNG_STATIC
* (nothing) == PNG_USE_DLL
* (nothing) == PNG_USE_DLL
*
* CYGWIN (2002-01-20): The preceding is now obsolete. With the advent
* of auto-import in binutils, we no longer need to worry about
* __declspec(dllexport) / __declspec(dllimport) and friends. Therefore,
* we don't need to worry about PNG_STATIC or ALL_STATIC when it comes
* to __declspec() stuff. However, we DO need to worry about
* PNG_BUILD_DLL and PNG_STATIC because those change some defaults
* such as CONSOLE_IO and whether GLOBAL_ARRAYS are allowed.
*/
#if defined(__CYGWIN__)
# if defined(ALL_STATIC)
@ -244,8 +301,11 @@
# undef _BSD_SOURCE
# endif
# ifdef _SETJMP_H
__png.h__ already includes setjmp.h;
__dont__ include it again.;
/* If you encounter a compiler error here, see the explanation
* near the end of INSTALL.
*/
__png.h__ already includes setjmp.h;
__dont__ include it again.;
# endif
# endif /* __linux__ */
@ -309,15 +369,13 @@
# define PNG_ALWAYS_EXTERN
#endif
/* For some reason, Borland C++ defines memcmp, etc. in mem.h, not
* stdlib.h like it should (I think). Or perhaps this is a C++
* "feature"?
*/
#ifdef __TURBOC__
/* This provides the non-ANSI (far) memory allocation routines. */
#if defined(__TURBOC__) && defined(__MSDOS__)
# include <mem.h>
# include "alloc.h"
# include <alloc.h>
#endif
/* I have no idea why is this necessary... */
#if defined(_MSC_VER) && (defined(WIN32) || defined(_Windows) || \
defined(_WINDOWS) || defined(_WIN32) || defined(__WIN32__))
# include <malloc.h>
@ -575,13 +633,6 @@
# endif
#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
# ifndef PNG_NO_USER_TRANSFORM_PTR
# define PNG_USER_TRANSFORM_PTR_SUPPORTED
# endif
#endif
#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant
encoders, but can cause trouble
if left undefined */
@ -591,10 +642,6 @@
# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
#endif
#ifndef PNG_NO_ERROR_NUMBERS
#define PNG_ERROR_NUMBERS_SUPPORTED
#endif
#ifndef PNG_NO_WRITE_FLUSH
# define PNG_WRITE_FLUSH_SUPPORTED
#endif
@ -606,6 +653,19 @@
#endif /* PNG_WRITE_SUPPORTED */
#ifndef PNG_1_0_X
# ifndef PNG_NO_ERROR_NUMBERS
# define PNG_ERROR_NUMBERS_SUPPORTED
# endif
#endif /* PNG_1_0_X */
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
# ifndef PNG_NO_USER_TRANSFORM_PTR
# define PNG_USER_TRANSFORM_PTR_SUPPORTED
# endif
#endif
#ifndef PNG_NO_STDIO
# define PNG_TIME_RFC1123_SUPPORTED
#endif
@ -647,9 +707,30 @@
#define PNG_THREAD_UNSAFE_OK
*/
#if !defined(PNG_1_0_X)
#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
# define PNG_USER_MEM_SUPPORTED
#endif
#endif /* PNG_1_0_X */
/* Added at libpng-1.2.6 */
#if !defined(PNG_1_0_X)
#ifndef PNG_SET_USER_LIMITS_SUPPORTED
#if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED)
# define PNG_SET_USER_LIMITS_SUPPORTED
#endif
#endif
#endif /* PNG_1_0_X */
/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter
* how large, set these limits to 0x7fffffffL
*/
#ifndef PNG_USER_WIDTH_MAX
# define PNG_USER_WIDTH_MAX 1000000L
#endif
#ifndef PNG_USER_HEIGHT_MAX
# define PNG_USER_HEIGHT_MAX 1000000L
#endif
/* These are currently experimental features, define them if you want */
@ -665,10 +746,8 @@
/* This is only for PowerPC big-endian and 680x0 systems */
/* some testing */
/*
#ifdef PNG_READ_SUPPORTED
# ifndef PNG_PNG_READ_BIG_ENDIAN_SUPPORTED
# define PNG_READ_BIG_ENDIAN_SUPPORTED
# endif
#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
# define PNG_READ_BIG_ENDIAN_SUPPORTED
#endif
*/
@ -976,7 +1055,13 @@ typedef unsigned char png_byte;
/* This is usually size_t. It is typedef'ed just in case you need it to
change (I'm not sure if you will or not, so I thought I'd be safe) */
typedef size_t png_size_t;
#ifdef PNG_SIZE_T
typedef PNG_SIZE_T png_size_t;
# define png_sizeof(x) png_convert_size(sizeof (x))
#else
typedef size_t png_size_t;
# define png_sizeof(x) sizeof (x)
#endif
/* The following is needed for medium model support. It cannot be in the
* PNG_INTERNAL section. Needs modification for other compilers besides
@ -1080,6 +1165,9 @@ typedef double FAR * FAR * png_doublepp;
/* Pointers to pointers to pointers; i.e., pointer to array */
typedef char FAR * FAR * FAR * png_charppp;
#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
/* SPC - Is this stuff deprecated? */
/* It'll be removed as of libpng-1.3.0 - GR-P */
/* 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.
@ -1087,6 +1175,7 @@ typedef char FAR * FAR * FAR * png_charppp;
typedef charf * png_zcharp;
typedef charf * FAR * png_zcharpp;
typedef z_stream FAR * png_zstreamp;
#endif /* (PNG_1_0_X) || defined(PNG_1_2_X) */
/*
* Define PNG_BUILD_DLL if the module being built is a Windows
@ -1145,10 +1234,21 @@ typedef z_stream FAR * png_zstreamp;
# endif
#endif
#if defined(__CYGWIN__)
# undef PNGAPI
# define PNGAPI __cdecl
# undef PNG_IMPEXP
# define PNG_IMPEXP
#endif
#ifndef PNGAPI
/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
* you may get warnings regarding the linkage of png_zalloc and png_zfree.
* Don't ignore those warnings; you must also reset the default calling
* convention in your compiler to match your PNGAPI, and you must build
* zlib and your applications the same way you build libpng.
*/
#if defined(__MINGW32__) || defined(__CYGWIN__) && !defined(PNG_MODULEDEF)
#if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
# ifndef PNG_NO_MODULEDEF
# define PNG_NO_MODULEDEF
# endif
@ -1160,13 +1260,14 @@ typedef z_stream FAR * png_zstreamp;
#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
(( defined(_Windows) || defined(_WINDOWS) || \
defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
) && !defined(__CYGWIN__))
defined(WIN32) || defined(_WIN32) || defined(__WIN32__) ))
# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
# define PNGAPI __cdecl
# else
# define PNGAPI _cdecl
# ifndef PNGAPI
# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800))
# define PNGAPI __cdecl
# else
# define PNGAPI _cdecl
# endif
# endif
# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \
@ -1188,8 +1289,8 @@ typedef z_stream FAR * png_zstreamp;
# if defined(PNG_BUILD_DLL)
# define PNG_IMPEXP __export
# else
# define PNG_IMPEXP /*__import*/ /* doesn't exist AFAIK in
VC++*/
# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in
VC++ */
# endif /* Exists in Borland C++ for
C++ classes (== huge) */
# endif
@ -1204,24 +1305,14 @@ typedef z_stream FAR * png_zstreamp;
# endif
# endif /* PNG_IMPEXP */
#else /* !(DLL || non-cygwin WINDOWS) */
# if defined(__CYGWIN__) && !defined(PNG_DLL)
# if !defined(PNG_IMPEXP)
# define PNG_IMPEXP
# endif
# define PNGAPI __cdecl
# else
# if (defined(__IBMC__) || defined(IBMCPP__)) && defined(__OS2__)
# define PNGAPI _System
# define PNG_IMPEXP
# else
# if 0 /* ... other platforms, with other meanings */
# else
# define PNGAPI
# define PNG_IMPEXP
# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
# ifndef PNGAPI
# define PNGAPI _System
# endif
# endif
# endif
#endif
# else
# if 0 /* ... other platforms, with other meanings */
# endif
# endif
#endif
#ifndef PNGAPI
@ -1231,6 +1322,17 @@ typedef z_stream FAR * png_zstreamp;
# define PNG_IMPEXP
#endif
#ifdef PNG_BUILDSYMS
# ifndef PNG_EXPORT
# define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END
# endif
# ifdef PNG_USE_GLOBAL_ARRAYS
# ifndef PNG_EXPORT_VAR
# define PNG_EXPORT_VAR(type) PNG_DATA_EXPORT
# endif
# endif
#endif
#ifndef PNG_EXPORT
# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
#endif
@ -1262,28 +1364,30 @@ typedef z_stream FAR * png_zstreamp;
# define NOCHECK 0
# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
# define png_strcpy _fstrcpy
# define png_strlen _fstrlen
# define png_memcmp _fmemcmp /* SJT: added */
# define png_memcpy _fmemcpy
# define png_memset _fmemset
# define png_strcpy _fstrcpy
# define png_strncpy _fstrncpy /* Added to v 1.2.6 */
# define png_strlen _fstrlen
# define png_memcmp _fmemcmp /* SJT: added */
# define png_memcpy _fmemcpy
# define png_memset _fmemset
#else /* use the usual functions */
# define CVT_PTR(ptr) (ptr)
# define CVT_PTR_NOCHECK(ptr) (ptr)
# define png_strcpy strcpy
# define png_strlen strlen
# define png_memcmp memcmp /* SJT: added */
# define png_memcpy memcpy
# define png_memset memset
# define png_strcpy strcpy
# define png_strncpy strncpy /* Added to v 1.2.6 */
# define png_strlen strlen
# define png_memcmp memcmp /* SJT: added */
# define png_memcpy memcpy
# define png_memset memset
#endif
/* End of memory model independent support */
/* Just a little check that someone hasn't tried to define something
* contradictory.
*/
#if (PNG_ZBUF_SIZE > 65536) && defined(PNG_MAX_MALLOC_64K)
#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K)
# undef PNG_ZBUF_SIZE
# define PNG_ZBUF_SIZE 65536
# define PNG_ZBUF_SIZE 65536L
#endif
#ifdef PNG_READ_SUPPORTED
@ -1327,5 +1431,7 @@ typedef z_stream FAR * png_zstreamp;
#endif /* PNG_INTERNAL */
#endif /* PNG_READ_SUPPORTED */
#endif /* PNGCONF_H */
/* Added at libpng-1.2.8 */
#endif /* PNG_VERSION_INFO_ONLY */
#endif /* PNGCONF_H */