blob: 12c18ef046970bc3e6c5dfb1e4d4eb78e0a5aed2 [file] [log] [blame]
Glenn Randers-Pehrson0f881d61998-02-07 10:20:57 -06001/* pngconf.h - machine configurable file for libpng
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -06002 *
Glenn Randers-Pehrsonec61c232000-05-16 06:17:36 -05003 * libpng 1.0.7beta13 - May 16, 2000
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -06004 * For conditions of distribution and use, see copyright notice in png.h
5 * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
6 * Copyright (c) 1996, 1997 Andreas Dilger
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -06007 * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -06008 */
Guy Schalnat51f0eb41995-09-26 05:22:39 -05009
10/* Any machine specific code is near the front of this file, so if you
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -060011 * are configuring libpng for a machine, you may want to read the section
12 * starting here down to where it starts to typedef png_color, png_text,
13 * and png_info.
14 */
Guy Schalnat51f0eb41995-09-26 05:22:39 -050015
16#ifndef PNGCONF_H
17#define PNGCONF_H
18
Andreas Dilger02ad0ef1997-01-17 01:34:35 -060019/* This is the size of the compression buffer, and thus the size of
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -060020 * an IDAT chunk. Make this whatever size you feel is best for your
21 * machine. One of these will be allocated per png_struct. When this
22 * is full, it writes the data to the disk, and does some other
Glenn Randers-Pehrson70e3f541998-01-03 22:40:55 -060023 * calculations. Making this an extremely small size will slow
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -060024 * the library down, but you may want to experiment to determine
25 * where it becomes significant, if you are concerned with memory
26 * usage. Note that zlib allocates at least 32Kb also. For readers,
27 * this describes the size of the buffer available to read the data in.
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -060028 * Unless this gets smaller than the size of a row (compressed),
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -060029 * it should not make much difference how big this is.
30 */
Guy Schalnat51f0eb41995-09-26 05:22:39 -050031
Glenn Randers-Pehrson70e3f541998-01-03 22:40:55 -060032#ifndef PNG_ZBUF_SIZE
Guy Schalnatb2e01bd1996-01-26 01:38:47 -060033#define PNG_ZBUF_SIZE 8192
Glenn Randers-Pehrson70e3f541998-01-03 22:40:55 -060034#endif
Guy Schalnat51f0eb41995-09-26 05:22:39 -050035
Andreas Dilger47a0c421997-05-16 02:46:07 -050036/* If you are running on a machine where you cannot allocate more
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -060037 * than 64K of memory at once, uncomment this. While libpng will not
38 * normally need that much memory in a chunk (unless you load up a very
39 * large file), zlib needs to know how big of a chunk it can use, and
40 * libpng thus makes sure to check any memory allocation to verify it
41 * will fit into memory.
Andreas Dilger47a0c421997-05-16 02:46:07 -050042#define PNG_MAX_MALLOC_64K
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -060043 */
Andreas Dilger47a0c421997-05-16 02:46:07 -050044#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
45#define PNG_MAX_MALLOC_64K
Guy Schalnat51f0eb41995-09-26 05:22:39 -050046#endif
47
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -050048/* This protects us against compilers that run on a windowing system
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -060049 * and thus don't have or would rather us not use the stdio types:
50 * stdin, stdout, and stderr. The only one currently used is stderr
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -060051 * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will
52 * prevent these from being compiled and used. #defining PNG_NO_STDIO
53 * will also prevent these, plus will prevent the entire set of stdio
54 * macros and functions (FILE *, printf, etc.) from being compiled and used,
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -050055 * unless (PNG_DEBUG > 0) has been #defined.
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -060056 *
57 * #define PNG_NO_CONSOLE_IO
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -060058 * #define PNG_NO_STDIO
59 */
Guy Schalnat6d764711995-12-19 03:22:19 -060060
Glenn Randers-Pehrson1ef65b62000-05-12 06:19:53 -050061#ifdef PNG_BUILD_DLL
62# ifndef PNG_CONSOLE_IO_SUPPORTED
63# ifndef PNG_NO_CONSOLE_IO
64# define PNG_NO_CONSOLE_IO
65# endif
66# endif
67#endif
68
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -060069# ifdef PNG_NO_STDIO
70# ifndef PNG_NO_CONSOLE_IO
71# define PNG_NO_CONSOLE_IO
72# endif
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -050073# ifdef PNG_DEBUG
74# if (PNG_DEBUG > 0)
75# include <stdio.h>
76# endif
77# endif
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -060078# else
79# include <stdio.h>
80# endif
Andreas Dilger02ad0ef1997-01-17 01:34:35 -060081
82/* This macro protects us against machines that don't have function
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -060083 * prototypes (ie K&R style headers). If your compiler does not handle
84 * function prototypes, define this macro and use the included ansi2knr.
85 * I've always been able to use _NO_PROTO as the indicator, but you may
86 * need to drag the empty declaration out in front of here, or change the
87 * ifdef to suit your own needs.
88 */
Guy Schalnat51f0eb41995-09-26 05:22:39 -050089#ifndef PNGARG
90
Andreas Dilger47a0c421997-05-16 02:46:07 -050091#ifdef OF /* zlib prototype munger */
Guy Schalnat51f0eb41995-09-26 05:22:39 -050092#define PNGARG(arglist) OF(arglist)
93#else
94
95#ifdef _NO_PROTO
Guy Schalnat6d764711995-12-19 03:22:19 -060096#define PNGARG(arglist) ()
Guy Schalnat51f0eb41995-09-26 05:22:39 -050097#else
98#define PNGARG(arglist) arglist
99#endif /* _NO_PROTO */
100
101#endif /* OF */
102
103#endif /* PNGARG */
104
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600105/* Try to determine if we are compiling on a Mac. Note that testing for
106 * just __MWERKS__ is not good enough, because the Codewarrior is now used
107 * on non-Mac platforms.
108 */
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600109#ifndef MACOS
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600110#if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600111 defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600112#define MACOS
113#endif
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600114#endif
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600115
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500116/* enough people need this for various reasons to include it here */
Guy Schalnate5a37791996-06-05 15:50:50 -0500117#if !defined(MACOS) && !defined(RISCOS)
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500118#include <sys/types.h>
119#endif
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600120
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600121#ifndef PNG_SETJMP_NOT_SUPPORTED
122# define PNG_SETJMP_SUPPORTED
123#endif
124
125#ifdef PNG_SETJMP_SUPPORTED
Andreas Dilger47a0c421997-05-16 02:46:07 -0500126/* This is an attempt to force a single setjmp behaviour on Linux. If
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600127 * the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
128 */
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600129# ifdef __linux__
130# ifdef _BSD_SOURCE
131# define _PNG_SAVE_BSD_SOURCE
132# undef _BSD_SOURCE
133# endif
134# ifdef _SETJMP_H
135 __png.h__ already includes setjmp.h
136 __dont__ include it again
137# endif
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600138#endif /* __linux__ */
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500139
140/* include setjmp.h for error handling */
141#include <setjmp.h>
142
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600143# ifdef __linux__
144# ifdef _PNG_SAVE_BSD_SOURCE
145# define _BSD_SOURCE
146# undef _PNG_SAVE_BSD_SOURCE
147# endif
148# endif /* __linux__ */
149#endif /* PNG_SETJMP_SUPPORTED */
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600150
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500151#ifdef BSD
152#include <strings.h>
153#else
154#include <string.h>
155#endif
156
Andreas Dilger47a0c421997-05-16 02:46:07 -0500157/* Other defines for things like memory and the like can go here. */
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500158#ifdef PNG_INTERNAL
159#include <stdlib.h>
Andreas Dilger47a0c421997-05-16 02:46:07 -0500160
161/* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
162 * aren't usually used outside the library (as far as I know), so it is
163 * debatable if they should be exported at all. In the future, when it is
164 * possible to have run-time registry of chunk-handling functions, some of
165 * these will be made available again.
166#define PNG_EXTERN extern
167 */
168#define PNG_EXTERN
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500169
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600170/* Other defines specific to compilers can go here. Try to keep
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600171 * them inside an appropriate ifdef/endif pair for portability.
172 */
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500173
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600174#if !defined(PNG_NO_FLOATING_POINT_SUPPORTED)
Andreas Dilger47a0c421997-05-16 02:46:07 -0500175#if defined(MACOS)
176/* We need to check that <math.h> hasn't already been included earlier
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600177 * as it seems it doesn't agree with <fp.h>, yet we should really use
178 * <fp.h> if possible.
179 */
Andreas Dilger47a0c421997-05-16 02:46:07 -0500180#if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600181#include <fp.h>
Andreas Dilger47a0c421997-05-16 02:46:07 -0500182#endif
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600183#else
184#include <math.h>
185#endif
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600186#endif
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600187
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600188/* Codewarrior on NT has linking problems without this. */
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -0500189#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600190#define PNG_ALWAYS_EXTERN
191#endif
192
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600193/* For some reason, Borland C++ defines memcmp, etc. in mem.h, not
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600194 * stdlib.h like it should (I think). Or perhaps this is a C++
195 * "feature"?
196 */
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500197#ifdef __TURBOC__
198#include <mem.h>
199#include "alloc.h"
200#endif
201
202#ifdef _MSC_VER
203#include <malloc.h>
204#endif
205
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600206/* This controls how fine the dithering gets. As this allocates
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600207 * a largish chunk of memory (32K), those who are not as concerned
208 * with dithering quality can decrease some or all of these.
209 */
Glenn Randers-Pehrson70e3f541998-01-03 22:40:55 -0600210#ifndef PNG_DITHER_RED_BITS
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500211#define PNG_DITHER_RED_BITS 5
Glenn Randers-Pehrson70e3f541998-01-03 22:40:55 -0600212#endif
213#ifndef PNG_DITHER_GREEN_BITS
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500214#define PNG_DITHER_GREEN_BITS 5
Glenn Randers-Pehrson70e3f541998-01-03 22:40:55 -0600215#endif
216#ifndef PNG_DITHER_BLUE_BITS
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500217#define PNG_DITHER_BLUE_BITS 5
Glenn Randers-Pehrson70e3f541998-01-03 22:40:55 -0600218#endif
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500219
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600220/* This controls how fine the gamma correction becomes when you
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600221 * are only interested in 8 bits anyway. Increasing this value
222 * results in more memory being used, and more pow() functions
223 * being called to fill in the gamma tables. Don't set this value
224 * less then 8, and even that may not work (I haven't tested it).
225 */
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500226
Glenn Randers-Pehrsonc4a2ae61998-01-16 22:06:18 -0600227#ifndef PNG_MAX_GAMMA_8
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500228#define PNG_MAX_GAMMA_8 11
Glenn Randers-Pehrsonc4a2ae61998-01-16 22:06:18 -0600229#endif
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500230
Andreas Dilger47a0c421997-05-16 02:46:07 -0500231/* This controls how much a difference in gamma we can tolerate before
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600232 * we actually start doing gamma conversion.
233 */
Glenn Randers-Pehrsonc4a2ae61998-01-16 22:06:18 -0600234#ifndef PNG_GAMMA_THRESHOLD
Andreas Dilger47a0c421997-05-16 02:46:07 -0500235#define PNG_GAMMA_THRESHOLD 0.05
Glenn Randers-Pehrsonc4a2ae61998-01-16 22:06:18 -0600236#endif
Andreas Dilger47a0c421997-05-16 02:46:07 -0500237
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500238#endif /* PNG_INTERNAL */
239
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600240/* The following uses const char * instead of char * for error
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600241 * and warning message functions, so some compilers won't complain.
Glenn Randers-Pehrsonc4a2ae61998-01-16 22:06:18 -0600242 * If you do not want to use const, define PNG_NO_CONST here.
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600243 */
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600244
Glenn Randers-Pehrsonc4a2ae61998-01-16 22:06:18 -0600245#ifndef PNG_NO_CONST
Guy Schalnat6d764711995-12-19 03:22:19 -0600246# define PNG_CONST const
247#else
248# define PNG_CONST
249#endif
250
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600251/* The following defines give you the ability to remove code from the
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600252 * library that you will not be using. I wish I could figure out how to
253 * automate this, but I can't do that without making it seriously hard
254 * on the users. So if you are not using an ability, change the #define
255 * to and #undef, and that part of the library will not be compiled. If
256 * your linker can't find a function, you may want to make sure the
257 * ability is defined here. Some of these depend upon some others being
258 * defined. I haven't figured out all the interactions here, so you may
259 * have to experiment awhile to get everything to compile. If you are
260 * creating or using a shared library, you probably shouldn't touch this,
261 * as it will affect the size of the structures, and this will cause bad
262 * things to happen if the library and/or application ever change.
263 */
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500264
Glenn Randers-Pehrson38e6e772000-04-09 19:06:13 -0500265/* Any features you will not be using can be undef'ed here */
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600266
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600267/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user
Glenn Randers-Pehrson75294572000-05-06 14:09:57 -0500268 * to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
269 * on the compile line, then pick and choose which ones to define without
270 * having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED
271 * if you only want to have a png-compliant reader/writer but don't need
272 * any of the extra transformations. This saves about 80 kbytes in a
273 * typical installation of the library. (PNG_NO_* form added in version
274 * 1.0.1c, for consistency)
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600275 */
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600276
Glenn Randers-Pehrson75294572000-05-06 14:09:57 -0500277/* The size of the png_text structure changed in libpng-1.0.6 when
278 * iTXt is supported. It is turned off by default, to support old apps
279 * that malloc the png_text structure instead of calling png_set_text()
280 * and letting libpng malloc it. It will be turned on by default in
281 * libpng-2.0.0.
282 */
283
284#ifndef PNG_iTXt_SUPPORTED
285# ifndef PNG_READ_iTXt_SUPPORTED
286# define PNG_NO_READ_iTXt
287# endif
288# ifndef PNG_WRITE_iTXt_SUPPORTED
289# define PNG_NO_WRITE_iTXt
290# endif
291#endif
292
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -0500293/* The following support, added after version 1.0.0, can be turned off here en
294 * masse by defining PNG_LEGACY_SUPPORTED in case you need binary compatibility
295 * with old applications that require the length of png_struct and png_info
296 * to remain unchanged.
297 */
298
299#ifdef PNG_LEGACY_SUPPORTED
300#define PNG_NO_FREE_ME
301#define PNG_NO_READ_UNKNOWN_CHUNKS
302#define PNG_NO_WRITE_UNKNOWN_CHUNKS
303#define PNG_NO_READ_USER_CHUNKS
304#define PNG_NO_READ_iCCP
305#define PNG_NO_WRITE_iCCP
Glenn Randers-Pehrson75294572000-05-06 14:09:57 -0500306#define PNG_NO_READ_iTXt
307#define PNG_NO_WRITE_iTXt
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -0500308#define PNG_NO_READ_sCAL
309#define PNG_NO_WRITE_sCAL
310#define PNG_NO_READ_sPLT
311#define PNG_NO_WRITE_sPLT
312#define PNG_NO_INFO_IMAGE
313#define PNG_NO_READ_RGB_TO_GRAY
314#define PNG_NO_READ_USER_TRANSFORM
315#define PNG_NO_WRITE_USER_TRANSFORM
316#define PNG_NO_USER_MEM
317#define PNG_NO_READ_EMPTY_PLTE
Glenn Randers-Pehrson75294572000-05-06 14:09:57 -0500318#define PNG_NO_FIXED_POINT_SUPPORTED
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -0500319#endif
320
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500321#ifndef PNG_NO_FLOATING_POINT_SUPPORTED
Glenn Randers-Pehrson38e6e772000-04-09 19:06:13 -0500322#define PNG_FLOATING_POINT_SUPPORTED
323#endif
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600324
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500325/* Ignore attempt to turn off both floating and fixed point support */
326
Glenn Randers-Pehrson75294572000-05-06 14:09:57 -0500327#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \
328 !defined(PNG_NO_FIXED_POINT_SUPPORTED)
Glenn Randers-Pehrson38e6e772000-04-09 19:06:13 -0500329#define PNG_FIXED_POINT_SUPPORTED
330#endif
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600331
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -0500332#ifndef PNG_NO_FREE_ME
333#define PNG_FREE_ME_SUPPORTED
334#endif
335
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500336#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
337 !defined(PNG_NO_READ_TRANSFORMS)
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600338#define PNG_READ_TRANSFORMS_SUPPORTED
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600339#endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500340#if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
341 !defined(PNG_NO_WRITE_TRANSFORMS)
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600342#define PNG_WRITE_TRANSFORMS_SUPPORTED
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600343#endif
344
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600345#ifdef PNG_READ_TRANSFORMS_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500346#ifndef PNG_NO_READ_EXPAND
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500347#define PNG_READ_EXPAND_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500348#endif
349#ifndef PNG_NO_READ_SHIFT
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500350#define PNG_READ_SHIFT_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500351#endif
352#ifndef PNG_NO_READ_PACK
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500353#define PNG_READ_PACK_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500354#endif
355#ifndef PNG_NO_READ_BGR
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500356#define PNG_READ_BGR_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500357#endif
358#ifndef PNG_NO_READ_SWAP
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500359#define PNG_READ_SWAP_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500360#endif
361#ifndef PNG_NO_READ_PACKSWAP
Andreas Dilger47a0c421997-05-16 02:46:07 -0500362#define PNG_READ_PACKSWAP_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500363#endif
364#ifndef PNG_NO_READ_INVERT
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500365#define PNG_READ_INVERT_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500366#endif
367#ifndef PNG_NO_READ_DITHER
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500368#define PNG_READ_DITHER_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500369#endif
370#ifndef PNG_NO_READ_BACKGROUND
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500371#define PNG_READ_BACKGROUND_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500372#endif
373#ifndef PNG_NO_READ_16_TO_8
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500374#define PNG_READ_16_TO_8_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500375#endif
376#ifndef PNG_NO_READ_FILLER
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500377#define PNG_READ_FILLER_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500378#endif
379#ifndef PNG_NO_READ_GAMMA
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500380#define PNG_READ_GAMMA_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500381#endif
382#ifndef PNG_NO_READ_GRAY_TO_RGB
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500383#define PNG_READ_GRAY_TO_RGB_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500384#endif
385#ifndef PNG_NO_READ_SWAP_ALPHA
Andreas Dilger47a0c421997-05-16 02:46:07 -0500386#define PNG_READ_SWAP_ALPHA_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500387#endif
388#ifndef PNG_NO_READ_INVERT_ALPHA
Glenn Randers-Pehrsonc4a2ae61998-01-16 22:06:18 -0600389#define PNG_READ_INVERT_ALPHA_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500390#endif
391#ifndef PNG_NO_READ_STRIP_ALPHA
Andreas Dilger47a0c421997-05-16 02:46:07 -0500392#define PNG_READ_STRIP_ALPHA_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500393#endif
394#ifndef PNG_NO_READ_USER_TRANSFORM
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600395#define PNG_READ_USER_TRANSFORM_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500396#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500397#ifndef PNG_NO_READ_RGB_TO_GRAY
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600398#define PNG_READ_RGB_TO_GRAY_SUPPORTED
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500399#endif
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600400#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600401
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500402#if !defined(PNG_NO_PROGRESSIVE_READ) && \
403 !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600404#define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */
405#endif /* about interlacing capability! You'll */
406 /* still have interlacing unless you change the following line: */
407#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500408
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -0500409#ifndef PNG_NO_READ_COMPOSITE_NODIV
410#ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600411#define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel and SGI */
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500412#endif
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -0500413#endif
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500414
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -0500415#ifndef PNG_NO_READ_EMPTY_PLTE
416#define PNG_READ_EMPTY_PLTE_SUPPORTED /* useful for MNG applications */
417#endif
418
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600419#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500420#ifndef PNG_NO_WRITE_SHIFT
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500421#define PNG_WRITE_SHIFT_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500422#endif
423#ifndef PNG_NO_WRITE_PACK
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500424#define PNG_WRITE_PACK_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500425#endif
426#ifndef PNG_NO_WRITE_BGR
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500427#define PNG_WRITE_BGR_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500428#endif
429#ifndef PNG_NO_WRITE_SWAP
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500430#define PNG_WRITE_SWAP_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500431#endif
432#ifndef PNG_NO_WRITE_PACKSWAP
Andreas Dilger47a0c421997-05-16 02:46:07 -0500433#define PNG_WRITE_PACKSWAP_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500434#endif
435#ifndef PNG_NO_WRITE_INVERT
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500436#define PNG_WRITE_INVERT_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500437#endif
438#ifndef PNG_NO_WRITE_FILLER
Andreas Dilger47a0c421997-05-16 02:46:07 -0500439#define PNG_WRITE_FILLER_SUPPORTED /* This is the same as WRITE_STRIP_ALPHA */
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500440#endif
441#ifndef PNG_NO_WRITE_SWAP_ALPHA
Andreas Dilger47a0c421997-05-16 02:46:07 -0500442#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500443#endif
444#ifndef PNG_NO_WRITE_INVERT_ALPHA
Glenn Randers-Pehrsonc4a2ae61998-01-16 22:06:18 -0600445#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500446#endif
447#ifndef PNG_NO_WRITE_USER_TRANSFORM
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600448#define PNG_WRITE_USER_TRANSFORM_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500449#endif
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600450#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600451
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500452#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
453defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
454#ifndef PNG_NO_USER_TRANSFORM_PTR
455#define PNG_USER_TRANSFORM_PTR_SUPPORTED
456#endif
457#endif
458
Glenn Randers-Pehrson08a33431998-03-07 06:06:55 -0600459#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant
460 encoders, but can cause trouble
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600461 if left undefined */
462
Glenn Randers-Pehrson38e6e772000-04-09 19:06:13 -0500463#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \
464 defined(PNG_FLOATING_POINT_SUPPORTED)
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500465#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
466#endif
467
468#ifndef PNG_NO_WRITE_FLUSH
469#define PNG_WRITE_FLUSH_SUPPORTED
470#endif
471
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -0500472#ifndef PNG_NO_WRITE_EMPTY_PLTE
473#define PNG_WRITE_EMPTY_PLTE_SUPPORTED /* useful for MNG applications */
474#endif
475
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500476#ifndef PNG_NO_STDIO
Glenn Randers-Pehrsonc4a2ae61998-01-16 22:06:18 -0600477#define PNG_TIME_RFC1123_SUPPORTED
Glenn Randers-Pehrson70e3f541998-01-03 22:40:55 -0600478#endif
Andreas Dilger47a0c421997-05-16 02:46:07 -0500479
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600480/* This adds extra functions in pngget.c for accessing data from the
481 * info pointer (added in version 0.99)
482 * png_get_image_width()
483 * png_get_image_height()
484 * png_get_bit_depth()
485 * png_get_color_type()
486 * png_get_compression_type()
487 * png_get_filter_type()
488 * png_get_interlace_type()
489 * png_get_pixel_aspect_ratio()
490 * png_get_pixels_per_meter()
491 * png_get_x_offset_pixels()
492 * png_get_y_offset_pixels()
493 * png_get_x_offset_microns()
494 * png_get_y_offset_microns()
495 */
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500496#ifndef PNG_NO_EASY_ACCESS
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600497#define PNG_EASY_ACCESS_SUPPORTED
498#endif
499
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -0600500#if defined(PNG_USE_PNGVCRD) || defined(PNG_USE_PNGGCCRD) && \
501 !defined(PNG_NO_ASSEMBLER_CODE)
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -0500502#define PNG_ASSEMBLER_CODE_SUPPORTED
503#endif
504
Glenn Randers-Pehrsonc4a2ae61998-01-16 22:06:18 -0600505/* These are currently experimental features, define them if you want */
506
507/* very little testing */
508/*
Glenn Randers-Pehrsoncbe52d81998-02-28 07:00:24 -0600509#define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500510#ifndef PNG_NO_USER_MEM
Glenn Randers-Pehrsonf7d1a171998-06-06 15:31:35 -0500511#define PNG_USER_MEM_SUPPORTED
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500512#endif
Glenn Randers-Pehrsonc4a2ae61998-01-16 22:06:18 -0600513*/
Andreas Dilger47a0c421997-05-16 02:46:07 -0500514
515/* This is only for PowerPC big-endian and 680x0 systems */
Glenn Randers-Pehrsonc4a2ae61998-01-16 22:06:18 -0600516/* some testing */
517/*
518#define PNG_READ_BIG_ENDIAN_SUPPORTED
519*/
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500520
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600521/* These functions are turned off by default, as they will be phased out. */
Glenn Randers-Pehrsonc4a2ae61998-01-16 22:06:18 -0600522/*
523#define PNG_USELESS_TESTS_SUPPORTED
524#define PNG_CORRECT_PALETTE_SUPPORTED
525*/
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600526
Andreas Dilger47a0c421997-05-16 02:46:07 -0500527/* Any chunks you are not interested in, you can undef here. The
528 * ones that allocate memory may be expecially important (hIST,
529 * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600530 * a bit smaller.
Andreas Dilger47a0c421997-05-16 02:46:07 -0500531 */
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500532
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500533#if !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
534 !defined(PNG_NO_READ_ANCILLARY_CHUNKS)
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600535#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
536#endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500537#if !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
538 !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS)
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600539#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
540#endif
541
542#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600543
544#ifdef PNG_NO_READ_TEXT
545# define PNG_NO_READ_iTXt
546# define PNG_NO_READ_tEXt
547# define PNG_NO_READ_zTXt
548#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500549#ifndef PNG_NO_READ_bKGD
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600550# define PNG_READ_bKGD_SUPPORTED
551# define PNG_bKGD_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500552#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500553#ifndef PNG_NO_READ_cHRM
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600554# define PNG_READ_cHRM_SUPPORTED
555# define PNG_cHRM_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500556#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500557#ifndef PNG_NO_READ_gAMA
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600558# define PNG_READ_gAMA_SUPPORTED
559# define PNG_gAMA_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500560#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500561#ifndef PNG_NO_READ_hIST
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600562# define PNG_READ_hIST_SUPPORTED
563# define PNG_hIST_SUPPORTED
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600564#endif
565#ifndef PNG_NO_READ_iCCP
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600566# define PNG_READ_iCCP_SUPPORTED
567# define PNG_iCCP_SUPPORTED
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600568#endif
569#ifndef PNG_NO_READ_iTXt
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600570# define PNG_READ_iTXt_SUPPORTED
571# define PNG_iTXt_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500572#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500573#ifndef PNG_NO_READ_oFFs
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600574# define PNG_READ_oFFs_SUPPORTED
575# define PNG_oFFs_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500576#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500577#ifndef PNG_NO_READ_pCAL
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600578# define PNG_READ_pCAL_SUPPORTED
579# define PNG_pCAL_SUPPORTED
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600580#endif
581#ifndef PNG_NO_READ_sCAL
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600582# define PNG_READ_sCAL_SUPPORTED
583# define PNG_sCAL_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500584#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500585#ifndef PNG_NO_READ_pHYs
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600586# define PNG_READ_pHYs_SUPPORTED
587# define PNG_pHYs_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500588#endif
589#ifndef PNG_NO_READ_sBIT
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600590# define PNG_READ_sBIT_SUPPORTED
591# define PNG_sBIT_SUPPORTED
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600592#endif
593#ifndef PNG_NO_READ_sPLT
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600594# define PNG_READ_sPLT_SUPPORTED
595# define PNG_sPLT_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500596#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500597#ifndef PNG_NO_READ_sRGB
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600598# define PNG_READ_sRGB_SUPPORTED
599# define PNG_sRGB_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500600#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500601#ifndef PNG_NO_READ_tEXt
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600602# define PNG_READ_tEXt_SUPPORTED
603# define PNG_tEXt_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500604#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500605#ifndef PNG_NO_READ_tIME
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600606# define PNG_READ_tIME_SUPPORTED
607# define PNG_tIME_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500608#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500609#ifndef PNG_NO_READ_tRNS
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600610# define PNG_READ_tRNS_SUPPORTED
611# define PNG_tRNS_SUPPORTED
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500612#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500613#ifndef PNG_NO_READ_zTXt
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600614# define PNG_READ_zTXt_SUPPORTED
615# define PNG_zTXt_SUPPORTED
616#endif
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500617#ifndef PNG_NO_READ_UNKNOWN_CHUNKS
618# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
Glenn Randers-Pehrson98c9d732000-05-03 21:06:11 -0500619# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
620# define PNG_UNKNOWN_CHUNKS_SUPPORTED
621# endif
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500622# ifndef PNG_NO_HANDLE_AS_UNKNOWN
623# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
624# endif
625#endif
626#if !defined (PNG_NO_READ_USER_CHUNKS) && \
Glenn Randers-Pehrson75294572000-05-06 14:09:57 -0500627 defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600628# define PNG_READ_USER_CHUNKS_SUPPORTED
629# define PNG_USER_CHUNKS_SUPPORTED
630# ifdef PNG_NO_READ_UNKNOWN_CHUNKS
631# undef PNG_NO_READ_UNKNOWN_CHUNKS
632# endif
633# ifdef PNG_NO_HANDLE_AS_UNKNOWN
634# undef PNG_NO_HANDLE_AS_UNKNOWN
635# endif
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600636#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500637#ifndef PNG_NO_READ_OPT_PLTE
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600638# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */
639#endif /* optional PLTE chunk in RGB and RGBA images */
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600640#if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \
641 defined(PNG_READ_zTXt_SUPPORTED)
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600642# define PNG_READ_TEXT_SUPPORTED
643# define PNG_TEXT_SUPPORTED
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600644#endif
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600645#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500646
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600647#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600648#ifdef PNG_NO_WRITE_TEXT
649# define PNG_NO_WRITE_iTXt
650# define PNG_NO_WRITE_tEXt
651# define PNG_NO_WRITE_zTXt
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600652#endif
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600653#ifndef PNG_NO_WRITE_bKGD
654# define PNG_WRITE_bKGD_SUPPORTED
655# ifndef PNG_bKGD_SUPPORTED
656# define PNG_bKGD_SUPPORTED
657# endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500658#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500659#ifndef PNG_NO_WRITE_cHRM
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600660# define PNG_WRITE_cHRM_SUPPORTED
661# ifndef PNG_cHRM_SUPPORTED
662# define PNG_cHRM_SUPPORTED
663# endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500664#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500665#ifndef PNG_NO_WRITE_gAMA
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600666# define PNG_WRITE_gAMA_SUPPORTED
667# ifndef PNG_gAMA_SUPPORTED
668# define PNG_gAMA_SUPPORTED
669# endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500670#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500671#ifndef PNG_NO_WRITE_hIST
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600672# define PNG_WRITE_hIST_SUPPORTED
673# ifndef PNG_hIST_SUPPORTED
674# define PNG_hIST_SUPPORTED
675# endif
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600676#endif
677#ifndef PNG_NO_WRITE_iCCP
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600678# define PNG_WRITE_iCCP_SUPPORTED
679# ifndef PNG_iCCP_SUPPORTED
680# define PNG_iCCP_SUPPORTED
681# endif
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600682#endif
683#ifndef PNG_NO_WRITE_iTXt
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600684# define PNG_WRITE_iTXt_SUPPORTED
685# ifndef PNG_iTXt_SUPPORTED
686# define PNG_iTXt_SUPPORTED
687# endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500688#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500689#ifndef PNG_NO_WRITE_oFFs
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600690# define PNG_WRITE_oFFs_SUPPORTED
691# ifndef PNG_oFFs_SUPPORTED
692# define PNG_oFFs_SUPPORTED
693# endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500694#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500695#ifndef PNG_NO_WRITE_pCAL
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600696# define PNG_WRITE_pCAL_SUPPORTED
697# ifndef PNG_pCAL_SUPPORTED
698# define PNG_pCAL_SUPPORTED
699# endif
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600700#endif
701#ifndef PNG_NO_WRITE_sCAL
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600702# define PNG_WRITE_sCAL_SUPPORTED
703# ifndef PNG_sCAL_SUPPORTED
704# define PNG_sCAL_SUPPORTED
705# endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500706#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500707#ifndef PNG_NO_WRITE_pHYs
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600708# define PNG_WRITE_pHYs_SUPPORTED
709# ifndef PNG_pHYs_SUPPORTED
710# define PNG_pHYs_SUPPORTED
711# endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500712#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500713#ifndef PNG_NO_WRITE_sBIT
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600714# define PNG_WRITE_sBIT_SUPPORTED
715# ifndef PNG_sBIT_SUPPORTED
716# define PNG_sBIT_SUPPORTED
717# endif
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600718#endif
719#ifndef PNG_NO_WRITE_sPLT
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600720# define PNG_WRITE_sPLT_SUPPORTED
721# ifndef PNG_sPLT_SUPPORTED
722# define PNG_sPLT_SUPPORTED
723# endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500724#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500725#ifndef PNG_NO_WRITE_sRGB
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600726# define PNG_WRITE_sRGB_SUPPORTED
727# ifndef PNG_sRGB_SUPPORTED
728# define PNG_sRGB_SUPPORTED
729# endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500730#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500731#ifndef PNG_NO_WRITE_tEXt
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600732# define PNG_WRITE_tEXt_SUPPORTED
733# ifndef PNG_tEXt_SUPPORTED
734# define PNG_tEXt_SUPPORTED
735# endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500736#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500737#ifndef PNG_NO_WRITE_tIME
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600738# define PNG_WRITE_tIME_SUPPORTED
739# ifndef PNG_tIME_SUPPORTED
740# define PNG_tIME_SUPPORTED
741# endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500742#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500743#ifndef PNG_NO_WRITE_tRNS
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600744# define PNG_WRITE_tRNS_SUPPORTED
745# ifndef PNG_tRNS_SUPPORTED
746# define PNG_tRNS_SUPPORTED
747# endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500748#endif
Glenn Randers-Pehrson8686fff1998-05-21 09:27:50 -0500749#ifndef PNG_NO_WRITE_zTXt
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600750# define PNG_WRITE_zTXt_SUPPORTED
751# ifndef PNG_zTXt_SUPPORTED
752# define PNG_zTXt_SUPPORTED
753# endif
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600754#endif
755#ifndef PNG_NO_WRITE_UNKNOWN_CHUNKS
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600756# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
757# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED
758# define PNG_UNKNOWN_CHUNKS_SUPPORTED
759# endif
760# ifndef PNG_NO_HANDLE_AS_UNKNOWN
761# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
762# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
763# endif
764# endif
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600765#endif
766#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \
767 defined(PNG_WRITE_zTXt_SUPPORTED)
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600768# define PNG_WRITE_TEXT_SUPPORTED
769# ifndef PNG_TEXT_SUPPORTED
770# define PNG_TEXT_SUPPORTED
771# endif
Glenn Randers-Pehrsond0dce401998-05-09 10:02:29 -0500772#endif
Glenn Randers-Pehrson46f61e21998-01-30 21:45:12 -0600773#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500774
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600775/* Turn this off to disable png_read_png() and
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -0600776 * png_write_png() and leave the row_pointers member
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600777 * out of the info structure.
778 */
779#ifndef PNG_NO_INFO_IMAGE
780# define PNG_INFO_IMAGE_SUPPORTED
781#endif
782
Andreas Dilger47a0c421997-05-16 02:46:07 -0500783/* need the time information for reading tIME chunks */
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600784#if defined(PNG_tIME_SUPPORTED)
785# include <time.h>
Andreas Dilger47a0c421997-05-16 02:46:07 -0500786#endif
787
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600788/* Some typedefs to get us started. These should be safe on most of the
Andreas Dilger47a0c421997-05-16 02:46:07 -0500789 * common platforms. The typedefs should be at least as large as the
790 * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
791 * don't have to be exactly that size. Some compilers dislike passing
792 * unsigned shorts as function parameters, so you may be better off using
793 * unsigned int for png_uint_16. Likewise, for 64-bit systems, you may
794 * want to have unsigned int for png_uint_32 instead of unsigned long.
795 */
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500796
797typedef unsigned long png_uint_32;
798typedef long png_int_32;
799typedef unsigned short png_uint_16;
800typedef short png_int_16;
801typedef unsigned char png_byte;
802
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600803/* This is usually size_t. It is typedef'ed just in case you need it to
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500804 change (I'm not sure if you will or not, so I thought I'd be safe) */
805typedef size_t png_size_t;
806
Andreas Dilger47a0c421997-05-16 02:46:07 -0500807/* The following is needed for medium model support. It cannot be in the
808 * PNG_INTERNAL section. Needs modification for other compilers besides
809 * MSC. Model independent support declares all arrays and pointers to be
810 * large using the far keyword. The zlib version used must also support
811 * model independent data. As of version zlib 1.0.4, the necessary changes
812 * have been made in zlib. The USE_FAR_KEYWORD define triggers other
813 * changes that are needed. (Tim Wegner)
814 */
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500815
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600816/* Separate compiler dependencies (problem here is that zlib.h always
817 defines FAR. (SJT) */
Guy Schalnat6d764711995-12-19 03:22:19 -0600818#ifdef __BORLANDC__
819#if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
820#define LDATA 1
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500821#else
Guy Schalnat6d764711995-12-19 03:22:19 -0600822#define LDATA 0
823#endif
824
825#if !defined(__WIN32__) && !defined(__FLAT__)
826#define PNG_MAX_MALLOC_64K
827#if (LDATA != 1)
828#ifndef FAR
829#define FAR __far
830#endif
831#define USE_FAR_KEYWORD
Guy Schalnatb2e01bd1996-01-26 01:38:47 -0600832#endif /* LDATA != 1 */
Guy Schalnat6d764711995-12-19 03:22:19 -0600833
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600834/* Possibly useful for moving data out of default segment.
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600835 * Uncomment it if you want. Could also define FARDATA as
836 * const if your compiler supports it. (SJT)
Guy Schalnat6d764711995-12-19 03:22:19 -0600837# define FARDATA FAR
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600838 */
Guy Schalnat6d764711995-12-19 03:22:19 -0600839#endif /* __WIN32__, __FLAT__ */
840
Guy Schalnatb2e01bd1996-01-26 01:38:47 -0600841#endif /* __BORLANDC__ */
Guy Schalnat6d764711995-12-19 03:22:19 -0600842
843
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600844/* Suggest testing for specific compiler first before testing for
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600845 * FAR. The Watcom compiler defines both __MEDIUM__ and M_I86MM,
846 * making reliance oncertain keywords suspect. (SJT)
847 */
Guy Schalnat6d764711995-12-19 03:22:19 -0600848
849/* MSC Medium model */
850#if defined(FAR)
851# if defined(M_I86MM)
852# define USE_FAR_KEYWORD
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600853# define FARDATA FAR
854# include <dos.h>
Guy Schalnat6d764711995-12-19 03:22:19 -0600855# endif
856#endif
857
858/* SJT: default case */
859#ifndef FAR
Guy Schalnat51f0eb41995-09-26 05:22:39 -0500860# define FAR
861#endif
862
Andreas Dilger47a0c421997-05-16 02:46:07 -0500863/* At this point FAR is always defined */
Guy Schalnat6d764711995-12-19 03:22:19 -0600864#ifndef FARDATA
865#define FARDATA
866#endif
867
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600868/* Typedef for floating-point numbers that are converted
869 to fixed-point with a multiple of 100,000, e.g., int_gamma */
870typedef png_int_32 png_fixed_point;
871
Andreas Dilger47a0c421997-05-16 02:46:07 -0500872/* Add typedefs for pointers */
Andreas Dilger02ad0ef1997-01-17 01:34:35 -0600873typedef void FAR * png_voidp;
Guy Schalnat6d764711995-12-19 03:22:19 -0600874typedef png_byte FAR * png_bytep;
875typedef png_uint_32 FAR * png_uint_32p;
876typedef png_int_32 FAR * png_int_32p;
877typedef png_uint_16 FAR * png_uint_16p;
878typedef png_int_16 FAR * png_int_16p;
879typedef PNG_CONST char FAR * png_const_charp;
880typedef char FAR * png_charp;
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600881typedef png_fixed_point FAR * png_fixed_point_p;
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600882#ifdef PNG_FLOATING_POINT_SUPPORTED
Andreas Dilger47a0c421997-05-16 02:46:07 -0500883typedef double FAR * png_doublep;
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600884#endif
Guy Schalnat6d764711995-12-19 03:22:19 -0600885
Andreas Dilger47a0c421997-05-16 02:46:07 -0500886/* Pointers to pointers; i.e. arrays */
Guy Schalnat6d764711995-12-19 03:22:19 -0600887typedef png_byte FAR * FAR * png_bytepp;
888typedef png_uint_32 FAR * FAR * png_uint_32pp;
889typedef png_int_32 FAR * FAR * png_int_32pp;
890typedef png_uint_16 FAR * FAR * png_uint_16pp;
891typedef png_int_16 FAR * FAR * png_int_16pp;
892typedef PNG_CONST char FAR * FAR * png_const_charpp;
893typedef char FAR * FAR * png_charpp;
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -0600894typedef png_fixed_point FAR * FAR * png_fixed_point_pp;
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600895#ifdef PNG_FLOATING_POINT_SUPPORTED
Andreas Dilger47a0c421997-05-16 02:46:07 -0500896typedef double FAR * FAR * png_doublepp;
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -0600897#endif
Guy Schalnat6d764711995-12-19 03:22:19 -0600898
Andreas Dilger47a0c421997-05-16 02:46:07 -0500899/* Pointers to pointers to pointers; i.e. pointer to array */
900typedef char FAR * FAR * FAR * png_charppp;
Guy Schalnat6d764711995-12-19 03:22:19 -0600901
Andreas Dilger47a0c421997-05-16 02:46:07 -0500902/* libpng typedefs for types in zlib. If zlib changes
903 * or another compression library is used, then change these.
904 * Eliminates need to change all the source files.
905 */
Guy Schalnat6d764711995-12-19 03:22:19 -0600906typedef charf * png_zcharp;
907typedef charf * FAR * png_zcharpp;
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -0600908typedef z_stream FAR * png_zstreamp;
Guy Schalnat6d764711995-12-19 03:22:19 -0600909
Glenn Randers-Pehrson75294572000-05-06 14:09:57 -0500910/*
911 * Define PNG_BUILD_DLL if the module being built is a Windows
912 * LIBPNG DLL.
913 *
914 * Define PNG_DLL if you want to *link* to the Windows LIBPNG DLL.
915 * It is equivalent to Microsoft predefined macro _DLL which is
916 * automatically defined when you compile using the share
917 * version of the CRT (C Run-Time library)
918 */
919
920#if !defined(PNG_DLL) && defined(PNG_BUILD_DLL)
921# define PNG_DLL
922#endif
923
Glenn Randers-Pehrsonec61c232000-05-16 06:17:36 -0500924/* Do not use global arrays (helps with building DLL's)
925 * They are no longer used in libpng itself, since version 1.0.5c,
926 * but might be required for some pre-1.0.5c applications.
927 */
928#if !defined(PNG_USE_LOCAL_ARRAYS) && !defined(PNG_USE_GLOBAL_ARRAYS)
929# if defined(PNG_NO_GLOBAL_ARRAYS) || (defined(__GNUC__) && defined(PNG_DLL))
930# define PNG_USE_LOCAL_ARRAYS
931# else
932# define PNG_USE_GLOBAL_ARRAYS
933# endif
934#endif
935
Glenn Randers-Pehrson75294572000-05-06 14:09:57 -0500936#if defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF)
937# define PNG_IMPEXP
938#endif
939
940#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \
941 defined(_Windows) || defined(_WINDOWS) || \
942 defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
943
944# define PNGAPI _cdecl
945
946# if !defined(PNG_IMPEXP) && (!defined(PNG_DLL) || \
947 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */)
948# define PNG_IMPEXP
949# endif
950
951# if !defined(PNG_IMPEXP)
952
953# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol
954# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol
955
956 /* Borland/Microsoft */
957# if defined(_MSC_VER) || defined(__BORLANDC__)
958# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500)
959# define PNG_EXPORT PNG_EXPORT_TYPE1
960# else
961# define PNG_EXPORT PNG_EXPORT_TYPE2
962# if defined(PNG_BUILD_DLL)
963# define PNG_IMPEXP __export
964# else
965# define PNG_IMPEXP /*__import*/ /* doesn't exist AFAIK in
966 VC++*/
967# endif /* Exists in Borland C++ for
968 C++ classes (== huge) */
969# endif
970# endif
971
972# if !defined(PNG_IMPEXP)
973# if defined(PNG_BUILD_DLL)
974# define PNG_IMPEXP __declspec(dllexport)
975# else
976# define PNG_IMPEXP __declspec(dllimport)
977# endif
978# endif
979# endif /* PNG_IMPEXP */
980#else
981# if 0 /* ... other platforms, with other meanings */
982# else
983# define PNGAPI
984# endif
985#endif
Andreas Dilger47a0c421997-05-16 02:46:07 -0500986
Glenn Randers-Pehrsonf8b008c1999-09-18 10:54:36 -0500987#ifndef PNG_EXPORT
Glenn Randers-Pehrson75294572000-05-06 14:09:57 -0500988# define PNG_EXPORT(type,symbol) type PNGAPI symbol
989#endif
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -0600990
Glenn Randers-Pehrson75294572000-05-06 14:09:57 -0500991#if defined(__MINGW32__) || defined(__CYGWIN32__)
992# define PNG_ATTR_DLLIMP
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -0600993#endif
994
Glenn Randers-Pehrson75294572000-05-06 14:09:57 -0500995#ifdef PNG_USE_GLOBAL_ARRAYS
Glenn Randers-Pehrson074af5e1999-11-28 23:32:18 -0600996#ifndef PNG_EXPORT_VAR
Glenn Randers-Pehrson1ef65b62000-05-12 06:19:53 -0500997# define PNG_EXPORT_VAR(type) extern type
Glenn Randers-Pehrson074af5e1999-11-28 23:32:18 -0600998#endif
Glenn Randers-Pehrson75294572000-05-06 14:09:57 -0500999#endif
Andreas Dilger47a0c421997-05-16 02:46:07 -05001000
Glenn Randers-Pehrson75294572000-05-06 14:09:57 -05001001/* User may want to use these so they are not in PNG_INTERNAL. Any library
1002 * functions that are passed far data must be model independent.
Glenn Randers-Pehrsonb6ce43d1998-01-01 07:13:13 -06001003 */
Andreas Dilger02ad0ef1997-01-17 01:34:35 -06001004
Glenn Randers-Pehrson61c32d92000-02-04 23:40:16 -06001005#ifndef PNG_ABORT
1006# define PNG_ABORT() abort()
1007#endif
1008
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -06001009#ifdef PNG_SETJMP_SUPPORTED
Glenn Randers-Pehrson520a7642000-03-21 05:13:06 -06001010# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
1011#else
1012# define png_jmpbuf(png_ptr) \
1013 (LIBPNG_WAS_COMPILED_WITH__PNG_SETJMP_NOT_SUPPORTED)
Glenn Randers-Pehrsona77ef622000-02-18 13:48:52 -06001014#endif
1015
Guy Schalnat51f0eb41995-09-26 05:22:39 -05001016#if defined(USE_FAR_KEYWORD) /* memory model independent fns */
Andreas Dilger02ad0ef1997-01-17 01:34:35 -06001017/* use this to make far-to-near assignments */
1018# define CHECK 1
1019# define NOCHECK 0
Glenn Randers-Pehrsona357b991998-02-08 20:56:40 -06001020# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
1021# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
Glenn Randers-Pehrsonf7d1a171998-06-06 15:31:35 -05001022# define png_strcpy _fstrcpy
Guy Schalnat51f0eb41995-09-26 05:22:39 -05001023# define png_strlen _fstrlen
Guy Schalnatb2e01bd1996-01-26 01:38:47 -06001024# define png_memcmp _fmemcmp /* SJT: added */
Guy Schalnat51f0eb41995-09-26 05:22:39 -05001025# define png_memcpy _fmemcpy
1026# define png_memset _fmemset
1027#else /* use the usual functions */
Andreas Dilger02ad0ef1997-01-17 01:34:35 -06001028# define CVT_PTR(ptr) (ptr)
1029# define CVT_PTR_NOCHECK(ptr) (ptr)
Glenn Randers-Pehrsonf7d1a171998-06-06 15:31:35 -05001030# define png_strcpy strcpy
Guy Schalnat51f0eb41995-09-26 05:22:39 -05001031# define png_strlen strlen
Guy Schalnatb2e01bd1996-01-26 01:38:47 -06001032# define png_memcmp memcmp /* SJT: added */
Guy Schalnat51f0eb41995-09-26 05:22:39 -05001033# define png_memcpy memcpy
1034# define png_memset memset
1035#endif
1036/* End of memory model independent support */
1037
Glenn Randers-Pehrson166c5a31999-12-10 09:43:02 -06001038/* Just a little check that someone hasn't tried to define something
Glenn Randers-Pehrson5c6aeb21998-12-29 11:47:59 -06001039 * contradictory.
Andreas Dilger47a0c421997-05-16 02:46:07 -05001040 */
1041#if (PNG_ZBUF_SIZE > 65536) && defined(PNG_MAX_MALLOC_64K)
1042#undef PNG_ZBUF_SIZE
1043#define PNG_ZBUF_SIZE 65536
1044#endif
1045
Guy Schalnat51f0eb41995-09-26 05:22:39 -05001046#endif /* PNGCONF_H */
1047