Main Page   Class Hierarchy   Compound List   File List   Compound Members  

pngconf.h

00001 
00002 /* pngconf.h - machine configurable file for libpng
00003  *
00004  * libpng 1.0.5 - October 15, 1999
00005  * For conditions of distribution and use, see copyright notice in png.h
00006  * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
00007  * Copyright (c) 1996, 1997 Andreas Dilger
00008  * Copyright (c) 1998, 1999 Glenn Randers-Pehrson
00009  */
00010 
00011 /* Any machine specific code is near the front of this file, so if you
00012  * are configuring libpng for a machine, you may want to read the section
00013  * starting here down to where it starts to typedef png_color, png_text,
00014  * and png_info.
00015  */
00016 
00017 #ifndef PNGCONF_H
00018 #define PNGCONF_H
00019 
00020 /* This is the size of the compression buffer, and thus the size of
00021  * an IDAT chunk.  Make this whatever size you feel is best for your
00022  * machine.  One of these will be allocated per png_struct.  When this
00023  * is full, it writes the data to the disk, and does some other
00024  * calculations.  Making this an extremely small size will slow
00025  * the library down, but you may want to experiment to determine
00026  * where it becomes significant, if you are concerned with memory
00027  * usage.  Note that zlib allocates at least 32Kb also.  For readers,
00028  * this describes the size of the buffer available to read the data in.
00029  * Unless this gets smaller than the size of a row (compressed),
00030  * it should not make much difference how big this is.
00031  */
00032 
00033 #ifndef PNG_ZBUF_SIZE
00034 #define PNG_ZBUF_SIZE 8192
00035 #endif
00036 
00037 /* If you are running on a machine where you cannot allocate more
00038  * than 64K of memory at once, uncomment this.  While libpng will not
00039  * normally need that much memory in a chunk (unless you load up a very
00040  * large file), zlib needs to know how big of a chunk it can use, and
00041  * libpng thus makes sure to check any memory allocation to verify it
00042  * will fit into memory.
00043 #define PNG_MAX_MALLOC_64K
00044  */
00045 #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K)
00046 #define PNG_MAX_MALLOC_64K
00047 #endif
00048 
00049 /* This protects us against compilers that run on a windowing system
00050  * and thus don't have or would rather us not use the stdio types:
00051  * stdin, stdout, and stderr.  The only one currently used is stderr
00052  * in png_error() and png_warning().  #defining PNG_NO_CONSOLE_IO will
00053  * prevent these from being compiled and used. #defining PNG_NO_STDIO
00054  * will also prevent these, plus will prevent the entire set of stdio
00055  * macros and functions (FILE *, printf, etc.) from being compiled and used,
00056  * unless (PNG_DEBUG > 0) has been #defined.
00057  *
00058  * #define PNG_NO_CONSOLE_IO
00059  * #define PNG_NO_STDIO
00060  */
00061 
00062 #  ifdef PNG_NO_STDIO
00063 #    ifndef PNG_NO_CONSOLE_IO
00064 #      define PNG_NO_CONSOLE_IO
00065 #    endif
00066 #    ifdef PNG_DEBUG
00067 #      if (PNG_DEBUG > 0)
00068 #        include <stdio.h>
00069 #      endif
00070 #    endif
00071 #  else
00072 #    include <stdio.h>
00073 #  endif
00074 
00075 /* This macro protects us against machines that don't have function
00076  * prototypes (ie K&R style headers).  If your compiler does not handle
00077  * function prototypes, define this macro and use the included ansi2knr.
00078  * I've always been able to use _NO_PROTO as the indicator, but you may
00079  * need to drag the empty declaration out in front of here, or change the
00080  * ifdef to suit your own needs.
00081  */
00082 #ifndef PNGARG
00083 
00084 #ifdef OF /* zlib prototype munger */
00085 #define PNGARG(arglist) OF(arglist)
00086 #else
00087 
00088 #ifdef _NO_PROTO
00089 #define PNGARG(arglist) ()
00090 #else
00091 #define PNGARG(arglist) arglist
00092 #endif /* _NO_PROTO */
00093 
00094 #endif /* OF */
00095 
00096 #endif /* PNGARG */
00097 
00098 /* Try to determine if we are compiling on a Mac.  Note that testing for
00099  * just __MWERKS__ is not good enough, because the Codewarrior is now used
00100  * on non-Mac platforms.
00101  */
00102 #ifndef MACOS
00103 #if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
00104     defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
00105 #define MACOS
00106 #endif
00107 #endif
00108 
00109 /* enough people need this for various reasons to include it here */
00110 #if !defined(MACOS) && !defined(RISCOS)
00111 #include <sys/types.h>
00112 #endif
00113 
00114 /* This is an attempt to force a single setjmp behaviour on Linux.  If
00115  * the X config stuff didn't define _BSD_SOURCE we wouldn't need this.
00116  */
00117 #ifdef __linux__
00118 #ifdef _BSD_SOURCE
00119 #define _PNG_SAVE_BSD_SOURCE
00120 #undef _BSD_SOURCE
00121 #endif
00122 #ifdef _SETJMP_H
00123 __png.h__ already includes setjmp.h
00124 __dont__ include it again
00125 #endif
00126 #endif /* __linux__ */
00127 
00128 /* include setjmp.h for error handling */
00129 #include <setjmp.h>
00130 
00131 #ifdef __linux__
00132 #ifdef _PNG_SAVE_BSD_SOURCE
00133 #define _BSD_SOURCE
00134 #undef _PNG_SAVE_BSD_SOURCE
00135 #endif
00136 #endif /* __linux__ */
00137 
00138 #ifdef BSD
00139 #include <strings.h>
00140 #else
00141 #include <string.h>
00142 #endif
00143 
00144 /* Other defines for things like memory and the like can go here.  */
00145 #ifdef PNG_INTERNAL
00146 #include <stdlib.h>
00147 
00148 /* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which
00149  * aren't usually used outside the library (as far as I know), so it is
00150  * debatable if they should be exported at all.  In the future, when it is
00151  * possible to have run-time registry of chunk-handling functions, some of
00152  * these will be made available again.
00153 #define PNG_EXTERN extern
00154  */
00155 #define PNG_EXTERN
00156 
00157 /* Other defines specific to compilers can go here.  Try to keep
00158  * them inside an appropriate ifdef/endif pair for portability.
00159  */
00160 
00161 #if defined(MACOS)
00162 /* We need to check that <math.h> hasn't already been included earlier
00163  * as it seems it doesn't agree with <fp.h>, yet we should really use
00164  * <fp.h> if possible.
00165  */
00166 #if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
00167 #include <fp.h>
00168 #endif
00169 #else
00170 #include <math.h>
00171 #endif
00172 
00173 /* Codewarrior on NT has linking problems without this. */
00174 #if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
00175 #define PNG_ALWAYS_EXTERN
00176 #endif
00177 
00178 /* For some reason, Borland C++ defines memcmp, etc. in mem.h, not
00179  * stdlib.h like it should (I think).  Or perhaps this is a C++
00180  * "feature"?
00181  */
00182 #ifdef __TURBOC__
00183 #include <mem.h>
00184 #include "alloc.h"
00185 #endif
00186 
00187 #ifdef _MSC_VER
00188 #include <malloc.h>
00189 #endif
00190 
00191 /* This controls how fine the dithering gets.  As this allocates
00192  * a largish chunk of memory (32K), those who are not as concerned
00193  * with dithering quality can decrease some or all of these.
00194  */
00195 #ifndef PNG_DITHER_RED_BITS
00196 #define PNG_DITHER_RED_BITS 5
00197 #endif
00198 #ifndef PNG_DITHER_GREEN_BITS
00199 #define PNG_DITHER_GREEN_BITS 5
00200 #endif
00201 #ifndef PNG_DITHER_BLUE_BITS
00202 #define PNG_DITHER_BLUE_BITS 5
00203 #endif
00204 
00205 /* This controls how fine the gamma correction becomes when you
00206  * are only interested in 8 bits anyway.  Increasing this value
00207  * results in more memory being used, and more pow() functions
00208  * being called to fill in the gamma tables.  Don't set this value
00209  * less then 8, and even that may not work (I haven't tested it).
00210  */
00211 
00212 #ifndef PNG_MAX_GAMMA_8
00213 #define PNG_MAX_GAMMA_8 11
00214 #endif
00215 
00216 /* This controls how much a difference in gamma we can tolerate before
00217  * we actually start doing gamma conversion.
00218  */
00219 #ifndef PNG_GAMMA_THRESHOLD
00220 #define PNG_GAMMA_THRESHOLD 0.05
00221 #endif
00222 
00223 #endif /* PNG_INTERNAL */
00224 
00225 /* The following uses const char * instead of char * for error
00226  * and warning message functions, so some compilers won't complain.
00227  * If you do not want to use const, define PNG_NO_CONST here.
00228  */
00229 
00230 #ifndef PNG_NO_CONST
00231 #  define PNG_CONST const
00232 #else
00233 #  define PNG_CONST
00234 #endif
00235 
00236 /* The following defines give you the ability to remove code from the
00237  * library that you will not be using.  I wish I could figure out how to
00238  * automate this, but I can't do that without making it seriously hard
00239  * on the users.  So if you are not using an ability, change the #define
00240  * to and #undef, and that part of the library will not be compiled.  If
00241  * your linker can't find a function, you may want to make sure the
00242  * ability is defined here.  Some of these depend upon some others being
00243  * defined.  I haven't figured out all the interactions here, so you may
00244  * have to experiment awhile to get everything to compile.  If you are
00245  * creating or using a shared library, you probably shouldn't touch this,
00246  * as it will affect the size of the structures, and this will cause bad
00247  * things to happen if the library and/or application ever change.
00248  */
00249 
00250 /* Any transformations you will not be using can be undef'ed here */
00251 
00252 /* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user
00253    to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
00254    on the compile line, then pick and choose which ones to define without
00255    having to edit this file. It is safe to use the *TRANSFORMS_NOT_SUPPORTED
00256    if you only want to have a png-compliant reader/writer but don't need
00257    any of the extra transformations.  This saves about 80 kbytes in a
00258    typical installation of the library. (PNG_NO_* form added in version
00259    1.0.1c, for consistency)
00260  */
00261 
00262 
00263 #if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
00264     !defined(PNG_NO_READ_TRANSFORMS)
00265 #define PNG_READ_TRANSFORMS_SUPPORTED
00266 #endif
00267 #if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
00268     !defined(PNG_NO_WRITE_TRANSFORMS)
00269 #define PNG_WRITE_TRANSFORMS_SUPPORTED
00270 #endif
00271 
00272 #ifdef PNG_READ_TRANSFORMS_SUPPORTED
00273 #ifndef PNG_NO_READ_EXPAND
00274 #define PNG_READ_EXPAND_SUPPORTED
00275 #endif
00276 #ifndef PNG_NO_READ_SHIFT
00277 #define PNG_READ_SHIFT_SUPPORTED
00278 #endif
00279 #ifndef PNG_NO_READ_PACK
00280 #define PNG_READ_PACK_SUPPORTED
00281 #endif
00282 #ifndef PNG_NO_READ_BGR
00283 #define PNG_READ_BGR_SUPPORTED
00284 #endif
00285 #ifndef PNG_NO_READ_SWAP
00286 #define PNG_READ_SWAP_SUPPORTED
00287 #endif
00288 #ifndef PNG_NO_READ_PACKSWAP
00289 #define PNG_READ_PACKSWAP_SUPPORTED
00290 #endif
00291 #ifndef PNG_NO_READ_INVERT
00292 #define PNG_READ_INVERT_SUPPORTED
00293 #endif
00294 #ifndef PNG_NO_READ_DITHER
00295 #define PNG_READ_DITHER_SUPPORTED
00296 #endif
00297 #ifndef PNG_NO_READ_BACKGROUND
00298 #define PNG_READ_BACKGROUND_SUPPORTED
00299 #endif
00300 #ifndef PNG_NO_READ_16_TO_8
00301 #define PNG_READ_16_TO_8_SUPPORTED
00302 #endif
00303 #ifndef PNG_NO_READ_FILLER
00304 #define PNG_READ_FILLER_SUPPORTED
00305 #endif
00306 #ifndef PNG_NO_READ_GAMMA
00307 #define PNG_READ_GAMMA_SUPPORTED
00308 #endif
00309 #ifndef PNG_NO_READ_GRAY_TO_RGB
00310 #define PNG_READ_GRAY_TO_RGB_SUPPORTED
00311 #endif
00312 #ifndef PNG_NO_READ_SWAP_ALPHA
00313 #define PNG_READ_SWAP_ALPHA_SUPPORTED
00314 #endif
00315 #ifndef PNG_NO_READ_INVERT_ALPHA
00316 #define PNG_READ_INVERT_ALPHA_SUPPORTED
00317 #endif
00318 #ifndef PNG_NO_READ_STRIP_ALPHA
00319 #define PNG_READ_STRIP_ALPHA_SUPPORTED
00320 #endif
00321 #ifndef PNG_NO_READ_USER_TRANSFORM
00322 #define PNG_READ_USER_TRANSFORM_SUPPORTED
00323 #endif
00324 #ifndef PNG_NO_READ_RGB_TO_GRAY
00325 #define PNG_READ_RGB_TO_GRAY_SUPPORTED
00326 #endif
00327 #endif /* PNG_READ_TRANSFORMS_SUPPORTED */
00328 
00329 #if !defined(PNG_NO_PROGRESSIVE_READ) && \
00330  !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive   */
00331 #define PNG_PROGRESSIVE_READ_SUPPORTED       /* reading.  This is not talking */
00332 #endif                               /* about interlacing capability!  You'll */
00333               /* still have interlacing unless you change the following line: */
00334 #define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */
00335 
00336 #ifndef PNG_NO_READ_COMPOSITED_NODIV
00337 #define PNG_READ_COMPOSITE_NODIV_SUPPORTED    /* well tested on Intel and SGI */
00338 #endif
00339 
00340 #ifndef PNG_NO_READ_EMPTY_PLTE
00341 #define PNG_READ_EMPTY_PLTE_SUPPORTED  /* useful for MNG applications */
00342 #endif
00343 
00344 #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
00345 #ifndef PNG_NO_WRITE_SHIFT
00346 #define PNG_WRITE_SHIFT_SUPPORTED
00347 #endif
00348 #ifndef PNG_NO_WRITE_PACK
00349 #define PNG_WRITE_PACK_SUPPORTED
00350 #endif
00351 #ifndef PNG_NO_WRITE_BGR
00352 #define PNG_WRITE_BGR_SUPPORTED
00353 #endif
00354 #ifndef PNG_NO_WRITE_SWAP
00355 #define PNG_WRITE_SWAP_SUPPORTED
00356 #endif
00357 #ifndef PNG_NO_WRITE_PACKSWAP
00358 #define PNG_WRITE_PACKSWAP_SUPPORTED
00359 #endif
00360 #ifndef PNG_NO_WRITE_INVERT
00361 #define PNG_WRITE_INVERT_SUPPORTED
00362 #endif
00363 #ifndef PNG_NO_WRITE_FILLER
00364 #define PNG_WRITE_FILLER_SUPPORTED  /* This is the same as WRITE_STRIP_ALPHA */
00365 #endif
00366 #ifndef PNG_NO_WRITE_SWAP_ALPHA
00367 #define PNG_WRITE_SWAP_ALPHA_SUPPORTED
00368 #endif
00369 #ifndef PNG_NO_WRITE_INVERT_ALPHA
00370 #define PNG_WRITE_INVERT_ALPHA_SUPPORTED
00371 #endif
00372 #ifndef PNG_NO_WRITE_USER_TRANSFORM
00373 #define PNG_WRITE_USER_TRANSFORM_SUPPORTED
00374 #endif
00375 #endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
00376 
00377 #define PNG_WRITE_INTERLACING_SUPPORTED  /* not required for PNG-compliant
00378                                             encoders, but can cause trouble
00379                                             if left undefined */
00380 
00381 #ifndef PNG_NO_WRITE_WEIGHTED_FILTER
00382 #define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
00383 #endif
00384 
00385 #ifndef PNG_NO_WRITE_FLUSH
00386 #define PNG_WRITE_FLUSH_SUPPORTED
00387 #endif
00388 
00389 #ifndef PNG_NO_WRITE_EMPTY_PLTE
00390 #define PNG_WRITE_EMPTY_PLTE_SUPPORTED  /* useful for MNG applications */
00391 #endif
00392 
00393 #ifndef PNG_NO_STDIO
00394 #define PNG_TIME_RFC1123_SUPPORTED
00395 #endif
00396 
00397 /* This adds extra functions in pngget.c for accessing data from the
00398  * info pointer (added in version 0.99)
00399  * png_get_image_width()
00400  * png_get_image_height()
00401  * png_get_bit_depth()
00402  * png_get_color_type()
00403  * png_get_compression_type()
00404  * png_get_filter_type()
00405  * png_get_interlace_type()
00406  * png_get_pixel_aspect_ratio()
00407  * png_get_pixels_per_meter()
00408  * png_get_x_offset_pixels()
00409  * png_get_y_offset_pixels()
00410  * png_get_x_offset_microns()
00411  * png_get_y_offset_microns()
00412  */
00413 #ifndef PNG_NO_EASY_ACCESS
00414 #define PNG_EASY_ACCESS_SUPPORTED
00415 #endif
00416 
00417 #ifndef PNG_NO_ASSEMBLER_CODE
00418 #define PNG_ASSEMBLER_CODE_SUPPORTED
00419 #endif
00420 
00421 /* These are currently experimental features, define them if you want */
00422 
00423 /* very little testing */
00424 /*
00425 #define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
00426 #define PNG_USER_MEM_SUPPORTED
00427 */
00428 
00429 /* This is only for PowerPC big-endian and 680x0 systems */
00430 /* some testing */
00431 /*
00432 #define PNG_READ_BIG_ENDIAN_SUPPORTED
00433 */
00434 
00435 /* These functions are turned off by default, as they will be phased out. */
00436 /*
00437 #define  PNG_USELESS_TESTS_SUPPORTED
00438 #define  PNG_CORRECT_PALETTE_SUPPORTED
00439 */
00440 
00441 /* Any chunks you are not interested in, you can undef here.  The
00442  * ones that allocate memory may be expecially important (hIST,
00443  * tEXt, zTXt, tRNS, pCAL).  Others will just save time and make png_info
00444  * a bit smaller.
00445  */
00446 
00447 #if !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
00448     !defined(PNG_NO_READ_ANCILLARY_CHUNKS)
00449 #define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
00450 #endif
00451 #if !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \
00452     !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS)
00453 #define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
00454 #endif
00455 
00456 #ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
00457 #ifndef PNG_NO_READ_bKGD
00458 #define PNG_READ_bKGD_SUPPORTED
00459 #endif
00460 #ifndef PNG_NO_READ_cHRM
00461 #define PNG_READ_cHRM_SUPPORTED
00462 #endif
00463 #ifndef PNG_NO_READ_gAMA
00464 #define PNG_READ_gAMA_SUPPORTED
00465 #endif
00466 #ifndef PNG_NO_READ_hIST
00467 #define PNG_READ_hIST_SUPPORTED
00468 #endif
00469 #ifndef PNG_NO_READ_oFFs
00470 #define PNG_READ_oFFs_SUPPORTED
00471 #endif
00472 #ifndef PNG_NO_READ_pCAL
00473 #define PNG_READ_pCAL_SUPPORTED
00474 #endif
00475 #ifndef PNG_NO_READ_pHYs
00476 #define PNG_READ_pHYs_SUPPORTED
00477 #endif
00478 #ifndef PNG_NO_READ_sBIT
00479 #define PNG_READ_sBIT_SUPPORTED
00480 #endif
00481 #ifndef PNG_NO_READ_sRGB
00482 #define PNG_READ_sRGB_SUPPORTED
00483 #endif
00484 #ifndef PNG_NO_READ_tEXt
00485 #define PNG_READ_tEXt_SUPPORTED
00486 #endif
00487 #ifndef PNG_NO_READ_tIME
00488 #define PNG_READ_tIME_SUPPORTED
00489 #endif
00490 #ifndef PNG_NO_READ_tRNS
00491 #define PNG_READ_tRNS_SUPPORTED
00492 #endif
00493 #ifndef PNG_NO_READ_zTXt
00494 #define PNG_READ_zTXt_SUPPORTED
00495 #endif
00496 #ifndef PNG_NO_READ_OPT_PLTE
00497 #define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the optional */
00498 #endif                              /* PLTE chunk in RGB and RGBA images */
00499 #endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */
00500 
00501 #ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
00502 #ifndef PNG_NO_WRITE_bKGD
00503 #define PNG_WRITE_bKGD_SUPPORTED
00504 #endif
00505 #ifndef PNG_NO_WRITE_cHRM
00506 #define PNG_WRITE_cHRM_SUPPORTED
00507 #endif
00508 #ifndef PNG_NO_WRITE_gAMA
00509 #define PNG_WRITE_gAMA_SUPPORTED
00510 #endif
00511 #ifndef PNG_NO_WRITE_hIST
00512 #define PNG_WRITE_hIST_SUPPORTED
00513 #endif
00514 #ifndef PNG_NO_WRITE_oFFs
00515 #define PNG_WRITE_oFFs_SUPPORTED
00516 #endif
00517 #ifndef PNG_NO_WRITE_pCAL
00518 #define PNG_WRITE_pCAL_SUPPORTED
00519 #endif
00520 #ifndef PNG_NO_WRITE_pHYs
00521 #define PNG_WRITE_pHYs_SUPPORTED
00522 #endif
00523 #ifndef PNG_NO_WRITE_sBIT
00524 #define PNG_WRITE_sBIT_SUPPORTED
00525 #endif
00526 #ifndef PNG_NO_WRITE_sRGB
00527 #define PNG_WRITE_sRGB_SUPPORTED
00528 #endif
00529 #ifndef PNG_NO_WRITE_tEXt
00530 #define PNG_WRITE_tEXt_SUPPORTED
00531 #endif
00532 #ifndef PNG_NO_WRITE_tIME
00533 #define PNG_WRITE_tIME_SUPPORTED
00534 #endif
00535 #ifndef PNG_NO_WRITE_tRNS
00536 #define PNG_WRITE_tRNS_SUPPORTED
00537 #endif
00538 #ifndef PNG_NO_WRITE_zTXt
00539 #define PNG_WRITE_zTXt_SUPPORTED
00540 #endif
00541 #endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */
00542 
00543 /* need the time information for reading tIME chunks */
00544 #if defined(PNG_READ_tIME_SUPPORTED) || defined(PNG_WRITE_tIME_SUPPORTED)
00545 #include <time.h>
00546 #endif
00547 
00548 /* Some typedefs to get us started.  These should be safe on most of the
00549  * common platforms.  The typedefs should be at least as large as the
00550  * numbers suggest (a png_uint_32 must be at least 32 bits long), but they
00551  * don't have to be exactly that size.  Some compilers dislike passing
00552  * unsigned shorts as function parameters, so you may be better off using
00553  * unsigned int for png_uint_16.  Likewise, for 64-bit systems, you may
00554  * want to have unsigned int for png_uint_32 instead of unsigned long.
00555  */
00556 
00557 typedef unsigned long png_uint_32;
00558 typedef long png_int_32;
00559 typedef unsigned short png_uint_16;
00560 typedef short png_int_16;
00561 typedef unsigned char png_byte;
00562 
00563 /* This is usually size_t.  It is typedef'ed just in case you need it to
00564    change (I'm not sure if you will or not, so I thought I'd be safe) */
00565 typedef size_t png_size_t;
00566 
00567 /* The following is needed for medium model support.  It cannot be in the
00568  * PNG_INTERNAL section.  Needs modification for other compilers besides
00569  * MSC.  Model independent support declares all arrays and pointers to be
00570  * large using the far keyword.  The zlib version used must also support
00571  * model independent data.  As of version zlib 1.0.4, the necessary changes
00572  * have been made in zlib.  The USE_FAR_KEYWORD define triggers other
00573  * changes that are needed. (Tim Wegner)
00574  */
00575 
00576 /* Separate compiler dependencies (problem here is that zlib.h always
00577    defines FAR. (SJT) */
00578 #ifdef __BORLANDC__
00579 #if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
00580 #define LDATA 1
00581 #else
00582 #define LDATA 0
00583 #endif
00584 
00585 #if !defined(__WIN32__) && !defined(__FLAT__)
00586 #define PNG_MAX_MALLOC_64K
00587 #if (LDATA != 1)
00588 #ifndef FAR
00589 #define FAR __far
00590 #endif
00591 #define USE_FAR_KEYWORD
00592 #endif   /* LDATA != 1 */
00593 
00594 /* Possibly useful for moving data out of default segment.
00595  * Uncomment it if you want. Could also define FARDATA as
00596  * const if your compiler supports it. (SJT)
00597 #  define FARDATA FAR
00598  */
00599 #endif  /* __WIN32__, __FLAT__ */
00600 
00601 #endif   /* __BORLANDC__ */
00602 
00603 
00604 /* Suggest testing for specific compiler first before testing for
00605  * FAR.  The Watcom compiler defines both __MEDIUM__ and M_I86MM,
00606  * making reliance oncertain keywords suspect. (SJT)
00607  */
00608 
00609 /* MSC Medium model */
00610 #if defined(FAR)
00611 #  if defined(M_I86MM)
00612 #     define USE_FAR_KEYWORD
00613 #     define FARDATA FAR
00614 #     include <dos.h>
00615 #  endif
00616 #endif
00617 
00618 /* SJT: default case */
00619 #ifndef FAR
00620 #   define FAR
00621 #endif
00622 
00623 /* At this point FAR is always defined */
00624 #ifndef FARDATA
00625 #define FARDATA
00626 #endif
00627 
00628 /* Add typedefs for pointers */
00629 typedef void            FAR * png_voidp;
00630 typedef png_byte        FAR * png_bytep;
00631 typedef png_uint_32     FAR * png_uint_32p;
00632 typedef png_int_32      FAR * png_int_32p;
00633 typedef png_uint_16     FAR * png_uint_16p;
00634 typedef png_int_16      FAR * png_int_16p;
00635 typedef PNG_CONST char  FAR * png_const_charp;
00636 typedef char            FAR * png_charp;
00637 typedef double          FAR * png_doublep;
00638 
00639 /* Pointers to pointers; i.e. arrays */
00640 typedef png_byte        FAR * FAR * png_bytepp;
00641 typedef png_uint_32     FAR * FAR * png_uint_32pp;
00642 typedef png_int_32      FAR * FAR * png_int_32pp;
00643 typedef png_uint_16     FAR * FAR * png_uint_16pp;
00644 typedef png_int_16      FAR * FAR * png_int_16pp;
00645 typedef PNG_CONST char  FAR * FAR * png_const_charpp;
00646 typedef char            FAR * FAR * png_charpp;
00647 typedef double          FAR * FAR * png_doublepp;
00648 
00649 /* Pointers to pointers to pointers; i.e. pointer to array */
00650 typedef char            FAR * FAR * FAR * png_charppp;
00651 
00652 /* libpng typedefs for types in zlib. If zlib changes
00653  * or another compression library is used, then change these.
00654  * Eliminates need to change all the source files.
00655  */
00656 typedef charf *         png_zcharp;
00657 typedef charf * FAR *   png_zcharpp;
00658 typedef z_stream FAR *  png_zstreamp; 
00659 
00660 
00661 #ifndef PNG_EXPORT
00662 /* allow for compilation as dll under MS Windows */
00663 #  ifdef __WIN32DLL__
00664 #    define PNG_EXPORT(type,symbol) __declspec(dllexport) type symbol
00665 #  endif
00666 
00667    /* this variant is used in Mozilla; may correspond to MSVC++ 6.0 changes */
00668 #  ifdef ALT_WIN32_DLL
00669 #    define PNG_EXPORT(type,symbol) type __attribute__((dllexport)) symbol
00670 #  endif
00671 
00672    /* allow for compilation as dll with Borland C++ 5.0 */
00673 #  if defined(__BORLANDC__) && defined(_Windows) && defined(__DLL__)
00674 #    define PNG_EXPORT(type,symbol) type _export symbol
00675 #  endif
00676 
00677 /* allow for compilation as shared lib under BeOS */
00678 #  ifdef __BEOSDLL__
00679 #    define PNG_EXPORT(type,symbol) __declspec(export) type symbol
00680 #  endif
00681 
00682    /* allow for compilation as shared lib under MacOS */
00683 #  ifdef __MACOSDLL__
00684 #    define PNG_EXPORT(type,symbol) __declspec(export) type symbol
00685 #  endif
00686 #endif
00687 
00688 #ifndef PNG_EXPORT
00689 #  define PNG_EXPORT(type,symbol) type symbol
00690 #endif
00691 
00692 
00693 /* User may want to use these so not in PNG_INTERNAL. Any library functions
00694  * that are passed far data must be model independent.
00695  */
00696 
00697 #if defined(USE_FAR_KEYWORD)  /* memory model independent fns */
00698 /* use this to make far-to-near assignments */
00699 #   define CHECK   1
00700 #   define NOCHECK 0
00701 #   define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
00702 #   define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
00703 #   define png_strcpy _fstrcpy
00704 #   define png_strlen _fstrlen
00705 #   define png_memcmp _fmemcmp      /* SJT: added */
00706 #   define png_memcpy _fmemcpy
00707 #   define png_memset _fmemset
00708 #else /* use the usual functions */
00709 #   define CVT_PTR(ptr)         (ptr)
00710 #   define CVT_PTR_NOCHECK(ptr) (ptr)
00711 #   define png_strcpy strcpy
00712 #   define png_strlen strlen
00713 #   define png_memcmp memcmp     /* SJT: added */
00714 #   define png_memcpy memcpy
00715 #   define png_memset memset
00716 #endif
00717 /* End of memory model independent support */
00718 
00719 /* Just a double check that someone hasn't tried to define something
00720  * contradictory. 
00721  */
00722 #if (PNG_ZBUF_SIZE > 65536) && defined(PNG_MAX_MALLOC_64K)
00723 #undef PNG_ZBUF_SIZE
00724 #define PNG_ZBUF_SIZE 65536
00725 #endif
00726 
00727 #endif /* PNGCONF_H */
00728 

Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000