diff -ru4NwbB libpng-1.4.1/Makefile.am libpng-1.5.0beta16/Makefile.am --- libpng-1.4.1/Makefile.am 2010-02-25 05:38:36.627740466 -0600 +++ libpng-1.5.0beta16/Makefile.am 2010-04-01 07:15:59.698906500 -0500 @@ -28,9 +28,9 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngset.c pngget.c pngrutil.c \ pngtrans.c pngwutil.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngwtran.c pngmem.c pngerror.c pngpread.c \ - png.h pngconf.h pngpriv.h + png.h pngconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS = @LIBPNG_DEFINES@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \ @@ -45,11 +45,8 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS += -export-symbols libpng.sym libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES = libpng.sym endif -# Avoid depending upon Character Ranges. -AN = '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' - #distribute headers in /usr/include/libpng/* pkgincludedir= $(includedir)/$(PNGLIB_BASENAME) pkginclude_HEADERS= png.h pngconf.h @@ -61,9 +58,8 @@ #extra source distribution files. EXTRA_DIST= \ ANNOUNCE CHANGES INSTALL LICENSE README TODO \ pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \ - ${srcdir}/projects/cbuilder5/* \ ${srcdir}/projects/visualc6/* \ ${srcdir}/projects/visualc71/* \ ${srcdir}/projects/xcode/* \ ${srcdir}/scripts/* \ @@ -72,37 +68,58 @@ ${srcdir}/contrib/pngminus/* \ ${srcdir}/contrib/pngsuite/* \ ${srcdir}/contrib/visupng/* \ $(TESTS) \ - example.c libpng-1.5.0beta16.txt + CMakeLists.txt example.c libpng-@PNGLIB_VERSION@.txt -CLEANFILES= pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers \ -libpng.sym +CLEANFILES= dfn.c dfn?.out pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \ + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \ + libpng.def symbols.new symbols.chk scripts/*.out MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \ config.sub configure depcomp install-sh ltmain.sh missing +SUFFIXES = .dfn .out + $(PNGLIB_BASENAME).pc: libpng.pc cp libpng.pc $@ $(PNGLIB_BASENAME)-config: libpng-config cp libpng-config $@ -libpng.sym: png.h pngconf.h - rm -f $@ $@.new - $(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) -DPNG_BUILDSYMS $(srcdir)/png.h | \ - $(SED) -n -e \ - 's|^.*PNG_FUNCTION_EXPORT[ ]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \ - -e 's|^.*PNG_DATA_EXPORT[ ]*\([$(AN)]*\).*$$|$(SYMBOL_PREFIX)\1|p' \ - >$@.new - mv $@.new $@ - -libpng.vers: libpng.sym - rm -f $@ $@.new - echo PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0 '{global:' > $@.new - $(SED) s/$$/\;/ libpng.sym >> $@.new - echo 'local: *; };' >> $@.new - mv $@.new $@ +scripts/sym.out scripts/vers.out scritps/def.out scripts/checksym.out: png.h pngconf.h + +libpng.sym: scripts/sym.out + rm -f $@ + cp $? $@ +libpng.vers: scripts/vers.out + rm -f $@ + cp $? $@ +libpng.def: scripts/def.out + rm -f $@ + cp $? $@ + +SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\ + -DPNGLIB_VERSION='@PNGLIB_VERSION@'\ + -DSYMBOL_PREFIX='$(SYMBOL_PREFIX)' + +.dfn.out: + rm -f $@ dfn.c dfn?.out + test -d scripts || mkdir scripts + echo '#include "$<"' >dfn.c + $(CPP) @LIBPNG_DEFINES@ $(CPPFLAGS) $(SYMBOL_CFLAGS) dfn.c >dfn1.out + $(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p' dfn1.out >dfn2.out + $(SED) -e 's| *@@@ *||' -e 's| *$$||' dfn2.out >dfn3.out + rm -f dfn.c dfn[12].out + mv dfn3.out $@ + +symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/checksym.out + rm -f $@ symbols.new + $(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/symbols.def\ + scripts/checksym.out >&2 + mv symbols.new $@ + +dist: symbols.chk test: check # install the .../include headers as links to the new ones @@ -130,4 +147,6 @@ uninstall-hook: cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h rm -f $(DESTDIR)$(pkgconfigdir)/libpng.pc rm -f $(DESTDIR)$(bindir)/libpng-config + rm -f $(DESTDIR)$(libdir)/libpng.a + rm -f $(DESTDIR)$(libdir)/libpng.la diff -ru4NwbB libpng-1.4.1/configure.ac libpng-1.5.0beta16/configure.ac --- libpng-1.4.1/configure.ac 2010-02-25 05:38:36.634441039 -0600 +++ libpng-1.5.0beta16/configure.ac 2010-04-01 07:15:59.704904438 -0500 @@ -23,10 +23,10 @@ dnl stop configure from automagically running automake AM_MAINTAINER_MODE PNGLIB_VERSION=1.5.0beta16 -PNGLIB_MAJOR=%RELEASE% -PNGLIB_MINOR=4 +PNGLIB_MAJOR=1 +PNGLIB_MINOR=5 PNGLIB_RELEASE=%RELEASE% dnl End of version number stuff @@ -37,8 +37,9 @@ AC_PROG_CC AC_PROG_LD AC_PROG_CPP AC_CHECK_TOOL(SED, sed, :) +AC_CHECK_TOOL(AWK, awk, :) AC_LIBTOOL_WIN32_DLL AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET @@ -58,14 +59,9 @@ AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc])) AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) ) AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed])) -case $host_os in - aix*) - LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG -D_ALL_SOURCE;; - *) - LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG;; -esac +LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG LIBPNG_DEFINES=$LIBPNG_DEFINES AC_SUBST(LIBPNG_DEFINES) AC_MSG_CHECKING([if libraries can be versioned]) diff -ru4NwbB libpng-1.4.1/contrib/gregbook/Makefile.sgi libpng-1.5.0beta16/contrib/gregbook/Makefile.sgi --- libpng-1.4.1/contrib/gregbook/Makefile.sgi 2010-02-25 05:38:30.385695920 -0600 +++ libpng-1.5.0beta16/contrib/gregbook/Makefile.sgi 2010-04-01 07:15:53.155536304 -0500 @@ -22,11 +22,11 @@ # macros -------------------------------------------------------------------- -PNGINC = -I/usr/local/include/libpng14 -PNGLIB = -L/usr/local/lib -lpng14 # dynamically linked against libpng -#PNGLIB = /usr/local/lib/libpng14.a # statically linked against libpng +PNGINC = -I/usr/local/include/libpng15 +PNGLIB = -L/usr/local/lib -lpng15 # dynamically linked against libpng +#PNGLIB = /usr/local/lib/libpng15.a # statically linked against libpng # or: #PNGINC = -I../.. #PNGLIB = -L../.. -lpng #PNGLIB = ../../libpng.a diff -ru4NwbB libpng-1.4.1/contrib/gregbook/Makefile.unx libpng-1.5.0beta16/contrib/gregbook/Makefile.unx --- libpng-1.4.1/contrib/gregbook/Makefile.unx 2010-02-25 05:38:30.398746087 -0600 +++ libpng-1.5.0beta16/contrib/gregbook/Makefile.unx 2010-04-01 07:15:53.170964401 -0500 @@ -25,16 +25,16 @@ # macros -------------------------------------------------------------------- #PNGDIR = /usr/local/lib -#PNGINC = -I/usr/local/include/libpng14 -#PNGLIBd = -L$(PNGDIR) -lpng14 # dynamically linked, installed libpng -#PNGLIBs = $(PNGDIR)/libpng14.a # statically linked, installed libpng +#PNGINC = -I/usr/local/include/libpng15 +#PNGLIBd = -L$(PNGDIR) -lpng15 # dynamically linked, installed libpng +#PNGLIBs = $(PNGDIR)/libpng15.a # statically linked, installed libpng # or: PNGDIR = ../..# this one is for libpng-x.y.z/contrib/gregbook builds #PNGDIR = ../libpng PNGINC = -I$(PNGDIR) -PNGLIBd = -Wl,-rpath,$(PNGDIR) -L$(PNGDIR) -lpng14 # dynamically linked +PNGLIBd = -Wl,-rpath,$(PNGDIR) -L$(PNGDIR) -lpng15 # dynamically linked PNGLIBs = $(PNGDIR)/libpng.a # statically linked, local libpng ZDIR = /usr/local/lib #ZDIR = /usr/lib64 diff -ru4NwbB libpng-1.4.1/contrib/gregbook/readpng2.c libpng-1.5.0beta16/contrib/gregbook/readpng2.c --- libpng-1.4.1/contrib/gregbook/readpng2.c 2010-02-25 05:38:30.475500071 -0600 +++ libpng-1.5.0beta16/contrib/gregbook/readpng2.c 2010-04-01 07:15:53.296059697 -0500 @@ -65,9 +65,8 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr); static void readpng2_row_callback(png_structp png_ptr, png_bytep new_row, png_uint_32 row_num, int pass); static void readpng2_end_callback(png_structp png_ptr, png_infop info_ptr); -static void readpng2_error_handler(png_structp png_ptr, png_const_charp msg); @@ -101,9 +100,9 @@ /* could also replace libpng warning-handler (final NULL), but no need: */ png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, mainprog_ptr, - readpng2_error_handler, NULL); + NULL, NULL); if (!png_ptr) return 4; /* out of memory */ info_ptr = png_create_info_struct(png_ptr); @@ -450,35 +449,4 @@ mainprog_ptr->png_ptr = NULL; mainprog_ptr->info_ptr = NULL; } - - - - - -static void readpng2_error_handler(png_structp png_ptr, png_const_charp msg) -{ - mainprog_info *mainprog_ptr; - - /* This function, aside from the extra step of retrieving the "error - * pointer" (below) and the fact that it exists within the application - * rather than within libpng, is essentially identical to libpng's - * default error handler. The second point is critical: since both - * setjmp() and longjmp() are called from the same code, they are - * guaranteed to have compatible notions of how big a jmp_buf is, - * regardless of whether _BSD_SOURCE or anything else has (or has not) - * been defined. */ - - fprintf(stderr, "readpng2 libpng error: %s\n", msg); - fflush(stderr); - - mainprog_ptr = png_get_error_ptr(png_ptr); - if (mainprog_ptr == NULL) { /* we are completely hosed now */ - fprintf(stderr, - "readpng2 severe error: jmpbuf not recoverable; terminating.\n"); - fflush(stderr); - exit(99); - } - - longjmp(mainprog_ptr->jmpbuf, 1); -} diff -ru4NwbB libpng-1.4.1/contrib/gregbook/rpng-win.c libpng-1.5.0beta16/contrib/gregbook/rpng-win.c --- libpng-1.4.1/contrib/gregbook/rpng-win.c 2010-02-25 05:38:30.520480260 -0600 +++ libpng-1.5.0beta16/contrib/gregbook/rpng-win.c 2010-04-01 07:15:53.338920588 -0500 @@ -23,8 +23,10 @@ command-line parsing bug - 1.10: enabled "message window"/console (thanks to David Geldreich) - 2.00: dual-licensed (added GNU GPL) - 2.01: fixed improper display of usage screen on PNG error(s) + - 2.02: removed special error-handling which is no longer needed + because of the new libpng png_longjmp() feature in libpng-1.5.0. --------------------------------------------------------------------------- Copyright (c) 1998-2008 Greg Roelofs. All rights reserved. diff -ru4NwbB libpng-1.4.1/contrib/gregbook/rpng-x.c libpng-1.5.0beta16/contrib/gregbook/rpng-x.c --- libpng-1.4.1/contrib/gregbook/rpng-x.c 2010-02-25 05:38:30.537528099 -0600 +++ libpng-1.5.0beta16/contrib/gregbook/rpng-x.c 2010-04-01 07:15:53.360454312 -0500 @@ -25,8 +25,10 @@ - 1.13: fixed XFreeGC() crash bug (thanks to Patrick Welche) - 1.14: added support for X resources (thanks to Gerhard Niklasch) - 2.00: dual-licensed (added GNU GPL) - 2.01: fixed improper display of usage screen on PNG error(s) + - 2.02: removed special error-handling which is no longer needed + because of the new libpng png_longjmp() feature in libpng-1.5.0. --------------------------------------------------------------------------- Copyright (c) 1998-2008 Greg Roelofs. All rights reserved. diff -ru4NwbB libpng-1.4.1/contrib/gregbook/rpng2-win.c libpng-1.5.0beta16/contrib/gregbook/rpng2-win.c --- libpng-1.4.1/contrib/gregbook/rpng2-win.c 2010-02-25 05:38:30.559869370 -0600 +++ libpng-1.5.0beta16/contrib/gregbook/rpng2-win.c 2010-04-01 07:15:53.380409836 -0500 @@ -31,9 +31,11 @@ - 2.00: dual-licensed (added GNU GPL) - 2.01: fixed 64-bit typo in readpng2.c - 2.02: fixed improper display of usage screen on PNG error(s); fixed unexpected-EOF and file-read-error cases - - 2.03: removed runtime MMX-enabling/disabling and obsolete -mmx* options + - 2.03: removed runtime MMX-enabling/disabling and obsolete -mmx* options; + removed special error-handling which is no longer needed + because of the new libpng png_longjmp() feature in libpng-1.5.0. --------------------------------------------------------------------------- Copyright (c) 1998-2008 Greg Roelofs. All rights reserved. diff -ru4NwbB libpng-1.4.1/contrib/gregbook/rpng2-x.c libpng-1.5.0beta16/contrib/gregbook/rpng2-x.c --- libpng-1.4.1/contrib/gregbook/rpng2-x.c 2010-02-25 05:38:30.588215354 -0600 +++ libpng-1.5.0beta16/contrib/gregbook/rpng2-x.c 2010-04-01 07:15:53.407046941 -0500 @@ -40,8 +40,10 @@ - 2.02: fixed improper display of usage screen on PNG error(s); fixed unexpected-EOF and file-read-error cases; fixed Trace() cut-and- paste bugs - 2.03: deleted runtime MMX-enabling/disabling and obsolete -mmx* options + removed special error-handling which is no longer needed + because of the new libpng png_longjmp() feature in libpng-1.5.0. --------------------------------------------------------------------------- Copyright (c) 1998-2008 Greg Roelofs. All rights reserved. diff -ru4NwbB libpng-1.4.1/contrib/gregbook/wpng.c libpng-1.5.0beta16/contrib/gregbook/wpng.c --- libpng-1.4.1/contrib/gregbook/wpng.c 2010-02-25 05:38:30.629488120 -0600 +++ libpng-1.5.0beta16/contrib/gregbook/wpng.c 2010-04-01 07:15:53.440599180 -0500 @@ -28,8 +28,10 @@ command-line parsing - 1.04: fixed DOS/OS2/Win32 detection, including partial Cygwin fix (see http://home.att.net/~perlspinr/diffs/GregBook_cygwin.diff) - 2.00: dual-licensed (added GNU GPL) + - 2.01: removed special error-handling which is no longer needed + because of the new libpng png_longjmp() feature in libpng-1.5.0. [REPORTED BUG (win32 only): "contrib/gregbook/wpng.c - cmd line dose not work! In order to do something useful I needed to redirect both input and output, with cygwin and with bcc32 as well. Under diff -ru4NwbB libpng-1.4.1/contrib/gregbook/writepng.c libpng-1.5.0beta16/contrib/gregbook/writepng.c --- libpng-1.4.1/contrib/gregbook/writepng.c 2010-02-25 05:38:30.641393677 -0600 +++ libpng-1.5.0beta16/contrib/gregbook/writepng.c 2010-04-01 07:15:53.456942719 -0500 @@ -59,12 +59,8 @@ #include "png.h" /* libpng header; includes zlib.h and setjmp.h */ #include "writepng.h" /* typedefs, common macros, public prototypes */ -/* local prototype */ - -static void writepng_error_handler(png_structp png_ptr, png_const_charp msg); - void writepng_version_info(void) { @@ -89,9 +85,9 @@ /* could also replace libpng warning-handler (final NULL), but no need: */ png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, mainprog_ptr, - writepng_error_handler, NULL); + NULL, NULL); if (!png_ptr) return 4; /* out of memory */ info_ptr = png_create_info_struct(png_ptr); @@ -358,35 +354,4 @@ if (png_ptr && info_ptr) png_destroy_write_struct(&png_ptr, &info_ptr); } - - - - - -static void writepng_error_handler(png_structp png_ptr, png_const_charp msg) -{ - mainprog_info *mainprog_ptr; - - /* This function, aside from the extra step of retrieving the "error - * pointer" (below) and the fact that it exists within the application - * rather than within libpng, is essentially identical to libpng's - * default error handler. The second point is critical: since both - * setjmp() and longjmp() are called from the same code, they are - * guaranteed to have compatible notions of how big a jmp_buf is, - * regardless of whether _BSD_SOURCE or anything else has (or has not) - * been defined. */ - - fprintf(stderr, "writepng libpng error: %s\n", msg); - fflush(stderr); - - mainprog_ptr = png_get_error_ptr(png_ptr); - if (mainprog_ptr == NULL) { /* we are completely hosed now */ - fprintf(stderr, - "writepng severe error: jmpbuf not recoverable; terminating.\n"); - fflush(stderr); - exit(99); - } - - longjmp(mainprog_ptr->jmpbuf, 1); -} diff -ru4NwbB libpng-1.4.1/contrib/pngminim/decoder/makefile libpng-1.5.0beta16/contrib/pngminim/decoder/makefile --- libpng-1.4.1/contrib/pngminim/decoder/makefile 2010-02-25 05:38:31.159287289 -0600 +++ libpng-1.5.0beta16/contrib/pngminim/decoder/makefile 2010-04-01 07:15:54.027932080 -0500 @@ -24,9 +24,9 @@ pngset$(O) pngtrans$(O) $(ZOBJS) # implicit make rules ------------------------------------------------------- -.c$(O): png.h pngconf.h pngpriv.h pngusr.h zlib.h +.c$(O): png.h pngconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngusr.h zlib.h $(CC) -c $(CFLAGS) $< # dependencies diff -ru4NwbB libpng-1.4.1/contrib/pngminim/encoder/makefile libpng-1.5.0beta16/contrib/pngminim/encoder/makefile --- libpng-1.4.1/contrib/pngminim/encoder/makefile 2010-02-25 05:38:31.203884053 -0600 +++ libpng-1.5.0beta16/contrib/pngminim/encoder/makefile 2010-04-01 07:15:54.071388226 -0500 @@ -23,9 +23,9 @@ pngwtran$(O) pngwutil$(O) $(ZOBJS) # implicit make rules ------------------------------------------------------- -.c$(O): png.h pngconf.h pngpriv.h pngusr.h zlib.h +.c$(O): png.h pngconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngusr.h zlib.h $(CC) -c $(CFLAGS) $< # dependencies diff -ru4NwbB libpng-1.4.1/contrib/pngminim/preader/makefile libpng-1.5.0beta16/contrib/pngminim/preader/makefile --- libpng-1.4.1/contrib/pngminim/preader/makefile 2010-02-25 05:38:31.239535467 -0600 +++ libpng-1.5.0beta16/contrib/pngminim/preader/makefile 2010-04-01 07:15:54.106050807 -0500 @@ -40,9 +40,9 @@ pngset$(O) pngtrans$(O) $(ZOBJS) # implicit make rules ------------------------------------------------------- -.c$(O): png.h pngconf.h pngpriv.h readpng2.h pngusr.h zlib.h +.c$(O): png.h pngconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h readpng2.h pngusr.h zlib.h $(CC) -c $(CFLAGS) $< # dependencies diff -ru4NwbB libpng-1.4.1/example.c libpng-1.5.0beta16/example.c --- libpng-1.4.1/example.c 2010-02-25 05:38:30.172040389 -0600 +++ libpng-1.5.0beta16/example.c 2010-04-01 07:15:52.916000822 -0500 @@ -1,9 +1,9 @@ #if 0 /* in case someone actually tries to compile this */ /* example.c - an example of using libpng - * Last changed in libpng 1.4.0 [January 3, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * This file has been placed in the public domain by the authors. * Maintained 1998-2010 Glenn Randers-Pehrson * Maintained 1996, 1997 Andreas Dilger) * Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -30,9 +30,9 @@ * is not already defined by libpng!). */ #ifndef png_jmpbuf -# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) +# define png_jmpbuf(png_ptr) ((png_ptr)->png_jmpbuf) #endif /* Check to see if a file is a PNG file using png_sig_cmp(). png_sig_cmp() * returns zero if the image is a PNG and nonzero if it isn't a PNG. @@ -675,19 +675,23 @@ /* Optionally write comments into the image */ text_ptr[0].key = "Title"; text_ptr[0].text = "Mona Lisa"; text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE; + text_ptr[0].itxt_length = 0; + text_ptr[0].lang = NULL; + text_ptr[0].lang_key = NULL; text_ptr[1].key = "Author"; text_ptr[1].text = "Leonardo DaVinci"; text_ptr[1].compression = PNG_TEXT_COMPRESSION_NONE; + text_ptr[1].itxt_length = 0; + text_ptr[1].lang = NULL; + text_ptr[1].lang_key = NULL; text_ptr[2].key = "Description"; text_ptr[2].text = ""; text_ptr[2].compression = PNG_TEXT_COMPRESSION_zTXt; -#ifdef PNG_iTXt_SUPPORTED - text_ptr[0].lang = NULL; - text_ptr[1].lang = NULL; + text_ptr[2].itxt_length = 0; text_ptr[2].lang = NULL; -#endif + text_ptr[2].lang_key = NULL; png_set_text(png_ptr, info_ptr, text_ptr, 3); /* Other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs */ diff -ru4NwbB libpng-1.4.1/png.c libpng-1.5.0beta16/png.c --- libpng-1.4.1/png.c 2010-02-25 05:38:30.179871619 -0600 +++ libpng-1.5.0beta16/png.c 2010-04-01 07:15:52.923485518 -0500 @@ -1,8 +1,8 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.4.1 [April 1, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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.) * @@ -10,11 +10,8 @@ * For conditions of distribution and use, see the disclaimer * and license in png.h */ -#define PNG_NO_EXTERN -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" #include "pngpriv.h" /* Generate a compiler error if there is an old png.h in the search path. */ typedef version_%_VER_% Your_png_h_is_not_version_%_VER_%; @@ -576,10 +573,9 @@ png_charp PNGAPI png_get_libpng_ver(png_structp png_ptr) { /* Version of *.c files used when building libpng */ - png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */ - return ((png_charp) PNG_LIBPNG_VER_STRING); + return png_get_header_ver(png_ptr); } png_charp PNGAPI png_get_header_ver(png_structp png_ptr) diff -ru4NwbB libpng-1.4.1/png.h libpng-1.5.0beta16/png.h --- libpng-1.4.1/png.h 2010-02-25 05:38:30.147965500 -0600 +++ libpng-1.5.0beta16/png.h 2010-04-01 07:15:52.876824646 -0500 @@ -136,10 +136,10 @@ * 1.4.0 14 10400 14.so.14.0[.0] * 1.4.1beta01-03 14 10401 14.so.14.1[.0] * 1.4.1rc01 14 10401 14.so.14.1[.0] * 1.4.1beta04-12 14 10401 14.so.14.1[.0] - * 1.4.1rc02-04 14 10401 14.so.14.1[.0] * 1.4.1 14 10401 14.so.14.1[.0] + * 1.5.0beta01-16 15 10500 15.so.15.0[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be * used for changes in backward compatibility, as it is intended. The @@ -432,17 +432,13 @@ * library functions, while the third has the internal library functions, * which applications aren't expected to use directly. */ -/* Variables declared in png.c - only it needs to define PNG_NO_EXTERN */ -#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) /* Version information for C files, stored in png.c. This had better match * the version above. */ #define png_libpng_ver png_get_header_ver(NULL) -#endif /* PNG_NO_EXTERN */ - /* Three color definitions. The order of the red, green, and blue, (and the * exact size) is not important, although the size of the fields need to * be png_byte or png_uint_16 (as defined below). */ @@ -526,15 +522,13 @@ png_charp key; /* keyword, 1-79 character description of "text" */ png_charp text; /* comment, may be an empty string (ie "") or a NULL pointer */ png_size_t text_length; /* length of the text string */ -#ifdef PNG_iTXt_SUPPORTED png_size_t itxt_length; /* length of the itxt string */ png_charp lang; /* language code, 0-79 characters or a NULL pointer */ png_charp lang_key; /* keyword translated UTF-8 string, 0 or more chars or a NULL pointer */ -#endif } png_text; typedef png_text FAR * png_textp; typedef png_text FAR * FAR * png_textpp; #endif @@ -587,310 +581,9 @@ typedef png_unknown_chunk FAR * png_unknown_chunkp; typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp; #endif -/* png_info is a structure that holds the information in a PNG file so - * that the application can find out the characteristics of the image. - * If you are reading the file, this structure will tell you what is - * in the PNG file. If you are writing the file, fill in the information - * you want to put into the PNG file, then call png_write_info(). - * The names chosen should be very close to the PNG specification, so - * consult that document for information about the meaning of each field. - * - * With libpng < 0.95, it was only possible to directly set and read the - * the values in the png_info_struct, which meant that the contents and - * order of the values had to remain fixed. With libpng 0.95 and later, - * however, there are now functions that abstract the contents of - * png_info_struct from the application, so this makes it easier to use - * libpng with dynamic libraries, and even makes it possible to use - * libraries that don't have all of the libpng ancillary chunk-handing - * functionality. - * - * In any case, the order of the parameters in png_info_struct should NOT - * be changed for as long as possible to keep compatibility with applications - * that use the old direct-access method with png_info_struct. - * - * The following members may have allocated storage attached that should be - * cleaned up before the structure is discarded: palette, trans, text, - * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile, - * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these - * are automatically freed when the info structure is deallocated, if they were - * allocated internally by libpng. This behavior can be changed by means - * of the png_data_freer() function. - * - * More allocation details: all the chunk-reading functions that - * change these members go through the corresponding png_set_* - * functions. A function to clear these members is available: see - * png_free_data(). The png_set_* functions do not depend on being - * able to point info structure members to any of the storage they are - * passed (they make their own copies), EXCEPT that the png_set_text - * functions use the same storage passed to them in the text_ptr or - * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns - * functions do not make their own copies. - */ -typedef struct png_info_struct -{ - /* the following are necessary for every PNG file */ - png_uint_32 width PNG_DEPSTRUCT; /* width of image in pixels (from IHDR) */ - png_uint_32 height PNG_DEPSTRUCT; /* height of image in pixels (from IHDR) */ - png_uint_32 valid PNG_DEPSTRUCT; /* valid chunk data (see PNG_INFO_ - below) */ - png_size_t rowbytes PNG_DEPSTRUCT; /* bytes needed to hold an untransformed - row */ - png_colorp palette PNG_DEPSTRUCT; /* array of color values - (valid & PNG_INFO_PLTE) */ - png_uint_16 num_palette PNG_DEPSTRUCT; /* number of color entries in - "palette" (PLTE) */ - png_uint_16 num_trans PNG_DEPSTRUCT; /* number of transparent palette - color (tRNS) */ - png_byte bit_depth PNG_DEPSTRUCT; /* 1, 2, 4, 8, or 16 bits/channel - (from IHDR) */ - png_byte color_type PNG_DEPSTRUCT; /* see PNG_COLOR_TYPE_ below - (from IHDR) */ - /* The following three should have been named *_method not *_type */ - png_byte compression_type PNG_DEPSTRUCT; /* must be - PNG_COMPRESSION_TYPE_BASE (IHDR) */ - png_byte filter_type PNG_DEPSTRUCT; /* must be PNG_FILTER_TYPE_BASE - (from IHDR) */ - png_byte interlace_type PNG_DEPSTRUCT; /* One of PNG_INTERLACE_NONE, - PNG_INTERLACE_ADAM7 */ - - /* The following is informational only on read, and not used on writes. */ - png_byte channels PNG_DEPSTRUCT; /* number of data channels per - pixel (1, 2, 3, 4) */ - png_byte pixel_depth PNG_DEPSTRUCT; /* number of bits per pixel */ - png_byte spare_byte PNG_DEPSTRUCT; /* to align the data, and for - future use */ - png_byte signature[8] PNG_DEPSTRUCT; /* magic bytes read by libpng - from start of file */ - - /* The rest of the data is optional. If you are reading, check the - * valid field to see if the information in these are valid. If you - * are writing, set the valid field to those chunks you want written, - * and initialize the appropriate fields below. - */ - -#if defined(PNG_gAMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) - /* The gAMA chunk describes the gamma characteristics of the system - * on which the image was created, normally in the range [1.0, 2.5]. - * Data is valid if (valid & PNG_INFO_gAMA) is non-zero. - */ - float gamma PNG_DEPSTRUCT; /* gamma value of image, - if (valid & PNG_INFO_gAMA) */ -#endif - -#ifdef PNG_sRGB_SUPPORTED - /* GR-P, 0.96a */ - /* Data valid if (valid & PNG_INFO_sRGB) non-zero. */ - png_byte srgb_intent PNG_DEPSTRUCT; /* sRGB rendering intent - [0, 1, 2, or 3] */ -#endif - -#ifdef PNG_TEXT_SUPPORTED - /* The tEXt, and zTXt chunks contain human-readable textual data in - * uncompressed, compressed, and optionally compressed forms, respectively. - * The data in "text" is an array of pointers to uncompressed, - * null-terminated C strings. Each chunk has a keyword that describes the - * textual data contained in that chunk. Keywords are not required to be - * unique, and the text string may be empty. Any number of text chunks may - * be in an image. - */ - int num_text PNG_DEPSTRUCT; /* number of comments read/to write */ - int max_text PNG_DEPSTRUCT; /* current size of text array */ - png_textp text PNG_DEPSTRUCT; /* array of comments read/to write */ -#endif /* PNG_TEXT_SUPPORTED */ - -#ifdef PNG_tIME_SUPPORTED - /* The tIME chunk holds the last time the displayed image data was - * modified. See the png_time struct for the contents of this struct. - */ - png_time mod_time PNG_DEPSTRUCT; -#endif - -#ifdef PNG_sBIT_SUPPORTED - /* The sBIT chunk specifies the number of significant high-order bits - * in the pixel data. Values are in the range [1, bit_depth], and are - * only specified for the channels in the pixel data. The contents of - * the low-order bits is not specified. Data is valid if - * (valid & PNG_INFO_sBIT) is non-zero. - */ - png_color_8 sig_bit PNG_DEPSTRUCT; /* significant bits in color channels */ -#endif - -#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \ -defined(PNG_READ_BACKGROUND_SUPPORTED) - /* The tRNS chunk supplies transparency data for paletted images and - * other image types that don't need a full alpha channel. There are - * "num_trans" transparency values for a paletted image, stored in the - * same order as the palette colors, starting from index 0. Values - * for the data are in the range [0, 255], ranging from fully transparent - * to fully opaque, respectively. For non-paletted images, there is a - * single color specified that should be treated as fully transparent. - * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. - */ - png_bytep trans_alpha PNG_DEPSTRUCT; /* alpha values for paletted - image */ - png_color_16 trans_color PNG_DEPSTRUCT; /* transparent color for - non-palette image */ -#endif - -#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - /* The bKGD chunk gives the suggested image background color if the - * display program does not have its own background color and the image - * is needs to composited onto a background before display. The colors - * in "background" are normally in the same color space/depth as the - * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. - */ - png_color_16 background PNG_DEPSTRUCT; -#endif - -#ifdef PNG_oFFs_SUPPORTED - /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards - * and downwards from the top-left corner of the display, page, or other - * application-specific co-ordinate space. See the PNG_OFFSET_ defines - * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. - */ - png_int_32 x_offset PNG_DEPSTRUCT; /* x offset on page */ - png_int_32 y_offset PNG_DEPSTRUCT; /* y offset on page */ - png_byte offset_unit_type PNG_DEPSTRUCT; /* offset units type */ -#endif - -#ifdef PNG_pHYs_SUPPORTED - /* The pHYs chunk gives the physical pixel density of the image for - * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ - * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. - */ - png_uint_32 x_pixels_per_unit PNG_DEPSTRUCT; /* horizontal pixel density */ - png_uint_32 y_pixels_per_unit PNG_DEPSTRUCT; /* vertical pixel density */ - png_byte phys_unit_type PNG_DEPSTRUCT; /* resolution type (see - PNG_RESOLUTION_ below) */ -#endif - -#ifdef PNG_hIST_SUPPORTED - /* The hIST chunk contains the relative frequency or importance of the - * various palette entries, so that a viewer can intelligently select a - * reduced-color palette, if required. Data is an array of "num_palette" - * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) - * is non-zero. - */ - png_uint_16p hist PNG_DEPSTRUCT; -#endif - -#ifdef PNG_cHRM_SUPPORTED - /* The cHRM chunk describes the CIE color characteristics of the monitor - * on which the PNG was created. This data allows the viewer to do gamut - * mapping of the input image to ensure that the viewer sees the same - * colors in the image as the creator. Values are in the range - * [0.0, 0.8]. Data valid if (valid & PNG_INFO_cHRM) non-zero. - */ -#ifdef PNG_FLOATING_POINT_SUPPORTED - float x_white PNG_DEPSTRUCT; - float y_white PNG_DEPSTRUCT; - float x_red PNG_DEPSTRUCT; - float y_red PNG_DEPSTRUCT; - float x_green PNG_DEPSTRUCT; - float y_green PNG_DEPSTRUCT; - float x_blue PNG_DEPSTRUCT; - float y_blue PNG_DEPSTRUCT; -#endif -#endif - -#ifdef PNG_pCAL_SUPPORTED - /* The pCAL chunk describes a transformation between the stored pixel - * values and original physical data values used to create the image. - * The integer range [0, 2^bit_depth - 1] maps to the floating-point - * range given by [pcal_X0, pcal_X1], and are further transformed by a - * (possibly non-linear) transformation function given by "pcal_type" - * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ - * defines below, and the PNG-Group's PNG extensions document for a - * complete description of the transformations and how they should be - * implemented, and for a description of the ASCII parameter strings. - * Data values are valid if (valid & PNG_INFO_pCAL) non-zero. - */ - png_charp pcal_purpose PNG_DEPSTRUCT; /* pCAL chunk description string */ - png_int_32 pcal_X0 PNG_DEPSTRUCT; /* minimum value */ - png_int_32 pcal_X1 PNG_DEPSTRUCT; /* maximum value */ - png_charp pcal_units PNG_DEPSTRUCT; /* Latin-1 string giving physical - units */ - png_charpp pcal_params PNG_DEPSTRUCT; /* ASCII strings containing - parameter values */ - png_byte pcal_type PNG_DEPSTRUCT; /* equation type - (see PNG_EQUATION_ below) */ - png_byte pcal_nparams PNG_DEPSTRUCT; /* number of parameters given - in pcal_params */ -#endif - -/* New members added in libpng-1.0.6 */ - png_uint_32 free_me PNG_DEPSTRUCT; /* flags items libpng is - responsible for freeing */ - -#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \ - defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED) - /* Storage for unknown chunks that the library doesn't recognize. */ - png_unknown_chunkp unknown_chunks PNG_DEPSTRUCT; - png_size_t unknown_chunks_num PNG_DEPSTRUCT; -#endif - -#ifdef PNG_iCCP_SUPPORTED - /* iCCP chunk data. */ - png_charp iccp_name PNG_DEPSTRUCT; /* profile name */ - png_charp iccp_profile PNG_DEPSTRUCT; /* International Color Consortium - profile data */ - /* Note to maintainer: should be png_bytep */ - png_uint_32 iccp_proflen PNG_DEPSTRUCT; /* ICC profile data length */ - png_byte iccp_compression PNG_DEPSTRUCT; /* Always zero */ -#endif - -#ifdef PNG_sPLT_SUPPORTED - /* Data on sPLT chunks (there may be more than one). */ - png_sPLT_tp splt_palettes PNG_DEPSTRUCT; - png_uint_32 splt_palettes_num PNG_DEPSTRUCT; -#endif - -#ifdef PNG_sCAL_SUPPORTED - /* The sCAL chunk describes the actual physical dimensions of the - * subject matter of the graphic. The chunk contains a unit specification - * a byte value, and two ASCII strings representing floating-point - * values. The values are width and height corresponsing to one pixel - * in the image. This external representation is converted to double - * here. Data values are valid if (valid & PNG_INFO_sCAL) is non-zero. - */ - png_byte scal_unit PNG_DEPSTRUCT; /* unit of physical scale */ -#ifdef PNG_FLOATING_POINT_SUPPORTED - double scal_pixel_width PNG_DEPSTRUCT; /* width of one pixel */ - double scal_pixel_height PNG_DEPSTRUCT; /* height of one pixel */ -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_charp scal_s_width PNG_DEPSTRUCT; /* string containing height */ - png_charp scal_s_height PNG_DEPSTRUCT; /* string containing width */ -#endif -#endif - -#ifdef PNG_INFO_IMAGE_SUPPORTED - /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) - non-zero */ - /* Data valid if (valid & PNG_INFO_IDAT) non-zero */ - png_bytepp row_pointers PNG_DEPSTRUCT; /* the image bits */ -#endif - -#if defined(PNG_FIXED_POINT_SUPPORTED) && defined(PNG_gAMA_SUPPORTED) - png_fixed_point int_gamma PNG_DEPSTRUCT; /* gamma of image, - if (valid & PNG_INFO_gAMA) */ -#endif - -#if defined(PNG_cHRM_SUPPORTED) && defined(PNG_FIXED_POINT_SUPPORTED) - png_fixed_point int_x_white PNG_DEPSTRUCT; - png_fixed_point int_y_white PNG_DEPSTRUCT; - png_fixed_point int_x_red PNG_DEPSTRUCT; - png_fixed_point int_y_red PNG_DEPSTRUCT; - png_fixed_point int_x_green PNG_DEPSTRUCT; - png_fixed_point int_y_green PNG_DEPSTRUCT; - png_fixed_point int_x_blue PNG_DEPSTRUCT; - png_fixed_point int_y_blue PNG_DEPSTRUCT; -#endif - -} png_info; - +typedef struct png_info_def png_info; typedef png_info FAR * png_infop; typedef png_info FAR * FAR * png_infopp; /* Maximum positive integer used in PNG is (2^31)-1 */ @@ -1011,43 +704,43 @@ */ typedef struct png_struct_def png_struct; typedef png_struct FAR * png_structp; -typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp)); -typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t)); -typedef void (PNGAPI *png_flush_ptr) PNGARG((png_structp)); -typedef void (PNGAPI *png_read_status_ptr) PNGARG((png_structp, png_uint_32, - int)); -typedef void (PNGAPI *png_write_status_ptr) PNGARG((png_structp, png_uint_32, - int)); +typedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp),); +typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t),); +typedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp),); +typedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32, + int),); +typedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32, + int),); #ifdef PNG_PROGRESSIVE_READ_SUPPORTED -typedef void (PNGAPI *png_progressive_info_ptr) PNGARG((png_structp, - png_infop)); -typedef void (PNGAPI *png_progressive_end_ptr) PNGARG((png_structp, png_infop)); -typedef void (PNGAPI *png_progressive_row_ptr) PNGARG((png_structp, png_bytep, - png_uint_32, int)); +typedef PNG_CALLBACK(void, *png_progressive_info_ptr, + (png_structp, png_infop),); +typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop),); +typedef PNG_CALLBACK(void, *png_progressive_row_ptr, (png_structp, png_bytep, + png_uint_32, int),); #endif #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -typedef void (PNGAPI *png_user_transform_ptr) PNGARG((png_structp, - png_row_infop, png_bytep)); +typedef PNG_CALLBACK(void, *png_user_transform_ptr, (png_structp, png_row_infop, + png_bytep),); #endif #ifdef PNG_USER_CHUNKS_SUPPORTED -typedef int (PNGAPI *png_user_chunk_ptr) PNGARG((png_structp, - png_unknown_chunkp)); +typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp, + png_unknown_chunkp),); #endif #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED -typedef void (PNGAPI *png_unknown_chunk_ptr) PNGARG((png_structp)); +typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp),); #endif #ifdef PNG_SETJMP_SUPPORTED /* This must match the function definition in , and the * application must include this before png.h to obtain the definition - * of jmp_buf. + * of jmp_buf. The function is required to be PNG_NORETURN. */ -typedef void (PNGAPI *png_longjmp_ptr) PNGARG((jmp_buf, int)); +typedef void (PNGCAPI *png_longjmp_ptr) PNGARG((jmp_buf, int)) PNG_NORETURN; #endif /* Transform masks for the high-level interface */ #define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ @@ -1073,398 +766,17 @@ #define PNG_FLAG_MNG_EMPTY_PLTE 0x01 #define PNG_FLAG_MNG_FILTER_64 0x04 #define PNG_ALL_MNG_FEATURES 0x05 -typedef png_voidp (*png_malloc_ptr) PNGARG((png_structp, png_alloc_size_t)); -typedef void (*png_free_ptr) PNGARG((png_structp, png_voidp)); - -/* The structure that holds the information to read and write PNG files. - * The only people who need to care about what is inside of this are the - * people who will be modifying the library for their own special needs. - * It should NOT be accessed directly by an application, except to store - * the jmp_buf. - */ - -struct png_struct_def -{ -#ifdef PNG_SETJMP_SUPPORTED - jmp_buf jmpbuf PNG_DEPSTRUCT; /* used in png_error */ - png_longjmp_ptr longjmp_fn PNG_DEPSTRUCT;/* setjmp non-local goto - function. */ -#endif - png_error_ptr error_fn PNG_DEPSTRUCT; /* function for printing - errors and aborting */ - png_error_ptr warning_fn PNG_DEPSTRUCT; /* function for printing - warnings */ - png_voidp error_ptr PNG_DEPSTRUCT; /* user supplied struct for - error functions */ - png_rw_ptr write_data_fn PNG_DEPSTRUCT; /* function for writing - output data */ - png_rw_ptr read_data_fn PNG_DEPSTRUCT; /* function for reading - input data */ - png_voidp io_ptr PNG_DEPSTRUCT; /* ptr to application struct - for I/O functions */ - -#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED - png_user_transform_ptr read_user_transform_fn PNG_DEPSTRUCT; /* user read - transform */ -#endif - -#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED - png_user_transform_ptr write_user_transform_fn PNG_DEPSTRUCT; /* user write - transform */ -#endif - -/* These were added in libpng-1.0.2 */ -#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) - png_voidp user_transform_ptr PNG_DEPSTRUCT; /* user supplied struct - for user transform */ - png_byte user_transform_depth PNG_DEPSTRUCT; /* bit depth of user - transformed pixels */ - png_byte user_transform_channels PNG_DEPSTRUCT; /* channels in user - transformed pixels */ -#endif -#endif - - png_uint_32 mode PNG_DEPSTRUCT; /* tells us where we are in - the PNG file */ - png_uint_32 flags PNG_DEPSTRUCT; /* flags indicating various - things to libpng */ - png_uint_32 transformations PNG_DEPSTRUCT; /* which transformations - to perform */ - - z_stream zstream PNG_DEPSTRUCT; /* pointer to decompression - structure (below) */ - png_bytep zbuf PNG_DEPSTRUCT; /* buffer for zlib */ - png_size_t zbuf_size PNG_DEPSTRUCT; /* size of zbuf */ - int zlib_level PNG_DEPSTRUCT; /* holds zlib compression level */ - int zlib_method PNG_DEPSTRUCT; /* holds zlib compression method */ - int zlib_window_bits PNG_DEPSTRUCT; /* holds zlib compression window - bits */ - int zlib_mem_level PNG_DEPSTRUCT; /* holds zlib compression memory - level */ - int zlib_strategy PNG_DEPSTRUCT; /* holds zlib compression - strategy */ - - png_uint_32 width PNG_DEPSTRUCT; /* width of image in pixels */ - png_uint_32 height PNG_DEPSTRUCT; /* height of image in pixels */ - png_uint_32 num_rows PNG_DEPSTRUCT; /* number of rows in current pass */ - png_uint_32 usr_width PNG_DEPSTRUCT; /* width of row at start of write */ - png_size_t rowbytes PNG_DEPSTRUCT; /* size of row in bytes */ -#if 0 /* Replaced with the following in libpng-1.4.1 */ - png_size_t irowbytes PNG_DEPSTRUCT; -#endif -/* Added in libpng-1.4.1 */ -#ifdef PNG_USER_LIMITS_SUPPORTED - /* Total memory that a zTXt, sPLT, iTXt, iCCP, or unknown chunk - * can occupy when decompressed. 0 means unlimited. - * We will change the typedef from png_size_t to png_alloc_size_t - * in libpng-1.6.0 - */ - png_alloc_size_t user_chunk_malloc_max PNG_DEPSTRUCT; -#endif - png_uint_32 iwidth PNG_DEPSTRUCT; /* width of current interlaced - row in pixels */ - png_uint_32 row_number PNG_DEPSTRUCT; /* current row in interlace pass */ - png_bytep prev_row PNG_DEPSTRUCT; /* buffer to save previous - (unfiltered) row */ - png_bytep row_buf PNG_DEPSTRUCT; /* buffer to save current - (unfiltered) row */ - png_bytep sub_row PNG_DEPSTRUCT; /* buffer to save "sub" row - when filtering */ - png_bytep up_row PNG_DEPSTRUCT; /* buffer to save "up" row - when filtering */ - png_bytep avg_row PNG_DEPSTRUCT; /* buffer to save "avg" row - when filtering */ - png_bytep paeth_row PNG_DEPSTRUCT; /* buffer to save "Paeth" row - when filtering */ - png_row_info row_info PNG_DEPSTRUCT; /* used for transformation - routines */ - - png_uint_32 idat_size PNG_DEPSTRUCT; /* current IDAT size for read */ - png_uint_32 crc PNG_DEPSTRUCT; /* current chunk CRC value */ - png_colorp palette PNG_DEPSTRUCT; /* palette from the input file */ - png_uint_16 num_palette PNG_DEPSTRUCT; /* number of color entries in - palette */ - png_uint_16 num_trans PNG_DEPSTRUCT; /* number of transparency values */ - png_byte chunk_name[5] PNG_DEPSTRUCT; /* null-terminated name of current - chunk */ - png_byte compression PNG_DEPSTRUCT; /* file compression type - (always 0) */ - png_byte filter PNG_DEPSTRUCT; /* file filter type (always 0) */ - png_byte interlaced PNG_DEPSTRUCT; /* PNG_INTERLACE_NONE, - PNG_INTERLACE_ADAM7 */ - png_byte pass PNG_DEPSTRUCT; /* current interlace pass (0 - 6) */ - png_byte do_filter PNG_DEPSTRUCT; /* row filter flags (see - PNG_FILTER_ below ) */ - png_byte color_type PNG_DEPSTRUCT; /* color type of file */ - png_byte bit_depth PNG_DEPSTRUCT; /* bit depth of file */ - png_byte usr_bit_depth PNG_DEPSTRUCT; /* bit depth of users row */ - png_byte pixel_depth PNG_DEPSTRUCT; /* number of bits per pixel */ - png_byte channels PNG_DEPSTRUCT; /* number of channels in file */ - png_byte usr_channels PNG_DEPSTRUCT; /* channels at start of write */ - png_byte sig_bytes PNG_DEPSTRUCT; /* magic bytes read/written from - start of file */ - -#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) - png_uint_16 filler PNG_DEPSTRUCT; /* filler bytes for pixel - expansion */ -#endif - -#ifdef PNG_bKGD_SUPPORTED - png_byte background_gamma_type PNG_DEPSTRUCT; -# ifdef PNG_FLOATING_POINT_SUPPORTED - float background_gamma PNG_DEPSTRUCT; -# endif - png_color_16 background PNG_DEPSTRUCT; /* background color in - screen gamma space */ -#ifdef PNG_READ_GAMMA_SUPPORTED - png_color_16 background_1 PNG_DEPSTRUCT; /* background normalized - to gamma 1.0 */ -#endif -#endif /* PNG_bKGD_SUPPORTED */ - -#ifdef PNG_WRITE_FLUSH_SUPPORTED - png_flush_ptr output_flush_fn PNG_DEPSTRUCT; /* Function for flushing - output */ - png_uint_32 flush_dist PNG_DEPSTRUCT; /* how many rows apart to flush, - 0 - no flush */ - png_uint_32 flush_rows PNG_DEPSTRUCT; /* number of rows written since - last flush */ -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - int gamma_shift PNG_DEPSTRUCT; /* number of "insignificant" bits - 16-bit gamma */ -#ifdef PNG_FLOATING_POINT_SUPPORTED - float gamma PNG_DEPSTRUCT; /* file gamma value */ - float screen_gamma PNG_DEPSTRUCT; /* screen gamma value - (display_exponent) */ -#endif -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - png_bytep gamma_table PNG_DEPSTRUCT; /* gamma table for 8-bit - depth files */ - png_bytep gamma_from_1 PNG_DEPSTRUCT; /* converts from 1.0 to screen */ - png_bytep gamma_to_1 PNG_DEPSTRUCT; /* converts from file to 1.0 */ - png_uint_16pp gamma_16_table PNG_DEPSTRUCT; /* gamma table for 16-bit - depth files */ - png_uint_16pp gamma_16_from_1 PNG_DEPSTRUCT; /* converts from 1.0 to - screen */ - png_uint_16pp gamma_16_to_1 PNG_DEPSTRUCT; /* converts from file to 1.0 */ -#endif - -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) - png_color_8 sig_bit PNG_DEPSTRUCT; /* significant bits in each - available channel */ -#endif - -#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) - png_color_8 shift PNG_DEPSTRUCT; /* shift for significant bit - tranformation */ -#endif - -#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ - || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - png_bytep trans_alpha PNG_DEPSTRUCT; /* alpha values for - paletted files */ - png_color_16 trans_color PNG_DEPSTRUCT; /* transparent color for - non-paletted files */ -#endif - - png_read_status_ptr read_row_fn PNG_DEPSTRUCT; /* called after each - row is decoded */ - png_write_status_ptr write_row_fn PNG_DEPSTRUCT; /* called after each - row is encoded */ -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED - png_progressive_info_ptr info_fn PNG_DEPSTRUCT; /* called after header - data fully read */ - png_progressive_row_ptr row_fn PNG_DEPSTRUCT; /* called after each - prog. row is decoded */ - png_progressive_end_ptr end_fn PNG_DEPSTRUCT; /* called after image - is complete */ - png_bytep save_buffer_ptr PNG_DEPSTRUCT; /* current location in - save_buffer */ - png_bytep save_buffer PNG_DEPSTRUCT; /* buffer for previously - read data */ - png_bytep current_buffer_ptr PNG_DEPSTRUCT; /* current location in - current_buffer */ - png_bytep current_buffer PNG_DEPSTRUCT; /* buffer for recently - used data */ - png_uint_32 push_length PNG_DEPSTRUCT; /* size of current input - chunk */ - png_uint_32 skip_length PNG_DEPSTRUCT; /* bytes to skip in - input data */ - png_size_t save_buffer_size PNG_DEPSTRUCT; /* amount of data now - in save_buffer */ - png_size_t save_buffer_max PNG_DEPSTRUCT; /* total size of - save_buffer */ - png_size_t buffer_size PNG_DEPSTRUCT; /* total amount of - available input data */ - png_size_t current_buffer_size PNG_DEPSTRUCT; /* amount of data now - in current_buffer */ - int process_mode PNG_DEPSTRUCT; /* what push library - is currently doing */ - int cur_palette PNG_DEPSTRUCT; /* current push library - palette index */ - -# ifdef PNG_TEXT_SUPPORTED - png_size_t current_text_size PNG_DEPSTRUCT; /* current size of - text input data */ - png_size_t current_text_left PNG_DEPSTRUCT; /* how much text left - to read in input */ - png_charp current_text PNG_DEPSTRUCT; /* current text chunk - buffer */ - png_charp current_text_ptr PNG_DEPSTRUCT; /* current location - in current_text */ -# endif /* PNG_PROGRESSIVE_READ_SUPPORTED && PNG_TEXT_SUPPORTED */ - -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ - -#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) -/* For the Borland special 64K segment handler */ - png_bytepp offset_table_ptr PNG_DEPSTRUCT; - png_bytep offset_table PNG_DEPSTRUCT; - png_uint_16 offset_table_number PNG_DEPSTRUCT; - png_uint_16 offset_table_count PNG_DEPSTRUCT; - png_uint_16 offset_table_count_free PNG_DEPSTRUCT; -#endif - -#ifdef PNG_READ_DITHER_SUPPORTED - png_bytep palette_lookup PNG_DEPSTRUCT; /* lookup table for dithering */ - png_bytep dither_index PNG_DEPSTRUCT; /* index translation for palette - files */ -#endif - -#if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED) - png_uint_16p hist PNG_DEPSTRUCT; /* histogram */ -#endif - -#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED - png_byte heuristic_method PNG_DEPSTRUCT; /* heuristic for row - filter selection */ - png_byte num_prev_filters PNG_DEPSTRUCT; /* number of weights - for previous rows */ - png_bytep prev_filters PNG_DEPSTRUCT; /* filter type(s) of - previous row(s) */ - png_uint_16p filter_weights PNG_DEPSTRUCT; /* weight(s) for previous - line(s) */ - png_uint_16p inv_filter_weights PNG_DEPSTRUCT; /* 1/weight(s) for - previous line(s) */ - png_uint_16p filter_costs PNG_DEPSTRUCT; /* relative filter - calculation cost */ - png_uint_16p inv_filter_costs PNG_DEPSTRUCT; /* 1/relative filter - calculation cost */ -#endif - -#ifdef PNG_TIME_RFC1123_SUPPORTED - png_charp time_buffer PNG_DEPSTRUCT; /* String to hold RFC 1123 time text */ -#endif - -/* New members added in libpng-1.0.6 */ - - png_uint_32 free_me PNG_DEPSTRUCT; /* flags items libpng is - responsible for freeing */ - -#ifdef PNG_USER_CHUNKS_SUPPORTED - png_voidp user_chunk_ptr PNG_DEPSTRUCT; - png_user_chunk_ptr read_user_chunk_fn PNG_DEPSTRUCT; /* user read - chunk handler */ -#endif - -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED - int num_chunk_list PNG_DEPSTRUCT; - png_bytep chunk_list PNG_DEPSTRUCT; -#endif - -/* New members added in libpng-1.0.3 */ -#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED - png_byte rgb_to_gray_status PNG_DEPSTRUCT; - /* These were changed from png_byte in libpng-1.0.6 */ - png_uint_16 rgb_to_gray_red_coeff PNG_DEPSTRUCT; - png_uint_16 rgb_to_gray_green_coeff PNG_DEPSTRUCT; - png_uint_16 rgb_to_gray_blue_coeff PNG_DEPSTRUCT; -#endif - -/* New member added in libpng-1.0.4 (renamed in 1.0.9) */ -#if defined(PNG_MNG_FEATURES_SUPPORTED) || \ - 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 */ - png_uint_32 mng_features_permitted PNG_DEPSTRUCT; -#endif - -/* New member added in libpng-1.0.7 */ -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) - png_fixed_point int_gamma PNG_DEPSTRUCT; -#endif - -/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ -#ifdef PNG_MNG_FEATURES_SUPPORTED - png_byte filter_type PNG_DEPSTRUCT; -#endif - -/* New members added in libpng-1.2.0 */ - -/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ -#ifdef PNG_USER_MEM_SUPPORTED - png_voidp mem_ptr PNG_DEPSTRUCT; /* user supplied struct for - mem functions */ - png_malloc_ptr malloc_fn PNG_DEPSTRUCT; /* function for - allocating memory */ - png_free_ptr free_fn PNG_DEPSTRUCT; /* function for - freeing memory */ -#endif - -/* New member added in libpng-1.0.13 and 1.2.0 */ - png_bytep big_row_buf PNG_DEPSTRUCT; /* buffer to save current - (unfiltered) row */ - -#ifdef PNG_READ_DITHER_SUPPORTED -/* The following three members were added at version 1.0.14 and 1.2.4 */ - png_bytep dither_sort PNG_DEPSTRUCT; /* working sort array */ - png_bytep index_to_palette PNG_DEPSTRUCT; /* where the original - index currently is - in the palette */ - png_bytep palette_to_index PNG_DEPSTRUCT; /* 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 PNG_DEPSTRUCT; - -#ifdef PNG_USER_LIMITS_SUPPORTED - png_uint_32 user_width_max PNG_DEPSTRUCT; - png_uint_32 user_height_max PNG_DEPSTRUCT; - /* Added in libpng-1.4.0: Total number of sPLT, text, and unknown - * chunks that can be stored (0 means unlimited). - */ - png_uint_32 user_chunk_cache_max PNG_DEPSTRUCT; -#endif - -/* New member added in libpng-1.0.25 and 1.2.17 */ -#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED - /* Storage for unknown chunk that the library doesn't recognize. */ - png_unknown_chunk unknown_chunk PNG_DEPSTRUCT; -#endif - -/* New members added in libpng-1.2.26 */ - png_uint_32 old_big_row_buf_size PNG_DEPSTRUCT; - png_uint_32 old_prev_row_size PNG_DEPSTRUCT; - -/* New member added in libpng-1.2.30 */ - png_charp chunkdata PNG_DEPSTRUCT; /* buffer for reading chunk data */ - -#ifdef PNG_IO_STATE_SUPPORTED -/* New member added in libpng-1.4.0 */ - png_uint_32 io_state PNG_DEPSTRUCT; -#endif -}; - +/* NOTE: prior to 1.5 these functions had no 'API' style declaration, + * this allowed the zlib default functions to be used on Windows + * platforms. In 1.5 the zlib default malloc (which just calls malloc and + * ignores the first argument) should be completely compatible with the + * following. + */ +typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp, + png_alloc_size_t),); +typedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp),); /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ @@ -1478,39 +790,44 @@ * a simple one line description of the use of each function. */ /* Returns the version number of the library */ -extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void)); +extern PNG_EXPORT(png_uint_32,png_access_version_number,(void),,1); /* Tell lib we have already handled the first magic bytes. * Handling more than 8 bytes from the beginning of the file is an error. */ -extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr, - int num_bytes)); +extern PNG_EXPORT(void,png_set_sig_bytes,(png_structp png_ptr, + int num_bytes),,2); /* Check sig[start] through sig[start + num_to_check - 1] to see if it's a * PNG file. Returns zero if the supplied bytes match the 8-byte PNG * signature, and non-zero otherwise. Having num_to_check == 0 or * start > 7 will always fail (ie return non-zero). */ -extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start, - png_size_t num_to_check)); +extern PNG_EXPORT(int,png_sig_cmp,(png_bytep sig, png_size_t start, + png_size_t num_to_check),,3); + +/* Simple signature checking function. This is the same as calling + * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). + */ +#define png_check_sig(sig,n) !png_sig_cmp((sig), 0, (n)) /* Allocate and initialize png_ptr struct for reading, and any other memory. */ -extern PNG_EXPORT(png_structp,png_create_read_struct) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, - png_error_ptr error_fn, png_error_ptr warn_fn)) PNG_ALLOCATED; +extern PNG_EXPORT(png_structp,png_create_read_struct, + (png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn),PNG_ALLOCATED,4); /* Allocate and initialize png_ptr struct for writing, and any other memory */ -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)) PNG_ALLOCATED; +extern PNG_EXPORT(png_structp,png_create_write_struct, + (png_const_charp user_png_ver, png_voidp error_ptr, + png_error_ptr error_fn, png_error_ptr warn_fn),PNG_ALLOCATED,5); -extern PNG_EXPORT(png_size_t,png_get_compression_buffer_size) - PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_size_t,png_get_compression_buffer_size,(png_structp + png_ptr),,6); -extern PNG_EXPORT(void,png_set_compression_buffer_size) - PNGARG((png_structp png_ptr, png_size_t size)); +extern PNG_EXPORT(void,png_set_compression_buffer_size,(png_structp png_ptr, + png_size_t size),,7); /* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp * match up. */ @@ -1521,184 +838,190 @@ * acceptable. The size of the jmp_buf is checked against the actual size * allocated by the library - the call will return NULL on a mismatch * indicating an ABI mismatch. */ -extern PNG_EXPORT(jmp_buf*, png_set_longjmp_fn) - PNGARG((png_structp png_ptr, png_longjmp_ptr longjmp_fn, size_t - jmp_buf_size)); +extern PNG_EXPORT(jmp_buf*, png_set_longjmp_fn, (png_structp png_ptr, + png_longjmp_ptr longjmp_fn, size_t jmp_buf_size),,8); # define png_jmpbuf(png_ptr) \ (*png_set_longjmp_fn((png_ptr), longjmp, sizeof (jmp_buf))) #else # define png_jmpbuf(png_ptr) \ (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP) #endif +/* This function should be used by libpng applications in place of + * longjmp(png_ptr->jmpbuf, val). If longjmp_fn() has been set, it + * will use it; otherwise it will call PNG_ABORT(). This function was + * added in libpng-1.5.0. + */ +extern PNG_EXPORT(void, png_longjmp, (png_structp png_ptr, int val), + PNG_NORETURN,9); /* Reset the compression stream */ -extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(int,png_reset_zstream,(png_structp png_ptr),,10); /* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ #ifdef PNG_USER_MEM_SUPPORTED -extern PNG_EXPORT(png_structp,png_create_read_struct_2) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, +extern PNG_EXPORT(png_structp,png_create_read_struct_2, + (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn)) PNG_ALLOCATED; -extern PNG_EXPORT(png_structp,png_create_write_struct_2) - PNGARG((png_const_charp user_png_ver, png_voidp error_ptr, + png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED,11); +extern PNG_EXPORT(png_structp,png_create_write_struct_2, + (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, - png_malloc_ptr malloc_fn, png_free_ptr free_fn)) PNG_ALLOCATED; + png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED,12); #endif /* Write the PNG file signature. */ -extern PNG_EXPORT(void,png_write_sig) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_write_sig,(png_structp png_ptr),,13); /* Write a PNG chunk - size, type, (optional) data, CRC. */ -extern PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr, - png_bytep chunk_name, png_bytep data, png_size_t length)); +extern PNG_EXPORT(void,png_write_chunk,(png_structp png_ptr, + png_bytep chunk_name, png_bytep data, png_size_t length),,14); /* Write the start of a PNG chunk - length and chunk name. */ -extern PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr, - png_bytep chunk_name, png_uint_32 length)); +extern PNG_EXPORT(void,png_write_chunk_start,(png_structp png_ptr, + png_bytep chunk_name, png_uint_32 length),,15); /* Write the data of a PNG chunk started with png_write_chunk_start(). */ -extern PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr, - png_bytep data, png_size_t length)); +extern PNG_EXPORT(void,png_write_chunk_data,(png_structp png_ptr, + png_bytep data, png_size_t length),,16); /* Finish a chunk started with png_write_chunk_start() (includes CRC). */ -extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_write_chunk_end,(png_structp png_ptr),,17); /* Allocate and initialize the info structure */ -extern PNG_EXPORT(png_infop,png_create_info_struct) - PNGARG((png_structp png_ptr)) PNG_ALLOCATED; +extern PNG_EXPORT(png_infop,png_create_info_struct,(png_structp png_ptr), + PNG_ALLOCATED,18); -extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr, - png_size_t png_info_struct_size)); +extern PNG_EXPORT(void,png_info_init_3,(png_infopp info_ptr, + png_size_t png_info_struct_size),,19); /* Writes all the PNG information before the image. */ -extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr, - png_infop info_ptr)); -extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr, - png_infop info_ptr)); +extern PNG_EXPORT(void,png_write_info_before_PLTE,(png_structp png_ptr, + png_infop info_ptr),,20); +extern PNG_EXPORT(void,png_write_info,(png_structp png_ptr, + png_infop info_ptr),,21); #ifdef PNG_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)); +extern PNG_EXPORT(void,png_read_info,(png_structp png_ptr, + png_infop info_ptr),,22); #endif #ifdef PNG_TIME_RFC1123_SUPPORTED -extern PNG_EXPORT(png_charp,png_convert_to_rfc1123) - PNGARG((png_structp png_ptr, png_timep ptime)); +extern PNG_EXPORT(png_charp,png_convert_to_rfc1123,(png_structp png_ptr, + png_timep ptime),,23); #endif #ifdef PNG_CONVERT_tIME_SUPPORTED /* Convert from a struct tm to png_time */ -extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime, - struct tm FAR * ttime)); +extern PNG_EXPORT(void,png_convert_from_struct_tm,(png_timep ptime, + struct tm FAR * ttime),,24); /* Convert from time_t to png_time. Uses gmtime() */ -extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime, - time_t ttime)); +extern PNG_EXPORT(void,png_convert_from_time_t,(png_timep ptime, + time_t ttime),,25); #endif /* PNG_CONVERT_tIME_SUPPORTED */ #ifdef PNG_READ_EXPAND_SUPPORTED /* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ -extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8) PNGARG((png_structp - png_ptr)); -extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_expand,(png_structp png_ptr),,26); +extern PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8,(png_structp png_ptr),, + 27); +extern PNG_EXPORT(void,png_set_palette_to_rgb,(png_structp png_ptr),,28); +extern PNG_EXPORT(void,png_set_tRNS_to_alpha,(png_structp png_ptr),,29); #endif #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) /* Use blue, green, red order for pixels. */ -extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_bgr,(png_structp png_ptr),,30); #endif #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED /* Expand the grayscale to 24-bit RGB if necessary. */ -extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_gray_to_rgb,(png_structp png_ptr),,31); #endif #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED /* Reduce RGB to grayscale. */ #ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr, - int error_action, double red, double green )); +extern PNG_EXPORT(void,png_set_rgb_to_gray,(png_structp png_ptr, + int error_action, double red, double green ),,32); #endif -extern PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr, - int error_action, png_fixed_point red, png_fixed_point green )); -extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp - png_ptr)); +extern PNG_EXPORT(void,png_set_rgb_to_gray_fixed,(png_structp png_ptr, + int error_action, png_fixed_point red, png_fixed_point green),,33); +extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status,(png_structp png_ptr),, + 34); #endif -extern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth, - png_colorp palette)); +extern PNG_EXPORT(void,png_build_grayscale_palette,(int bit_depth, + png_colorp palette),,35); #ifdef PNG_READ_STRIP_ALPHA_SUPPORTED -extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_strip_alpha,(png_structp png_ptr),,36); #endif #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) -extern PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_swap_alpha,(png_structp png_ptr),,37); #endif #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) -extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_invert_alpha,(png_structp png_ptr),,38); #endif #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) /* 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)); +extern PNG_EXPORT(void,png_set_filler,(png_structp png_ptr, + png_uint_32 filler, int flags),,39); /* 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. */ -extern PNG_EXPORT(void,png_set_add_alpha) PNGARG((png_structp png_ptr, - png_uint_32 filler, int flags)); +extern PNG_EXPORT(void,png_set_add_alpha,(png_structp png_ptr, + png_uint_32 filler, int flags),,40); #endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */ #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) /* Swap bytes in 16-bit depth files. */ -extern PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_swap,(png_structp png_ptr),,41); #endif #if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) /* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ -extern PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_packing,(png_structp png_ptr),,42); #endif #if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ defined(PNG_WRITE_PACKSWAP_SUPPORTED) /* Swap packing order of pixels in bytes. */ -extern PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_packswap,(png_structp png_ptr),,43); #endif #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) /* Converts files to legal bit depths. */ -extern PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr, - png_color_8p true_bits)); +extern PNG_EXPORT(void,png_set_shift,(png_structp png_ptr, + png_color_8p true_bits),,44); #endif #if defined(PNG_READ_INTERLACING_SUPPORTED) || \ defined(PNG_WRITE_INTERLACING_SUPPORTED) /* Have the code handle the interlacing. Returns the number of passes. */ -extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(int,png_set_interlace_handling,(png_structp png_ptr),,45); #endif #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) /* Invert monochrome files */ -extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_invert_mono,(png_structp png_ptr),,46); #endif #ifdef PNG_READ_BACKGROUND_SUPPORTED /* Handle alpha and tRNS by replacing with a background color. */ #ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr, +extern PNG_EXPORT(void,png_set_background,(png_structp png_ptr, png_color_16p background_color, int background_gamma_code, - int need_expand, double background_gamma)); + int need_expand, double background_gamma),,47); #endif #define PNG_BACKGROUND_GAMMA_UNKNOWN 0 #define PNG_BACKGROUND_GAMMA_SCREEN 1 #define PNG_BACKGROUND_GAMMA_FILE 2 @@ -1706,99 +1029,97 @@ #endif #ifdef PNG_READ_16_TO_8_SUPPORTED /* Strip the second byte of information from a 16-bit depth file. */ -extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_strip_16,(png_structp png_ptr),,48); #endif #ifdef PNG_READ_DITHER_SUPPORTED /* Turn on dithering, and reduce the palette to the number of colors * available. */ -extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr, +extern PNG_EXPORT(void,png_set_dither,(png_structp png_ptr, png_colorp palette, int num_palette, int maximum_colors, - png_uint_16p histogram, int full_dither)); + png_uint_16p histogram, int full_dither),,49); #endif #ifdef PNG_READ_GAMMA_SUPPORTED /* Handle gamma correction. Screen_gamma=(display_exponent) */ #ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr, - double screen_gamma, double default_file_gamma)); +extern PNG_EXPORT(void,png_set_gamma,(png_structp png_ptr, + double screen_gamma, double default_file_gamma),,50); #endif #endif #ifdef PNG_WRITE_FLUSH_SUPPORTED /* Set how many lines between output flushes - 0 for no flushing */ -extern PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows)); +extern PNG_EXPORT(void,png_set_flush,(png_structp png_ptr, int nrows),,51); /* Flush the current PNG output buffer */ -extern PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_write_flush,(png_structp png_ptr),,52); #endif /* Optional update palette with requested transformations */ -extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_start_read_image,(png_structp png_ptr),,53); /* Optional call to update the users info structure */ -extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr, - png_infop info_ptr)); +extern PNG_EXPORT(void,png_read_update_info,(png_structp png_ptr, + png_infop info_ptr),,54); #ifdef PNG_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)); +extern PNG_EXPORT(void,png_read_rows,(png_structp png_ptr, png_bytepp row, + png_bytepp display_row, png_uint_32 num_rows),,55); #endif #ifdef PNG_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)); +extern PNG_EXPORT(void,png_read_row,(png_structp png_ptr, png_bytep row, + png_bytep display_row),,56); #endif #ifdef PNG_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)); +extern PNG_EXPORT(void,png_read_image,(png_structp png_ptr, + png_bytepp image),,57); #endif /* Write a row of image data */ -extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr, - png_bytep row)); +extern PNG_EXPORT(void,png_write_row,(png_structp png_ptr, png_bytep row),,58); /* Write a few rows of image data */ -extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr, - png_bytepp row, png_uint_32 num_rows)); +extern PNG_EXPORT(void,png_write_rows,(png_structp png_ptr, + png_bytepp row, png_uint_32 num_rows),,59); /* Write the image data */ -extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr, - png_bytepp image)); +extern PNG_EXPORT(void,png_write_image,(png_structp png_ptr, + png_bytepp image),,60); /* Write the end of the PNG file. */ -extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr, - png_infop info_ptr)); +extern PNG_EXPORT(void,png_write_end,(png_structp png_ptr, + png_infop info_ptr),,61); #ifdef PNG_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)); +extern PNG_EXPORT(void,png_read_end,(png_structp png_ptr, + png_infop info_ptr),,62); #endif /* Free any memory associated with the png_info_struct */ -extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr, - png_infopp info_ptr_ptr)); +extern PNG_EXPORT(void,png_destroy_info_struct,(png_structp png_ptr, + png_infopp info_ptr_ptr),,63); /* Free any memory associated with the png_struct and the png_info_structs */ -extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp - png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); +extern PNG_EXPORT(void,png_destroy_read_struct,(png_structpp png_ptr_ptr, + png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr),,64); /* Free any memory associated with the png_struct and the png_info_structs */ -extern PNG_EXPORT(void,png_destroy_write_struct) - PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); +extern PNG_EXPORT(void,png_destroy_write_struct,(png_structpp png_ptr_ptr, + png_infopp info_ptr_ptr),,65); /* Set the libpng method of handling chunk CRC errors */ -extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr, - int crit_action, int ancil_action)); +extern PNG_EXPORT(void,png_set_crc_action,(png_structp png_ptr, + int crit_action, int ancil_action),,66); /* Values for png_set_crc_action() to say how to handle CRC errors in * ancillary and critical chunks, and whether to use the data contained * therein. Note that it is impossible to "discard" data in a critical @@ -1825,10 +1146,10 @@ /* Set the filtering method(s) used by libpng. Currently, the only valid * value for "method" is 0. */ -extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method, - int filters)); +extern PNG_EXPORT(void,png_set_filter,(png_structp png_ptr, int method, + int filters),,67); /* Flags for png_set_filter() to say which filters to use. The flags * are chosen so that they don't conflict with real filter types * below, in case they are supplied instead of the #defined constants. @@ -1882,11 +1203,11 @@ * the weights and costs are set to 1.0, this degenerates the WEIGHTED method * to the UNWEIGHTED method, but with added encoding time/computation. */ #ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr, +extern PNG_EXPORT(void,png_set_filter_heuristics,(png_structp png_ptr, int heuristic_method, int num_weights, png_doublep filter_weights, - png_doublep filter_costs)); + png_doublep filter_costs),,68); #endif #endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ /* Heuristic used for row filter selection. These defines should NOT be @@ -1903,22 +1224,22 @@ * shown that zlib compression levels 3-6 usually perform as well as level 9 * for PNG images, and do considerably fewer caclulations. In the future, * these values may not correspond directly to the zlib compression levels. */ -extern PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr, - int level)); +extern PNG_EXPORT(void,png_set_compression_level,(png_structp png_ptr, + int level),,69); -extern PNG_EXPORT(void,png_set_compression_mem_level) - PNGARG((png_structp png_ptr, int mem_level)); +extern PNG_EXPORT(void,png_set_compression_mem_level,(png_structp png_ptr, + int mem_level),,70); -extern PNG_EXPORT(void,png_set_compression_strategy) - PNGARG((png_structp png_ptr, int strategy)); +extern PNG_EXPORT(void,png_set_compression_strategy,(png_structp png_ptr, + int strategy),,71); -extern PNG_EXPORT(void,png_set_compression_window_bits) - PNGARG((png_structp png_ptr, int window_bits)); +extern PNG_EXPORT(void,png_set_compression_window_bits,(png_structp png_ptr, + int window_bits),,72); -extern PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr, - int method)); +extern PNG_EXPORT(void,png_set_compression_method,(png_structp png_ptr, + int method),,73); /* These next functions are called for input/output, memory, and error * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, * and call standard C I/O routines such as fread(), fwrite(), and @@ -1929,10 +1250,9 @@ */ #ifdef PNG_STDIO_SUPPORTED /* Initialize the input/output for the PNG file to the default functions. */ -extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr, - png_FILE_p fp)); +extern PNG_EXPORT(void,png_init_io,(png_structp png_ptr, png_FILE_p fp),,74); #endif /* Replace the (error and abort), and warning functions with user * supplied functions. If no messages are to be printed you must still @@ -1941,13 +1261,14 @@ * method of error handling. If error_fn or warning_fn is NULL, the * default function will be used. */ -extern PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr, - png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); +extern PNG_EXPORT(void,png_set_error_fn,(png_structp png_ptr, + png_voidp error_ptr, png_error_ptr error_fn, + png_error_ptr warning_fn),,75); /* Return the user pointer associated with the error functions */ -extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_voidp,png_get_error_ptr,(png_structp png_ptr),,76); /* Replace the default data output functions with a user supplied one(s). * If buffered output is not used, then output_flush_fn can be set to NULL. * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time @@ -1957,103 +1278,101 @@ * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's * default flush function, which uses the standard *FILE structure, will * be used. */ -extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr, - png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); +extern PNG_EXPORT(void,png_set_write_fn,(png_structp png_ptr, + png_voidp io_ptr, png_rw_ptr write_data_fn, + png_flush_ptr output_flush_fn),,77); /* Replace the default data input function with a user supplied one. */ -extern PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr, - png_voidp io_ptr, png_rw_ptr read_data_fn)); +extern PNG_EXPORT(void,png_set_read_fn,(png_structp png_ptr, + png_voidp io_ptr, png_rw_ptr read_data_fn),,78); /* Return the user pointer associated with the I/O functions */ -extern PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_voidp,png_get_io_ptr,(png_structp png_ptr),,79); -extern PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr, - png_read_status_ptr read_row_fn)); +extern PNG_EXPORT(void,png_set_read_status_fn,(png_structp png_ptr, + png_read_status_ptr read_row_fn),,80); -extern PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr, - png_write_status_ptr write_row_fn)); +extern PNG_EXPORT(void,png_set_write_status_fn,(png_structp png_ptr, + png_write_status_ptr write_row_fn),,81); #ifdef PNG_USER_MEM_SUPPORTED /* Replace the default memory allocation functions with user supplied one(s). */ -extern PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr, - png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +extern PNG_EXPORT(void,png_set_mem_fn,(png_structp png_ptr, + png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),,82); /* Return the user pointer associated with the memory functions */ -extern PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_voidp,png_get_mem_ptr,(png_structp png_ptr),,83); #endif #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED -extern PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp - png_ptr, png_user_transform_ptr read_user_transform_fn)); +extern PNG_EXPORT(void,png_set_read_user_transform_fn,(png_structp png_ptr, + png_user_transform_ptr read_user_transform_fn),,84); #endif #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED -extern PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp - png_ptr, png_user_transform_ptr write_user_transform_fn)); +extern PNG_EXPORT(void,png_set_write_user_transform_fn,(png_structp png_ptr, + png_user_transform_ptr write_user_transform_fn),,85); #endif #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -extern PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp - png_ptr, png_voidp user_transform_ptr, int user_transform_depth, - int user_transform_channels)); +extern PNG_EXPORT(void,png_set_user_transform_info,(png_structp png_ptr, + png_voidp user_transform_ptr, int user_transform_depth, + int user_transform_channels),,86); /* Return the user pointer associated with the user transform functions */ -extern PNG_EXPORT(png_voidp,png_get_user_transform_ptr) - PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_voidp,png_get_user_transform_ptr, + (png_structp png_ptr),,87); #endif #ifdef PNG_USER_CHUNKS_SUPPORTED -extern PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr, - png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); -extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp - png_ptr)); +extern PNG_EXPORT(void,png_set_read_user_chunk_fn,(png_structp png_ptr, + png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn),,88); +extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr,(png_structp png_ptr),,89); #endif #ifdef PNG_PROGRESSIVE_READ_SUPPORTED /* Sets the function callbacks for the push reader, and a pointer to a * user-defined structure available to the callback functions. */ -extern PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr, - png_voidp progressive_ptr, - png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, - png_progressive_end_ptr end_fn)); +extern PNG_EXPORT(void,png_set_progressive_read_fn,(png_structp png_ptr, + png_voidp progressive_ptr, png_progressive_info_ptr info_fn, + png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn),,90); /* Returns the user pointer associated with the push read functions */ -extern PNG_EXPORT(png_voidp,png_get_progressive_ptr) - PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_voidp,png_get_progressive_ptr,(png_structp png_ptr),,91); /* Function to be called when data becomes available */ -extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytep buffer, png_size_t buffer_size)); +extern PNG_EXPORT(void,png_process_data,(png_structp png_ptr, + png_infop info_ptr, png_bytep buffer, png_size_t buffer_size),,92); /* Function that combines rows. Not very much different than the * png_combine_row() call. Is this even used????? */ -extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr, - png_bytep old_row, png_bytep new_row)); +extern PNG_EXPORT(void,png_progressive_combine_row,(png_structp png_ptr, + png_bytep old_row, png_bytep new_row),,93); #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ -extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr, - png_alloc_size_t size)) PNG_ALLOCATED; +extern PNG_EXPORT(png_voidp,png_malloc,(png_structp png_ptr, + png_alloc_size_t size),PNG_ALLOCATED,94); /* Added at libpng version 1.4.0 */ -extern PNG_EXPORT(png_voidp,png_calloc) PNGARG((png_structp png_ptr, - png_alloc_size_t size)) PNG_ALLOCATED; +extern PNG_EXPORT(png_voidp,png_calloc,(png_structp png_ptr, + png_alloc_size_t size),PNG_ALLOCATED,95); /* Added at libpng version 1.2.4 */ -extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr, - png_alloc_size_t size)) PNG_ALLOCATED; +extern PNG_EXPORT(png_voidp,png_malloc_warn,(png_structp png_ptr, + png_alloc_size_t size),PNG_ALLOCATED,96); /* Frees a pointer allocated by png_malloc() */ -extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr)); +extern PNG_EXPORT(void,png_free,(png_structp png_ptr, png_voidp ptr),,97); /* 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)); +extern PNG_EXPORT(void,png_free_data,(png_structp png_ptr, png_infop info_ptr, + png_uint_32 free_me, int num),,98); /* Reassign responsibility for freeing existing data, whether allocated * by libpng or by the application */ -extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr, - png_infop info_ptr, int freer, png_uint_32 mask)); +extern PNG_EXPORT(void,png_data_freer,(png_structp png_ptr, png_infop info_ptr, + int freer, png_uint_32 mask),,99); /* Assignments for png_data_freer */ #define PNG_DESTROY_WILL_FREE_DATA 1 #define PNG_SET_WILL_FREE_DATA 1 #define PNG_USER_WILL_FREE_DATA 2 @@ -2072,48 +1391,48 @@ #define PNG_FREE_ALL 0x7fff #define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ #ifdef PNG_USER_MEM_SUPPORTED -extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr, - png_alloc_size_t size)) PNG_ALLOCATED; -extern PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr, - png_voidp ptr)); +extern PNG_EXPORT(png_voidp,png_malloc_default,(png_structp png_ptr, + png_alloc_size_t size),PNG_ALLOCATED,100); +extern PNG_EXPORT(void,png_free_default,(png_structp png_ptr, + png_voidp ptr),,101); #endif #ifndef PNG_NO_ERROR_TEXT /* 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_message)) PNG_NORETURN; +extern PNG_EXPORT(void,png_error,(png_structp png_ptr, + png_const_charp error_message),PNG_NORETURN,102); /* 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_message)) PNG_NORETURN; +extern PNG_EXPORT(void,png_chunk_error,(png_structp png_ptr, + png_const_charp error_message),PNG_NORETURN,103); #else /* Fatal error in PNG image of libpng - can't continue */ -extern PNG_EXPORT(void,png_err) PNGARG((png_structp png_ptr)) PNG_NORETURN; +extern PNG_EXPORT(void,png_err,(png_structp png_ptr),PNG_NORETURN,104); #endif /* 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 warning_message)); +extern PNG_EXPORT(void,png_warning,(png_structp png_ptr, + png_const_charp warning_message),,105); /* 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 warning_message)); +extern PNG_EXPORT(void,png_chunk_warning,(png_structp png_ptr, + png_const_charp warning_message),,106); #ifdef PNG_BENIGN_ERRORS_SUPPORTED /* Benign error in libpng. Can continue, but may have a problem. * User can choose whether to handle as a fatal error or as a warning. */ -extern PNG_EXPORT(void,png_benign_error) PNGARG((png_structp png_ptr, - png_const_charp warning_message)); +extern PNG_EXPORT(void,png_benign_error,(png_structp png_ptr, + png_const_charp warning_message),,107); /* Same, chunk name is prepended to message. */ -extern PNG_EXPORT(void,png_chunk_benign_error) PNGARG((png_structp png_ptr, - png_const_charp warning_message)); +extern PNG_EXPORT(void,png_chunk_benign_error,(png_structp png_ptr, + png_const_charp warning_message),,108); -extern PNG_EXPORT(void,png_set_benign_errors) PNGARG((png_structp - png_ptr, int allowed)); +extern PNG_EXPORT(void,png_set_benign_errors,(png_structp png_ptr, + int allowed),,109); #endif /* The png_set_ functions are for storing values in the png_info_struct. * Similarly, the png_get_ calls are used to read values from the @@ -2127,260 +1446,265 @@ * to avoid problems with future changes in the size and internal layout of * png_info_struct. */ /* Returns "flag" if chunk data is valid in info_ptr. */ -extern PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr, -png_infop info_ptr, png_uint_32 flag)); +extern PNG_EXPORT(png_uint_32,png_get_valid,(png_structp png_ptr, + png_infop info_ptr, png_uint_32 flag),,110); /* Returns number of bytes needed to hold a transformed row. */ -extern PNG_EXPORT(png_size_t,png_get_rowbytes) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +extern PNG_EXPORT(png_size_t,png_get_rowbytes,(png_structp png_ptr, + png_infop info_ptr),,111); #ifdef PNG_INFO_IMAGE_SUPPORTED /* Returns row_pointers, which is an array of pointers to scanlines that was * returned from png_read_png(). */ -extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +extern PNG_EXPORT(png_bytepp,png_get_rows,(png_structp png_ptr, + png_infop info_ptr),,112); /* Set row_pointers, which is an array of pointers to scanlines for use * by png_write_png(). */ -extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_bytepp row_pointers)); +extern PNG_EXPORT(void,png_set_rows,(png_structp png_ptr, png_infop info_ptr, + png_bytepp row_pointers),,113); #endif /* Returns number of color channels in image. */ -extern PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +extern PNG_EXPORT(png_byte,png_get_channels,(png_structp png_ptr, + png_infop info_ptr),,114); #ifdef PNG_EASY_ACCESS_SUPPORTED /* Returns image width in pixels. */ -extern PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_uint_32, png_get_image_width,(png_structp png_ptr, + png_infop info_ptr),,115); /* Returns image height in pixels. */ -extern PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_uint_32, png_get_image_height,(png_structp png_ptr, + png_infop info_ptr),,116); /* Returns image bit_depth. */ -extern PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_byte, png_get_bit_depth,(png_structp png_ptr, + png_infop info_ptr),,117); /* Returns image color_type. */ -extern PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_byte, png_get_color_type,(png_structp png_ptr, + png_infop info_ptr),,118); /* Returns image filter_type. */ -extern PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_byte, png_get_filter_type,(png_structp png_ptr, + png_infop info_ptr),,119); /* Returns image interlace_type. */ -extern PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_byte, png_get_interlace_type,(png_structp png_ptr, + png_infop info_ptr),,120); /* Returns image compression_type. */ -extern PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_byte, png_get_compression_type,(png_structp png_ptr, + png_infop info_ptr),,121); /* Returns image resolution in pixels per meter, from pHYs chunk data. */ -extern PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_uint_32, png_get_pixels_per_meter,(png_structp png_ptr, + png_infop info_ptr),,122); +extern PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter, + (png_structp png_ptr, png_infop info_ptr),,123); +extern PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter, + (png_structp png_ptr, png_infop info_ptr),,124); /* Returns pixel aspect ratio, computed from pHYs chunk data. */ #ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(float, png_get_pixel_aspect_ratio, + (png_structp png_ptr, png_infop info_ptr),,125); #endif /* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ -extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -extern PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels, + (png_structp png_ptr, png_infop info_ptr),,126); +extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels, + (png_structp png_ptr, png_infop info_ptr),,127); +extern PNG_EXPORT(png_int_32, png_get_x_offset_microns, + (png_structp png_ptr, png_infop info_ptr),,128); +extern PNG_EXPORT(png_int_32, png_get_y_offset_microns, + (png_structp png_ptr, png_infop info_ptr),,129); #endif /* PNG_EASY_ACCESS_SUPPORTED */ /* Returns pointer to signature string read from PNG header */ -extern PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +extern PNG_EXPORT(png_bytep,png_get_signature,(png_structp png_ptr, + png_infop info_ptr),,130); #ifdef PNG_bKGD_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_16p *background)); +extern PNG_EXPORT(png_uint_32,png_get_bKGD,(png_structp png_ptr, + png_infop info_ptr, png_color_16p *background),,131); #endif #ifdef PNG_bKGD_SUPPORTED -extern PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_16p background)); +extern PNG_EXPORT(void,png_set_bKGD,(png_structp png_ptr, + png_infop info_ptr, png_color_16p background),,132); #endif #ifdef PNG_cHRM_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr, - png_infop info_ptr, double *white_x, double *white_y, double *red_x, - double *red_y, double *green_x, double *green_y, double *blue_x, - double *blue_y)); +extern PNG_EXPORT(png_uint_32,png_get_cHRM,(png_structp png_ptr, + png_infop info_ptr, double *white_x, double *white_y, + double *red_x, double *red_y, double *green_x, double *green_y, + double *blue_x, double *blue_y),,133); #endif #ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point - *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, - png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point - *int_blue_x, png_fixed_point *int_blue_y)); +extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed,(png_structp png_ptr, + png_infop info_ptr, + png_fixed_point *int_white_x, png_fixed_point *int_white_y, + png_fixed_point *int_red_x, png_fixed_point *int_red_y, + png_fixed_point *int_green_x, png_fixed_point *int_green_y, + png_fixed_point *int_blue_x, png_fixed_point *int_blue_y),,134); #endif #endif #ifdef PNG_cHRM_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr, - png_infop info_ptr, double white_x, double white_y, double red_x, - double red_y, double green_x, double green_y, double blue_x, double blue_y)); +extern PNG_EXPORT(void,png_set_cHRM,(png_structp png_ptr, + png_infop info_ptr, double white_x, double white_y, + double red_x, double red_y, double green_x, double green_y, + double blue_x, double blue_y),,135); #endif #ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, - png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point - int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, - png_fixed_point int_blue_y)); +extern PNG_EXPORT(void,png_set_cHRM_fixed,(png_structp png_ptr, + png_infop info_ptr, + png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, + png_fixed_point int_green_x, png_fixed_point int_green_y, + png_fixed_point int_blue_x, png_fixed_point int_blue_y),,136); #endif #endif #ifdef PNG_gAMA_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr, - png_infop info_ptr, double *file_gamma)); +extern PNG_EXPORT(png_uint_32,png_get_gAMA,(png_structp png_ptr, + png_infop info_ptr, double *file_gamma),,137); #endif -extern PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point *int_file_gamma)); +extern PNG_EXPORT(png_uint_32,png_get_gAMA_fixed,(png_structp png_ptr, + png_infop info_ptr, png_fixed_point *int_file_gamma),,138); #endif #ifdef PNG_gAMA_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr, - png_infop info_ptr, double file_gamma)); +extern PNG_EXPORT(void,png_set_gAMA,(png_structp png_ptr, + png_infop info_ptr, double file_gamma),,139); #endif -extern PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point int_file_gamma)); +extern PNG_EXPORT(void,png_set_gAMA_fixed,(png_structp png_ptr, + png_infop info_ptr, png_fixed_point int_file_gamma),,140); #endif #ifdef PNG_hIST_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_16p *hist)); +extern PNG_EXPORT(png_uint_32,png_get_hIST,(png_structp png_ptr, + png_infop info_ptr, png_uint_16p *hist),,141); #endif #ifdef PNG_hIST_SUPPORTED -extern PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_16p hist)); +extern PNG_EXPORT(void,png_set_hIST,(png_structp png_ptr, + png_infop info_ptr, png_uint_16p hist),,142); #endif -extern PNG_EXPORT(png_uint_32,png_get_IHDR) PNGARG((png_structp png_ptr, +extern PNG_EXPORT(png_uint_32,png_get_IHDR,(png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, - int *compression_method, int *filter_method)); + int *compression_method, int *filter_method),,143); -extern PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr, +extern PNG_EXPORT(void,png_set_IHDR,(png_structp png_ptr, png_infop info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_method, int compression_method, - int filter_method)); + int filter_method),,144); #ifdef PNG_oFFs_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr, +extern PNG_EXPORT(png_uint_32,png_get_oFFs,(png_structp png_ptr, png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, - int *unit_type)); + int *unit_type),,145); #endif #ifdef PNG_oFFs_SUPPORTED -extern PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr, +extern PNG_EXPORT(void,png_set_oFFs,(png_structp png_ptr, png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y, - int unit_type)); + int unit_type),,146); #endif #ifdef PNG_pCAL_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr, +extern PNG_EXPORT(png_uint_32,png_get_pCAL,(png_structp png_ptr, png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, - int *type, int *nparams, png_charp *units, png_charpp *params)); + int *type, int *nparams, png_charp *units, png_charpp *params),,147); #endif #ifdef PNG_pCAL_SUPPORTED -extern PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr, +extern PNG_EXPORT(void,png_set_pCAL,(png_structp png_ptr, png_infop info_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, - int type, int nparams, png_charp units, png_charpp params)); + int type, int nparams, png_charp units, png_charpp params),,148); #endif #ifdef PNG_pHYs_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +extern PNG_EXPORT(png_uint_32,png_get_pHYs,(png_structp png_ptr, + png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, + int *unit_type),,149); #endif #ifdef PNG_pHYs_SUPPORTED -extern PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); +extern PNG_EXPORT(void,png_set_pHYs,(png_structp png_ptr, + png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, + int unit_type),,150); #endif -extern PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_colorp *palette, int *num_palette)); +extern PNG_EXPORT(png_uint_32,png_get_PLTE,(png_structp png_ptr, + png_infop info_ptr, png_colorp *palette, int *num_palette),,151); -extern PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_colorp palette, int num_palette)); +extern PNG_EXPORT(void,png_set_PLTE,(png_structp png_ptr, + png_infop info_ptr, png_colorp palette, int num_palette),,152); #ifdef PNG_sBIT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_8p *sig_bit)); +extern PNG_EXPORT(png_uint_32,png_get_sBIT,(png_structp png_ptr, + png_infop info_ptr, png_color_8p *sig_bit),,153); #endif #ifdef PNG_sBIT_SUPPORTED -extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_color_8p sig_bit)); +extern PNG_EXPORT(void,png_set_sBIT,(png_structp png_ptr, + png_infop info_ptr, png_color_8p sig_bit),,154); #endif #ifdef PNG_sRGB_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *intent)); +extern PNG_EXPORT(png_uint_32,png_get_sRGB,(png_structp png_ptr, + png_infop info_ptr, int *intent),,155); #endif #ifdef PNG_sRGB_SUPPORTED -extern PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr, - png_infop info_ptr, int intent)); -extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr, - png_infop info_ptr, int intent)); +extern PNG_EXPORT(void,png_set_sRGB,(png_structp png_ptr, + png_infop info_ptr, int intent),,156); +extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM,(png_structp png_ptr, + png_infop info_ptr, int intent),,157); #endif #ifdef PNG_iCCP_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr, +extern PNG_EXPORT(png_uint_32,png_get_iCCP,(png_structp png_ptr, png_infop info_ptr, png_charpp name, int *compression_type, - png_charpp profile, png_uint_32 *proflen)); + png_charpp profile, png_uint_32 *proflen),,158); /* Note to maintainer: profile should be png_bytepp */ #endif #ifdef PNG_iCCP_SUPPORTED -extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr, +extern PNG_EXPORT(void,png_set_iCCP,(png_structp png_ptr, png_infop info_ptr, png_charp name, int compression_type, - png_charp profile, png_uint_32 proflen)); + png_charp profile, png_uint_32 proflen),,159); /* Note to maintainer: profile should be png_bytep */ #endif #ifdef PNG_sPLT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_sPLT_tpp entries)); +extern PNG_EXPORT(png_uint_32,png_get_sPLT,(png_structp png_ptr, + png_infop info_ptr, png_sPLT_tpp entries),,160); #endif #ifdef PNG_sPLT_SUPPORTED -extern PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_sPLT_tp entries, int nentries)); +extern PNG_EXPORT(void,png_set_sPLT,(png_structp png_ptr, + png_infop info_ptr, png_sPLT_tp entries, int nentries),,161); #endif #ifdef PNG_TEXT_SUPPORTED /* png_get_text also returns the number of text chunks in *num_text */ -extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_textp *text_ptr, int *num_text)); +extern PNG_EXPORT(png_uint_32,png_get_text,(png_structp png_ptr, + png_infop info_ptr, png_textp *text_ptr, int *num_text),,162); #endif /* Note while png_set_text() will accept a structure whose text, * language, and translated keywords are NULL pointers, the structure @@ -2389,57 +1713,56 @@ * they will never be NULL pointers. */ #ifdef PNG_TEXT_SUPPORTED -extern PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_textp text_ptr, int num_text)); +extern PNG_EXPORT(void,png_set_text,(png_structp png_ptr, + png_infop info_ptr, png_textp text_ptr, int num_text),,163); #endif #ifdef PNG_tIME_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_timep *mod_time)); +extern PNG_EXPORT(png_uint_32,png_get_tIME,(png_structp png_ptr, + png_infop info_ptr, png_timep *mod_time),,164); #endif #ifdef PNG_tIME_SUPPORTED -extern PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_timep mod_time)); +extern PNG_EXPORT(void,png_set_tIME,(png_structp png_ptr, + png_infop info_ptr, png_timep mod_time),,165); #endif #ifdef PNG_tRNS_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr, +extern PNG_EXPORT(png_uint_32,png_get_tRNS,(png_structp png_ptr, png_infop info_ptr, png_bytep *trans_alpha, int *num_trans, - png_color_16p *trans_color)); + png_color_16p *trans_color),,166); #endif #ifdef PNG_tRNS_SUPPORTED -extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr, +extern PNG_EXPORT(void,png_set_tRNS,(png_structp png_ptr, png_infop info_ptr, png_bytep trans_alpha, int num_trans, - png_color_16p trans_color)); -#endif - -#ifdef PNG_tRNS_SUPPORTED + png_color_16p trans_color),,167); #endif #ifdef PNG_sCAL_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *unit, double *width, double *height)); +extern PNG_EXPORT(png_uint_32,png_get_sCAL,(png_structp png_ptr, + png_infop info_ptr, int *unit, double *width, double *height),,168); #else #ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); +extern PNG_EXPORT(png_uint_32,png_get_sCAL_s,(png_structp png_ptr, + png_infop info_ptr, int *unit, png_charpp swidth, + png_charpp sheight),,169); #endif #endif #endif /* PNG_sCAL_SUPPORTED */ #ifdef PNG_sCAL_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, int unit, double width, double height)); +extern PNG_EXPORT(void,png_set_sCAL,(png_structp png_ptr, + png_infop info_ptr, int unit, double width, double height),,170); #else #ifdef PNG_FIXED_POINT_SUPPORTED -extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr, - png_infop info_ptr, int unit, png_charp swidth, png_charp sheight)); +extern PNG_EXPORT(void,png_set_sCAL_s,(png_structp png_ptr, + png_infop info_ptr, int unit, png_charp swidth, + png_charp sheight),,171); #endif #endif #endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ @@ -2452,50 +1775,47 @@ = 1: do not keep = 2: keep only if safe-to-copy = 3: keep even if unsafe-to-copy */ -extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp - png_ptr, int keep, png_bytep chunk_list, int num_chunks)); -PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep - chunk_name)); +extern PNG_EXPORT(void, png_set_keep_unknown_chunks,(png_structp png_ptr, + int keep, png_bytep chunk_list, int num_chunks),,172); +extern PNG_EXPORT(int,png_handle_as_unknown,(png_structp png_ptr, + png_bytep chunk_name),,173); #endif #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED -extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)); -extern PNG_EXPORT(void, png_set_unknown_chunk_location) - PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location)); -extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp - png_ptr, png_infop info_ptr, png_unknown_chunkpp entries)); +extern PNG_EXPORT(void, png_set_unknown_chunks,(png_structp png_ptr, + png_infop info_ptr, png_unknown_chunkp unknowns, + int num_unknowns),,174); +extern PNG_EXPORT(void, png_set_unknown_chunk_location, + (png_structp png_ptr, png_infop info_ptr, int chunk, + int location),,175); +extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks,(png_structp png_ptr, + png_infop info_ptr, png_unknown_chunkpp entries),,176); #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, * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */ -extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr, - png_infop info_ptr, int mask)); +extern PNG_EXPORT(void, png_set_invalid,(png_structp png_ptr, + png_infop info_ptr, int mask),,177); #ifdef PNG_INFO_IMAGE_SUPPORTED /* The "params" pointer is currently not used and is for future expansion. */ -extern PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr, - png_infop info_ptr, - int transforms, - png_voidp params)); -extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr, - png_infop info_ptr, - int transforms, - png_voidp params)); +extern PNG_EXPORT(void, png_read_png,(png_structp png_ptr, + png_infop info_ptr, int transforms, png_voidp params),,178); +extern PNG_EXPORT(void, png_write_png,(png_structp png_ptr, + png_infop info_ptr, int transforms, png_voidp params),,179); #endif -extern PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr)); -extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp - png_ptr)); -extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_charp,png_get_copyright,(png_structp png_ptr),,180); +extern PNG_EXPORT(png_charp,png_get_header_ver,(png_structp png_ptr),,181); +extern PNG_EXPORT(png_charp,png_get_header_version,(png_structp png_ptr),,182); +extern PNG_EXPORT(png_charp,png_get_libpng_ver,(png_structp png_ptr),,183); #ifdef PNG_MNG_FEATURES_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp - png_ptr, png_uint_32 mng_features_permitted)); +extern PNG_EXPORT(png_uint_32,png_permit_mng_features,(png_structp png_ptr, + png_uint_32 mng_features_permitted),,184); #endif /* For use in png_set_keep_unknown, added to version 1.2.6 */ #define PNG_HANDLE_CHUNK_AS_DEFAULT 0 @@ -2506,60 +1826,60 @@ /* Strip the prepended error numbers ("#nnn ") from error and warning * messages before passing them to the error or warning handler. */ #ifdef PNG_ERROR_NUMBERS_SUPPORTED -extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp - png_ptr, png_uint_32 strip_mode)); +extern PNG_EXPORT(void,png_set_strip_error_numbers,(png_structp png_ptr, + png_uint_32 strip_mode),,185); #endif /* Added in 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)); +extern PNG_EXPORT(void,png_set_user_limits,(png_structp png_ptr, + png_uint_32 user_width_max, png_uint_32 user_height_max),,186); +extern PNG_EXPORT(png_uint_32,png_get_user_width_max, + (png_structp png_ptr),,187); +extern PNG_EXPORT(png_uint_32,png_get_user_height_max, + (png_structp png_ptr),,188); /* Added in libpng-1.4.0 */ -extern PNG_EXPORT(void,png_set_chunk_cache_max) PNGARG((png_structp - png_ptr, png_uint_32 user_chunk_cache_max)); -extern PNG_EXPORT(png_uint_32,png_get_chunk_cache_max) - PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_chunk_cache_max,(png_structp png_ptr, + png_uint_32 user_chunk_cache_max),,189); +extern PNG_EXPORT(png_uint_32,png_get_chunk_cache_max, + (png_structp png_ptr),,190); /* Added in libpng-1.4.1 */ -extern PNG_EXPORT(void,png_set_chunk_malloc_max) PNGARG((png_structp - png_ptr, png_alloc_size_t user_chunk_cache_max)); -extern PNG_EXPORT(png_alloc_size_t,png_get_chunk_malloc_max) - PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(void,png_set_chunk_malloc_max,(png_structp png_ptr, + png_alloc_size_t user_chunk_cache_max),,191); +extern PNG_EXPORT(png_alloc_size_t,png_get_chunk_malloc_max, + (png_structp png_ptr),,192); #endif #if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) -PNG_EXPORT(png_uint_32,png_get_pixels_per_inch) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(png_uint_32,png_get_pixels_per_inch,(png_structp png_ptr, + png_infop info_ptr),,193); -PNG_EXPORT(png_uint_32,png_get_x_pixels_per_inch) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(png_uint_32,png_get_x_pixels_per_inch,(png_structp png_ptr, + png_infop info_ptr),,194); -PNG_EXPORT(png_uint_32,png_get_y_pixels_per_inch) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(png_uint_32,png_get_y_pixels_per_inch,(png_structp png_ptr, + png_infop info_ptr),,195); -PNG_EXPORT(float,png_get_x_offset_inches) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(float,png_get_x_offset_inches,(png_structp png_ptr, + png_infop info_ptr),,196); -PNG_EXPORT(float,png_get_y_offset_inches) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(float,png_get_y_offset_inches,(png_structp png_ptr, + png_infop info_ptr),,197); #ifdef PNG_pHYs_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_pHYs_dpi) PNGARG((png_structp png_ptr, -png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +PNG_EXPORT(png_uint_32,png_get_pHYs_dpi,(png_structp png_ptr, + png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, + int *unit_type),,198); #endif /* PNG_pHYs_SUPPORTED */ #endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */ /* Added in libpng-1.4.0 */ #ifdef PNG_IO_STATE_SUPPORTED -extern PNG_EXPORT(png_uint_32,png_get_io_state) PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_uint_32,png_get_io_state,(png_structp png_ptr),,199); -extern PNG_EXPORT(png_bytep,png_get_io_chunk_name) - PNGARG((png_structp png_ptr)); +extern PNG_EXPORT(png_bytep,png_get_io_chunk_name,(png_structp png_ptr),,200); /* The flags returned by png_get_io_state() are the following: */ #define PNG_IO_NONE 0x0000 /* no I/O at this moment */ #define PNG_IO_READING 0x0001 /* currently reading */ @@ -2639,32 +1959,36 @@ ((png_int_32)(*((buf) + 2)) << 8) + \ ((png_int_32)(*((buf) + 3)))) #endif #else -extern PNG_EXPORT(png_uint_32,png_get_uint_32) PNGARG((png_bytep buf)); -extern PNG_EXPORT(png_uint_16,png_get_uint_16) PNGARG((png_bytep buf)); +extern PNG_EXPORT(png_uint_32,png_get_uint_32,(png_bytep buf),,201); +extern PNG_EXPORT(png_uint_16,png_get_uint_16,(png_bytep buf),,202); #ifdef PNG_GET_INT_32_SUPPORTED -extern PNG_EXPORT(png_int_32,png_get_int_32) PNGARG((png_bytep buf)); +extern PNG_EXPORT(png_int_32,png_get_int_32,(png_bytep buf),,203); #endif #endif -extern PNG_EXPORT(png_uint_32,png_get_uint_31) - PNGARG((png_structp png_ptr, png_bytep buf)); +extern PNG_EXPORT(png_uint_32,png_get_uint_31,(png_structp png_ptr, + png_bytep buf),,204); /* No png_get_int_16 -- may be added if there's a real need for it. */ /* Place a 32-bit number into a buffer in PNG byte order (big-endian). */ -extern PNG_EXPORT(void,png_save_uint_32) - PNGARG((png_bytep buf, png_uint_32 i)); -extern PNG_EXPORT(void,png_save_int_32) - PNGARG((png_bytep buf, png_int_32 i)); +extern PNG_EXPORT(void,png_save_uint_32,(png_bytep buf, png_uint_32 i),,205); +extern PNG_EXPORT(void,png_save_int_32,(png_bytep buf, png_int_32 i),,206); /* Place a 16-bit number into a buffer in PNG byte order. * The parameter is declared unsigned int, not png_uint_16, * just to avoid potential problems on pre-ANSI C compilers. */ -extern PNG_EXPORT(void,png_save_uint_16) - PNGARG((png_bytep buf, unsigned int i)); +extern PNG_EXPORT(void,png_save_uint_16,(png_bytep buf, unsigned int i),,207); /* No png_save_int_16 -- may be added if there's a real need for it. */ +/* The last ordinal number (this is the *last* one, the next one to + * use is one more than this.) + */ +#ifdef PNG_EXPORT_LAST_ORDINAL + PNG_EXPORT_LAST_ORDINAL(207); +#endif + /* ************************************************************************* */ /* Various modes of operation. Note that after an init, mode is set to * zero automatically when the structure is created. diff -ru4NwbB libpng-1.4.1/pngconf.h libpng-1.5.0beta16/pngconf.h --- libpng-1.4.1/pngconf.h 2010-02-25 05:38:30.156747672 -0600 +++ libpng-1.5.0beta16/pngconf.h 2010-04-01 07:15:52.885268929 -0500 @@ -1,9 +1,9 @@ /* pngconf.h - machine configurable file for libpng * * libpng version 1.5.0beta16 - April 1, 2010 - * For conditions of distribution and use, see copyright notice in png.h + * * Copyright (c) 1998-2010 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.) * @@ -25,19 +25,8 @@ #ifndef PNG_NO_LIMITS_H # include #endif -/* Added at libpng-1.2.9 */ - -/* config.h is created by and PNG_CONFIGURE_LIBPNG is set by the "configure" - * script. - */ -#ifdef PNG_CONFIGURE_LIBPNG -# ifdef HAVE_CONFIG_H -# include "config.h" -# endif -#endif - /* * Added at libpng-1.2.8 * * PNG_USER_CONFIG has to be defined on the compiler command line. This @@ -146,9 +135,10 @@ # define PNG_ALIGNED_MEMORY_SUPPORTED #endif /* 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 */ + * support PNGs that are embedded in MNG datastreams + */ #ifndef PNG_NO_MNG_FEATURES # ifndef PNG_MNG_FEATURES_SUPPORTED # define PNG_MNG_FEATURES_SUPPORTED # endif @@ -161,9 +151,9 @@ # endif #endif /* Added at libpng-1.4.0beta49 for testing (this test is no longer used - in libpng and png_calloc() is always present) + * in libpng and png_calloc() is always present) */ #define PNG_CALLOC_SUPPORTED /* If you are running on a machine where you cannot allocate more @@ -177,84 +167,309 @@ #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) # define PNG_MAX_MALLOC_64K #endif -/* Special munging to support doing things the 'cygwin' way: - * 'Normal' png-on-win32 defines/defaults: - * PNG_BUILD_DLL -- building dll - * PNG_USE_DLL -- building an application, linking to dll - * (no define) -- building static library, or building an - * application and linking to the static lib - * 'Cygwin' defines/defaults: - * 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 - * that. If a cygwin user *wants* to define 'PNG_USE_DLL' that's okay, but - * unnecessary. +/* This macro protects us against machines that don't have function + * prototypes (ie K&R style headers). If your compiler does not handle + * function prototypes, define this macro and use the included ansi2knr. + * I've always been able to use _NO_PROTO as the indicator, but you may + * need to drag the empty declaration out in front of here, or change the + * ifdef to suit your own needs. + */ +#ifndef PNGARG + +# ifdef OF /* zlib prototype munger */ +# define PNGARG(arglist) OF(arglist) +# else + +# ifdef _NO_PROTO +# define PNGARG(arglist) () +# else +# define PNGARG(arglist) arglist +# endif /* _NO_PROTO */ + +# endif /* OF */ + +#endif /* PNGARG */ + +/* Function calling conventions. + * ============================= + * Normally it is not necessary to specify to the compiler how to call + * a function - it just does it - however on x86 systems derived from + * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems + * and some others) there are multiple ways to call a function and the + * default can be changed on the compiler command line. For this reason + * libpng allows the calling convention of every exported function and + * every function called via a user supplied function pointer to be + * specified. This is done by defining the following macros: + * + * PNGAPI Calling convention for exported functions. + * PNGCBAPI Calling convention for user provided (callback) functions. + * PNGCAPI Calling convention used by the ANSI-C library (required + * for longjmp callbacks and sometimes used internally to + * specify the calling convention for zlib). + * + * + * Two common cases are supported: + * + * PNGAPI_RULE=0 Use the operating system convention for PNGAPI and + * the 'C' calling convention (from PNGCAPI) for + * callbacks (PNGCBAPI). + * PNGAPI_RULE=1 Use PNGCAPI - the 'C' calling convention - throughout. + * This is correct on Cygwin implementations, assumed to + * be correct on MingW compilations and likely to work + * in C/C++ only environments everywhere else. + * + * These cases only differ if the operating system does not use the C + * calling convention, at present this just means the above cases + * (x86 DOS/Windows sytems) and, even then, this does not apply to + * Cygwin running on those systems. + */ +#ifndef PNGAPI_RULE +# define PNGAPI_RULE 0 +#endif + +/* Symbol export + * ============= + * When building a shared library it is almost always necessary to tell + * the compiler which symbols to export. The png.h macro 'PNG_EXPORT' + * is used to mark the symbols. On some systems these symbols can be + * extracted at link time and need no special processing by the compiler, + * on other systems the symbols are flagged by the compiler and just + * the declaration requires a special tag applied (unfortunately) in a + * compiler dependent way. Some systems can do either. + * + * A small number of older systems also require a symbol from a DLL to + * be flagged to the program that calls it. This is a problem because + * we do not know in the header file included by application code that + * the symbol will come from a shared library, as opposed to a statically + * linked one. For this reason the application must tell us by setting + * the magic flag PNG_USE_DLL to turn on the special processing before + * it includes png.h. + * + * Four additional macros are used to make this happen: + * + * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from + * the build or imported if PNG_USE_DLL is set - compiler + * and system specific. + * + * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to + * 'type', compiler specific. + * + * PNG_DLL_EXPORT Set to the magic to use during a libpng build to + * make a symbol exported from the DLL. * - * Also, the precedence order is: - * ALL_STATIC (since we can't #undef something outside our namespace) - * PNG_BUILD_DLL - * PNG_STATIC - * (nothing) == PNG_USE_DLL + * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come + * from a DLL - used to define PNG_IMPEXP when + * PNG_USE_DLL is set. + */ + +/* System specific discovery. + * ========================== + * This code is used at build time to find PNG_IMPEXP, the API settings + * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL + * import processing is possible. * - * 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. - */ -#ifdef __CYGWIN__ -# ifdef ALL_STATIC -# ifdef PNG_BUILD_DLL -# undef PNG_BUILD_DLL + * NOTE: this is poorly tested and may miss many cases, the default + * (everything empty) is harmless unless the result is a DLL that is + * intended to be distributed! + */ +#if defined(__CYGWIN__) + /* Cygwin: force PNGCAPI to cdecl. */ +# ifndef PNGCAPI +# define PNGCAPI __cdecl +# endif + + /* Provide the appropriate defaults for exporting a symbol from + * the DLL and forcing import. Always set these - the choice to + * use them is made below. + */ +# ifndef PNG_DLL_EXPORT +# define PNG_DLL_EXPORT __declspec(dllexport) +# endif +# ifndef PNG_DLL_IMPORT +# define PNG_DLL_IMPORT __declspec(dllimport) +# endif + +#else /* !Cygwin */ +# if ( defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\ + defined(_WIN32) || defined(__WIN32__) ) &&\ + ( defined(_X86_) || defined(_X64_) || defined(_M_IX86) ||\ + defined(_M_X64) || defined(_M_IA64) ) + /* Windows system (DOS doesn't support DLLs) running on x86/x64 and + * not being built under Cygwin or by a MingW compiler. + */ +# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) +# ifndef PNGCAPI +# define PNGCAPI __cdecl +# endif +# if PNGAPI_RULE == 0 && !defined(PNGAPI) +# define PNGAPI __stdcall # endif -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL +# else + /* An older compiler, or one not detected (erroneously) above. */ +# ifndef PNGCAPI +# define PNGCAPI _cdecl # endif -# ifdef PNG_DLL -# undef PNG_DLL +# if PNGAPI_RULE == 0 && !defined(PNGAPI) +# define PNGAPI _stdcall # endif -# ifndef PNG_STATIC -# define PNG_STATIC +# endif /* compiler/api */ + /* NOTE: PNGCBAPI always defaults to PNGCAPI. */ + +# if (defined(_MSC_VER) && _MSC_VER < 800) ||\ + (defined(__BORLANDC__) && __BORLANDC__ < 0x500) + /* older Borland and MSC + * compilers used '__export' and required this to be after + * the type. + */ +# ifndef PNG_EXPORT_TYPE +# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP # endif -# else -# ifdef PNG_BUILD_DLL -# ifdef PNG_STATIC -# undef PNG_STATIC +# define PNG_DLL_EXPORT __export +# else /* newer compiler */ +# define PNG_DLL_EXPORT __declspec(dllexport) +# ifndef PNG_DLL_IMPORT +# define PNG_DLL_IMPORT __declspec(dllimport) +# endif +# endif /* compiler */ + +# else /* !Cygwin && !Windows/x86 */ +# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) +# ifndef PNGAPI +# define PNGAPI _System # endif -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL +# else /* !Cygwin && !Windows/x86 && !OS/2 */ + /* Use the defaults */ +# endif /* other system, !OS/2 */ +# endif /* !Windows/x86 */ +#endif /* !Cygwin */ + +/* Now do all the defaulting . */ +#ifndef PNGCAPI +# define PNGCAPI # endif -# ifndef PNG_DLL -# define PNG_DLL +#ifndef PNGCBAPI +# define PNGCBAPI PNGCAPI # endif -# else -# ifdef PNG_STATIC -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL +#ifndef PNGAPI +# define PNGAPI PNGCAPI +#endif + +/* The default for PNG_IMPEXP depends on whether the library is + * being built or used. + */ +#ifndef PNG_IMPEXP +# ifdef PNGLIB_BUILD + /* Building the library */ +# if (defined(DLL_EXPORT)/*from libtool*/ ||\ + defined(_WINDLL) || defined(_DLL) || defined(__DLL__) ||\ + defined(PNG_BUILD_DLL)) && defined(PNG_DLL_EXPORT) + /* Building a DLL. */ +# define PNG_IMPEXP PNG_DLL_EXPORT +# endif /* DLL */ +# else + /* Using the library */ +# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) + /* This forces use of a DLL, disallowing static linking */ +# define PNG_IMPEXP PNG_DLL_IMPORT # endif -# ifdef PNG_DLL -# undef PNG_DLL # endif + +# ifndef PNG_IMPEXP +# define PNG_IMPEXP +# endif +#endif + +#ifndef PNG_EXPORT_TYPE +# define PNG_EXPORT_TYPE(type) PNG_IMPEXP type +#endif +#ifndef PNG_EXPORT +# define PNG_EXPORT(type, name, args, attributes, ordinal)\ + PNG_EXPORT_TYPE(type) (PNGAPI name) PNGARG(args) attributes +#endif + +/* Use PNG_REMOVED to comment out a removed interface. */ +#ifndef PNG_REMOVED +# define PNG_REMOVED(name, ordinal) +#endif + +#ifndef PNG_CALLBACK +# define PNG_CALLBACK(type, name, args, attributes)\ + type (PNGCBAPI name) PNGARG(args) attributes +#endif + +/* Support for compiler specific function attributes. These are used + * so that where compiler support is available incorrect use of API + * functions in png.h will generate compiler warnings. + * + * Added at libpng-1.2.41. + */ + +#ifndef PNG_NO_PEDANTIC_WARNINGS +# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED +# define PNG_PEDANTIC_WARNINGS_SUPPORTED +# endif +#endif + +#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED + /* Support for compiler specific function attributes. These are used + * so that where compiler support is available incorrect use of API + * functions in png.h will generate compiler warnings. Added at libpng + * version 1.2.41. + */ +# ifdef __GNUC__ +# ifndef PNG_USE_RESULT +# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) +# endif +# ifndef PNG_NORETURN +# define PNG_NORETURN __attribute__((__noreturn__)) +# endif +# ifndef PNG_ALLOCATED +# define PNG_ALLOCATED __attribute__((__malloc__)) +# endif + + /* This specifically protects structure members that should only be + * accessed from within the library, therefore should be empty during + * a library build. + */ +# ifndef PNGLIB_BUILD +# ifndef PNG_DEPRECATED +# define PNG_DEPRECATED __attribute__((__deprecated__)) +# endif +# ifndef PNG_DEPSTRUCT +# define PNG_DEPSTRUCT __attribute__((__deprecated__)) +# endif +# ifndef PNG_PRIVATE +# if 0 /* Doesn't work so we use deprecated instead*/ +# define PNG_PRIVATE \ + __attribute__((warning("This function is not exported by libpng."))) # else -# ifndef PNG_USE_DLL -# define PNG_USE_DLL +# define PNG_PRIVATE \ + __attribute__((__deprecated__)) # endif -# ifndef PNG_DLL -# define PNG_DLL +# endif /* PNG_PRIVATE */ +# endif /* PNGLIB_BUILD */ +# endif /* __GNUC__ */ +#endif /* PNG_PEDANTIC_WARNINGS */ + +#ifndef PNG_DEPRECATED +# define PNG_DEPRECATED /* Use of this function is deprecated */ # endif +#ifndef PNG_USE_RESULT +# define PNG_USE_RESULT /* The result of this function must be checked */ +#endif +#ifndef PNG_NORETURN +# define PNG_NORETURN /* This function does not return */ # endif +#ifndef PNG_ALLOCATED +# define PNG_ALLOCATED /* The result of the function is new memory */ # endif +#ifndef PNG_DEPSTRUCT +# define PNG_DEPSTRUCT /* Access to this struct member is deprecated */ # endif +#ifndef PNG_PRIVATE +# define PNG_PRIVATE /* This is a private libpng function */ #endif /* This protects us against compilers that run on a windowing system * and thus don't have or would rather us not use the stdio types: @@ -272,15 +487,8 @@ #if !defined(PNG_NO_STDIO) && !defined(PNG_STDIO_SUPPORTED) # define PNG_STDIO_SUPPORTED #endif - -#ifdef PNG_BUILD_DLL -# if !defined(PNG_CONSOLE_IO_SUPPORTED) && !defined(PNG_NO_CONSOLE_IO) -# define PNG_NO_CONSOLE_IO -# endif -#endif - # ifdef PNG_NO_STDIO # ifndef PNG_NO_CONSOLE_IO # define PNG_NO_CONSOLE_IO # endif @@ -296,93 +504,17 @@ #if !(defined PNG_NO_CONSOLE_IO) && !defined(PNG_CONSOLE_IO_SUPPORTED) # define PNG_CONSOLE_IO_SUPPORTED #endif -/* This macro protects us against machines that don't have function - * prototypes (ie K&R style headers). If your compiler does not handle - * function prototypes, define this macro and use the included ansi2knr. - * I've always been able to use _NO_PROTO as the indicator, but you may - * need to drag the empty declaration out in front of here, or change the - * ifdef to suit your own needs. - */ -#ifndef PNGARG - -#ifdef OF /* zlib prototype munger */ -# define PNGARG(arglist) OF(arglist) -#else - -#ifdef _NO_PROTO -# define PNGARG(arglist) () -#else -# define PNGARG(arglist) arglist -#endif /* _NO_PROTO */ - -#endif /* OF */ - -#endif /* PNGARG */ - -/* Try to determine if we are compiling on a Mac. Note that testing for - * just __MWERKS__ is not good enough, because the Codewarrior is now used - * on non-Mac platforms. - */ -#ifndef MACOS -# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ - defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) -# define MACOS -# endif -#endif - -/* Enough people need this for various reasons to include it here */ -#if !defined(MACOS) && !defined(RISCOS) -# include -#endif - /* PNG_SETJMP_NOT_SUPPORTED and PNG_NO_SETJMP_SUPPORTED are deprecated. */ #if !defined(PNG_NO_SETJMP) && \ !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) # define PNG_SETJMP_SUPPORTED #endif #ifdef PNG_SETJMP_SUPPORTED -/* This is an attempt to force a single setjmp behaviour on Linux. If - * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. - * - * You can bypass this test if you know that your application uses exactly - * the same setjmp.h that was included when libpng was built. Only define - * PNG_SKIP_SETJMP_CHECK while building your application, prior to the - * application's '#include "png.h"'. Don't define PNG_SKIP_SETJMP_CHECK - * while building a separate libpng library for general use. - */ - -# ifndef PNG_SKIP_SETJMP_CHECK -# ifdef __linux__ -# ifdef _BSD_SOURCE -# define PNG_SAVE_BSD_SOURCE -# undef _BSD_SOURCE -# endif -# ifdef _SETJMP_H - /* If you encounter a compiler error here, see the explanation - * near the end of INSTALL. - */ - __pngconf.h__ in libpng already includes setjmp.h; - __dont__ include it again.; -# endif -# endif /* __linux__ */ -# endif /* PNG_SKIP_SETJMP_CHECK */ - - /* Include setjmp.h for error handling */ # include - -# ifdef __linux__ -# ifdef PNG_SAVE_BSD_SOURCE -# ifdef _BSD_SOURCE -# undef _BSD_SOURCE -# endif -# define _BSD_SOURCE -# undef PNG_SAVE_BSD_SOURCE # endif -# endif /* __linux__ */ -#endif /* PNG_SETJMP_SUPPORTED */ #ifdef BSD # include #else @@ -498,13 +628,8 @@ # endif # ifndef PNG_NO_READ_INVERT # define PNG_READ_INVERT_SUPPORTED # endif -#if 0 /* removed from libpng-1.4.0 */ -# ifndef PNG_NO_READ_DITHER -# define PNG_READ_DITHER_SUPPORTED -# endif -#endif /* 0 */ # ifndef PNG_NO_READ_BACKGROUND # define PNG_READ_BACKGROUND_SUPPORTED # endif # ifndef PNG_NO_READ_16_TO_8 @@ -535,16 +660,18 @@ # define PNG_READ_RGB_TO_GRAY_SUPPORTED # endif #endif /* PNG_READ_TRANSFORMS_SUPPORTED */ -/* PNG_PROGRESSIVE_READ_NOT_SUPPORTED is deprecated. */ -#if !defined(PNG_NO_PROGRESSIVE_READ) && \ - !defined(PNG_PROGRESSIVE_READ_NOT_SUPPORTED) /* if you don't do progressive */ -# define PNG_PROGRESSIVE_READ_SUPPORTED /* reading. This is not talking */ -#endif /* about interlacing capability! You'll */ - /* still have interlacing unless you change the following define: */ +# ifndef PNG_NO_PROGRESSIVE_READ +# define PNG_PROGRESSIVE_READ_SUPPORTED +# endif +/* You can define PNG_NO_PROGRESSIVE_READ if you don't do progressive reading. + * This is not talking about interlacing capability! You'll still have + * interlacing unless you change the following define which is required + * for PNG-compliant decoders: + */ -#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ +# define PNG_READ_INTERLACING_SUPPORTED /* PNG_NO_SEQUENTIAL_READ_SUPPORTED is deprecated. */ #if !defined(PNG_NO_SEQUENTIAL_READ) && \ !defined(PNG_SEQUENTIAL_READ_SUPPORTED) && \ @@ -553,9 +680,10 @@ #endif #ifndef PNG_NO_READ_COMPOSITE_NODIV # ifndef PNG_NO_READ_COMPOSITED_NODIV /* libpng-1.0.x misspelling */ -# define PNG_READ_COMPOSITE_NODIV_SUPPORTED /* well tested on Intel, SGI */ + /* well tested on Intel, SGI */ +# define PNG_READ_COMPOSITE_NODIV_SUPPORTED # endif #endif #if !defined(PNG_NO_GET_INT_32) || defined(PNG_READ_oFFS_SUPPORTED) || \ @@ -688,10 +816,10 @@ # endif #endif /* Added at libpng-1.2.43 */ -#ifndef PNG_USER_LIMITS_SUPPORTED # ifndef PNG_NO_USER_LIMITS +# ifndef PNG_USER_LIMITS_SUPPORTED # define PNG_USER_LIMITS_SUPPORTED # endif #endif @@ -736,9 +864,9 @@ #endif /* These are currently experimental features, define them if you want */ -/* Very little testing */ +/* Very little testing, not enabled by default. */ /* #ifdef PNG_READ_SUPPORTED # ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED # define PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED @@ -746,9 +874,9 @@ #endif */ /* This is only for PowerPC big-endian and 680x0 systems */ -/* some testing */ +/* some testing, not enabled by default. */ /* #ifndef PNG_READ_BIG_ENDIAN_SUPPORTED # define PNG_READ_BIG_ENDIAN_SUPPORTED #endif @@ -873,10 +1000,13 @@ # define PNG_READ_zTXt_SUPPORTED # define PNG_zTXt_SUPPORTED #endif #ifndef PNG_NO_READ_OPT_PLTE -# define PNG_READ_OPT_PLTE_SUPPORTED /* only affects support of the */ -#endif /* optional PLTE chunk in RGB and RGBA images */ + /* This only affects support of the optional PLTE chunk in RGB and RGBA + * images. + */ +# define PNG_READ_OPT_PLTE_SUPPORTED +# endif #if defined(PNG_READ_iTXt_SUPPORTED) || defined(PNG_READ_tEXt_SUPPORTED) || \ defined(PNG_READ_zTXt_SUPPORTED) # define PNG_READ_TEXT_SUPPORTED # define PNG_TEXT_SUPPORTED @@ -1020,9 +1150,10 @@ # ifndef PNG_zTXt_SUPPORTED # define PNG_zTXt_SUPPORTED # endif #endif -#if defined(PNG_WRITE_iTXt_SUPPORTED) || defined(PNG_WRITE_tEXt_SUPPORTED) || \ +# if defined(PNG_WRITE_iTXt_SUPPORTED) || \ + defined(PNG_WRITE_tEXt_SUPPORTED) || \ defined(PNG_WRITE_zTXt_SUPPORTED) # define PNG_WRITE_TEXT_SUPPORTED # ifndef PNG_TEXT_SUPPORTED # define PNG_TEXT_SUPPORTED @@ -1030,10 +1161,10 @@ #endif #ifdef PNG_WRITE_tIME_SUPPORTED # ifndef PNG_NO_CONVERT_tIME -# ifndef _WIN32_WCE /* The "tm" structure is not supported on WindowsCE */ +# ifndef _WIN32_WCE # ifndef PNG_CONVERT_tIME_SUPPORTED # define PNG_CONVERT_tIME_SUPPORTED # endif # endif @@ -1060,11 +1191,10 @@ # endif #endif #endif /* PNG_WRITE_SUPPORTED */ -/* Turn this off to disable png_read_png() and - * png_write_png() and leave the row_pointers member - * out of the info structure. +/* Turn this off to disable png_read_png() and png_write_png() and + * leave the row_pointers member out of the info structure. */ #ifndef PNG_NO_INFO_IMAGE # define PNG_INFO_IMAGE_SUPPORTED #endif @@ -1161,9 +1291,10 @@ # define FARDATA #endif /* Typedef for floating-point numbers that are converted - to fixed-point with a multiple of 100,000, e.g., int_gamma */ + * to fixed-point with a multiple of 100,000, e.g., int_gamma + */ typedef png_int_32 png_fixed_point; /* Add typedefs for pointers */ typedef void FAR * png_voidp; @@ -1199,204 +1330,15 @@ /* Pointers to pointers to pointers; i.e., pointer to array */ typedef char FAR * FAR * FAR * png_charppp; -/* Define PNG_BUILD_DLL if the module being built is a Windows - * LIBPNG DLL. - * - * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. - * It is equivalent to Microsoft predefined macro _DLL that is - * automatically defined when you compile using the share - * version of the CRT (C Run-Time library) - * - * The cygwin mods make this behavior a little different: - * Define PNG_BUILD_DLL if you are building a dll for use with cygwin - * Define PNG_STATIC if you are building a static library for use with cygwin, - * -or- if you are building an application that you want to link to the - * static library. - * PNG_USE_DLL is defined by default (no user action needed) unless one of - * the other flags is defined. - */ - -#if !defined(PNG_DLL) && (defined(PNG_BUILD_DLL) || defined(PNG_USE_DLL)) -# define PNG_DLL -#endif - -#ifdef __CYGWIN__ -# undef PNGAPI -# define PNGAPI __cdecl -# undef PNG_IMPEXP -# define PNG_IMPEXP -#endif - #define PNG_USE_LOCAL_ARRAYS /* Not used in libpng, defined for legacy apps */ -/* 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(PNG_MODULEDEF) -# ifndef PNG_NO_MODULEDEF -# define PNG_NO_MODULEDEF -# endif -#endif - -#if !defined(PNG_IMPEXP) && defined(PNG_BUILD_DLL) && !defined(PNG_NO_MODULEDEF) -# define PNG_IMPEXP -#endif - -#if defined(PNG_DLL) || defined(_DLL) || defined(__DLL__ ) || \ - (( defined(_Windows) || defined(_WINDOWS) || \ - defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) - -# 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) || \ - 0 /* WINCOMPILER_WITH_NO_SUPPORT_FOR_DECLIMPEXP */) -# define PNG_IMPEXP -# endif - -# ifndef PNG_IMPEXP - -# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol -# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol - - /* Borland/Microsoft */ -# if defined(_MSC_VER) || defined(__BORLANDC__) -# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) -# define PNG_EXPORT PNG_EXPORT_TYPE1 -# else -# define PNG_EXPORT PNG_EXPORT_TYPE2 -# ifdef PNG_BUILD_DLL -# define PNG_IMPEXP __export -# else -# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in VC++ */ -# endif /* Exists in Borland C++ for - C++ classes (== huge) */ -# endif -# endif - -# ifndef PNG_IMPEXP -# ifdef PNG_BUILD_DLL -# define PNG_IMPEXP __declspec(dllexport) -# else -# define PNG_IMPEXP __declspec(dllimport) -# endif -# endif -# endif /* PNG_IMPEXP */ -#else /* !(DLL || non-cygwin WINDOWS) */ -# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) -# ifndef PNGAPI -# define PNGAPI _System -# endif -# else -# if 0 /* ... other platforms, with other meanings */ -# endif -# endif -#endif - -#ifndef PNGAPI -# define PNGAPI -#endif -#ifndef PNG_IMPEXP -# define PNG_IMPEXP -#endif - -#ifdef PNG_BUILDSYMS -# ifndef PNG_EXPORT -# define PNG_EXPORT(type,symbol) PNG_FUNCTION_EXPORT symbol END -# endif -#endif - -#ifndef PNG_EXPORT -# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol -#endif - -/* Support for compiler specific function attributes. These are used - * so that where compiler support is available incorrect use of API - * functions in png.h will generate compiler warnings. - * - * Added at libpng-1.2.41. - */ - -#ifndef PNG_NO_PEDANTIC_WARNINGS -# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED -# define PNG_PEDANTIC_WARNINGS_SUPPORTED -# endif -#endif - -#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED -/* Support for compiler specific function attributes. These are used - * so that where compiler support is available incorrect use of API - * functions in png.h will generate compiler warnings. Added at libpng - * version 1.2.41. - */ -# ifdef __GNUC__ -# ifndef PNG_USE_RESULT -# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) -# endif -# ifndef PNG_NORETURN -# define PNG_NORETURN __attribute__((__noreturn__)) -# endif -# ifndef PNG_ALLOCATED -# define PNG_ALLOCATED __attribute__((__malloc__)) -# endif - - /* This specifically protects structure members that should only be - * accessed from within the library, therefore should be empty during - * a library build. - */ -# ifndef PNG_DEPRECATED -# define PNG_DEPRECATED __attribute__((__deprecated__)) -# endif -# ifndef PNG_DEPSTRUCT -# define PNG_DEPSTRUCT __attribute__((__deprecated__)) -# endif -# ifndef PNG_PRIVATE -# if 0 /* Doesn't work so we use deprecated instead*/ -# define PNG_PRIVATE \ - __attribute__((warning("This function is not exported by libpng."))) -# else -# define PNG_PRIVATE \ - __attribute__((__deprecated__)) -# endif -# endif /* PNG_PRIVATE */ -# endif /* __GNUC__ */ -#endif /* PNG_PEDANTIC_WARNINGS */ - -#ifndef PNG_DEPRECATED -# define PNG_DEPRECATED /* Use of this function is deprecated */ -#endif -#ifndef PNG_USE_RESULT -# define PNG_USE_RESULT /* The result of this function must be checked */ -#endif -#ifndef PNG_NORETURN -# define PNG_NORETURN /* This function does not return */ -#endif -#ifndef PNG_ALLOCATED -# define PNG_ALLOCATED /* The result of the function is new memory */ -#endif -#ifndef PNG_DEPSTRUCT -# define PNG_DEPSTRUCT /* Access to this struct member is deprecated */ -#endif -#ifndef PNG_PRIVATE -# define PNG_PRIVATE /* This is a private libpng function */ -#endif - /* Users may want to use these so they are not private. Any library * functions that are passed far data must be model-independent. */ -/* memory model/platform independent fns */ +/* Memory model/platform independent fns */ #ifndef PNG_ABORT # ifdef _WINDOWS_ # define PNG_ABORT() ExitProcess(0) # else diff -ru4NwbB libpng-1.4.1/pngdebug.h libpng-1.5.0beta16/pngdebug.h --- libpng-1.4.1/pngdebug.h 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta16/pngdebug.h 2010-04-01 07:15:52.908560272 -0500 @@ -0,0 +1,139 @@ + +/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c + * + * Copyright (c) 1998-2010 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.) + * + * Last changed in libpng version 1.5.0 - April 1, 2010 + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +/* Define PNG_DEBUG at compile time for debugging information. Higher + * numbers for PNG_DEBUG mean more debugging information. This has + * only been added since version 0.95 so it is not implemented throughout + * libpng yet, but more support will be added as needed. + * + * png_debug[1-2]?(level, message ,arg{0-2}) + * Expands to a statement (either a simple expression or a compound + * do..while(0) statement) that outputs a message with parameter + * substitution if PNG_DEBUG is defined to 2 or more. If PNG_DEBUG + * is undefined, 0 or 1 every png_debug expands to a simple expression + * (actually ((void)0)). + * + * level: level of detail of message, starting at 0. A level 'n' + * message is preceded by 'n' tab characters (not implemented + * on Microsoft compilers unless PNG_DEBUG_FILE is also + * defined, to allow debug DLL compilation with no standard IO). + * message: a printf(3) style text string. A trailing '\n' is added + * to the message. + * arg: 0 to 2 arguments for printf(3) style substitution in message. + */ +#ifndef PNGDEBUG_H +#define PNGDEBUG_H +#ifdef PNG_DEBUG +# if (PNG_DEBUG > 0) +# if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) +# include +# if (PNG_DEBUG > 1) +# ifndef _DEBUG +# define _DEBUG +# endif +# ifndef png_debug +# define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE) +# endif +# ifndef png_debug1 +# define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1) +# endif +# ifndef png_debug2 +# define png_debug2(l,m,p1,p2) \ + _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2) +# endif +# endif +# else /* PNG_DEBUG_FILE || !_MSC_VER */ +# ifndef PNG_DEBUG_FILE +# define PNG_DEBUG_FILE stderr +# endif /* PNG_DEBUG_FILE */ + +# if (PNG_DEBUG > 1) +/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on + * non-ISO compilers + */ +# ifdef __STDC__ +# ifndef png_debug +# define png_debug(l,m) \ + do { \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \ + } while (0) +# endif +# ifndef png_debug1 +# define png_debug1(l,m,p1) \ + do { \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \ + } while (0) +# endif +# ifndef png_debug2 +# define png_debug2(l,m,p1,p2) \ + do { \ + int num_tabs=l; \ + fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \ + } while (0) +# endif +# else /* __STDC __ */ +# ifndef png_debug +# define png_debug(l,m) \ + do { \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format); \ + } while (0) +# endif +# ifndef png_debug1 +# define png_debug1(l,m,p1) \ + do { \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format,p1); \ + } while (0) +# endif +# ifndef png_debug2 +# define png_debug2(l,m,p1,p2) \ + do { \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format,p1,p2); \ + } while (0) +# endif +# endif /* __STDC __ */ +# endif /* (PNG_DEBUG > 1) */ + +# endif /* _MSC_VER */ +# endif /* (PNG_DEBUG > 0) */ +#endif /* PNG_DEBUG */ +#ifndef png_debug +# define png_debug(l, m) ((void)0) +#endif +#ifndef png_debug1 +# define png_debug1(l, m, p1) ((void)0) +#endif +#ifndef png_debug2 +# define png_debug2(l, m, p1, p2) ((void)0) +#endif +#endif /* PNGDEBUG_H */ diff -ru4NwbB libpng-1.4.1/pngerror.c libpng-1.5.0beta16/pngerror.c --- libpng-1.4.1/pngerror.c 2010-02-25 05:38:30.185638465 -0600 +++ libpng-1.5.0beta16/pngerror.c 2010-04-01 07:15:52.929044422 -0500 @@ -1,8 +1,8 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * Last changed in libpng 1.4.0 [January 3, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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.) * @@ -15,13 +15,12 @@ * and use png_set_error_fn() to use those functions. See the instructions * at each function. */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) #include "pngpriv.h" +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) + static void /* PRIVATE */ png_default_error PNGARG((png_structp png_ptr, png_const_charp error_message)) PNG_NORETURN; #ifdef PNG_WARNINGS_SUPPORTED @@ -241,9 +240,9 @@ if (png_ptr == NULL || jmp_buf_size != png_sizeof(jmp_buf)) return NULL; png_ptr->longjmp_fn = longjmp_fn; - return &png_ptr->jmpbuf; + return &png_ptr->png_jmpbuf; } #endif /* This is the default error handling function. Note that replacements for @@ -287,28 +286,33 @@ fprintf(stderr, "libpng error: %s", error_message); fprintf(stderr, PNG_STRING_NEWLINE); } #endif + png_longjmp(png_ptr, 1); +#ifndef PNG_CONSOLE_IO_SUPPORTED + error_message = error_message; /* Make compiler happy */ +#endif +} +void PNGAPI +png_longjmp(png_structp png_ptr, int val) +{ #ifdef PNG_SETJMP_SUPPORTED if (png_ptr && png_ptr->longjmp_fn) { # ifdef USE_FAR_KEYWORD { - jmp_buf jmpbuf; - png_memcpy(jmpbuf, png_ptr->jmpbuf, png_sizeof(jmp_buf)); - png_ptr->longjmp_fn(jmpbuf, 1); + jmp_buf png_jmpbuf; + png_memcpy(png_jmpbuf, png_ptr->png_jmpbuf, png_sizeof(jmp_buf)); + png_ptr->longjmp_fn(png_jmpbuf, val); } # else - png_ptr->longjmp_fn(png_ptr->jmpbuf, 1); + png_ptr->longjmp_fn(png_ptr->png_jmpbuf, val); # endif } #endif /* Here if not setjmp support or if png_ptr is null. */ PNG_ABORT(); -#ifndef PNG_CONSOLE_IO_SUPPORTED - error_message = error_message; /* Make compiler happy */ -#endif } #ifdef PNG_WARNINGS_SUPPORTED /* This function is called when there is a warning, but the library thinks @@ -360,9 +364,9 @@ /* This function is called when the application wants to use another method * of handling errors and warnings. Note that the error function MUST NOT * return to the calling routine or serious problems will occur. The return - * method used in the default routine calls longjmp(png_ptr->jmpbuf, 1) + * method used in the default routine calls longjmp(png_ptr->png_jmpbuf, 1) */ void PNGAPI png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn) @@ -394,9 +398,10 @@ { if (png_ptr != NULL) { png_ptr->flags &= - ((~(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode); + ((~(PNG_FLAG_STRIP_ERROR_NUMBERS | + PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode); } } #endif #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff -ru4NwbB libpng-1.4.1/pngget.c libpng-1.5.0beta16/pngget.c --- libpng-1.4.1/pngget.c 2010-02-25 05:38:30.192877855 -0600 +++ libpng-1.5.0beta16/pngget.c 2010-04-01 07:15:52.936157474 -0500 @@ -11,13 +11,12 @@ * and license in png.h * */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) #include "pngpriv.h" +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) + png_uint_32 PNGAPI png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag) { if (png_ptr != NULL && info_ptr != NULL) @@ -766,10 +765,10 @@ { if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0) { png_debug1(1, "in %s retrieval function", - (png_ptr->chunk_name[0] == '\0' ? "text" - : (png_const_charp)png_ptr->chunk_name)); + (png_ptr->chunk_name[0] == '\0' ? "text" : + (png_const_charp)png_ptr->chunk_name)); if (text_ptr != NULL) *text_ptr = info_ptr->text; @@ -901,10 +900,9 @@ /* This function was added to libpng 1.4.1 */ png_alloc_size_t PNGAPI png_get_chunk_malloc_max (png_structp png_ptr) { - return (png_ptr? - png_ptr->user_chunk_malloc_max : 0); + return (png_ptr ? png_ptr->user_chunk_malloc_max : 0); } #endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */ /* These functions were added to libpng 1.4.0 */ diff -ru4NwbB libpng-1.4.1/pnginfo.h libpng-1.5.0beta16/pnginfo.h --- libpng-1.4.1/pnginfo.h 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta16/pnginfo.h 2010-04-01 07:15:52.903777545 -0500 @@ -0,0 +1,294 @@ + +/* pnginfo.h - header file for PNG reference library + * + * Copyright (c) 1998-2010 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.) + * + * Last changed in libpng version 1.5.0 - April 1, 2010 + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + + /* png_info is a structure that holds the information in a PNG file so + * that the application can find out the characteristics of the image. + * If you are reading the file, this structure will tell you what is + * in the PNG file. If you are writing the file, fill in the information + * you want to put into the PNG file, using png_set_*() functions, then + * call png_write_info(). + * + * The names chosen should be very close to the PNG specification, so + * consult that document for information about the meaning of each field. + * + * With libpng < 0.95, it was only possible to directly set and read the + * the values in the png_info_struct, which meant that the contents and + * order of the values had to remain fixed. With libpng 0.95 and later, + * however, there are now functions that abstract the contents of + * png_info_struct from the application, so this makes it easier to use + * libpng with dynamic libraries, and even makes it possible to use + * libraries that don't have all of the libpng ancillary chunk-handing + * functionality. In libpng-1.5.0 this was moved into a separate private + * file that is not visible to applications. + * + * The following members may have allocated storage attached that should be + * cleaned up before the structure is discarded: palette, trans, text, + * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile, + * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these + * are automatically freed when the info structure is deallocated, if they were + * allocated internally by libpng. This behavior can be changed by means + * of the png_data_freer() function. + * + * More allocation details: all the chunk-reading functions that + * change these members go through the corresponding png_set_* + * functions. A function to clear these members is available: see + * png_free_data(). The png_set_* functions do not depend on being + * able to point info structure members to any of the storage they are + * passed (they make their own copies), EXCEPT that the png_set_text + * functions use the same storage passed to them in the text_ptr or + * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns + * functions do not make their own copies. + */ +#ifndef PNGINFO_H +#define PNGINFO_H + +struct png_info_def +{ + /* the following are necessary for every PNG file */ + png_uint_32 width; /* width of image in pixels (from IHDR) */ + png_uint_32 height; /* height of image in pixels (from IHDR) */ + png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */ + png_size_t rowbytes; /* bytes needed to hold an untransformed row */ + png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */ + png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */ + png_uint_16 num_trans; /* number of transparent palette color (tRNS) */ + png_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */ + png_byte color_type; /* see PNG_COLOR_TYPE_ below (from IHDR) */ + /* The following three should have been named *_method not *_type */ + png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */ + png_byte filter_type; /* must be PNG_FILTER_TYPE_BASE (from IHDR) */ + 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 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 */ + + /* The rest of the data is optional. If you are reading, check the + * valid field to see if the information in these are valid. If you + * are writing, set the valid field to those chunks you want written, + * and initialize the appropriate fields below. + */ + +#if defined(PNG_gAMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) + /* The gAMA chunk describes the gamma characteristics of the system + * on which the image was created, normally in the range [1.0, 2.5]. + * Data is valid if (valid & PNG_INFO_gAMA) is non-zero. + */ + float gamma; /* gamma value of image, if (valid & PNG_INFO_gAMA) */ +#endif + +#ifdef PNG_sRGB_SUPPORTED + /* GR-P, 0.96a */ + /* Data valid if (valid & PNG_INFO_sRGB) non-zero. */ + png_byte srgb_intent; /* sRGB rendering intent [0, 1, 2, or 3] */ +#endif + +#ifdef PNG_TEXT_SUPPORTED + /* The tEXt, and zTXt chunks contain human-readable textual data in + * uncompressed, compressed, and optionally compressed forms, respectively. + * The data in "text" is an array of pointers to uncompressed, + * null-terminated C strings. Each chunk has a keyword that describes the + * textual data contained in that chunk. Keywords are not required to be + * unique, and the text string may be empty. Any number of text chunks may + * be in an image. + */ + int num_text; /* number of comments read or comments to write */ + int max_text; /* current size of text array */ + png_textp text; /* array of comments read or comments to write */ +#endif /* PNG_TEXT_SUPPORTED */ + +#ifdef PNG_tIME_SUPPORTED + /* The tIME chunk holds the last time the displayed image data was + * modified. See the png_time struct for the contents of this struct. + */ + png_time mod_time; +#endif + +#ifdef PNG_sBIT_SUPPORTED + /* The sBIT chunk specifies the number of significant high-order bits + * in the pixel data. Values are in the range [1, bit_depth], and are + * only specified for the channels in the pixel data. The contents of + * the low-order bits is not specified. Data is valid if + * (valid & PNG_INFO_sBIT) is non-zero. + */ + png_color_8 sig_bit; /* significant bits in color channels */ +#endif + +#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \ +defined(PNG_READ_BACKGROUND_SUPPORTED) + /* The tRNS chunk supplies transparency data for paletted images and + * other image types that don't need a full alpha channel. There are + * "num_trans" transparency values for a paletted image, stored in the + * same order as the palette colors, starting from index 0. Values + * for the data are in the range [0, 255], ranging from fully transparent + * to fully opaque, respectively. For non-paletted images, there is a + * single color specified that should be treated as fully transparent. + * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. + */ + png_bytep trans; /* alpha values for paletted image */ + png_bytep trans_alpha; /* alpha values for paletted image */ + png_color_16 trans_color; /* transparent color for non-palette image */ +#endif + +#if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + /* The bKGD chunk gives the suggested image background color if the + * display program does not have its own background color and the image + * is needs to composited onto a background before display. The colors + * in "background" are normally in the same color space/depth as the + * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. + */ + png_color_16 background; +#endif + +#ifdef PNG_oFFs_SUPPORTED + /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards + * and downwards from the top-left corner of the display, page, or other + * application-specific co-ordinate space. See the PNG_OFFSET_ defines + * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. + */ + png_int_32 x_offset; /* x offset on page */ + png_int_32 y_offset; /* y offset on page */ + png_byte offset_unit_type; /* offset units type */ +#endif + +#ifdef PNG_pHYs_SUPPORTED + /* The pHYs chunk gives the physical pixel density of the image for + * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ + * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. + */ + png_uint_32 x_pixels_per_unit; /* horizontal pixel density */ + png_uint_32 y_pixels_per_unit; /* vertical pixel density */ + png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */ +#endif + +#ifdef PNG_hIST_SUPPORTED + /* The hIST chunk contains the relative frequency or importance of the + * various palette entries, so that a viewer can intelligently select a + * reduced-color palette, if required. Data is an array of "num_palette" + * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) + * is non-zero. + */ + png_uint_16p hist; +#endif + +#ifdef PNG_cHRM_SUPPORTED + /* The cHRM chunk describes the CIE color characteristics of the monitor + * on which the PNG was created. This data allows the viewer to do gamut + * mapping of the input image to ensure that the viewer sees the same + * colors in the image as the creator. Values are in the range + * [0.0, 0.8]. Data valid if (valid & PNG_INFO_cHRM) non-zero. + */ +#ifdef PNG_FLOATING_POINT_SUPPORTED + float x_white; + float y_white; + float x_red; + float y_red; + float x_green; + float y_green; + float x_blue; + float y_blue; +#endif +#endif + +#ifdef PNG_pCAL_SUPPORTED + /* The pCAL chunk describes a transformation between the stored pixel + * values and original physical data values used to create the image. + * The integer range [0, 2^bit_depth - 1] maps to the floating-point + * range given by [pcal_X0, pcal_X1], and are further transformed by a + * (possibly non-linear) transformation function given by "pcal_type" + * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ + * defines below, and the PNG-Group's PNG extensions document for a + * complete description of the transformations and how they should be + * implemented, and for a description of the ASCII parameter strings. + * Data values are valid if (valid & PNG_INFO_pCAL) non-zero. + */ + png_charp pcal_purpose; /* pCAL chunk description string */ + png_int_32 pcal_X0; /* minimum value */ + png_int_32 pcal_X1; /* maximum value */ + png_charp pcal_units; /* Latin-1 string giving physical units */ + png_charpp pcal_params; /* ASCII strings containing parameter values */ + png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */ + png_byte pcal_nparams; /* number of parameters given in pcal_params */ +#endif + +/* New members added in libpng-1.0.6 */ + png_uint_32 free_me; /* flags items libpng is responsible for freeing */ + +#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) || \ + defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED) + /* Storage for unknown chunks that the library doesn't recognize. */ + png_unknown_chunkp unknown_chunks; + png_size_t unknown_chunks_num; +#endif + +#ifdef PNG_iCCP_SUPPORTED + /* iCCP chunk data. */ + png_charp iccp_name; /* profile name */ + png_charp iccp_profile; /* International Color Consortium profile data */ + /* Note to maintainer: should be png_bytep */ + png_uint_32 iccp_proflen; /* ICC profile data length */ + png_byte iccp_compression; /* Always zero */ +#endif + +#ifdef PNG_sPLT_SUPPORTED + /* Data on sPLT chunks (there may be more than one). */ + png_sPLT_tp splt_palettes; + png_uint_32 splt_palettes_num; +#endif + +#ifdef PNG_sCAL_SUPPORTED + /* The sCAL chunk describes the actual physical dimensions of the + * subject matter of the graphic. The chunk contains a unit specification + * a byte value, and two ASCII strings representing floating-point + * values. The values are width and height corresponsing to one pixel + * in the image. This external representation is converted to double + * here. Data values are valid if (valid & PNG_INFO_sCAL) is non-zero. + */ + png_byte scal_unit; /* unit of physical scale */ +#ifdef PNG_FLOATING_POINT_SUPPORTED + double scal_pixel_width; /* width of one pixel */ + double scal_pixel_height; /* height of one pixel */ +#endif +#ifdef PNG_FIXED_POINT_SUPPORTED + png_charp scal_s_width; /* string containing height */ + png_charp scal_s_height; /* string containing width */ +#endif +#endif + +#ifdef PNG_INFO_IMAGE_SUPPORTED + /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) + non-zero */ + /* Data valid if (valid & PNG_INFO_IDAT) non-zero */ + png_bytepp row_pointers; /* the image bits */ +#endif + +#if defined(PNG_FIXED_POINT_SUPPORTED) && defined(PNG_gAMA_SUPPORTED) + png_fixed_point int_gamma; /* gamma of image, if (valid & PNG_INFO_gAMA) */ +#endif + +#if defined(PNG_cHRM_SUPPORTED) && defined(PNG_FIXED_POINT_SUPPORTED) + png_fixed_point int_x_white; + png_fixed_point int_y_white; + png_fixed_point int_x_red; + png_fixed_point int_y_red; + png_fixed_point int_x_green; + png_fixed_point int_y_green; + png_fixed_point int_x_blue; + png_fixed_point int_y_blue; +#endif + +}; +#endif /* PNGINFO_H */ diff -ru4NwbB libpng-1.4.1/pngmem.c libpng-1.5.0beta16/pngmem.c --- libpng-1.4.1/pngmem.c 2010-02-25 05:38:30.199420289 -0600 +++ libpng-1.5.0beta16/pngmem.c 2010-04-01 07:15:52.942459257 -0500 @@ -1,8 +1,8 @@ /* pngmem.c - stub functions for memory allocation * - * Last changed in libpng 1.4.0 [April 1, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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,13 +16,12 @@ * png_create_read_struct_2() and png_create_write_struct_2() to * identify the replacement functions. */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) #include "pngpriv.h" +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) + /* Borland DOS special memory handler */ #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) /* If you change this, be sure to change the one in png.h also */ diff -ru4NwbB libpng-1.4.1/pngpread.c libpng-1.5.0beta16/pngpread.c --- libpng-1.4.1/pngpread.c 2010-02-25 05:38:30.208407619 -0600 +++ libpng-1.5.0beta16/pngpread.c 2010-04-01 07:15:52.951338845 -0500 @@ -1,8 +1,8 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.4.1 [April 1, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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.) * @@ -10,13 +10,12 @@ * For conditions of distribution and use, see the disclaimer * and license in png.h */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED #include "pngpriv.h" +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED + /* Push model modes */ #define PNG_READ_SIG_MODE 0 #define PNG_READ_CHUNK_MODE 1 #define PNG_READ_IDAT_MODE 2 @@ -624,9 +623,9 @@ png_ptr->process_mode = PNG_READ_CHUNK_MODE; } } -void PNGAPI +void PNGCBAPI png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length) { png_bytep ptr; @@ -1235,12 +1234,11 @@ text_ptr = (png_textp)png_malloc(png_ptr, png_sizeof(png_text)); text_ptr->compression = PNG_TEXT_COMPRESSION_NONE; text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED + text_ptr->itxt_length = 0; text_ptr->lang = NULL; text_ptr->lang_key = NULL; -#endif text_ptr->text = text; ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); @@ -1437,12 +1435,11 @@ text_ptr = (png_textp)png_malloc(png_ptr, png_sizeof(png_text)); text_ptr->compression = PNG_TEXT_COMPRESSION_zTXt; text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED + text_ptr->itxt_length = 0; text_ptr->lang = NULL; text_ptr->lang_key = NULL; -#endif text_ptr->text = text; ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); diff -ru4NwbB libpng-1.4.1/pngpriv.h libpng-1.5.0beta16/pngpriv.h --- libpng-1.4.1/pngpriv.h 2010-02-25 05:38:30.164470109 -0600 +++ libpng-1.5.0beta16/pngpriv.h 2010-04-01 07:15:52.892736560 -0500 @@ -23,12 +23,27 @@ #ifndef PNGPRIV_H #define PNGPRIV_H -#ifndef PNG_VERSION_INFO_ONLY +#define PNGLIB_BUILD +#include "png.h" +#include "pnginfo.h" +#include "pngstruct.h" #include +/* Added at libpng-1.2.9 */ +/* Moved to pngpriv.h at libpng-1.5.0 */ + +/* config.h is created by and PNG_CONFIGURE_LIBPNG is set by the "configure" + * script. + */ +#ifdef PNG_CONFIGURE_LIBPNG +# ifdef HAVE_CONFIG_H +# include "config.h" +# endif +#endif + /* The functions exported by PNG_EXTERN are internal functions, which * aren't usually used outside the library (as far as I know), so it is * debatable if they should be exported at all. In the future, when it * is possible to have run-time registry of chunk-handling functions, @@ -41,9 +56,10 @@ * them inside an appropriate ifdef/endif pair for portability. */ #ifdef PNG_FLOATING_POINT_SUPPORTED -# ifdef MACOS +# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ + defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) /* We need to check that hasn't already been included earlier * as it seems it doesn't agree with , yet we should really use * if possible. */ @@ -60,13 +76,8 @@ # include # endif #endif -/* Codewarrior on NT has linking problems without this. */ -#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__) -# define PNG_ALWAYS_EXTERN -#endif - /* This provides the non-ANSI (far) memory allocation routines. */ #if defined(__TURBOC__) && defined(__MSDOS__) # include # include @@ -264,25 +275,27 @@ /* Function to free memory for zlib. PNGAPI is disallowed. */ PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr)); -/* Next four functions are used internally as callbacks. PNGAPI is required - * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3. */ +/* Next four functions are used internally as callbacks. PNGCBAPI is required + * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3, changed to PNGCBAPI + * at 1.5.0 + */ -PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr, +PNG_EXTERN void PNGCBAPI 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_EXTERN void PNGCBAPI 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_EXTERN void PNGCBAPI png_default_write_data PNGARG((png_structp png_ptr, png_bytep data, png_size_t length)); #ifdef PNG_WRITE_FLUSH_SUPPORTED #ifdef PNG_STDIO_SUPPORTED -PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr)); +PNG_EXTERN void PNGCBAPI png_default_flush PNGARG((png_structp png_ptr)); #endif #endif /* Reset the CRC variable */ @@ -838,119 +851,13 @@ extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr, int check)); #endif /* USE_FAR_KEYWORD */ -/* Define PNG_DEBUG at compile time for debugging information. Higher - * numbers for PNG_DEBUG mean more debugging information. This has - * only been added since version 0.95 so it is not implemented throughout - * libpng yet, but more support will be added as needed. - */ -#ifdef PNG_DEBUG -#if (PNG_DEBUG > 0) -#if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) -#include -#if (PNG_DEBUG > 1) -#ifndef _DEBUG -# define _DEBUG -#endif -#ifndef png_debug -#define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE) -#endif -#ifndef png_debug1 -#define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1) -#endif -#ifndef png_debug2 -#define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2) -#endif -#endif -#else /* PNG_DEBUG_FILE || !_MSC_VER */ -#ifndef PNG_DEBUG_FILE -#define PNG_DEBUG_FILE stderr -#endif /* PNG_DEBUG_FILE */ - -#if (PNG_DEBUG > 1) -/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on - * non-ISO compilers - */ -# ifdef __STDC__ -# ifndef png_debug -# define png_debug(l,m) \ - { \ - int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \ - } -# endif -# ifndef png_debug1 -# define png_debug1(l,m,p1) \ - { \ - int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \ - } -# endif -# ifndef png_debug2 -# define png_debug2(l,m,p1,p2) \ - { \ - int num_tabs=l; \ - fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \ - } -# endif -# else /* __STDC __ */ -# ifndef png_debug -# define png_debug(l,m) \ - { \ - int num_tabs=l; \ - char format[256]; \ - snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ - m,PNG_STRING_NEWLINE); \ - fprintf(PNG_DEBUG_FILE,format); \ - } -# endif -# ifndef png_debug1 -# define png_debug1(l,m,p1) \ - { \ - int num_tabs=l; \ - char format[256]; \ - snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ - m,PNG_STRING_NEWLINE); \ - fprintf(PNG_DEBUG_FILE,format,p1); \ - } -# endif -# ifndef png_debug2 -# define png_debug2(l,m,p1,p2) \ - { \ - int num_tabs=l; \ - char format[256]; \ - snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ - (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ - m,PNG_STRING_NEWLINE); \ - fprintf(PNG_DEBUG_FILE,format,p1,p2); \ - } -# endif -# endif /* __STDC __ */ -#endif /* (PNG_DEBUG > 1) */ - -#endif /* _MSC_VER */ -#endif /* (PNG_DEBUG > 0) */ -#endif /* PNG_DEBUG */ -#ifndef png_debug -#define png_debug(l, m) -#endif -#ifndef png_debug1 -#define png_debug1(l, m, p1) -#endif -#ifndef png_debug2 -#define png_debug2(l, m, p1, p2) -#endif +#include "pngdebug.h" /* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ #ifdef __cplusplus } #endif -#endif /* PNG_VERSION_INFO_ONLY */ #endif /* PNGPRIV_H */ diff -ru4NwbB libpng-1.4.1/pngread.c libpng-1.5.0beta16/pngread.c --- libpng-1.4.1/pngread.c 2010-02-25 05:38:30.217312332 -0600 +++ libpng-1.5.0beta16/pngread.c 2010-04-01 07:15:52.959919886 -0500 @@ -1,8 +1,8 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.4.1 [April 1, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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.) * @@ -13,13 +13,11 @@ * This file contains routines that an application calls directly to * read a PNG file or stream. */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#ifdef PNG_READ_SUPPORTED #include "pngpriv.h" +#ifdef PNG_READ_SUPPORTED /* Create a PNG structure for reading, and allocate any memory needed. */ png_structp PNGAPI png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr, @@ -48,9 +46,9 @@ volatile int png_cleanup_needed = 0; #ifdef PNG_SETJMP_SUPPORTED #ifdef USE_FAR_KEYWORD - jmp_buf jmpbuf; + jmp_buf png_jmpbuf; #endif #endif int i; @@ -84,15 +82,15 @@ /* Applications that neglect to set up their own setjmp() and then encounter a png_error() will longjmp here. Since the jmpbuf is then meaningless we abort instead of returning. */ #ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) + if (setjmp(png_jmpbuf)) #else if (setjmp(png_jmpbuf(png_ptr))) /* Sets longjmp to match setjmp */ #endif PNG_ABORT(); #ifdef USE_FAR_KEYWORD - png_memcpy(png_jmpbuf(png_ptr), jmpbuf, png_sizeof(jmp_buf)); + png_memcpy(png_jmpbuf(png_ptr), png_jmpbuf, png_sizeof(jmp_buf)); #endif #endif /* PNG_SETJMP_SUPPORTED */ #ifdef PNG_USER_MEM_SUPPORTED @@ -124,27 +122,26 @@ if (user_png_ver == NULL || user_png_ver[0] != png_libpng_ver[0] || (user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) || (user_png_ver[0] == '0' && user_png_ver[2] < '9')) { -#ifdef PNG_STDIO_SUPPORTED +#ifdef PNG_CONSOLE_IO_SUPPORTED char msg[80]; if (user_png_ver) { - png_snprintf(msg, 80, - "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); - } - png_snprintf(msg, 80, - "Application is running with png.c from libpng-%.20s", + png_snprintf2(msg, 80, + "Application built with libpng-%.20s" + " but running with %.20s", + user_png_ver, png_libpng_ver); png_warning(png_ptr, msg); + } +#else + png_warning(png_ptr, + "Incompatible libpng version in application and library"); #endif #ifdef PNG_ERROR_NUMBERS_SUPPORTED png_ptr->flags = 0; #endif - png_warning(png_ptr, - "Incompatible libpng version in application and library"); png_cleanup_needed = 1; } } @@ -432,9 +429,10 @@ if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) png_read_start_row(png_ptr); else png_warning(png_ptr, - "Ignoring extra png_read_update_info() call; row buffer not reallocated"); + "Ignoring extra png_read_update_info() call;" + " row buffer not reallocated"); png_read_transform_info(png_ptr, info_ptr); } @@ -668,13 +666,11 @@ */ png_do_read_interlace(png_ptr); if (dsp_row != NULL) - png_combine_row(png_ptr, dsp_row, - png_pass_dsp_mask[png_ptr->pass]); + png_combine_row(png_ptr, dsp_row, png_pass_dsp_mask[png_ptr->pass]); if (row != NULL) - png_combine_row(png_ptr, row, - png_pass_mask[png_ptr->pass]); + png_combine_row(png_ptr, row, png_pass_mask[png_ptr->pass]); } else #endif { @@ -1157,9 +1153,9 @@ /* Save the important info out of the png_struct, in case it is * being used again. */ #ifdef PNG_SETJMP_SUPPORTED - png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf)); + png_memcpy(tmp_jmp, png_ptr->png_jmpbuf, png_sizeof(jmp_buf)); #endif error_fn = png_ptr->error_fn; warning_fn = png_ptr->warning_fn; @@ -1177,9 +1173,9 @@ png_ptr->free_fn = free_fn; #endif #ifdef PNG_SETJMP_SUPPORTED - png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf)); + png_memcpy(png_ptr->png_jmpbuf, tmp_jmp, png_sizeof(jmp_buf)); #endif } @@ -1282,40 +1278,35 @@ } #endif #ifdef PNG_READ_BGR_SUPPORTED - /* Flip the RGB pixels to BGR (or RGBA to BGRA) - */ + /* Flip the RGB pixels to BGR (or RGBA to BGRA) */ if (transforms & PNG_TRANSFORM_BGR) png_set_bgr(png_ptr); #endif #ifdef PNG_READ_SWAP_ALPHA_SUPPORTED - /* Swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR) - */ + /* Swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR) */ if (transforms & PNG_TRANSFORM_SWAP_ALPHA) png_set_swap_alpha(png_ptr); #endif #ifdef PNG_READ_SWAP_SUPPORTED - /* Swap bytes of 16 bit files to least significant byte first - */ + /* Swap bytes of 16 bit files to least significant byte first */ if (transforms & PNG_TRANSFORM_SWAP_ENDIAN) png_set_swap(png_ptr); #endif /* Added at libpng-1.2.41 */ #ifdef PNG_READ_INVERT_ALPHA_SUPPORTED - /* Invert the alpha channel from opacity to transparency - */ + /* Invert the alpha channel from opacity to transparency */ if (transforms & PNG_TRANSFORM_INVERT_ALPHA) png_set_invert_alpha(png_ptr); #endif /* Added at libpng-1.2.41 */ #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED - /* Expand grayscale image to RGB - */ + /* Expand grayscale image to RGB */ if (transforms & PNG_TRANSFORM_GRAY_TO_RGB) png_set_gray_to_rgb(png_ptr); #endif diff -ru4NwbB libpng-1.4.1/pngrio.c libpng-1.5.0beta16/pngrio.c --- libpng-1.4.1/pngrio.c 2010-02-25 05:38:30.222455681 -0600 +++ libpng-1.5.0beta16/pngrio.c 2010-04-01 07:15:52.964909371 -0500 @@ -1,8 +1,8 @@ /* pngrio.c - functions for data input * - * Last changed in libpng 1.4.1 [April 1, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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.) * @@ -17,13 +17,12 @@ * function, but rather write a replacement function and then make * libpng use it at run time with png_set_read_fn(...). */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#ifdef PNG_READ_SUPPORTED #include "pngpriv.h" +#ifdef PNG_READ_SUPPORTED + /* Read the data from whatever input you are using. The default routine * reads from a file pointer. Note that this routine sometimes gets called * with very small lengths, so you should implement some kind of simple * buffering if you are using unbuffered reads. This should never be asked @@ -46,9 +45,9 @@ * read_data function and use it at run time with png_set_read_fn(), rather * than changing the library. */ #ifndef USE_FAR_KEYWORD -void PNGAPI +void PNGCBAPI png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { png_size_t check; @@ -70,9 +69,9 @@ #define NEAR_BUF_SIZE 1024 #define MIN(a,b) (a <= b ? a : b) -static void PNGAPI +static void PNGCBAPI png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { png_size_t check; png_byte *n_data; @@ -150,11 +149,10 @@ if (png_ptr->write_data_fn != NULL) { png_ptr->write_data_fn = NULL; png_warning(png_ptr, - "It's an error to set both read_data_fn and write_data_fn in the "); - png_warning(png_ptr, - "same structure. Resetting write_data_fn to NULL"); + "Can't set both read_data_fn and write_data_fn in the" + " same structure"); } #ifdef PNG_WRITE_FLUSH_SUPPORTED png_ptr->output_flush_fn = NULL; diff -ru4NwbB libpng-1.4.1/pngrtran.c libpng-1.5.0beta16/pngrtran.c --- libpng-1.4.1/pngrtran.c 2010-02-25 05:38:30.238164331 -0600 +++ libpng-1.5.0beta16/pngrtran.c 2010-04-01 07:15:52.980163809 -0500 @@ -1,8 +1,8 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.4.1 [April 1, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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.) * @@ -15,13 +15,12 @@ * Transformations that are used in both reading and writing are * in pngtrans.c. */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#ifdef PNG_READ_SUPPORTED #include "pngpriv.h" +#ifdef PNG_READ_SUPPORTED + /* Set the action on getting a CRC error for an ancillary or critical chunk. */ void PNGAPI png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action) { @@ -678,15 +677,18 @@ return; switch(error_action) { - case 1: png_ptr->transformations |= PNG_RGB_TO_GRAY; + case 1: + png_ptr->transformations |= PNG_RGB_TO_GRAY; break; - case 2: png_ptr->transformations |= PNG_RGB_TO_GRAY_WARN; + case 2: + png_ptr->transformations |= PNG_RGB_TO_GRAY_WARN; break; - case 3: png_ptr->transformations |= PNG_RGB_TO_GRAY_ERR; + case 3: + png_ptr->transformations |= PNG_RGB_TO_GRAY_ERR; } if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) #ifdef PNG_READ_EXPAND_SUPPORTED png_ptr->transformations |= PNG_EXPAND; @@ -772,9 +774,10 @@ if ((png_ptr->transformations & PNG_BACKGROUND_EXPAND) && !(color_type & PNG_COLOR_MASK_COLOR)) { png_ptr->mode |= PNG_BACKGROUND_IS_GRAY; - } else if ((png_ptr->transformations & PNG_BACKGROUND) && + } + else if ((png_ptr->transformations & PNG_BACKGROUND) && !(png_ptr->transformations & PNG_BACKGROUND_EXPAND) && (png_ptr->transformations & PNG_GRAY_TO_RGB) && png_ptr->background.red == png_ptr->background.green && png_ptr->background.red == png_ptr->background.blue) @@ -951,9 +954,10 @@ back.green = (png_byte)(pow( (double)png_ptr->background.green/%F255%, gs) * 255.0 + .5); back.blue = (png_byte)(pow( - (double)png_ptr->background.blue/%F255%, gs) * 255.0 + .5); + (double)png_ptr->background.blue/%F255%, gs) * 255.0 + + .5); } back_1.red = (png_byte)(pow( (double)png_ptr->background.red/%F255%, g) * 255.0 + .5); @@ -1306,9 +1310,9 @@ png_debug(1, "in png_do_read_transformations"); if (png_ptr->row_buf == NULL) { -#ifdef PNG_STDIO_SUPPORTED +#ifdef PNG_CONSOLE_IO_SUPPORTED char msg[50]; png_snprintf2(msg, 50, "NULL row buffer for row %ld, pass %d", (long)png_ptr->row_number, @@ -1893,17 +1897,17 @@ #ifdef PNG_READ_INVERT_ALPHA_SUPPORTED void /* PRIVATE */ png_do_read_invert_alpha(png_row_infop row_info, png_bytep row) { + png_uint_32 row_width; png_debug(1, "in png_do_read_invert_alpha"); - { - png_uint_32 row_width = row_info->width; + row_width = row_info->width; if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) { - /* This inverts the alpha channel in RGBA */ if (row_info->bit_depth == 8) { + /* This inverts the alpha channel in RGBA */ png_bytep sp = row + row_info->rowbytes; png_bytep dp = sp; png_uint_32 i; @@ -1948,11 +1952,11 @@ } } else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { - /* This inverts the alpha channel in GA */ if (row_info->bit_depth == 8) { + /* This inverts the alpha channel in GA */ png_bytep sp = row + row_info->rowbytes; png_bytep dp = sp; png_uint_32 i; @@ -1961,11 +1965,11 @@ *(--dp) = (png_byte)(255 - *(--sp)); *(--dp) = *(--sp); } } - /* This inverts the alpha channel in GGAA */ else { + /* This inverts the alpha channel in GGAA */ png_bytep sp = row + row_info->rowbytes; png_bytep dp = sp; png_uint_32 i; @@ -1982,9 +1986,8 @@ } } } } -} #endif #ifdef PNG_READ_FILLER_SUPPORTED /* Add filler channel if we have RGB color */ @@ -2004,11 +2007,11 @@ row_info->color_type == PNG_COLOR_TYPE_GRAY) { if (row_info->bit_depth == 8) { - /* This changes the data from G to GX */ if (flags & PNG_FLAG_FILLER_AFTER) { + /* This changes the data from G to GX */ png_bytep sp = row + (png_size_t)row_width; png_bytep dp = sp + (png_size_t)row_width; for (i = 1; i < row_width; i++) { @@ -2019,11 +2022,11 @@ row_info->channels = 2; row_info->pixel_depth = 16; row_info->rowbytes = row_width * 2; } - /* This changes the data from G to XG */ else { + /* This changes the data from G to XG */ png_bytep sp = row + (png_size_t)row_width; png_bytep dp = sp + (png_size_t)row_width; for (i = 0; i < row_width; i++) { @@ -2036,11 +2039,11 @@ } } else if (row_info->bit_depth == 16) { - /* This changes the data from GG to GGXX */ if (flags & PNG_FLAG_FILLER_AFTER) { + /* This changes the data from GG to GGXX */ png_bytep sp = row + (png_size_t)row_width * 2; png_bytep dp = sp + (png_size_t)row_width * 2; for (i = 1; i < row_width; i++) { @@ -2054,11 +2057,11 @@ row_info->channels = 2; row_info->pixel_depth = 32; row_info->rowbytes = row_width * 4; } - /* This changes the data from GG to XXGG */ else { + /* This changes the data from GG to XXGG */ png_bytep sp = row + (png_size_t)row_width * 2; png_bytep dp = sp + (png_size_t)row_width * 2; for (i = 0; i < row_width; i++) { @@ -2076,11 +2079,11 @@ else if (row_info->color_type == PNG_COLOR_TYPE_RGB) { if (row_info->bit_depth == 8) { - /* This changes the data from RGB to RGBX */ if (flags & PNG_FLAG_FILLER_AFTER) { + /* This changes the data from RGB to RGBX */ png_bytep sp = row + (png_size_t)row_width * 3; png_bytep dp = sp + (png_size_t)row_width; for (i = 1; i < row_width; i++) { @@ -2093,11 +2096,11 @@ row_info->channels = 4; row_info->pixel_depth = 32; row_info->rowbytes = row_width * 4; } - /* This changes the data from RGB to XRGB */ else { + /* This changes the data from RGB to XRGB */ png_bytep sp = row + (png_size_t)row_width * 3; png_bytep dp = sp + (png_size_t)row_width; for (i = 0; i < row_width; i++) { @@ -2112,11 +2115,11 @@ } } else if (row_info->bit_depth == 16) { - /* This changes the data from RRGGBB to RRGGBBXX */ if (flags & PNG_FLAG_FILLER_AFTER) { + /* This changes the data from RRGGBB to RRGGBBXX */ png_bytep sp = row + (png_size_t)row_width * 6; png_bytep dp = sp + (png_size_t)row_width * 2; for (i = 1; i < row_width; i++) { @@ -2134,11 +2137,11 @@ row_info->channels = 4; row_info->pixel_depth = 64; row_info->rowbytes = row_width * 8; } - /* This changes the data from RRGGBB to XXRRGGBB */ else { + /* This changes the data from RRGGBB to XXRRGGBB */ png_bytep sp = row + (png_size_t)row_width * 6; png_bytep dp = sp + (png_size_t)row_width * 2; for (i = 0; i < row_width; i++) { @@ -2176,8 +2179,9 @@ if (row_info->color_type == PNG_COLOR_TYPE_GRAY) { if (row_info->bit_depth == 8) { + /* This changes G to RGB */ png_bytep sp = row + (png_size_t)row_width - 1; png_bytep dp = sp + (png_size_t)row_width * 2; for (i = 0; i < row_width; i++) { @@ -2187,8 +2191,9 @@ } } else { + /* This changes GG to RRGGBB */ png_bytep sp = row + (png_size_t)row_width * 2 - 1; png_bytep dp = sp + (png_size_t)row_width * 4; for (i = 0; i < row_width; i++) { @@ -2204,8 +2209,9 @@ else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { if (row_info->bit_depth == 8) { + /* This changes GA to RGBA */ png_bytep sp = row + (png_size_t)row_width * 2 - 1; png_bytep dp = sp + (png_size_t)row_width * 2; for (i = 0; i < row_width; i++) { @@ -2216,8 +2222,9 @@ } } else { + /* This changes GGAA to RRGGBBAA */ png_bytep sp = row + (png_size_t)row_width * 4 - 1; png_bytep dp = sp + (png_size_t)row_width * 4; for (i = 0; i < row_width; i++) { @@ -2346,15 +2353,15 @@ if (red == green && red == blue) w = red; else { - png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) >> - png_ptr->gamma_shift][red>>8]; + png_uint_16 red_1 = png_ptr->gamma_16_to_1[(red&0xff) + >> png_ptr->gamma_shift][red>>8]; png_uint_16 green_1 = png_ptr->gamma_16_to_1[(green&0xff) >> png_ptr->gamma_shift][green>>8]; - png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) >> - png_ptr->gamma_shift][blue>>8]; + png_uint_16 blue_1 = png_ptr->gamma_16_to_1[(blue&0xff) + >> png_ptr->gamma_shift][blue>>8]; png_uint_16 gray16 = (png_uint_16)((rc*red_1 + gc*green_1 + bc*blue_1)>>15); w = png_ptr->gamma_16_from_1[(gray16&0xff) >> png_ptr->gamma_shift][gray16 >> 8]; @@ -2730,29 +2737,24 @@ sp = row; for (i = 0; i < row_width; i++, sp++) { if (*sp == trans_color->gray) - { *sp = (png_byte)background->gray; - } + else - { *sp = gamma_table[*sp]; } } - } else #endif { sp = row; for (i = 0; i < row_width; i++, sp++) { if (*sp == trans_color->gray) - { *sp = (png_byte)background->gray; } } - } break; } case 16: @@ -2853,10 +2855,12 @@ sp = row; for (i = 0; i < row_width; i++, sp += 6) { png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1)); - png_uint_16 g = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - png_uint_16 b = (png_uint_16)(((*(sp+4)) << 8) + *(sp+5)); + png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8) + + *(sp + 3)); + png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8) + + *(sp + 5)); if (r == trans_color->red && g == trans_color->green && b == trans_color->blue) { /* Background is already in screen gamma */ @@ -2887,10 +2891,12 @@ sp = row; for (i = 0; i < row_width; i++, sp += 6) { png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp+1)); - png_uint_16 g = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); - png_uint_16 b = (png_uint_16)(((*(sp+4)) << 8) + *(sp+5)); + png_uint_16 g = (png_uint_16)(((*(sp + 2)) << 8) + + *(sp + 3)); + png_uint_16 b = (png_uint_16)(((*(sp + 4)) << 8) + + *(sp + 5)); if (r == trans_color->red && g == trans_color->green && b == trans_color->blue) { @@ -2921,11 +2927,10 @@ { png_uint_16 a = *(sp + 1); if (a == 0xff) - { *dp = gamma_table[*sp]; - } + else if (a == 0) { /* Background is already in screen gamma */ *dp = (png_byte)background->gray; @@ -2949,20 +2954,17 @@ { png_byte a = *(sp + 1); if (a == 0xff) - { *dp = *sp; - } + #ifdef PNG_READ_GAMMA_SUPPORTED else if (a == 0) - { *dp = (png_byte)background->gray; - } + else - { png_composite(*dp, *sp, a, background_1->gray); - } + #else *dp = (png_byte)background->gray; #endif } @@ -2977,9 +2979,10 @@ sp = row; dp = row; for (i = 0; i < row_width; i++, sp += 4, dp += 2) { - png_uint_16 a = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); + png_uint_16 a = (png_uint_16)(((*(sp + 2)) << 8) + + *(sp + 3)); if (a == (png_uint_16)0xffff) { png_uint_16 v; @@ -3018,13 +3021,13 @@ sp = row; dp = row; for (i = 0; i < row_width; i++, sp += 4, dp += 2) { - png_uint_16 a = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3)); + png_uint_16 a = (png_uint_16)(((*(sp + 2)) << 8) + + *(sp + 3)); if (a == (png_uint_16)0xffff) - { png_memcpy(dp, sp, 2); - } + #ifdef PNG_READ_GAMMA_SUPPORTED else if (a == 0) #else else diff -ru4NwbB libpng-1.4.1/pngrutil.c libpng-1.5.0beta16/pngrutil.c --- libpng-1.4.1/pngrutil.c 2010-02-25 05:38:30.252231541 -0600 +++ libpng-1.5.0beta16/pngrutil.c 2010-04-01 07:15:52.993749196 -0500 @@ -13,13 +13,12 @@ * This file contains routines that are only called from within * libpng itself during the course of reading an image. */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#ifdef PNG_READ_SUPPORTED #include "pngpriv.h" +#ifdef PNG_READ_SUPPORTED + # define png_strtod(p,a,b) strtod(a,b) png_uint_32 PNGAPI png_get_uint_31(png_structp png_ptr, png_bytep buf) { @@ -32,12 +31,13 @@ /* Grab an unsigned 32-bit integer from a buffer in big-endian format. */ png_uint_32 PNGAPI png_get_uint_32(png_bytep buf) { - png_uint_32 i = ((png_uint_32)(*buf) << 24) + + png_uint_32 i = + ((png_uint_32)(*(buf )) << 24) + ((png_uint_32)(*(buf + 1)) << 16) + ((png_uint_32)(*(buf + 2)) << 8) + - (png_uint_32)(*(buf + 3)); + ((png_uint_32)(*(buf + 3)) ) ; return (i); } @@ -89,9 +89,9 @@ /* Put the chunk name into png_ptr->chunk_name */ png_memcpy(png_ptr->chunk_name, buf + 4, 4); - png_debug2(0, "Reading %s chunk, length = %lu", + png_debug2(0, "Reading %s chunk, length = %u", png_ptr->chunk_name, length); /* Reset the crc and run it over the chunk name */ png_reset_crc(png_ptr); @@ -230,9 +230,10 @@ { if (output != 0 && output_size > count) { int copy = output_size - count; - if (avail < copy) copy = avail; + if (avail < copy) + copy = avail; png_memcpy(output + count, png_ptr->zbuf, copy); } count += avail; } @@ -253,14 +254,17 @@ * and the error message is dumped into the uncompressed * buffer if available. */ { - char *msg, umsg[52]; + char *msg; +#ifdef PNG_CONSOLE_IO_SUPPORTED + char umsg[52]; +#endif if (png_ptr->zstream.msg != 0) msg = png_ptr->zstream.msg; else { -#ifdef PNG_STDIO_SUPPORTED +#ifdef PNG_CONSOLE_IO_SUPPORTED switch (ret) { case Z_BUF_ERROR: msg = "Buffer error in compressed datastream in %s chunk"; @@ -282,9 +286,9 @@ png_warning(png_ptr, msg); } - /* 0 means an error - notice that this code simple ignores + /* 0 means an error - notice that this code simply ignores * zero length compressed chunks as a result. */ return 0; } @@ -314,28 +318,36 @@ { png_size_t expanded_size = png_inflate(png_ptr, (png_bytep)(png_ptr->chunkdata + prefix_size), chunklength - prefix_size, - 0/*output*/, 0/*output size*/); + 0, /*output*/ + 0); /*output size*/ /* Now check the limits on this chunk - if the limit fails the * compressed data will be removed, the prefix will remain. */ #ifdef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED if (png_ptr->user_chunk_malloc_max && (prefix_size + expanded_size >= png_ptr->user_chunk_malloc_max - 1)) #else +# ifdef PNG_USER_CHUNK_MALLOC_MAX if ((PNG_USER_CHUNK_MALLOC_MAX > 0) && prefix_size + expanded_size >= PNG_USER_CHUNK_MALLOC_MAX - 1) #endif +#endif png_warning(png_ptr, "Exceeded size limit while expanding chunk"); /* If the size is zero either there was an error and a message * has already been output (warning) or the size really is zero * and we have nothing to do - the code will exit through the * error case below. */ +#if defined(PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED) || \ + defined(PNG_USER_CHUNK_MALLOC_MAX) else if (expanded_size > 0) +#else + if (expanded_size > 0) +#endif { /* Success (maybe) - really uncompress the chunk. */ png_size_t new_size = 0; png_charp text = png_malloc_warn(png_ptr, @@ -367,12 +379,13 @@ } else /* if (comp_type != PNG_COMPRESSION_TYPE_BASE) */ { +#ifdef PNG_STDIO_SUPPORTED char umsg[50]; -#ifdef PNG_STDIO_SUPPORTED - png_snprintf(umsg, sizeof umsg, "Unknown zTXt compression type %d", comp_type); + png_snprintf(umsg, sizeof umsg, + "Unknown zTXt compression type %d", comp_type); png_warning(png_ptr, umsg); #else png_warning(png_ptr, "Unknown zTXt compression type"); #endif @@ -471,9 +484,9 @@ png_ptr->channels); png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->width); png_debug1(3, "bit_depth = %d", png_ptr->bit_depth); png_debug1(3, "channels = %d", png_ptr->channels); - png_debug1(3, "rowbytes = %lu", png_ptr->rowbytes); + png_debug1(3, "rowbytes = %u", png_ptr->rowbytes); png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, color_type, interlace_type, compression_type, filter_type); } @@ -558,9 +571,9 @@ palette[i].blue = buf[2]; } #endif - /* If we actually NEED the PLTE chunk (ie for a paletted image), we do + /* If we actually need the PLTE chunk (ie for a paletted image), we do * whatever the normal CRC configuration tells us. However, if we * have an RGB image, the PLTE can be considered ancillary, so * we will act as though it is. */ @@ -573,11 +586,12 @@ #ifndef PNG_READ_OPT_PLTE_SUPPORTED else if (png_crc_error(png_ptr)) /* Only if we have a CRC error */ { /* If we don't want to use the data from an ancillary chunk, - we have two options: an error abort, or a warning and we - ignore the data in this chunk (which should be OK, since - it's considered ancillary for a RGB or RGBA image). */ + * we have two options: an error abort, or a warning and we + * ignore the data in this chunk (which should be OK, since + * it's considered ancillary for a RGB or RGBA image). + */ if (!(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_USE)) { if (png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN) { @@ -1118,17 +1132,16 @@ if (profile_size > profile_length) { png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; - png_warning(png_ptr, "Ignoring truncated iCCP profile"); #ifdef PNG_STDIO_SUPPORTED { - char umsg[50]; + char umsg[80]; - png_snprintf(umsg, 50, "declared profile size = %lu", - (unsigned long)profile_size); - png_warning(png_ptr, umsg); - png_snprintf(umsg, 50, "actual profile length = %lu", + png_snprintf2(umsg, 80, + "Ignoring iCCP chunk with declared size = %lu " + "and actual length = %lu", + (unsigned long)profile_size, (unsigned long)profile_length); png_warning(png_ptr, umsg); } #endif @@ -1451,9 +1464,10 @@ /* We convert the index value into RGB components so that we can allow * arbitrary RGB values for background when we have transparency, and * so it is easy to determine the RGB values of the background color - * from the info_ptr struct. */ + * from the info_ptr struct. + */ if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { png_ptr->background.index = buf[0]; if (info_ptr && info_ptr->num_palette) @@ -1657,9 +1671,9 @@ png_crc_finish(png_ptr, length); return; } - png_debug1(2, "Allocating and reading pCAL chunk data (%lu bytes)", + png_debug1(2, "Allocating and reading pCAL chunk data (%u bytes)", length + 1); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); if (png_ptr->chunkdata == NULL) @@ -1685,9 +1699,10 @@ endptr = png_ptr->chunkdata + slength; /* We need to have at least 12 bytes after the purpose string - in order to get the parameter information. */ + * in order to get the parameter information. + */ if (endptr <= buf + 12) { png_warning(png_ptr, "Invalid pCAL data"); png_free(png_ptr, png_ptr->chunkdata); @@ -1703,9 +1718,10 @@ units = buf + 11; png_debug(3, "Checking pCAL equation type and number of parameters"); /* Check that we have the right number of parameters for known - equation types. */ + * equation types. + */ if ((type == PNG_EQUATION_LINEAR && nparams != 2) || (type == PNG_EQUATION_BASE_E && nparams != 3) || (type == PNG_EQUATION_ARBITRARY && nparams != 3) || (type == PNG_EQUATION_HYPERBOLIC && nparams != 4)) @@ -1795,9 +1811,9 @@ png_crc_finish(png_ptr, length); return; } - png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)", + png_debug1(2, "Allocating and reading sCAL chunk data (%u bytes)", length + 1); png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); if (png_ptr->chunkdata == NULL) { @@ -2033,13 +2049,11 @@ return; } text_ptr->compression = PNG_TEXT_COMPRESSION_NONE; text_ptr->key = key; -#ifdef PNG_iTXt_SUPPORTED text_ptr->lang = NULL; text_ptr->lang_key = NULL; text_ptr->itxt_length = 0; -#endif text_ptr->text = text; text_ptr->text_length = png_strlen(text); ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); @@ -2089,9 +2103,10 @@ png_ptr->mode |= PNG_AFTER_IDAT; #ifdef PNG_MAX_MALLOC_64K /* We will no doubt have problems with chunks even half this size, but - there is no hard and fast rule to tell us where to stop. */ + * there is no hard and fast rule to tell us where to stop. + */ if (length > (png_uint_32)65535L) { png_warning(png_ptr, "zTXt chunk too large to fit in memory"); png_crc_finish(png_ptr, length); @@ -2153,13 +2168,11 @@ return; } text_ptr->compression = comp_type; text_ptr->key = png_ptr->chunkdata; -#ifdef PNG_iTXt_SUPPORTED text_ptr->lang = NULL; text_ptr->lang_key = NULL; text_ptr->itxt_length = 0; -#endif text_ptr->text = png_ptr->chunkdata + prefix_len; text_ptr->text_length = data_len; ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); @@ -2210,9 +2223,10 @@ png_ptr->mode |= PNG_AFTER_IDAT; #ifdef PNG_MAX_MALLOC_64K /* We will no doubt have problems with chunks even half this size, but - there is no hard and fast rule to tell us where to stop. */ + * there is no hard and fast rule to tell us where to stop. + */ if (length > (png_uint_32)65535L) { png_warning(png_ptr, "iTXt chunk too large to fit in memory"); png_crc_finish(png_ptr, length); @@ -2318,12 +2332,13 @@ } #endif /* This function is called when we haven't found a handler for a - chunk. If there isn't a problem with the chunk itself (ie bad - chunk name, CRC, or a critical chunk), the chunk is silently ignored - -- unless the PNG_FLAG_UNKNOWN_CHUNKS_SUPPORTED flag is on in which - case it will be saved away to be written out later. */ + * chunk. If there isn't a problem with the chunk itself (ie bad + * chunk name, CRC, or a critical chunk), the chunk is silently ignored + * -- unless the PNG_FLAG_UNKNOWN_CHUNKS_SUPPORTED flag is on in which + * case it will be saved away to be written out later. + */ void /* PRIVATE */ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) { png_uint_32 skip = 0; @@ -2433,12 +2448,13 @@ #endif } /* This function is called to verify that a chunk name is valid. - This function can't have the "critical chunk check" incorporated - into it, since in the future we will need to be able to call user - functions to handle unknown critical chunks after we check that - the chunk name itself is valid. */ + * This function can't have the "critical chunk check" incorporated + * into it, since in the future we will need to be able to call user + * functions to handle unknown critical chunks after we check that + * the chunk name itself is valid. + */ #define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97)) void /* PRIVATE */ @@ -2452,17 +2468,18 @@ } } /* Combines the row recently read in with the existing pixels in the - row. This routine takes care of alpha and transparency if requested. - This routine also handles the two methods of progressive display - of interlaced images, depending on the mask value. - The mask value describes which pixels are to be combined with - the row. The pattern always repeats every 8 pixels, so just 8 - bits are needed. A one indicates the pixel is to be combined, - a zero indicates the pixel is to be skipped. This is in addition - to any alpha or transparency value associated with the pixel. If - you want all pixels to be combined, pass 0xff (255) in mask. */ + * row. This routine takes care of alpha and transparency if requested. + * This routine also handles the two methods of progressive display + * of interlaced images, depending on the mask value. + * The mask value describes which pixels are to be combined with + * the row. The pattern always repeats every 8 pixels, so just 8 + * bits are needed. A one indicates the pixel is to be combined, + * a zero indicates the pixel is to be skipped. This is in addition + * to any alpha or transparency value associated with the pixel. If + * you want all pixels to be combined, pass 0xff (255) in mask. + */ void /* PRIVATE */ png_combine_row(png_structp png_ptr, png_bytep row, int mask) { @@ -2664,12 +2681,8 @@ } } #ifdef PNG_READ_INTERLACING_SUPPORTED -/* OLD pre-1.0.9 interface: -void png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass, - png_uint_32 transformations) - */ void /* PRIVATE */ png_do_read_interlace(png_structp png_ptr) { png_row_infop row_info = &(png_ptr->row_info); @@ -2894,9 +2907,9 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter) { png_debug(1, "in png_read_filter_row"); - png_debug2(2, "row = %lu, filter = %d", png_ptr->row_number, filter); + png_debug2(2, "row = %u, filter = %d", png_ptr->row_number, filter); switch (filter) { case PNG_FILTER_VALUE_NONE: break; @@ -3342,14 +3355,14 @@ } png_memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1); - png_debug1(3, "width = %lu,", png_ptr->width); - png_debug1(3, "height = %lu,", png_ptr->height); - png_debug1(3, "iwidth = %lu,", png_ptr->iwidth); - png_debug1(3, "num_rows = %lu,", png_ptr->num_rows); - png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes); - png_debug1(3, "irowbytes = %lu", + png_debug1(3, "width = %u,", png_ptr->width); + png_debug1(3, "height = %u,", png_ptr->height); + png_debug1(3, "iwidth = %u,", png_ptr->iwidth); + png_debug1(3, "num_rows = %u,", png_ptr->num_rows); + png_debug1(3, "rowbytes = %u,", png_ptr->rowbytes); + png_debug1(3, "irowbytes = %u", PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1); png_ptr->flags |= PNG_FLAG_ROW_INIT; } diff -ru4NwbB libpng-1.4.1/pngset.c libpng-1.5.0beta16/pngset.c --- libpng-1.4.1/pngset.c 2010-02-25 05:38:30.260562697 -0600 +++ libpng-1.5.0beta16/pngset.c 2010-04-01 07:15:53.002187488 -0500 @@ -1,8 +1,8 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.4.1 [April 1, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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.) * @@ -15,13 +15,12 @@ * into the info struct for writing into the file. This abstracts the * info struct and allows us to change the structure in the future. */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) #include "pngpriv.h" +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) + #ifdef PNG_bKGD_SUPPORTED void PNGAPI png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p background) { @@ -251,9 +250,9 @@ info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth); /* Check for potential overflow */ if (width > (PNG_UINT_32_MAX - >> 3) /* 8-byte RGBA pixels */ + >> 3) /* 8-byte RRGGBBAA pixels */ - 64 /* bigrowbuf hack */ - 1 /* filter byte */ - 7*8 /* rounding of width to multiple of 8 pixels */ - 8) /* extra max_pixel_depth pad */ @@ -747,9 +746,8 @@ (int)textp->key); png_memcpy(textp->key, text_ptr[i].key,(png_size_t)(key_len)); *(textp->key + key_len) = '\0'; -#ifdef PNG_iTXt_SUPPORTED if (text_ptr[i].compression > 0) { textp->lang = textp->key + key_len + 1; png_memcpy(textp->lang, text_ptr[i].lang, lang_len); @@ -759,14 +757,11 @@ *(textp->lang_key + lang_key_len) = '\0'; textp->text = textp->lang_key + lang_key_len + 1; } else -#endif { -#ifdef PNG_iTXt_SUPPORTED textp->lang=NULL; textp->lang_key=NULL; -#endif textp->text = textp->key + key_len + 1; } if (text_length) png_memcpy(textp->text, text_ptr[i].text, @@ -780,14 +775,11 @@ textp->itxt_length = text_length; } else #endif - { textp->text_length = text_length; -#ifdef PNG_iTXt_SUPPORTED textp->itxt_length = 0; -#endif } info_ptr->num_text++; png_debug1(3, "transferred text chunk %d", info_ptr->num_text); } diff -ru4NwbB libpng-1.4.1/pngstruct.h libpng-1.5.0beta16/pngstruct.h --- libpng-1.4.1/pngstruct.h 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta16/pngstruct.h 2010-04-01 07:15:52.898319706 -0500 @@ -0,0 +1,311 @@ + +/* pngstruct.h - header file for PNG reference library + * + * Copyright (c) 1998-2010 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.) + * + * Last changed in libpng version 1.5.0 - April 1, 2010 + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +/* The structure that holds the information to read and write PNG files. + * The only people who need to care about what is inside of this are the + * people who will be modifying the library for their own special needs. + * It should NOT be accessed directly by an application. + */ + +#ifndef PNGSTRUCT_H +#define PNGSTRUCT_H +struct png_struct_def +{ +#ifdef PNG_SETJMP_SUPPORTED + jmp_buf png_jmpbuf; /* used in png_error */ + png_longjmp_ptr longjmp_fn;/* setjmp non-local goto function. */ +#endif + png_error_ptr error_fn; /* function for printing errors and aborting */ + png_error_ptr warning_fn; /* function for printing warnings */ + 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 */ + +#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED + png_user_transform_ptr read_user_transform_fn; /* user read transform */ +#endif + +#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED + png_user_transform_ptr write_user_transform_fn; /* user write transform */ +#endif + +/* These were added in libpng-1.0.2 */ +#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) + png_voidp user_transform_ptr; /* user supplied struct for user transform */ + png_byte user_transform_depth; /* bit depth of user transformed pixels */ + png_byte user_transform_channels; /* channels in user transformed pixels */ +#endif +#endif + + png_uint_32 mode; /* tells us where we are in the PNG file */ + png_uint_32 flags; /* flags indicating various things to libpng */ + png_uint_32 transformations; /* which transformations to perform */ + + z_stream zstream; /* pointer to decompression structure (below) */ + png_bytep zbuf; /* buffer for zlib */ + png_size_t zbuf_size; /* size of zbuf */ + int zlib_level; /* holds zlib compression level */ + int zlib_method; /* holds zlib compression method */ + int zlib_window_bits; /* holds zlib compression window bits */ + int zlib_mem_level; /* holds zlib compression memory level */ + int zlib_strategy; /* holds zlib compression strategy */ + + png_uint_32 width; /* width of image in pixels */ + png_uint_32 height; /* height of image in pixels */ + png_uint_32 num_rows; /* number of rows in current pass */ + png_uint_32 usr_width; /* width of row at start of write */ + png_size_t rowbytes; /* size of row in bytes */ + png_uint_32 iwidth; /* width of current interlaced row in pixels */ + png_uint_32 row_number; /* current row in interlace pass */ + png_bytep prev_row; /* buffer to save previous (unfiltered) row */ + png_bytep row_buf; /* buffer to save current (unfiltered) row */ + png_bytep sub_row; /* buffer to save "sub" row when filtering */ + png_bytep up_row; /* buffer to save "up" row when filtering */ + png_bytep avg_row; /* buffer to save "avg" row when filtering */ + png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ + png_row_info row_info; /* used for transformation routines */ + + png_uint_32 idat_size; /* current IDAT size for read */ + png_uint_32 crc; /* current chunk CRC value */ + png_colorp palette; /* palette from the input file */ + png_uint_16 num_palette; /* number of color entries in palette */ + png_uint_16 num_trans; /* number of transparency values */ + png_byte chunk_name[5]; /* null-terminated name of current chunk */ + png_byte compression; /* file compression type (always 0) */ + png_byte filter; /* file filter type (always 0) */ + png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ + png_byte pass; /* current interlace pass (0 - 6) */ + png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ + png_byte color_type; /* color type of file */ + png_byte bit_depth; /* bit depth of file */ + png_byte usr_bit_depth; /* bit depth of users row */ + png_byte pixel_depth; /* number of bits per pixel */ + png_byte channels; /* number of channels in file */ + png_byte usr_channels; /* channels at start of write */ + png_byte sig_bytes; /* magic bytes read/written from start of file */ + +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) + png_uint_16 filler; /* filler bytes for pixel expansion */ +#endif + +#ifdef PNG_bKGD_SUPPORTED + png_byte background_gamma_type; +# ifdef PNG_FLOATING_POINT_SUPPORTED + float background_gamma; +# endif + png_color_16 background; /* background color in screen gamma space */ +#ifdef PNG_READ_GAMMA_SUPPORTED + png_color_16 background_1; /* background normalized to gamma 1.0 */ +#endif +#endif /* PNG_bKGD_SUPPORTED */ + +#ifdef PNG_WRITE_FLUSH_SUPPORTED + png_flush_ptr output_flush_fn; /* Function for flushing output */ + png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ + png_uint_32 flush_rows; /* number of rows written since last flush */ +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */ +#ifdef PNG_FLOATING_POINT_SUPPORTED + float gamma; /* file gamma value */ + float screen_gamma; /* screen gamma value (display_exponent) */ +#endif +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_bytep gamma_table; /* gamma table for 8-bit depth files */ + png_bytep gamma_from_1; /* converts from 1.0 to screen */ + png_bytep gamma_to_1; /* converts from file to 1.0 */ + png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ + png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ + png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ +#endif + +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) + png_color_8 sig_bit; /* significant bits in each available channel */ +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) + png_color_8 shift; /* shift for significant bit tranformation */ +#endif + +#if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ + || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_bytep trans_alpha; /* alpha values for paletted files */ + png_color_16 trans_color; /* transparent color for non-paletted files */ +#endif + + png_read_status_ptr read_row_fn; /* called after each row is decoded */ + png_write_status_ptr write_row_fn; /* called after each row is encoded */ +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED + png_progressive_info_ptr info_fn; /* called after header data fully read */ + png_progressive_row_ptr row_fn; /* called after each prog. row is decoded */ + png_progressive_end_ptr end_fn; /* called after image is complete */ + png_bytep save_buffer_ptr; /* current location in save_buffer */ + png_bytep save_buffer; /* buffer for previously read data */ + png_bytep current_buffer_ptr; /* current location in current_buffer */ + png_bytep current_buffer; /* buffer for recently used data */ + png_uint_32 push_length; /* size of current input chunk */ + png_uint_32 skip_length; /* bytes to skip in input data */ + png_size_t save_buffer_size; /* amount of data now in save_buffer */ + png_size_t save_buffer_max; /* total size of save_buffer */ + png_size_t buffer_size; /* total amount of available input data */ + png_size_t current_buffer_size; /* amount of data now in current_buffer */ + int process_mode; /* what push library is currently doing */ + int cur_palette; /* current push library palette index */ + +# ifdef PNG_TEXT_SUPPORTED + png_size_t current_text_size; /* current size of text input data */ + png_size_t current_text_left; /* how much text left to read in input */ + png_charp current_text; /* current text chunk buffer */ + png_charp current_text_ptr; /* current location in current_text */ +# endif /* PNG_PROGRESSIVE_READ_SUPPORTED && PNG_TEXT_SUPPORTED */ + +#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ + +#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) +/* For the Borland special 64K segment handler */ + png_bytepp offset_table_ptr; + png_bytep offset_table; + png_uint_16 offset_table_number; + png_uint_16 offset_table_count; + png_uint_16 offset_table_count_free; +#endif + +#ifdef PNG_READ_DITHER_SUPPORTED + png_bytep palette_lookup; /* lookup table for dithering */ + png_bytep dither_index; /* index translation for palette files */ +#endif + +#if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED) + png_uint_16p hist; /* histogram */ +#endif + +#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED + png_byte heuristic_method; /* heuristic for row filter selection */ + png_byte num_prev_filters; /* number of weights for previous rows */ + png_bytep prev_filters; /* filter type(s) of previous row(s) */ + png_uint_16p filter_weights; /* weight(s) for previous line(s) */ + png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ + png_uint_16p filter_costs; /* relative filter calculation cost */ + png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ +#endif + +#ifdef PNG_TIME_RFC1123_SUPPORTED + png_charp time_buffer; /* String to hold RFC 1123 time text */ +#endif + +/* New members added in libpng-1.0.6 */ + + png_uint_32 free_me; /* flags items libpng is responsible for freeing */ + +#ifdef PNG_USER_CHUNKS_SUPPORTED + png_voidp user_chunk_ptr; + png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ +#endif + +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED + int num_chunk_list; + png_bytep chunk_list; +#endif + +/* New members added in libpng-1.0.3 */ +#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED + png_byte rgb_to_gray_status; + /* These were changed from png_byte in libpng-1.0.6 */ + png_uint_16 rgb_to_gray_red_coeff; + png_uint_16 rgb_to_gray_green_coeff; + png_uint_16 rgb_to_gray_blue_coeff; +#endif + +/* New member added in libpng-1.0.4 (renamed in 1.0.9) */ +#if defined(PNG_MNG_FEATURES_SUPPORTED) || \ + 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 */ + png_uint_32 mng_features_permitted; +#endif + +/* New member added in libpng-1.0.7 */ +#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) + png_fixed_point int_gamma; +#endif + +/* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ +#ifdef PNG_MNG_FEATURES_SUPPORTED + png_byte filter_type; +#endif + +/* New members added in libpng-1.2.0 */ + +/* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ +#ifdef PNG_USER_MEM_SUPPORTED + png_voidp mem_ptr; /* user supplied struct for mem functions */ + png_malloc_ptr malloc_fn; /* function for allocating memory */ + 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 */ + +#ifdef 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_USER_LIMITS_SUPPORTED + png_uint_32 user_width_max; + png_uint_32 user_height_max; + + /* Added in libpng-1.4.0: Total number of sPLT, text, and unknown + * chunks that can be stored (0 means unlimited). + */ + png_uint_32 user_chunk_cache_max; + + /* Total memory that a zTXt, sPLT, iTXt, iCCP, or unknown chunk + * can occupy when decompressed. 0 means unlimited. + */ + png_uint_32 user_chunk_malloc_max; +#endif + +/* New member added in libpng-1.0.25 and 1.2.17 */ +#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED + /* Storage for unknown chunk that the library doesn't recognize. */ + png_unknown_chunk unknown_chunk; +#endif + +/* New members added in libpng-1.2.26 */ + png_uint_32 old_big_row_buf_size; + png_uint_32 old_prev_row_size; + +/* New member added in libpng-1.2.30 */ + png_charp chunkdata; /* buffer for reading chunk data */ + +#ifdef PNG_IO_STATE_SUPPORTED +/* New member added in libpng-1.4.0 */ + png_uint_32 io_state; +#endif +}; +#endif /* PNGSTRUCT_H */ diff -ru4NwbB libpng-1.4.1/pngtest.c libpng-1.5.0beta16/pngtest.c --- libpng-1.4.1/pngtest.c 2010-02-25 05:38:30.269808116 -0600 +++ libpng-1.5.0beta16/pngtest.c 2010-04-01 07:15:53.016825083 -0500 @@ -1,8 +1,8 @@ /* pngtest.c - a simple test program to test libpng * - * Last changed in libpng 1.4.1 [April 1, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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.) * @@ -31,9 +31,8 @@ * of files at once by typing "pngtest -m file1.png file2.png ..." */ #include "png.h" -#include "pngpriv.h" # include # include # define FCLOSE(file) fclose(file) @@ -41,13 +40,23 @@ #ifndef PNG_STDIO_SUPPORTED typedef FILE * png_FILE_p; #endif -/* Makes pngtest verbose so we can find problems (needs to be before png.h) */ +/* Makes pngtest verbose so we can find problems. */ #ifndef PNG_DEBUG # define PNG_DEBUG 0 #endif +#if PNG_DEBUG > 1 +# define pngtest_debug(m) ((void)fprintf(stderr, m "\n")) +# define pngtest_debug1(m,p1) ((void)fprintf(stderr, m "\n", p1)) +# define pngtest_debug2(m,p1,p2) ((void)fprintf(stderr, m "\n", p1, p2)) +#else +# define pngtest_debug(m) ((void)0) +# define pngtest_debug1(m,p1) ((void)0) +# define pngtest_debug2(m,p1,p2) ((void)0) +#endif + #if !PNG_DEBUG # define SINGLE_ROWBUF_ALLOC /* Makes buffer overruns easier to nail */ #endif @@ -81,13 +90,8 @@ /* Defined so I can write to a file on gui/windowing platforms */ /* #define STDERR stderr */ #define STDERR stdout /* For DOS */ -/* In case a system header (e.g., on AIX) defined jmpbuf */ -#ifdef jmpbuf -# undef jmpbuf -#endif - /* Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng */ #ifndef png_jmpbuf # define png_jmpbuf(png_ptr) png_ptr->jmpbuf #endif @@ -96,11 +100,11 @@ static int status_pass = 1; static int status_dots_requested = 0; static int status_dots = 1; -void +void PNGCBAPI read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass); -void +void PNGCBAPI read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass) { if (png_ptr == NULL || row_number > PNG_UINT_31_MAX) return; @@ -118,11 +122,11 @@ } fprintf(stdout, "r"); } -void +void PNGCBAPI write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass); -void +void PNGCBAPI write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass) { if (png_ptr == NULL || row_number > PNG_UINT_31_MAX || pass > 7) return; @@ -135,11 +139,11 @@ * but merely examine the row filters. We set this to 256 rather than * 5 in case illegal filter values are present.) */ static png_uint_32 filters_used[256]; -void +void PNGCBAPI count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data); -void +void PNGCBAPI count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data) { if (png_ptr != NULL && row_info != NULL) ++filters_used[*(data - 1)]; @@ -152,11 +156,11 @@ */ static png_uint_32 zero_samples; -void +void PNGCBAPI count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data); -void +void PNGCBAPI count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data) { png_bytep dp = data; if (png_ptr == NULL)return; @@ -263,9 +267,9 @@ * than changing the library. */ #ifndef USE_FAR_KEYWORD -static void +static void PNGCBAPI pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { png_size_t check = 0; png_voidp io_ptr; @@ -292,18 +296,18 @@ #define NEAR_BUF_SIZE 1024 #define MIN(a,b) (a <= b ? a : b) -static void +static void PNGCBAPI pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { png_size_t check; png_byte *n_data; png_FILE_p io_ptr; /* Check if data really is near. If so, use usual code. */ n_data = (png_byte *)CVT_PTR_NOCHECK(data); - io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); + io_ptr = (png_FILE_p)CVT_PTR(png_get_io_ptr(png_ptr)); if ((png_bytep)n_data == data) { check = fread(n_data, 1, length, io_ptr); } @@ -332,9 +336,9 @@ } #endif /* USE_FAR_KEYWORD */ #ifdef PNG_WRITE_FLUSH_SUPPORTED -static void +static void PNGCBAPI pngtest_flush(png_structp png_ptr) { /* Do nothing; fflush() is said to be just a waste of energy. */ png_ptr = png_ptr; /* Stifle compiler warning */ @@ -346,14 +350,14 @@ * write_data function and use it at run time with png_set_write_fn(), rather * than changing the library. */ #ifndef USE_FAR_KEYWORD -static void +static void PNGCBAPI pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length) { png_size_t check; - check = fwrite(data, 1, length, (png_FILE_p)png_ptr->io_ptr); + check = fwrite(data, 1, length, (png_FILE_p)png_get_io_ptr(png_ptr)); if (check != length) { png_error(png_ptr, "Write Error"); } @@ -366,18 +370,18 @@ #define NEAR_BUF_SIZE 1024 #define MIN(a,b) (a <= b ? a : b) -static void +static void PNGCBAPI pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length) { png_size_t check; png_byte *near_data; /* Needs to be "png_byte *" instead of "png_bytep" */ png_FILE_p io_ptr; /* Check if data really is near. If so, use usual code. */ near_data = (png_byte *)CVT_PTR_NOCHECK(data); - io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr); + io_ptr = (png_FILE_p)CVT_PTR(png_get_io_ptr(png_ptr)); if ((png_bytep)near_data == data) { check = fwrite(near_data, 1, length, io_ptr); } @@ -412,9 +416,9 @@ * it can continue anyway. Replacement functions don't have to do anything * here if you don't want to. In the default configuration, png_ptr is * not used, but it is passed in case it may be useful. */ -static void +static void PNGCBAPI pngtest_warning(png_structp png_ptr, png_const_charp message) { PNG_CONST char *name = "UNKNOWN (ERROR!)"; char *test; @@ -429,9 +433,9 @@ * this function MUST NOT RETURN, or the program will likely crash. This * function is used by default, or if the program supplies NULL for the * error function pointer in png_set_error_fn(). */ -static void +static void PNGCBAPI pngtest_error(png_structp png_ptr, png_const_charp message) { pngtest_warning(png_ptr, message); /* We can return because png_error calls the default handler, which is @@ -466,14 +470,14 @@ static int maximum_allocation = 0; static int total_allocation = 0; static int num_allocations = 0; -png_voidp png_debug_malloc - PNGARG((png_structp png_ptr, png_alloc_size_t size)); -void png_debug_free PNGARG((png_structp png_ptr, png_voidp ptr)); +png_voidp PNGCBAPI png_debug_malloc PNGARG((png_structp png_ptr, + png_alloc_size_t size)); +void PNGCBAPI png_debug_free PNGARG((png_structp png_ptr, png_voidp ptr)); png_voidp -png_debug_malloc(png_structp png_ptr, png_alloc_size_t size) +PNGCBAPI png_debug_malloc(png_structp png_ptr, png_alloc_size_t size) { /* png_malloc has already tested for NULL; png_create_struct calls * png_debug_malloc directly, with png_ptr == NULL which is OK @@ -511,16 +515,16 @@ pinformation = pinfo; /* Make sure the caller isn't assuming zeroed memory. */ png_memset(pinfo->pointer, 0xdd, pinfo->size); if (verbose) - printf("png_malloc %lu bytes at %x\n", (unsigned long)size, + printf("png_malloc %lu bytes at %p\n", (unsigned long)size, pinfo->pointer); return (png_voidp)(pinfo->pointer); } } /* Free a pointer. It is removed from the list at the same time. */ -void +void PNGCBAPI png_debug_free(png_structp png_ptr, png_voidp ptr) { if (png_ptr == NULL) fprintf(STDERR, "NULL pointer to png_debug_free.\n"); @@ -561,9 +565,9 @@ } /* Finally free the data. */ if (verbose) - printf("Freeing %x\n", ptr); + printf("Freeing %p\n", ptr); png_free_default(png_ptr, ptr); ptr = NULL; } #endif /* PNG_USER_MEM_SUPPORTED && PNG_DEBUG */ @@ -583,9 +587,9 @@ * 2: vpAg height * 3: vpAg units */ -static int read_user_chunk_callback(png_struct *png_ptr, +static int PNGCBAPI read_user_chunk_callback(png_struct *png_ptr, png_unknown_chunkp chunk) { png_uint_32 *my_user_chunk_data; @@ -660,9 +664,9 @@ int num_pass, pass; int bit_depth, color_type; #ifdef PNG_SETJMP_SUPPORTED #ifdef USE_FAR_KEYWORD - jmp_buf jmpbuf; + jmp_buf png_jmpbuf; #endif #endif char inbuf[256], outbuf[256]; @@ -681,14 +685,13 @@ FCLOSE(fpin); return (1); } - png_debug(0, "Allocating read and write structures"); + pngtest_debug("Allocating read and write structures"); #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG read_ptr = png_create_read_struct_2(PNG_LIBPNG_VER_STRING, NULL, - NULL, NULL, NULL, - (png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free); + NULL, NULL, NULL, png_debug_malloc, png_debug_free); #else read_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); #endif @@ -719,20 +722,20 @@ png_set_error_fn(write_ptr, (png_voidp)inname, pngtest_error, pngtest_warning); #endif #endif - png_debug(0, "Allocating read_info, write_info and end_info structures"); + pngtest_debug("Allocating read_info, write_info and end_info structures"); read_info_ptr = png_create_info_struct(read_ptr); end_info_ptr = png_create_info_struct(read_ptr); #ifdef PNG_WRITE_SUPPORTED write_info_ptr = png_create_info_struct(write_ptr); write_end_info_ptr = png_create_info_struct(write_ptr); #endif #ifdef PNG_SETJMP_SUPPORTED - png_debug(0, "Setting jmpbuf for read struct"); + pngtest_debug("Setting jmpbuf for read struct"); #ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) + if (setjmp(png_jmpbuf)) #else if (setjmp(png_jmpbuf(read_ptr))) #endif { @@ -748,15 +751,15 @@ FCLOSE(fpout); return (1); } #ifdef USE_FAR_KEYWORD - png_memcpy(png_jmpbuf(read_ptr), jmpbuf, png_sizeof(jmp_buf)); + png_memcpy(png_jmpbuf(read_ptr), png_jmpbuf, png_sizeof(jmp_buf)); #endif #ifdef PNG_WRITE_SUPPORTED - png_debug(0, "Setting jmpbuf for write struct"); + pngtest_debug("Setting jmpbuf for write struct"); #ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) + if (setjmp(png_jmpbuf)) #else if (setjmp(png_jmpbuf(write_ptr))) #endif { @@ -770,14 +773,14 @@ FCLOSE(fpout); return (1); } #ifdef USE_FAR_KEYWORD - png_memcpy(png_jmpbuf(write_ptr), jmpbuf, png_sizeof(jmp_buf)); + png_memcpy(png_jmpbuf(write_ptr), png_jmpbuf, png_sizeof(jmp_buf)); #endif #endif #endif - png_debug(0, "Initializing input and output streams"); + pngtest_debug("Initializing input and output streams"); #ifdef PNG_STDIO_SUPPORTED png_init_io(read_ptr, fpin); # ifdef PNG_WRITE_SUPPORTED png_init_io(write_ptr, fpout); @@ -835,12 +838,12 @@ png_set_keep_unknown_chunks(write_ptr, PNG_HANDLE_CHUNK_IF_SAFE, NULL, 0); #endif - png_debug(0, "Reading info struct"); + pngtest_debug("Reading info struct"); png_read_info(read_ptr, read_info_ptr); - png_debug(0, "Transferring info struct"); + pngtest_debug("Transferring info struct"); { int interlace_type, compression_type, filter_type; if (png_get_IHDR(read_ptr, read_info_ptr, &width, &height, &bit_depth, @@ -1025,9 +1028,9 @@ int num_text; if (png_get_text(read_ptr, read_info_ptr, &text_ptr, &num_text) > 0) { - png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks", num_text); + pngtest_debug1("Handling %d iTXt/tEXt/zTXt chunks", num_text); png_set_text(write_ptr, write_info_ptr, text_ptr, num_text); } } #endif @@ -1095,9 +1098,9 @@ } #endif #ifdef PNG_WRITE_SUPPORTED - png_debug(0, "Writing info struct"); + pngtest_debug("Writing info struct"); /* If we wanted, we could write info in two steps: * png_write_info_before_PLTE(write_ptr, write_info_ptr); */ @@ -1138,14 +1141,14 @@ #endif #endif #ifdef SINGLE_ROWBUF_ALLOC - png_debug(0, "Allocating row buffer..."); + pngtest_debug("Allocating row buffer..."); row_buf = (png_bytep)png_malloc(read_ptr, png_get_rowbytes(read_ptr, read_info_ptr)); - png_debug1(0, "0x%08lx", (unsigned long)row_buf); + pngtest_debug1("\t0x%08lx", (unsigned long)row_buf); #endif /* SINGLE_ROWBUF_ALLOC */ - png_debug(0, "Writing row data"); + pngtest_debug("Writing row data"); #if defined(PNG_READ_INTERLACING_SUPPORTED) || \ defined(PNG_WRITE_INTERLACING_SUPPORTED) num_pass = png_set_interlace_handling(read_ptr); @@ -1162,16 +1165,16 @@ t_start = t_stop; #endif for (pass = 0; pass < num_pass; pass++) { - png_debug1(0, "Writing row data for pass %d", pass); + pngtest_debug1("Writing row data for pass %d", pass); for (y = 0; y < height; y++) { #ifndef SINGLE_ROWBUF_ALLOC - png_debug2(0, "Allocating row buffer (pass %d, y = %ld)...", pass, y); + pngtest_debug2("Allocating row buffer (pass %d, y = %u)...", pass, y); row_buf = (png_bytep)png_malloc(read_ptr, png_get_rowbytes(read_ptr, read_info_ptr)); - png_debug2(0, "0x%08lx (%ld bytes)", (unsigned long)row_buf, + pngtest_debug2("\t0x%08lx (%u bytes)", (unsigned long)row_buf, png_get_rowbytes(read_ptr, read_info_ptr)); #endif /* !SINGLE_ROWBUF_ALLOC */ png_read_rows(read_ptr, (png_bytepp)&row_buf, NULL, 1); @@ -1189,9 +1192,9 @@ #endif #endif /* PNG_WRITE_SUPPORTED */ #ifndef SINGLE_ROWBUF_ALLOC - png_debug2(0, "Freeing row buffer (pass %d, y = %ld)", pass, y); + pngtest_debug2("Freeing row buffer (pass %d, y = %u)", pass, y); png_free(read_ptr, row_buf); row_buf = NULL; #endif /* !SINGLE_ROWBUF_ALLOC */ } @@ -1203,9 +1206,9 @@ #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED png_free_data(write_ptr, write_info_ptr, PNG_FREE_UNKN, -1); #endif - png_debug(0, "Reading and writing end_info data"); + pngtest_debug("Reading and writing end_info data"); png_read_end(read_ptr, end_info_ptr); #ifdef PNG_TEXT_SUPPORTED { @@ -1213,9 +1216,9 @@ int num_text; if (png_get_text(read_ptr, end_info_ptr, &text_ptr, &num_text) > 0) { - png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks", num_text); + pngtest_debug1("Handling %d iTXt/tEXt/zTXt chunks", num_text); png_set_text(write_ptr, write_end_info_ptr, text_ptr, num_text); } } #endif @@ -1274,28 +1277,28 @@ (unsigned long)iwidth, (unsigned long)iheight); } #endif - png_debug(0, "Destroying data structs"); + pngtest_debug("Destroying data structs"); #ifdef SINGLE_ROWBUF_ALLOC - png_debug(1, "destroying row_buf for read_ptr"); + pngtest_debug("destroying row_buf for read_ptr"); png_free(read_ptr, row_buf); row_buf = NULL; #endif /* SINGLE_ROWBUF_ALLOC */ - png_debug(1, "destroying read_ptr, read_info_ptr, end_info_ptr"); + pngtest_debug("destroying read_ptr, read_info_ptr, end_info_ptr"); png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); #ifdef PNG_WRITE_SUPPORTED - png_debug(1, "destroying write_end_info_ptr"); + pngtest_debug("destroying write_end_info_ptr"); png_destroy_info_struct(write_ptr, &write_end_info_ptr); - png_debug(1, "destroying write_ptr, write_info_ptr"); + pngtest_debug("destroying write_ptr, write_info_ptr"); png_destroy_write_struct(&write_ptr, &write_info_ptr); #endif - png_debug(0, "Destruction complete."); + pngtest_debug("Destruction complete."); FCLOSE(fpin); FCLOSE(fpout); - png_debug(0, "Opening files for comparison"); + pngtest_debug("Opening files for comparison"); if ((fpin = fopen(inname, "rb")) == NULL) { fprintf(STDERR, "Could not find file %s\n", inname); return (1); @@ -1390,10 +1393,8 @@ png_get_header_version(NULL)); /* Show the version of libpng used in building the application */ fprintf(STDERR, " pngtest (%lu):%s", (unsigned long)PNG_LIBPNG_VER, PNG_HEADER_VERSION_STRING); - fprintf(STDERR, " sizeof(png_struct)=%ld, sizeof(png_info)=%ld\n", - (long)png_sizeof(png_struct), (long)png_sizeof(png_info)); /* Do some consistency checking on the memory allocation settings, I'm * not sure this matters, but it is nice to know, the first of these * tests should be impossible because of the way the macros are set diff -ru4NwbB libpng-1.4.1/pngtrans.c libpng-1.5.0beta16/pngtrans.c --- libpng-1.4.1/pngtrans.c 2010-02-25 05:38:30.276418365 -0600 +++ libpng-1.5.0beta16/pngtrans.c 2010-04-01 07:15:53.023681271 -0500 @@ -1,8 +1,8 @@ /* pngtrans.c - transforms the data in a row (used by both readers and writers) * - * Last changed in libpng 1.4.0 [January 3, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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.) * @@ -10,13 +10,12 @@ * For conditions of distribution and use, see the disclaimer * and license in png.h */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) #include "pngpriv.h" +#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) + #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) /* Turn on BGR-to-RGB mapping */ void PNGAPI png_set_bgr(png_structp png_ptr) @@ -134,9 +133,9 @@ png_ptr->usr_channels = 4; } /* Also I added this in libpng-1.0.2a (what happens when we expand - * a less-than-8-bit grayscale to GA? */ + * a less-than-8-bit grayscale to GA?) */ if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY && png_ptr->bit_depth >= 8) { png_ptr->usr_channels = 2; @@ -504,20 +503,20 @@ row_info->channels == 2) { if (row_info->bit_depth == 8) { - /* This converts from GX or GA to G */ if (flags & PNG_FLAG_FILLER_AFTER) { + /* This converts from GX or GA to G */ for (i = 0; i < row_width; i++) { *dp++ = *sp++; sp++; } } - /* This converts from XG or AG to G */ else { + /* This converts from XG or AG to G */ for (i = 0; i < row_width; i++) { sp++; *dp++ = *sp++; diff -ru4NwbB libpng-1.4.1/pngwio.c libpng-1.5.0beta16/pngwio.c --- libpng-1.4.1/pngwio.c 2010-02-25 05:38:30.281788194 -0600 +++ libpng-1.5.0beta16/pngwio.c 2010-04-01 07:15:53.028836026 -0500 @@ -1,8 +1,8 @@ /* pngwio.c - functions for data output * - * Last changed in libpng 1.4.0 [January 3, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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.) * @@ -17,13 +17,12 @@ * functions, but rather write replacement functions and then change * them at run time with png_set_write_fn(...). */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED #include "pngpriv.h" +#ifdef PNG_WRITE_SUPPORTED + /* Write the data to whatever output you are using. The default routine * writes to a file pointer. Note that this routine sometimes gets called * with very small lengths, so you should implement some kind of simple * buffering if you are using unbuffered writes. This should never be asked @@ -45,9 +44,9 @@ * write_data function and use it at run time with png_set_write_fn(), rather * than changing the library. */ #ifndef USE_FAR_KEYWORD -void PNGAPI +void PNGCBAPI png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length) { png_uint_32 check; @@ -65,9 +64,9 @@ #define NEAR_BUF_SIZE 1024 #define MIN(a,b) (a <= b ? a : b) -void PNGAPI +void PNGCBAPI png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length) { png_uint_32 check; png_byte *near_data; /* Needs to be "png_byte *" instead of "png_bytep" */ @@ -123,9 +122,9 @@ (*(png_ptr->output_flush_fn))(png_ptr); } #ifdef PNG_STDIO_SUPPORTED -void PNGAPI +void PNGCBAPI png_default_flush(png_structp png_ptr) { png_FILE_p io_ptr; if (png_ptr == NULL) @@ -200,11 +199,10 @@ if (png_ptr->read_data_fn != NULL) { png_ptr->read_data_fn = NULL; png_warning(png_ptr, - "Attempted to set both read_data_fn and write_data_fn in"); - png_warning(png_ptr, - "the same structure. Resetting read_data_fn to NULL"); + "Can't set both read_data_fn and write_data_fn in the" + " same structure"); } } #ifdef USE_FAR_KEYWORD diff -ru4NwbB libpng-1.4.1/pngwrite.c libpng-1.5.0beta16/pngwrite.c --- libpng-1.4.1/pngwrite.c 2010-02-25 05:38:30.290604661 -0600 +++ libpng-1.5.0beta16/pngwrite.c 2010-04-01 07:15:53.037390463 -0500 @@ -1,8 +1,8 @@ /* pngwrite.c - general routines to write a PNG file * - * Last changed in libpng 1.4.0 [January 3, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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.) * @@ -10,14 +10,12 @@ * For conditions of distribution and use, see the disclaimer * and license in png.h */ -/* Get internal access to png.h */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED #include "pngpriv.h" +#ifdef PNG_WRITE_SUPPORTED + /* Writes all the PNG information. This is the suggested way to use the * library. If you have a new chunk to add, make a function to write it, * and put it in the correct location here. If you want the chunk written * after the image data, put it in png_write_end(). I strongly encourage @@ -475,9 +473,9 @@ #endif png_structp png_ptr; #ifdef PNG_SETJMP_SUPPORTED #ifdef USE_FAR_KEYWORD - jmp_buf jmpbuf; + jmp_buf png_jmpbuf; #endif #endif int i; @@ -502,14 +500,14 @@ /* Applications that neglect to set up their own setjmp() and then encounter a png_error() will longjmp here. Since the jmpbuf is then meaningless we abort instead of returning. */ #ifdef USE_FAR_KEYWORD - if (setjmp(jmpbuf)) + if (setjmp(png_jmpbuf)) #else if (setjmp(png_jmpbuf(png_ptr))) /* sets longjmp to match setjmp */ #endif #ifdef USE_FAR_KEYWORD - png_memcpy(png_jmpbuf(png_ptr), jmpbuf, png_sizeof(jmp_buf)); + png_memcpy(png_jmpbuf(png_ptr), png_jmpbuf, png_sizeof(jmp_buf)); #endif PNG_ABORT(); #endif @@ -538,27 +536,26 @@ if (user_png_ver == NULL || user_png_ver[0] != png_libpng_ver[0] || (user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) || (user_png_ver[0] == '0' && user_png_ver[2] < '9')) { -#ifdef PNG_STDIO_SUPPORTED +#ifdef PNG_CONSOLE_IO_SUPPORTED char msg[80]; if (user_png_ver) { - png_snprintf(msg, 80, - "Application was compiled with png.h from libpng-%.20s", - user_png_ver); - png_warning(png_ptr, msg); - } - png_snprintf(msg, 80, - "Application is running with png.c from libpng-%.20s", + png_snprintf2(msg, 80, + "Application built with libpng-%.20s" + " but running with %.20s", + user_png_ver, png_libpng_ver); png_warning(png_ptr, msg); + } +#else + png_warning(png_ptr, + "Incompatible libpng version in application and library"); #endif #ifdef PNG_ERROR_NUMBERS_SUPPORTED png_ptr->flags = 0; #endif - png_warning(png_ptr, - "Incompatible libpng version in application and library"); png_cleanup_needed = 1; } } @@ -660,9 +657,9 @@ { if (png_ptr == NULL) return; - png_debug2(1, "in png_write_row (row %ld, pass %d)", + png_debug2(1, "in png_write_row (row %u, pass %d)", png_ptr->row_number, png_ptr->pass); /* Initialize transformations and other stuff if first time */ if (png_ptr->row_number == 0 && png_ptr->pass == 0) @@ -777,13 +774,13 @@ png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, png_ptr->row_info.width); png_debug1(3, "row_info->color_type = %d", png_ptr->row_info.color_type); - png_debug1(3, "row_info->width = %lu", png_ptr->row_info.width); + png_debug1(3, "row_info->width = %u", png_ptr->row_info.width); png_debug1(3, "row_info->channels = %d", png_ptr->row_info.channels); png_debug1(3, "row_info->bit_depth = %d", png_ptr->row_info.bit_depth); png_debug1(3, "row_info->pixel_depth = %d", png_ptr->row_info.pixel_depth); - png_debug1(3, "row_info->rowbytes = %lu", png_ptr->row_info.rowbytes); + png_debug1(3, "row_info->rowbytes = %u", png_ptr->row_info.rowbytes); /* Copy user's row into buffer, leaving room for filter byte. */ png_memcpy(png_ptr->row_buf + 1, row, png_ptr->row_info.rowbytes); @@ -877,10 +874,9 @@ if (!(png_ptr->zstream.avail_out)) { /* Write the IDAT and reset the zlib output buffer */ - png_write_IDAT(png_ptr, png_ptr->zbuf, - png_ptr->zbuf_size); + png_write_IDAT(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size); png_ptr->zstream.next_out = png_ptr->zbuf; png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; wrote_IDAT = 1; } @@ -1014,9 +1010,9 @@ #endif #ifdef PNG_SETJMP_SUPPORTED /* Reset structure */ - png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf)); + png_memcpy(tmp_jmp, png_ptr->png_jmpbuf, png_sizeof(jmp_buf)); #endif error_fn = png_ptr->error_fn; warning_fn = png_ptr->warning_fn; @@ -1034,9 +1030,9 @@ png_ptr->free_fn = free_fn; #endif #ifdef PNG_SETJMP_SUPPORTED - png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf)); + png_memcpy(png_ptr->png_jmpbuf, tmp_jmp, png_sizeof(jmp_buf)); #endif } /* Allow the application to select one or more row filters to use. */ @@ -1071,11 +1067,13 @@ case PNG_FILTER_VALUE_AVG: png_ptr->do_filter = PNG_FILTER_AVG; break; case PNG_FILTER_VALUE_PAETH: png_ptr->do_filter = PNG_FILTER_PAETH; break; - default: png_ptr->do_filter = (png_byte)filters; break; + default: + png_ptr->do_filter = (png_byte)filters; break; #else - default: png_warning(png_ptr, "Unknown row filter for method 0"); + default: + png_warning(png_ptr, "Unknown row filter for method 0"); #endif /* PNG_WRITE_FILTER_SUPPORTED */ } /* If we have allocated the row_buf, this means we have already started diff -ru4NwbB libpng-1.4.1/pngwtran.c libpng-1.5.0beta16/pngwtran.c --- libpng-1.4.1/pngwtran.c 2010-02-25 05:38:30.297152013 -0600 +++ libpng-1.5.0beta16/pngwtran.c 2010-04-01 07:15:53.043555587 -0500 @@ -1,8 +1,8 @@ /* pngwtran.c - transforms the data in a row for PNG writers * - * Last changed in libpng 1.4.1 [April 1, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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.) * @@ -10,13 +10,12 @@ * For conditions of distribution and use, see the disclaimer * and license in png.h */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED #include "pngpriv.h" +#ifdef PNG_WRITE_SUPPORTED + /* Transform the data according to the user's wishes. The order of * transformations is significant. */ void /* PRIVATE */ @@ -340,11 +339,11 @@ { if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) { - /* This converts from ARGB to RGBA */ if (row_info->bit_depth == 8) { + /* This converts from ARGB to RGBA */ png_bytep sp, dp; png_uint_32 i; png_uint_32 row_width = row_info->width; for (i = 0, sp = dp = row; i < row_width; i++) @@ -355,11 +354,11 @@ *(dp++) = *(sp++); *(dp++) = save; } } - /* This converts from AARRGGBB to RRGGBBAA */ else { + /* This converts from AARRGGBB to RRGGBBAA */ png_bytep sp, dp; png_uint_32 i; png_uint_32 row_width = row_info->width; @@ -380,11 +379,11 @@ } } else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { - /* This converts from AG to GA */ if (row_info->bit_depth == 8) { + /* This converts from AG to GA */ png_bytep sp, dp; png_uint_32 i; png_uint_32 row_width = row_info->width; @@ -394,11 +393,11 @@ *(dp++) = *(sp++); *(dp++) = save; } } - /* This converts from AAGG to GGAA */ else { + /* This converts from AAGG to GGAA */ png_bytep sp, dp; png_uint_32 i; png_uint_32 row_width = row_info->width; @@ -426,11 +425,11 @@ { if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) { - /* This inverts the alpha channel in RGBA */ if (row_info->bit_depth == 8) { + /* This inverts the alpha channel in RGBA */ png_bytep sp, dp; png_uint_32 i; png_uint_32 row_width = row_info->width; for (i = 0, sp = dp = row; i < row_width; i++) @@ -443,11 +442,11 @@ sp+=3; dp = sp; *(dp++) = (png_byte)(255 - *(sp++)); } } - /* This inverts the alpha channel in RRGGBBAA */ else { + /* This inverts the alpha channel in RRGGBBAA */ png_bytep sp, dp; png_uint_32 i; png_uint_32 row_width = row_info->width; @@ -468,11 +467,11 @@ } } else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { - /* This inverts the alpha channel in GA */ if (row_info->bit_depth == 8) { + /* This inverts the alpha channel in GA */ png_bytep sp, dp; png_uint_32 i; png_uint_32 row_width = row_info->width; @@ -481,11 +480,11 @@ *(dp++) = *(sp++); *(dp++) = (png_byte)(255 - *(sp++)); } } - /* This inverts the alpha channel in GGAA */ else { + /* This inverts the alpha channel in GGAA */ png_bytep sp, dp; png_uint_32 i; png_uint_32 row_width = row_info->width; diff -ru4NwbB libpng-1.4.1/pngwutil.c libpng-1.5.0beta16/pngwutil.c --- libpng-1.4.1/pngwutil.c 2010-02-25 05:38:30.309075604 -0600 +++ libpng-1.5.0beta16/pngwutil.c 2010-04-01 07:15:53.055083754 -0500 @@ -1,8 +1,8 @@ /* pngwutil.c - utilities to write a PNG file * - * Last changed in libpng 1.4.1 [April 1, 2010] + * Last changed in libpng 1.5.0 [April 1, 2010] * Copyright (c) 1998-2010 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.) * @@ -10,13 +10,12 @@ * For conditions of distribution and use, see the disclaimer * and license in png.h */ -#define PNG_NO_PEDANTIC_WARNINGS -#include "png.h" -#ifdef PNG_WRITE_SUPPORTED #include "pngpriv.h" +#ifdef PNG_WRITE_SUPPORTED + /* Place a 32-bit number into a buffer in PNG byte order. We work * with unsigned numbers for convenience, although one supported * ancillary chunk uses signed (two's complement) numbers. */ @@ -220,9 +219,9 @@ } if (compression >= PNG_TEXT_COMPRESSION_LAST) { -#ifdef PNG_STDIO_SUPPORTED +#ifdef PNG_CONSOLE_IO_SUPPORTED char msg[50]; png_snprintf(msg, 50, "Unknown compression type %d", compression); png_warning(png_ptr, msg); #else @@ -434,10 +433,12 @@ case 1: case 2: case 4: case 8: - case 16: png_ptr->channels = 1; break; - default: png_error(png_ptr, + case 16: + png_ptr->channels = 1; break; + default: + png_error(png_ptr, "Invalid bit depth for grayscale image"); } break; case PNG_COLOR_TYPE_RGB: @@ -450,10 +451,13 @@ { case 1: case 2: case 4: - case 8: png_ptr->channels = 1; break; - default: png_error(png_ptr, "Invalid bit depth for paletted image"); + case 8: + png_ptr->channels = 1; + break; + default: + png_error(png_ptr, "Invalid bit depth for paletted image"); } break; case PNG_COLOR_TYPE_GRAY_ALPHA: if (bit_depth != 8 && bit_depth != 16) @@ -570,13 +574,16 @@ png_ptr->zlib_method, png_ptr->zlib_window_bits, png_ptr->zlib_mem_level, png_ptr->zlib_strategy); if (ret != Z_OK) { - if (ret == Z_VERSION_ERROR) png_error(png_ptr, + if (ret == Z_VERSION_ERROR) + png_error(png_ptr, "zlib failed to initialize compressor -- version error"); - if (ret == Z_STREAM_ERROR) png_error(png_ptr, + if (ret == Z_STREAM_ERROR) + png_error(png_ptr, "zlib failed to initialize compressor -- stream error"); - if (ret == Z_MEM_ERROR) png_error(png_ptr, + if (ret == Z_MEM_ERROR) + png_error(png_ptr, "zlib failed to initialize compressor -- mem error"); png_error(png_ptr, "zlib failed to initialize compressor"); } png_ptr->zstream.next_out = png_ptr->zbuf; @@ -1252,9 +1259,9 @@ { if ((png_byte)*kp < 0x20 || ((png_byte)*kp > 0x7E && (png_byte)*kp < 0xA1)) { -#ifdef PNG_STDIO_SUPPORTED +#ifdef PNG_CONSOLE_IO_SUPPORTED char msg[40]; png_snprintf(msg, 40, "invalid keyword character 0x%02X", (png_byte)*kp); @@ -1500,9 +1507,9 @@ png_write_chunk_data(png_ptr, (png_bytep)new_key, (png_size_t)(key_len + 1)); /* Set the compression flag */ - if (compression == PNG_ITXT_COMPRESSION_NONE || \ + if (compression == PNG_ITXT_COMPRESSION_NONE || compression == PNG_TEXT_COMPRESSION_NONE) cbuf[0] = 0; else /* compression == PNG_ITXT_COMPRESSION_zTXt */ cbuf[0] = 1; @@ -1571,9 +1578,10 @@ params_len = (png_uint_32p)png_malloc(png_ptr, (png_alloc_size_t)(nparams * png_sizeof(png_uint_32))); /* Find the length of each parameter, making sure we don't count the - null terminator for the last parameter. */ + * null terminator for the last parameter. + */ for (i = 0; i < nparams; i++) { params_len[i] = png_strlen(params[i]) + (i == nparams - 1 ? 0 : 1); png_debug2(3, "pCAL parameter %d length = %lu", i, @@ -2059,10 +2067,10 @@ /* Start at the beginning */ dp = row; /* Find out how many bytes each pixel takes up */ pixel_bytes = (row_info->pixel_depth >> 3); - /* Loop through the row, only looking at the pixels that - matter */ + + /* Loop through the row, only looking at the pixels that matter */ for (i = png_pass_start[pass]; i < row_width; i += png_pass_inc[pass]) { /* Find out where the original pixel is */ @@ -2152,10 +2160,9 @@ /* We don't need to test the 'no filter' case if this is the only filter * that has been chosen, as it doesn't actually do anything to the data. */ - if ((filter_to_do & PNG_FILTER_NONE) && - filter_to_do != PNG_FILTER_NONE) + if ((filter_to_do & PNG_FILTER_NONE) && filter_to_do != PNG_FILTER_NONE) { png_bytep rp; png_uint_32 sum = 0; png_uint_32 i; diff -ru4NwbB libpng-1.4.1/projects/visualc6/README.txt libpng-1.5.0beta16/projects/visualc6/README.txt --- libpng-1.4.1/projects/visualc6/README.txt 2010-02-25 05:38:32.709699497 -0600 +++ libpng-1.5.0beta16/projects/visualc6/README.txt 2010-04-01 07:15:55.857508249 -0500 @@ -32,11 +32,11 @@ This project builds the libpng binaries as follows: -* Win32_DLL_Release\libpng14.dll DLL build -* Win32_DLL_Debug\libpng14d.dll DLL build (debug version) -* Win32_DLL_VB\libpng14vb.dll DLL build for Visual Basic, using stdcall +* Win32_DLL_Release\libpng15.dll DLL build +* Win32_DLL_Debug\libpng15d.dll DLL build (debug version) +* Win32_DLL_VB\libpng15vb.dll DLL build for Visual Basic, using stdcall * Win32_LIB_Release\libpng.lib static build * Win32_LIB_Debug\libpngd.lib static build (debug version) diff -ru4NwbB libpng-1.4.1/projects/visualc6/libpng.dsp libpng-1.5.0beta16/projects/visualc6/libpng.dsp --- libpng-1.4.1/projects/visualc6/libpng.dsp 2010-02-25 05:38:32.719705133 -0600 +++ libpng-1.5.0beta16/projects/visualc6/libpng.dsp 2010-04-01 07:15:55.867402870 -0500 @@ -43,11 +43,11 @@ # PROP Intermediate_Dir "Win32_DLL_Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" CPP=cl.exe -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c +# ADD BASE CPP /nologo /MD /W3 /O2 /D "NDEBUG" /FD /c # SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "ZLIB_DLL" /FD /c # SUBTRACT CPP /YX /Yc /Yu MTL=midl.exe # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 @@ -58,9 +58,9 @@ # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /dll /machine:I386 -# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_Release\libpng14.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release" +# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_Release\libpng15.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release" !ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug" # PROP BASE Use_MFC 0 @@ -74,11 +74,11 @@ # PROP Intermediate_Dir "Win32_DLL_Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" CPP=cl.exe -# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c +# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "_DEBUG" /FD /GZ /c # SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /D "ZLIB_DLL" /FD /GZ /c # SUBTRACT CPP /YX /Yc /Yu MTL=midl.exe # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 @@ -89,9 +89,9 @@ # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 zlib1d.lib /nologo /dll /debug /machine:I386 /out:"Win32_DLL_Debug\libpng14d.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Debug" +# ADD LINK32 zlib1d.lib /nologo /dll /debug /machine:I386 /out:"Win32_DLL_Debug\libpng15d.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Debug" !ELSEIF "$(CFG)" == "libpng - Win32 DLL VB" # PROP BASE Use_MFC 0 @@ -105,11 +105,11 @@ # PROP Intermediate_Dir "Win32_DLL_VB" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" CPP=cl.exe -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c +# ADD BASE CPP /nologo /MD /W3 /O2 /D "NDEBUG" /FD /c # SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /D PNGAPI=__stdcall /D "PNG_NO_MODULEDEF" /D "PNG_LIBPNG_SPECIALBUILD" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /D "ZLIB_DLL" /D PNGAPI=__stdcall /D "PNG_NO_MODULEDEF" /D "PNG_LIBPNG_SPECIALBUILD" /FD /c # SUBTRACT CPP /YX /Yc /Yu MTL=midl.exe # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 @@ -120,12 +120,12 @@ # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /dll /machine:I386 -# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_VB\libpng14vb.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release" +# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_VB\libpng15vb.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release" # Begin Special Build Tool OutDir=.\Win32_DLL_VB -TargetName=libpng14vb +TargetName=libpng15vb SOURCE="$(InputPath)" PostBuild_Cmds=echo Deleting $(targetname) import library and export file (Not required for VB projects) del $(outdir)\$(targetname).lib del $(outdir)\$(targetname).exp # End Special Build Tool @@ -141,11 +141,11 @@ # PROP Output_Dir "Win32_LIB_Release" # PROP Intermediate_Dir "Win32_LIB_Release" # PROP Target_Dir "" CPP=cl.exe -# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c +# ADD BASE CPP /nologo /MD /W3 /O2 /D "NDEBUG" /FD /c # SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX /Yc /Yu RSC=rc.exe # ADD BASE RSC /l 0x409 /d "PNG_NO_PEDANTIC_WARNINGS" /d "NDEBUG" # ADD RSC /l 0x409 /i "..\.." /d "PNG_NO_PEDANTIC_WARNINGS" /d "NDEBUG" @@ -168,11 +168,11 @@ # PROP Output_Dir "Win32_LIB_Debug" # PROP Intermediate_Dir "Win32_LIB_Debug" # PROP Target_Dir "" CPP=cl.exe -# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c +# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "_DEBUG" /FD /GZ /c # SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /FD /GZ /c # SUBTRACT CPP /YX /Yc /Yu RSC=rc.exe # ADD BASE RSC /l 0x409 /d "PNG_NO_PEDANTIC_WARNINGS" /d "_DEBUG" # ADD RSC /l 0x409 /d "PNG_NO_PEDANTIC_WARNINGS" /d "_DEBUG" diff -ru4NwbB libpng-1.4.1/projects/visualc6/pngtest.dsp libpng-1.5.0beta16/projects/visualc6/pngtest.dsp --- libpng-1.4.1/projects/visualc6/pngtest.dsp 2010-02-25 05:38:32.729326139 -0600 +++ libpng-1.5.0beta16/projects/visualc6/pngtest.dsp 2010-04-01 07:15:55.876768674 -0500 @@ -42,20 +42,20 @@ # PROP Output_Dir "Win32_DLL_Release" # PROP Intermediate_Dir "Win32_DLL_Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c +# ADD BASE CPP /nologo /W3 /O2 /D "NDEBUG" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W3 /O2 /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_DLL" /D "PNG_NO_STDIO" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "..\..\..\zlib" /D "NDEBUG" /D "PNG_NO_STDIO" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:console /machine:I386 -# ADD LINK32 Win32_DLL_Release\libpng14.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Release\zlib1.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 Win32_DLL_Release\libpng15.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Release\zlib1.lib /nologo /subsystem:console /machine:I386 # Begin Special Build Tool OutDir=.\Win32_DLL_Release SOURCE="$(InputPath)" PostBuild_Desc=[Run Test] @@ -74,20 +74,20 @@ # PROP Output_Dir "Win32_DLL_Debug" # PROP Intermediate_Dir "Win32_DLL_Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "_DEBUG" /FD /GZ /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "PNG_DLL" /D "PNG_NO_STDIO" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\..\..\zlib" /D "_DEBUG" /D "PNG_NO_STDIO" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 Win32_DLL_Debug\libpng14d.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Debug\zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 Win32_DLL_Debug\libpng15d.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Debug\zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # Begin Special Build Tool OutDir=.\Win32_DLL_Debug SOURCE="$(InputPath)" PostBuild_Desc=[Run Test] @@ -106,11 +106,11 @@ # PROP Output_Dir "Win32_LIB_Release" # PROP Intermediate_Dir "Win32_LIB_Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c +# ADD BASE CPP /nologo /W3 /O2 /D "NDEBUG" /FD /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W3 /O2 /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "..\..\..\zlib" /D "NDEBUG" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -138,11 +138,11 @@ # PROP Output_Dir "Win32_LIB_Debug" # PROP Intermediate_Dir "Win32_LIB_Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /D "_DEBUG" /FD /GZ /c # SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\..\..\zlib" /D "_DEBUG" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff -ru4NwbB libpng-1.4.1/projects/visualc71/README.txt libpng-1.5.0beta16/projects/visualc71/README.txt --- libpng-1.4.1/projects/visualc71/README.txt 2009-11-14 06:16:20.000000000 -0600 +++ libpng-1.5.0beta16/projects/visualc71/README.txt 2010-03-16 07:37:09.354520000 -0500 @@ -4,8 +4,18 @@ This code is released under the libpng license. For conditions of distribution and use, see copyright notice in png.h +Changes in libpng 15: +* The standard calling convention (used in all builds) is __stdcall for + libpng exported functions and __cdecl for function callbacks. + Consequently the VB configuration is no longer required but is provided + in libpng15vb.dll for backward compatibility. +* The DEF file is no longer required, the DLLs link by name. A standard + DEF file, pngwin.def, is included in the distribution for applications + that require link by number (ordinal), builds that require link by + number should use the ordinals from this file (or from png.h). + Assumptions: * The libpng source files are in ..\.. * The zlib source files are in ..\..\..\zlib * The zlib project file is in . /* Warning: This is until the zlib project diff -ru4NwbB libpng-1.4.1/projects/visualc71/libpng.vcproj libpng-1.5.0beta16/projects/visualc71/libpng.vcproj --- libpng-1.4.1/projects/visualc71/libpng.vcproj 2009-12-04 07:53:56.000000000 -0600 +++ libpng-1.5.0beta16/projects/visualc71/libpng.vcproj 2010-03-14 09:03:30.512341000 -0500 @@ -10,30 +10,29 @@ + OutputFile="$(OutDir)\libpng%DLLNUM%.dll" + LinkIncremental="1"/> @@ -58,29 +57,28 @@ Name="VCAuxiliaryManagedWrapperGeneratorTool"/> @@ -106,28 +104,28 @@ Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + OutputFile="$(OutDir)\libpng.lib"/> @@ -195,28 +192,28 @@ Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + OutputFile="$(OutDir)\libpngd.lib"/> @@ -335,29 +332,8 @@ - - - - - - - - - - - @@ -401,9 +377,9 @@ + RelativePath="PRJ0041.mak"> 32-bit Borland C++ (all modules compiled in C mode) makefile.beos => beos makefile makefile.bor => Borland makefile (uses bcc) makefile.cegcc => minge32ce for Windows CE makefile - makefile.cygwin => Cygwin/gcc makefile makefile.darwin => Darwin makefile, can use on MacosX makefile.dec => DEC Alpha UNIX makefile makefile.dj2 => DJGPP 2 makefile makefile.elf => Linux/ELF makefile symbol versioning, @@ -27,14 +26,13 @@ makefile.hpux => HPUX (10.20 and 11.00) makefile makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64-bit makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static) makefile.intel => Intel C/C++ version 4.0 and later - makefile.mingw => Mingw makefile makefile.mips => MIPS makefile makefile.msc => Microsoft C makefile makefile.netbsd => NetBSD/cc makefile, makes libpng.so. makefile.openbsd => OpenBSD makefile - makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def) + makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def) makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc makefile.sggcc => Silicon Graphics (gcc, creates libpng%SONAME%.so.%SONUM%.1.5.0beta16) makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib) @@ -57,11 +55,8 @@ descrip.mms => VMS makefile for MMS or MMK libpng-config-body.in => used by several makefiles to create libpng-config libpng-config-head.in => used by several makefiles to create libpng-config libpng.pc.in => Used by several makefiles to create libpng.pc - pngos2.def => OS/2 module definition file used by makefile.os2 - pngwin.def => Module definitions for makefile.cygwin and mingw - png32ce.def => Module definition file used by makefile.cegcc pngwin.rc => Used by the visualc6 and visualc71 projects. SCOPTIONS.ppc => Used with smakefile.ppc Further information can be found in comments in the individual makefiles. diff -ru4NwbB libpng-1.4.1/scripts/checksym.awk libpng-1.5.0beta16/scripts/checksym.awk --- libpng-1.4.1/scripts/checksym.awk 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta16/scripts/checksym.awk 2010-03-16 07:37:09.371492000 -0500 @@ -0,0 +1,152 @@ +#!/bin/awk +# Check a list of symbols against the master definition +# (official) list. Arguments: +# +# awk -f checksym.awk official-def list-to-check +# +# Output is a file in the current directory called 'symbols.new', +# stdout holds error messages. Error code indicates success or +# failure. +# +# NOTE: this is a pure, old fashioned, awk script. It will +# work with any awk + +BEGIN{ + err=0 + master="" # master file + official[1] = "" # defined symbols from master file + symbol[1] = "" # defined symbols from png.h + removed[1] = "" # removed symbols from png.h + lasto = 0 # last ordinal value from png.h + mastero = 0 # highest ordinal in master file + symbolo = 0 # highest ordinal in png.h +} + +# Read existing definitions from the master file (the first +# file on the command line.) This must be a def file and it +# has definition lines (others are ignored) of the form: +# +# symbol @ordinal +# +master == "" { + master = FILENAME; +} +FILENAME==master && NF==2 && $2~/^@/ && $1!~/^;/ { + o=0+substr($2,2) + if (o >0) { + if (official[o] == "") { + official[o] = $1 + if (o > mastero) mastero = o + next + } else + print master ": duplicated symbol:", official[o] ":", $0 + } else + print master ": bad export line format:", $0 + err = 1 +} +FILENAME==master { + next +} + +# Read new definitions, these are free form but the lines must +# just be symbol definitions. Lines will be commented out for +# 'removed' symbols, introduced in png.h using PNG_REMOVED rather +# than PNG_EXPORT. Use checksym.dfn to generate the input file. +# +# symbol ordinal # two fields, exported symbol +# ; symbol ordinal # three fields, removed symbol +# ; ordinal # two fields, the last ordinal +NF==2 && $1 == ";" && $2 ~ /^[1-9][0-9]*$/ { # last ordinal + o = 0+$2 + if (lasto == 0 || lasto == o) + lasto=o + else { + print "png.h: duplicated last ordinal:", lasto, o + err = 1 + } + next +} +NF==3 && $1 == ";" && $3 ~ /^[1-9][0-9]*$/ { # removed symbol + o = 0+$3 + if (removed[o] == "" || removed[o] == $2) { + removed[o] = $2 + if (o > symbolo) symbolo = o + } else { + print "png.h: duplicated removed symbol", + o ": '" removed[o] "' != '" $2 "'" + err = 1 + } + next +} +NF==2 && $2 ~ /^[1-9][0-9]*$/ { # exported symbol + o = 0+$2 + if (symbol[o] == "" || symbol[o] == $1) { + symbol[o] = $1 + if (o > symbolo) symbolo = o + } else { + print "png.h: duplicated symbol", + o ": '" symbol[o] "' != '" $1 "'" + err = 1 + } +} +{ + next # skip all other lines +} + +# At the end check for symbols marked as both duplicated and removed +END{ + if (symbolo > lasto) { + print "highest symbol ordinal in png.h,", + symbolo ", exceeds last ordinal from png.h", lasto + err = 1 + } + if (mastero > lasto) { + print "highest symbol ordinal in", master ",", + mastero ", exceeds last ordinal from png.h", lasto + err = 1 + } + missing = 0 + for (o=1; o<=lasto; ++o) { + stop=0 + if (symbol[o] == "" && removed[o] == "") { + if (missing == 0) missing = o + if (o < lasto) continue + stop=1 + } + if (missing != 0) { + if (o-1 > missing) + print "png.h: missing symbol definitions:", missing "-" o-1 + else + print "png.h: missing symbol definition:", missing + missing = 0 + err = 1 + } + if (stop == 1) break; # lasto is missing + if (symbol[o] != "" && removed[o] != "") { + print "png.h: symbol", o, + "both exported as '" symbol[o] "' and removed as '" removed[o] "'" + err = 1 + } else if (symbol[o] != official[o]) { + # either master symbol not there or it changed + err = 1 + if (symbol[o] == "") + print "png.h: removed symbol", o, + "'" symbol[o] "' exported as '" official[o] "' in", master + else if (official[o] == "") + print "png.h: exported symbol", o, "'" symbol[o] "' not present in", + master + else + print "png.h: exported symbol", o, + "'" symbol[o] "' exists as '" official[o] "' in", master + } + + # Finally generate symbols.new + if (symbol[o] != "") + print " " symbol[o], "@" o > "symbols.new" + } + + if (err != 0) { + print "*** A new list is in symbols.new ***" + exit 1 + } +} diff -ru4NwbB libpng-1.4.1/scripts/checksym.dfn libpng-1.5.0beta16/scripts/checksym.dfn --- libpng-1.4.1/scripts/checksym.dfn 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta16/scripts/checksym.dfn 2010-04-01 07:15:55.397500101 -0500 @@ -0,0 +1,102 @@ + +/* pngwin.dfn - find all exported symbols + * + * Last changed in libpng 1.5.0 [April 1, 2010] + * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +#define PNG_EXPORT(type, name, args, attributes, ordinal)\ + PNG_DEFN_MAGIC-name ordinal-PNG_DEFN_END +#define PNG_REMOVED(type, name, args, attributes, ordinal)\ + PNG_DEFN_MAGIC-; name ordinal-PNG_DEFN_END +#define PNG_EXPORT_LAST_ORDINAL(ordinal)\ + PNG_DEFN_MAGIC-; ordinal-PNG_DEFN_END + +/* Turn on everything that we can turn on: */ +#define PNG_BENIGN_ERRORS_SUPPORTED +#define PNG_CONVERT_tIME_SUPPORTED +#define PNG_EASY_ACCESS_SUPPORTED +#define PNG_ERROR_NUMBERS_SUPPORTED +#undef PNG_FIXED_POINT_SUPPORTED /* Chose between floating and fixed */ +#define PNG_FLOATING_POINT_SUPPORTED +#define PNG_NO_USE_READ_MACROS /* Exposes no APIs if defined */ +#define PNG_GET_INT_32_SUPPORTED +#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +#define PNG_INCH_CONVERSIONS /* NOTE: no SUPPORTED! */ +#define PNG_INFO_IMAGE_SUPPORTED +#define PNG_IO_STATE_SUPPORTED +#define PNG_MNG_FEATURES_SUPPORTED +#define PNG_PROGRESSIVE_READ_SUPPORTED +#define PNG_READ_16_TO_8_SUPPORTED +#define PNG_READ_BACKGROUND_SUPPORTED +#define PNG_READ_BGR_SUPPORTED +#define PNG_READ_COMPOSITE_NODIV_SUPPORTED +#define PNG_READ_DITHER_SUPPORTED +#define PNG_READ_EXPAND_SUPPORTED +#define PNG_READ_FILLER_SUPPORTED +#define PNG_READ_GAMMA_SUPPORTED +#define PNG_READ_GRAY_TO_RGB_SUPPORTED +#define PNG_READ_INTERLACING_SUPPORTED +#define PNG_READ_INVERT_ALPHA_SUPPORTED +#define PNG_READ_INVERT_SUPPORTED +#define PNG_READ_PACKSWAP_SUPPORTED +#define PNG_READ_PACK_SUPPORTED +#define PNG_READ_RGB_TO_GRAY_SUPPORTED +#define PNG_READ_SHIFT_SUPPORTED +#define PNG_READ_STRIP_ALPHA_SUPPORTED +#define PNG_READ_SWAP_ALPHA_SUPPORTED +#define PNG_READ_SWAP_SUPPORTED +#define PNG_READ_USER_TRANSFORM_SUPPORTED +#define PNG_SEQUENTIAL_READ_SUPPORTED +#define PNG_SETJMP_SUPPORTED +#define PNG_SET_USER_LIMITS_SUPPORTED +#define PNG_STDIO_SUPPORTED +#define PNG_TEXT_SUPPORTED +#define PNG_TIME_RFC1123_SUPPORTED +#define PNG_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_USER_CHUNKS_SUPPORTED +#define PNG_USER_MEM_SUPPORTED +#define PNG_NO_ERROR_TEXT /* NOTE: no supported */ +#define PNG_WRITE_BGR_SUPPORTED +#define PNG_WRITE_FILLER_SUPPORTED +#define PNG_WRITE_FLUSH_SUPPORTED +#define PNG_WRITE_INTERLACING_SUPPORTED +#define PNG_WRITE_INVERT_ALPHA_SUPPORTED +#define PNG_WRITE_INVERT_SUPPORTED +#define PNG_WRITE_PACKSWAP_SUPPORTED +#define PNG_WRITE_PACK_SUPPORTED +#define PNG_WRITE_SHIFT_SUPPORTED +#define PNG_WRITE_SWAP_ALPHA_SUPPORTED +#define PNG_WRITE_SWAP_SUPPORTED +#define PNG_WRITE_USER_TRANSFORM_SUPPORTED +#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED +#define PNG_bKGD_SUPPORTED +#define PNG_cHRM_SUPPORTED +#define PNG_gAMA_SUPPORTED +#define PNG_hIST_SUPPORTED +#define PNG_iCCP_SUPPORTED +#define PNG_iTXt_SUPPORTED +#define PNG_oFFs_SUPPORTED +#define PNG_pCAL_SUPPORTED +#define PNG_pHYs_SUPPORTED +#define PNG_sBIT_SUPPORTED +#define PNG_sCAL_SUPPORTED +#define PNG_sPLT_SUPPORTED +#define PNG_sRGB_SUPPORTED +#define PNG_tIME_SUPPORTED +#define PNG_tRNS_SUPPORTED + +#include "../png.h" + +/* Now repeat, but toggle everything that has a #else clause */ +#define PNG_FIXED_POINT_SUPPORTED +#undef PNG_FLOATING_POINT_SUPPORTED +#define PNG_NO_FLOATING_POINT_SUPPORTED +#undef PNG_NO_ERROR_TEXT + +#undef PNG_H +#include "../png.h" diff -ru4NwbB libpng-1.4.1/scripts/def.dfn libpng-1.5.0beta16/scripts/def.dfn --- libpng-1.4.1/scripts/def.dfn 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta16/scripts/def.dfn 2010-03-16 07:37:09.387640000 -0500 @@ -0,0 +1,32 @@ + +/* def.dfn - define format of libpng.def + * + * Last changed in libpng 1.5.0 [March 12, 2010] + * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +#define PNG_EXPORT(type, name, args, attributes, ordinal)\ + PNG_DEFN_MAGIC- name @ordinal-PNG_DEFN_END +#define PNG_REMOVED(type, name, args, attributes, ordinal)\ + PNG_DEFN_MAGIC-; name @ordinal-PNG_DEFN_END + +PNG_DEFN_MAGIC-;---------------------------------------------------------------PNG_DEFN_END +PNG_DEFN_MAGIC-; LIBPNG module definition file for Windows, WindowsCE and OS/2-PNG_DEFN_END +PNG_DEFN_MAGIC-; On OS/2 uncomment lines preceded by ;0S2-PNG_DEFN_END +PNG_DEFN_MAGIC-;---------------------------------------------------------------PNG_DEFN_END +PNG_DEFN_MAGIC--PNG_DEFN_END +PNG_DEFN_MAGIC-; If you give the library an explicit name one or other files-PNG_DEFN_END +PNG_DEFN_MAGIC-; may need modifying to support the new name on one or more-PNG_DEFN_END +PNG_DEFN_MAGIC-; systems.-PNG_DEFN_END +PNG_DEFN_MAGIC-LIBRARY-PNG_DEFN_END +PNG_DEFN_MAGIC-;OS2 DESCRIPTION "PNG image compression library"-PNG_DEFN_END +PNG_DEFN_MAGIC-;OS2 CODE PRELOAD MOVEABLE DISCARDABLE-PNG_DEFN_END +PNG_DEFN_MAGIC--PNG_DEFN_END +PNG_DEFN_MAGIC-EXPORTS-PNG_DEFN_END +PNG_DEFN_MAGIC-;Version PNGLIB_VERSION-PNG_DEFN_END + +#include "../png.h" diff -ru4NwbB libpng-1.4.1/scripts/makefile.aix libpng-1.5.0beta16/scripts/makefile.aix --- libpng-1.4.1/scripts/makefile.aix 2010-02-25 05:38:32.284706311 -0600 +++ libpng-1.5.0beta16/scripts/makefile.aix 2010-04-01 07:15:55.457555056 -0500 @@ -45,9 +45,9 @@ LDDEBUG = CRELEASE = -O2 LDRELEASE = -s WARNMORE=-W -Wall -CFLAGS = -D_ALL_SOURCE -I$(ZLIBINC) $(WARNMORE) $(CRELEASE) +CFLAGS = -I$(ZLIBINC) $(WARNMORE) $(CRELEASE) LDFLAGS = -L. -L$(ZLIBLIB) -lpng%N% -lz -lm $(LDRELEASE) # File extensions O=.o diff -ru4NwbB libpng-1.4.1/scripts/makefile.cegcc libpng-1.5.0beta16/scripts/makefile.cegcc --- libpng-1.4.1/scripts/makefile.cegcc 2010-02-25 05:38:32.324428895 -0600 +++ libpng-1.5.0beta16/scripts/makefile.cegcc 2010-04-01 07:15:55.498164062 -0500 @@ -28,9 +28,9 @@ NAME = libpng PACKAGE = $(NAME)-$(VER) BIN = libpng%NN%-0.dll -LIB = libpng%NN%.a libpng%NN%.dll.a libpng.a libpng.dll.a scripts/png32ce.def +LIB = libpng%NN%.a libpng%NN%.dll.a libpng.a libpng.dll.a INCLUDE = %HEADERS% PC = libpng%NN%.pc libpng.pc MANIFESTVERBIN = "Libpng-$(VER): Binary files" @@ -63,9 +63,9 @@ @touch $(PACKAGE)-dev/manifest/$(PACKAGE)-dev.ver compilation: @echo " * Compilation of $(PACKAGE)" - cd $(PACKAGE) && CPPFLAGS="$(CPPFLAGS) -DPNG_BUILD_DLL -DPNG_CONSOLE_IO_SUPPORTED -D_WIN32_WCE=0x0420" CFLAGS="$(CFLAGS) -mms-bitfields -O3 -pipe -fomit-frame-pointer" LDFLAGS="$(LDFLAGS) -Wl,--enable-auto-import -Wl,-s" ./configure --prefix=/opt/wince --host=arm-mingw32ce && make + cd $(PACKAGE) && CPPFLAGS="$(CPPFLAGS) -DPNG_CONSOLE_IO_SUPPORTED -D_WIN32_WCE=0x0420" CFLAGS="$(CFLAGS) -mms-bitfields -O3 -pipe -fomit-frame-pointer" LDFLAGS="$(LDFLAGS) -Wl,--enable-auto-import -Wl,-s" ./configure --prefix=/opt/wince --host=arm-mingw32ce && make copy: @echo " * Copy of binary and development files" @for i in $(BIN); do \ diff -ru4NwbB libpng-1.4.1/scripts/makefile.cygwin libpng-1.5.0beta16/scripts/makefile.cygwin --- libpng-1.4.1/scripts/makefile.cygwin 2010-02-25 05:38:32.335752420 -0600 +++ libpng-1.5.0beta16/scripts/makefile.cygwin 1969-12-31 18:00:00.000000000 -0600 @@ -1,291 +0,0 @@ -# makefile for cygwin on x86 -# Builds both dll (with import lib) and static lib versions -# of the library, and builds two copies of pngtest: one -# statically linked and one dynamically linked. -# -# Copyright (C) 2002, 2006-2008 Soren Anderson, Charles Wilson, -# and Glenn Randers-Pehrson, based on makefile for linux-elf w/mmx by: -# Copyright (C) 1998-2000 Greg Roelofs -# Copyright (C) 1996, 1997 Andreas Dilger -# -# This code is released under the libpng license. -# For conditions of distribution and use, see the disclaimer -# and license in png.h - -# This makefile intends to support building outside the src directory -# if desired. When invoking it, specify an argument to SRCDIR on the -# command line that points to the top of the directory where your source -# is located. - -ifdef SRCDIR -VPATH = $(SRCDIR) -else -SRCDIR = . -endif - -# Override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. - -DESTDIR= - -CC=gcc -ifdef MINGW -MINGW_CCFLAGS=-mno-cygwin -I/usr/include/mingw -MINGW_LDFLAGS=-mno-cygwin -L/usr/lib/mingw -endif - -# Where "make install" puts libpng*.a, *png*.dll, png.h, and pngconf.h -ifndef prefix -prefix=/usr -$(warning You haven't specified a 'prefix=' location. Defaulting to "/usr") -endif -exec_prefix=$(prefix) - -# Where the zlib library and include files are located -ZLIBLIB= /usr/lib -ZLIBINC= -#ZLIBLIB=../zlib -#ZLIBINC=../zlib - -ALIGN= -# for i386: -#ALIGN=-malign-loops=2 -malign-functions=2 - -WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ - -Wmissing-declarations -Wtraditional -Wcast-align \ - -Wstrict-prototypes -Wmissing-prototypes #-Wconversion - -CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \ - -W -Wall -O3 $(ALIGN) -funroll-loops \ - -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5 - -LIBNAME = libpng%N% -PNGMAJ = %SONUM% -CYGDLL = %N% - -SHAREDLIB=cygpng$(CYGDLL).dll -STATLIB=libpng.a -IMPLIB=libpng.dll.a -SHAREDDEF=libpng.def -LIBS=$(SHAREDLIB) $(STATLIB) -EXE=.exe - -LDFLAGS=$(strip -L. $(MINGW_LDFLAGS) -lpng $(addprefix -L,$(ZLIBLIB)) -lz) -LDSFLAGS=$(strip -shared -L. $(MINGW_LDFLAGS) -Wl,--export-all) -LDEXTRA=-Wl,--out-implib=$(IMPLIB) $(addprefix -L,$(ZLIBLIB)) -lz - -MKDIR_P=/bin/mkdir -pv -RANLIB=ranlib -#RANLIB=echo - -INCPATH=$(prefix)/include -LIBPATH=$(exec_prefix)/lib - -BINPATH=$(exec_prefix)/bin -MANPATH=$(prefix)/man -MAN3PATH=$(MANPATH)/man3 -MAN5PATH=$(MANPATH)/man5 - -# cosmetic: shortened strings: -S =$(SRCDIR) -D =$(DESTDIR) -DB =$(D)$(BINPATH) -DI =$(D)$(INCPATH) -DL =$(D)$(LIBPATH) - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -OBJSDLL = $(OBJS:.o=.pic.o) - -.SUFFIXES: .c .o .pic.o - -%.o : %.c - $(CC) -c $(CFLAGS) -o $@ $< -%.pic.o : CFLAGS += -DPNG_BUILD_DLL -%.pic.o : %.c - $(CC) -c $(CFLAGS) -o $@ $< - -all: all-static all-shared libpng.pc libpng-config libpng.pc libpng-config - -# Make this to verify that "make [...] install" will do what you want. -buildsetup-tell: - @echo VPATH is set to: \"$(VPATH)\" - @echo prefix is set to: \"$(prefix)\" - @echo -e INCPATH,LIBPATH, etc. are set to:'\n' \ - $(addprefix $(D),$(INCPATH)'\n' $(LIBPATH)'\n' $(BINPATH)'\n' \ - $(MANPATH)'\n' $(MAN3PATH)'\n' $(MAN5PATH)'\n')'\n' - -libpng.pc: scripts/libpng.pc.in - @echo -e Making pkg-config file for this libpng installation..'\n' \ - using PREFIX=\"$(prefix)\"'\n' - cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \ - -e s!@exec_prefix@!$(exec_prefix)! \ - -e s!@libdir@!$(LIBPATH)! \ - -e s!@includedir@!$(INCPATH)! \ - -e s!-lpng%NN%!-lpng%NN%\ -lz! > libpng.pc - -libpng-config: scripts/libpng-config-head.in scripts/libpng-config-body.in - @echo -e Making $(LIBNAME) libpng-config file for this libpng \ - installation..'\n' using PREFIX=\"$(prefix)\"'\n' - ( cat $(S)/scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng$(CYGDLL) -lz\"; \ - cat $(S)/scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -static: all-static -shared: all-shared -all-static: $(STATLIB) pngtest-stat$(EXE) -all-shared: $(SHAREDLIB) pngtest$(EXE) - -$(STATLIB): $(OBJS) - ar rc $@ $(OBJS) - $(RANLIB) $@ - -$(SHAREDDEF): scripts/pngwin.def - cat $< | sed -e '1{G;s/^\(.*\)\(\n\)/EXPORTS/;};2,/^EXPORTS/d' | \ - sed -e 's/\([^;]*\);/;/' > $@ - -$(SHAREDLIB): $(OBJSDLL) $(SHAREDDEF) - $(CC) $(LDSFLAGS) -o $@ $(OBJSDLL) -L. $(LDEXTRA) - -pngtest$(EXE): pngtest.pic.o $(SHAREDLIB) - $(CC) $(CFLAGS) $< $(LDFLAGS) -o $@ - -pngtest-stat$(EXE): pngtest.o $(STATLIB) - $(CC) -static $(CFLAGS) $< $(LDFLAGS) -o $@ - -pngtest.pic.o: pngtest.c - $(CC) $(CFLAGS) -c $< -o $@ - -pngtest.o: pngtest.c png.h pngconf.h - $(CC) $(CFLAGS) -c $< -o $@ - -test: test-static test-shared - -test-static: pngtest-stat$(EXE) - ./pngtest-stat $(S)/pngtest.png - -test-shared: pngtest$(EXE) - ./pngtest $(S)/pngtest.png - -install-static: $(STATLIB) install-headers install-man - -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi - install -m 644 $(STATLIB) $(DL)/$(LIBNAME).a - -@rm -f $(DL)/$(STATLIB) - (cd $(DL); ln -sf $(LIBNAME).a $(STATLIB)) - -install-shared: $(SHAREDLIB) libpng.pc libpng-config install-headers install-man - -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi - -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi - -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - install -m 644 $(IMPLIB) $(DL)/$(LIBNAME).dll.a - -@rm -f $(DL)/$(IMPLIB) - (cd $(DL); ln -sf $(LIBNAME).dll.a $(IMPLIB)) - install -s -m 755 $(SHAREDLIB) $(DB) - install -m 644 libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) - -install-headers: - -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - -@rm -f $(DI)/png.h - -@rm -f $(DI)/pngconf.h - install -m 644 $(S)/png.h $(S)/pngconf.h $(DI)/$(LIBNAME) - -@rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) - -install-man: - -@if [ ! -d $(D)$(MAN3PATH) ]; then $(MKDIR_P) $(D)$(MAN3PATH); fi - -@if [ ! -d $(D)$(MAN5PATH) ]; then $(MKDIR_P) $(D)$(MAN5PATH); fi - install -m 644 $(S)/libpngpf.3 $(S)/libpng.3 $(D)$(MAN3PATH) - install -m 644 $(S)/png.5 $(D)$(MAN5PATH) - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -# Run this to verify that a future `configure' run will pick up the settings -# you want. -test-config-install: SHELL=/bin/bash -test-config-install: $(DB)/libpng-config - @echo -e Testing libpng-config functions...'\n' - @ for TYRA in LDFLAGS CPPFLAGS CFLAGS LIBS VERSION; \ - do \ - printf "(%d)\t %10s =%s\n" $$(($$gytiu + 1)) $$TYRA \ - "$$($(DB)/libpng-config `echo --$$TYRA |tr '[:upper:]' '[:lower:]'`)"; \ - gytiu=$$(( $$gytiu + 1 )); \ - done - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) $(CFLAGS) \ - `$(BINPATH)/libpng%N%-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) \ - -o pngtestd `$(BINPATH)/libpng%N%-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - $(CC) $(CFLAGS) \ - `$(BINPATH)/libpng%N%-config --cflags` pngtest.c \ - -L$(ZLIBLIB) \ - -o pngtesti$(EXE) `$(BINPATH)/libpng%N%-config --ldflags` - ./pngtesti$(EXE) pngtest.png - -clean: - /bin/rm -f *.pic.o *.o $(STATLIB) $(IMPLIB) $(SHAREDLIB) \ - pngtest-stat$(EXE) pngtest$(EXE) pngout.png $(SHAREDDEF) \ - libpng-config libpng.pc pngtesti$(EXE) - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -.PHONY: buildsetup-tell libpng.pc libpng-config test-config-install clean - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o png.pic.o: %HEADERS% png.c -pngerror.o pngerror.pic.o: %HEADERS% pngerror.c -pngrio.o pngrio.pic.o: %HEADERS% pngrio.c -pngwio.o pngwio.pic.o: %HEADERS% pngwio.c -pngmem.o pngmem.pic.o: %HEADERS% pngmem.c -pngset.o pngset.pic.o: %HEADERS% pngset.c -pngget.o pngget.pic.o: %HEADERS% pngget.c -pngread.o pngread.pic.o: %HEADERS% pngread.c -pngrtran.o pngrtran.pic.o: %HEADERS% pngrtran.c -pngrutil.o pngrutil.pic.o: %HEADERS% pngrutil.c -pngtrans.o pngtrans.pic.o: %HEADERS% pngtrans.c -pngwrite.o pngwrite.pic.o: %HEADERS% pngwrite.c -pngwtran.o pngwtran.pic.o: %HEADERS% pngwtran.c -pngwutil.o pngwutil.pic.o: %HEADERS% pngwutil.c -pngpread.o pngpread.pic.o: %HEADERS% pngpread.c - -pngtest.o: png.h pngconf.h pngtest.c -pngtest-stat.o: png.h pngconf.h pngtest.c - - - diff -ru4NwbB libpng-1.4.1/scripts/makefile.mingw libpng-1.5.0beta16/scripts/makefile.mingw --- libpng-1.4.1/scripts/makefile.mingw 2010-02-25 05:38:32.477139267 -0600 +++ libpng-1.5.0beta16/scripts/makefile.mingw 1969-12-31 18:00:00.000000000 -0600 @@ -1,282 +0,0 @@ -# makefile for mingw on x86 -# Builds both dll (with import lib) and static lib versions -# of the library, and builds two copies of pngtest: one -# statically linked and one dynamically linked. -# -# Copyright (C) 2002, 2006, 2008 Soren Anderson, Charles Wilson, -# and Glenn Randers-Pehrson, based on makefile for linux-elf w/mmx by: -# Copyright (C) 1998-2000, 2007 Greg Roelofs -# Copyright (C) 1996, 1997 Andreas Dilger -# -# This code is released under the libpng license. -# For conditions of distribution and use, see the disclaimer -# and license in png.h - -# Built from makefile.cygwin - -# This makefile expects to be run under the MSYS shell (part of -# the MINGW project) and not under CMD.EXE which does not provide -# "cat" or "sed". - -# This makefile intends to support building outside the src directory -# if desired. When invoking it, specify an argument to SRCDIR on the -# command line that points to the top of the directory where your source -# is located. -ifdef SRCDIR -VPATH = $(SRCDIR) -else -SRCDIR = . -endif - -# Override DESTDIR= on the make install command line to easily support -# installing into a temporary location. Example: -# -# make install DESTDIR=/tmp/build/libpng -# -# If you're going to install into a temporary location -# via DESTDIR, $(DESTDIR)$(prefix) must already exist before -# you execute make install. -DESTDIR= - -# If you're using a cross-compiler, add the appropriate prefix (e.g., -# "i386-mingw32msvc-") to the following three commands: -CC=gcc -AR=ar -RANLIB=ranlib - -MKDIR_P=/bin/mkdir -pv - -# Where "make install" puts libpng*.a, *png*.dll, png.h, and pngconf.h -ifndef prefix -prefix=/usr -$(warning "You haven't specified a 'prefix=' location. Defaulting to '/usr'") -endif -exec_prefix=$(prefix) - -# Where the zlib library and include files are located -ZLIBLIB= /usr/lib -ZLIBINC= - -ALIGN= -# for i386: -#ALIGN=-malign-loops=2 -malign-functions=2 - -WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \ - -Wmissing-declarations -Wtraditional -Wcast-align \ - -Wstrict-prototypes -Wmissing-prototypes #-Wconversion - -CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \ - -W -Wall -O3 $(ALIGN) -funroll-loops \ - -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5 - -LIBNAME = libpng%NN% -PNGMAJ = %SONUM% -MINGDLL = %NN% - -SHAREDLIB=libpng$(MINGDLL).dll -STATLIB=libpng.a -IMPLIB=libpng.dll.a -SHAREDDEF=libpng.def -LIBS=$(SHAREDLIB) $(STATLIB) -EXE=.exe - -LDFLAGS=$(strip -L. $(MINGW_LDFLAGS) -lpng $(addprefix -L,$(ZLIBLIB)) -lz) -LDSFLAGS=$(strip -shared -L. $(MINGW_LDFLAGS)) -LDEXTRA=-Wl,--out-implib=$(IMPLIB) $(addprefix -L,$(ZLIBLIB)) -lz - -INCPATH=$(prefix)/include -LIBPATH=$(exec_prefix)/lib - -BINPATH=$(exec_prefix)/bin -MANPATH=$(prefix)/man -MAN3PATH=$(MANPATH)/man3 -MAN5PATH=$(MANPATH)/man5 - -# cosmetic: shortened strings: -S =$(SRCDIR) -D =$(DESTDIR) -DB =$(D)$(BINPATH) -DI =$(D)$(INCPATH) -DL =$(D)$(LIBPATH) - -OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ - pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ - pngwtran.o pngmem.o pngerror.o pngpread.o - -OBJSDLL = $(OBJS:.o=.pic.o) - -.SUFFIXES: .c .o .pic.o - -%.o : %.c - $(CC) -c $(CFLAGS) -o $@ $< -%.pic.o : CFLAGS += -DPNG_BUILD_DLL -%.pic.o : %.c - $(CC) -c $(CFLAGS) -o $@ $< - -all: all-static all-shared libpng.pc libpng-config libpng.pc libpng-config - -# Make this to verify that "make [...] install" will do what you want. -buildsetup-tell: - @echo VPATH is set to: \"$(VPATH)\" - @echo prefix is set to: \"$(prefix)\" - @echo -e INCPATH,LIBPATH, etc. are set to:'\n' \ - $(addprefix $(D),$(INCPATH)'\n' $(LIBPATH)'\n' $(BINPATH)'\n' \ - $(MANPATH)'\n' $(MAN3PATH)'\n' $(MAN5PATH)'\n')'\n' - -libpng.pc: scripts/libpng.pc.in - @echo -e Making pkg-config file for this libpng installation..'\n' \ - using PREFIX=\"$(prefix)\"'\n' - cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \ - -e s!@exec_prefix@!$(exec_prefix)! \ - -e s!@libdir@!$(LIBPATH)! \ - -e s!@includedir@!$(INCPATH)! \ - -e s!@includedir@!$(INCPATH)! \ - -e s!-lpng%NN%!-lpng%NN%\ -lz\ -lm! > libpng.pc - -libpng-config: scripts/libpng-config-head.in scripts/libpng-config-body.in - @echo -e Making $(LIBNAME) libpng-config file for this libpng \ - installation..'\n' using PREFIX=\"$(prefix)\"'\n' - ( cat $(S)/scripts/libpng-config-head.in; \ - echo prefix=\"$(prefix)\"; \ - echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \ - echo L_opts=\"-L$(LIBPATH)\"; \ - echo libs=\"-lpng$(MINGDLL) -lz\"; \ - cat $(S)/scripts/libpng-config-body.in ) > libpng-config - chmod +x libpng-config - -static: all-static -shared: all-shared -all-static: $(STATLIB) pngtest-stat$(EXE) -all-shared: $(SHAREDLIB) pngtest$(EXE) - -$(STATLIB): $(OBJS) - $(AR) rc $@ $(OBJS) - $(RANLIB) $@ - -$(SHAREDDEF): scripts/pngwin.def - cat $< | sed -e '1{G;s/^\(.*\)\(\n\)/EXPORTS/;};2,/^EXPORTS/d' | \ - sed -e 's/\([^;]*\);/;/' > $@ - -$(SHAREDLIB): $(OBJSDLL) $(SHAREDDEF) - $(CC) $(LDSFLAGS) -o $@ $(OBJSDLL) -L. $(LDEXTRA) - -pngtest$(EXE): pngtest.pic.o $(SHAREDLIB) - $(CC) $(CFLAGS) $< $(LDFLAGS) -o $@ - -pngtest-stat$(EXE): pngtest.o $(STATLIB) - $(CC) -static $(CFLAGS) $< $(LDFLAGS) -o $@ - -test: test-static test-shared - -test-static: pngtest-stat$(EXE) - ./pngtest-stat $(S)/pngtest.png - -test-shared: pngtest$(EXE) - ./pngtest $(S)/pngtest.png - -install-static: $(STATLIB) install-headers install-man - -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi - install -m 644 $(STATLIB) $(DL)/$(LIBNAME).a - -@rm -f $(DL)/$(STATLIB) - (cd $(DL); ln -sf $(LIBNAME).a $(STATLIB)) - -install-shared: $(SHAREDLIB) libpng.pc libpng-config install-headers install-man - -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi - -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi - -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi - -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc - -@/bin/rm -f $(DL)/pkgconfig/libpng.pc - install -m 644 $(IMPLIB) $(DL)/$(LIBNAME).dll.a - -@rm -f $(DL)/$(IMPLIB) - (cd $(DL); ln -sf $(LIBNAME).dll.a $(IMPLIB)) - install -s -m 755 $(SHAREDLIB) $(DB) - install -m 644 libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc - (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc) - -install-headers: - -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi - -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - -@rm -f $(DI)/png.h - -@rm -f $(DI)/pngconf.h - install -m 644 $(S)/png.h $(S)/pngconf.h $(DI)/$(LIBNAME) - -@rm -f $(DI)/libpng - (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .) - -install-man: - -@if [ ! -d $(D)$(MAN3PATH) ]; then $(MKDIR_P) $(D)$(MAN3PATH); fi - -@if [ ! -d $(D)$(MAN5PATH) ]; then $(MKDIR_P) $(D)$(MAN5PATH); fi - install -m 644 $(S)/libpngpf.3 $(S)/libpng.3 $(D)$(MAN3PATH) - install -m 644 $(S)/png.5 $(D)$(MAN5PATH) - -install-config: libpng-config - -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi - -@/bin/rm -f $(DB)/libpng-config - -@/bin/rm -f $(DB)/$(LIBNAME)-config - cp libpng-config $(DB)/$(LIBNAME)-config - chmod 755 $(DB)/$(LIBNAME)-config - (cd $(DB); ln -sf $(LIBNAME)-config libpng-config) - -# Run this to verify that a future `configure' run will pick up the settings -# you want. -test-config-install: SHELL=/bin/bash -test-config-install: $(DB)/libpng-config - @echo -e Testing libpng-config functions...'\n' - @ for TYRA in LDFLAGS CPPFLAGS CFLAGS LIBS VERSION; \ - do \ - printf "(%d)\t %10s =%s\n" $$(($$gytiu + 1)) $$TYRA \ - "$$($(DB)/libpng-config `echo --$$TYRA |tr '[:upper:]' '[:lower:]'`)"; \ - gytiu=$$(( $$gytiu + 1 )); \ - done - -install: install-static install-shared install-man install-config - -# If you installed in $(DESTDIR), test-installed won't work until you -# move the library to its final location. Use test-dd to test it -# before then. - -test-dd: - echo - echo Testing installed dynamic shared library in $(DL). - $(CC) -I$(DI) $(CFLAGS) \ - `$(BINPATH)/libpng%NN%-config --cflags` pngtest.c \ - -L$(DL) -L$(ZLIBLIB) \ - -o pngtestd `$(BINPATH)/libpng%NN%-config --ldflags` - ./pngtestd pngtest.png - -test-installed: - $(CC) $(CFLAGS) \ - `$(BINPATH)/libpng%NN%-config --cflags` pngtest.c \ - -L$(ZLIBLIB) \ - -o pngtesti$(EXE) `$(BINPATH)/libpng%NN%-config --ldflags` - ./pngtesti$(EXE) pngtest.png - -clean: - /bin/rm -f *.pic.o *.o $(STATLIB) $(IMPLIB) $(SHAREDLIB) \ - pngtest-stat$(EXE) pngtest$(EXE) pngout.png $(SHAREDDEF) \ - libpng-config libpng.pc pngtesti$(EXE) - -DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO -writelock: - chmod a-w *.[ch35] $(DOCS) scripts/* - -.PHONY: buildsetup-tell libpng.pc libpng-config test-config-install clean - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -png.o png.pic.o: %HEADERS% png.c -pngerror.o pngerror.pic.o: %HEADERS% pngerror.c -pngrio.o pngrio.pic.o: %HEADERS% pngrio.c -pngwio.o pngwio.pic.o: %HEADERS% pngwio.c -pngmem.o pngmem.pic.o: %HEADERS% pngmem.c -pngset.o pngset.pic.o: %HEADERS% pngset.c -pngget.o pngget.pic.o: %HEADERS% pngget.c -pngread.o pngread.pic.o: %HEADERS% pngread.c -pngrtran.o pngrtran.pic.o: %HEADERS% pngrtran.c -pngrutil.o pngrutil.pic.o: %HEADERS% pngrutil.c -pngtrans.o pngtrans.pic.o: %HEADERS% pngtrans.c -pngwrite.o pngwrite.pic.o: %HEADERS% pngwrite.c -pngwtran.o pngwtran.pic.o: %HEADERS% pngwtran.c -pngwutil.o pngwutil.pic.o: %HEADERS% pngwutil.c -pngpread.o pngpread.pic.o: %HEADERS% pngpread.c - -pngtest.o pngtest.pic.o: png.h pngconf.h pngtest.c diff -ru4NwbB libpng-1.4.1/scripts/makefile.os2 libpng-1.5.0beta16/scripts/makefile.os2 --- libpng-1.4.1/scripts/makefile.os2 2010-02-25 05:38:32.533938333 -0600 +++ libpng-1.5.0beta16/scripts/makefile.os2 2010-04-01 07:15:55.693334577 -0500 @@ -3,9 +3,9 @@ # This code is released under the libpng license. # For conditions of distribution and use, see the disclaimer # and license in png.h -# Related files: pngos2.def +# Related files: scripts/pngwin.def CC=gcc -Zomf -s # Where the zlib library and include files are located @@ -35,12 +35,12 @@ $(PNGLIB): $(OBJS) $(AR) rc $@ $(OBJS) -$(SHAREDLIB): $(OBJS) pngos2.def +$(SHAREDLIB): $(OBJS) scripts/pngwin.def $(CC) $(LDFLAGS) -Zdll -o $@ $^ -$(SHAREDLIBIMP): pngos2.def +$(SHAREDLIBIMP): scripts/pngwin.def $(IMPLIB) -o $@ $^ pngtest.exe: pngtest.o png.dll pngdll.lib $(CC) -o $@ $(CFLAGS) $< $(LDFLAGS) diff -ru4NwbB libpng-1.4.1/scripts/png32ce.def libpng-1.5.0beta16/scripts/png32ce.def --- libpng-1.4.1/scripts/png32ce.def 2010-02-25 05:38:32.667725680 -0600 +++ libpng-1.5.0beta16/scripts/png32ce.def 1969-12-31 18:00:00.000000000 -0600 @@ -1,259 +0,0 @@ -;------------------------------------------ -; LIBPNG module definition file for Windows -;------------------------------------------ - -LIBRARY lpngce - - png_memcpy_check - png_memset_check - png_set_dither - png_read_init_3 - png_write_init_3 - png_set_strip_error_numbers - png_get_uint_32 - png_get_uint_16 - png_get_int_32 - -EXPORTS -;Version 1.5.0beta16 - png_build_grayscale_palette @1 -; png_check_sig @2 - png_chunk_error @3 - png_chunk_warning @4 -; png_convert_from_struct_tm @5 -; png_convert_from_time_t @6 - png_create_info_struct @7 - png_create_read_struct @8 - png_create_write_struct @9 - png_data_freer @10 - png_destroy_info_struct @11 - png_destroy_read_struct @12 - png_destroy_write_struct @13 - png_error @14 - png_free @15 - png_free_data @16 - png_get_IHDR @17 - png_get_PLTE @18 - png_get_bKGD @19 - png_get_bit_depth @20 - png_get_cHRM @21 - png_get_cHRM_fixed @22 - png_get_channels @23 - png_get_color_type @24 - png_get_compression_buffer_size @25 - png_get_compression_type @26 - png_get_copyright @27 - png_get_error_ptr @28 - png_get_filter_type @29 - png_get_gAMA @30 - png_get_gAMA_fixed @31 - png_get_hIST @32 - png_get_header_ver @33 - png_get_header_version @34 - png_get_iCCP @35 - png_get_image_height @36 - png_get_image_width @37 - png_get_interlace_type @38 - png_get_io_ptr @39 - png_get_libpng_ver @40 - png_get_oFFs @41 - png_get_pCAL @42 - png_get_pHYs @43 - png_get_pixel_aspect_ratio @44 - png_get_pixels_per_meter @45 - png_get_progressive_ptr @46 - png_get_rgb_to_gray_status @47 - png_get_rowbytes @48 - png_get_rows @49 - png_get_sBIT @50 - png_get_sCAL @51 - png_get_sPLT @52 - png_get_sRGB @53 - png_get_signature @54 - png_get_tIME @55 - png_get_tRNS @56 - png_get_text @57 - png_get_unknown_chunks @58 - png_get_user_chunk_ptr @59 - png_get_user_transform_ptr @60 - png_get_valid @61 - png_get_x_offset_microns @62 - png_get_x_offset_pixels @63 - png_get_x_pixels_per_meter @64 - png_get_y_offset_microns @65 - png_get_y_offset_pixels @66 - png_get_y_pixels_per_meter @67 - png_malloc @68 -; png_memcpy_check @69 -; png_memset_check @70 - png_permit_empty_plte @71 - png_process_data @72 - png_progressive_combine_row @73 - png_read_end @74 - png_read_image @75 - png_read_info @76 -; png_read_init is deprecated - png_read_init @77 - png_read_png @78 - png_read_row @79 - png_read_rows @80 - png_read_update_info @81 - png_reset_zstream @82 - png_set_IHDR @83 - png_set_PLTE @84 - png_set_bKGD @85 - png_set_background @86 - png_set_bgr @87 - png_set_cHRM @88 - png_set_cHRM_fixed @89 - png_set_compression_buffer_size @90 - png_set_compression_level @91 - png_set_compression_mem_level @92 - png_set_compression_method @93 - png_set_compression_strategy @94 - png_set_compression_window_bits @95 - png_set_crc_action @96 -; png_set_dither @97 - png_set_error_fn @98 - png_set_expand @99 - png_set_filler @100 - png_set_filter @101 - png_set_filter_heuristics @102 - png_set_flush @103 - png_set_gAMA @104 - png_set_gAMA_fixed @105 - png_set_gamma @106 - png_set_gray_1_2_4_to_8 @107 ; deprecated - png_set_gray_to_rgb @108 - png_set_hIST @109 - png_set_iCCP @110 - png_set_interlace_handling @111 - png_set_invert_alpha @112 - png_set_invert_mono @113 - png_set_keep_unknown_chunks @114 - png_set_oFFs @115 - png_set_pCAL @116 - png_set_pHYs @117 - png_set_packing @118 - png_set_packswap @119 - png_set_palette_to_rgb @120 - png_set_progressive_read_fn @121 - png_set_read_fn @122 - png_set_read_status_fn @123 - png_set_read_user_chunk_fn @124 - png_set_read_user_transform_fn @125 - png_set_rgb_to_gray @126 - png_set_rgb_to_gray_fixed @127 - png_set_rows @128 - png_set_sBIT @129 - png_set_sCAL @130 - png_set_sPLT @131 - png_set_sRGB @132 - png_set_sRGB_gAMA_and_cHRM @133 - png_set_shift @134 - png_set_sig_bytes @135 - png_set_strip_16 @136 - png_set_strip_alpha @137 - png_set_swap @138 - png_set_swap_alpha @139 - png_set_tIME @140 - png_set_tRNS @141 - png_set_tRNS_to_alpha @142 - png_set_text @143 - png_set_unknown_chunk_location @144 - png_set_unknown_chunks @145 - png_set_user_transform_info @146 - png_set_write_fn @147 - png_set_write_status_fn @148 - png_set_write_user_transform_fn @149 - png_sig_cmp @150 - png_start_read_image @151 - png_warning @152 - png_write_chunk @153 - png_write_chunk_data @154 - png_write_chunk_end @155 - png_write_chunk_start @156 - png_write_end @157 - png_write_flush @158 - png_write_image @159 - png_write_info @160 - png_write_info_before_PLTE @161 -; png_write_init is deprecated - png_write_init @162 - png_write_png @163 - png_write_row @164 - png_write_rows @165 -; png_read_init_2 and png_write_init_2 are deprecated. - png_read_init_2 @166 - png_write_init_2 @167 - png_access_version_number @168 -; png_sig_bytes @169 -; png_libpng_ver @170 - png_init_io @171 - png_convert_to_rfc1123 @172 - png_set_invalid @173 -; Added at version 1.0.12 -; For compatiblity with 1.0.7-1.0.11 - png_info_init @174 -; png_read_init_3 @175 -; png_write_init_3 @176 - png_info_init_3 @177 - png_destroy_struct @178 -; Added at version 1.2.0 -; For use with PNG_USER_MEM_SUPPORTED -; png_destroy_struct_2 @179 -; png_create_read_struct_2 @180 -; png_create_write_struct_2 @181 -; png_malloc_default @182 -; png_free_default @183 -; MNG features -; png_permit_mng_features @184 -; MMX support -; png_mmx_support @185 -; png_get_mmx_flagmask @186 -; png_get_asm_flagmask @187 -; png_get_asm_flags @188 -; png_get_mmx_bitdepth_threshold @189 -; png_get_mmx_rowbytes_threshold @190 -; png_set_asm_flags @191 -; png_init_mmx_flags @192 -; Strip error numbers -; png_set_strip_error_numbers @193 -; Added at version 1.2.2 - png_handle_as_unknown @179 - png_zalloc @180 - png_zfree @181 -; png_handle_as_unknown @194 -; png_zalloc @195 -; png_zfree @196 -; Added at version 1.2.6 - png_malloc_warn @195 - png_get_user_height_max @196 - png_get_user_width_max @197 - png_set_user_limits @198 -; Added at version 1.2.7 - png_set_add_alpha @199 -; Added at version 1.2.9 -; png_get_uint_32 @200 - png_save_uint_32 @201 -; png_get_uint_16 @202 - png_save_uint_16 @203 -; png_get_int_32 @204 - png_save_int_32 @205 - png_get_uint_31 @206 - png_set_expand_gray_1_2_4_to_8 @207 -; Added at version 1.2.41 - png_write_sig @208 - png_benign_error @209 - png_benign_chunk_error @210 - png_set_benign_error @211 - png_get_io_chunk_name @212 - png_get_io_state @213 - png_get_chunk_cache_max @215 - png_set_chunk_cache_max @216 - png_check_cHRM_fixed @217 - png_calloc @218 - png_set_longjmp_fn @219 -; Added at version 1.4.1 - png_get_chunk_malloc_max @220 - png_set_chunk_malloc_max @221 diff -ru4NwbB libpng-1.4.1/scripts/pngos2.def libpng-1.5.0beta16/scripts/pngos2.def --- libpng-1.4.1/scripts/pngos2.def 2010-02-25 05:38:32.678461726 -0600 +++ libpng-1.5.0beta16/scripts/pngos2.def 1969-12-31 18:00:00.000000000 -0600 @@ -1,253 +0,0 @@ -;---------------------------------------- -; PNG.LIB module definition file for OS/2 -;---------------------------------------- - -; Version 1.5.0beta16 - -LIBRARY PNG -DESCRIPTION "PNG image compression library for OS/2" -CODE PRELOAD MOVEABLE DISCARDABLE -DATA PRELOAD MOVEABLE MULTIPLE - -EXPORTS - - png_build_grayscale_palette - png_chunk_error - png_chunk_warning - png_convert_from_struct_tm - png_convert_from_time_t - png_create_info_struct - png_create_read_struct - png_create_write_struct - png_data_freer - png_destroy_info_struct - png_destroy_read_struct - png_destroy_write_struct - png_error - png_free - png_free_data - png_get_IHDR - png_get_PLTE - png_get_bKGD - png_get_bit_depth - png_get_cHRM - png_get_cHRM_fixed - png_get_channels - png_get_color_type - png_get_compression_buffer_size - png_get_compression_type - png_get_copyright - png_get_error_ptr - png_get_filter_type - png_get_gAMA - png_get_gAMA_fixed - png_get_hIST - png_get_header_ver - png_get_header_version - png_get_iCCP - png_get_image_height - png_get_image_width - png_get_interlace_type - png_get_io_ptr - png_get_libpng_ver - png_get_oFFs - png_get_pCAL - png_get_pHYs - png_get_pixel_aspect_ratio - png_get_pixels_per_meter - png_get_progressive_ptr - png_get_rgb_to_gray_status - png_get_rowbytes - png_get_rows - png_get_sBIT - png_get_sCAL - png_get_sPLT - png_get_sRGB - png_get_signature - png_get_tIME - png_get_tRNS - png_get_text - png_get_unknown_chunks - png_get_user_chunk_ptr - png_get_user_transform_ptr - png_get_valid - png_get_x_offset_microns - png_get_x_offset_pixels - png_get_x_pixels_per_meter - png_get_y_offset_microns - png_get_y_offset_pixels - png_get_y_pixels_per_meter - png_malloc - png_process_data - png_progressive_combine_row - png_read_end - png_read_image - png_read_info - png_read_png - png_read_row - png_read_rows - png_read_update_info - png_reset_zstream - png_set_IHDR - png_set_PLTE - png_set_bKGD - png_set_background - png_set_bgr - png_set_cHRM - png_set_cHRM_fixed - png_set_compression_buffer_size - png_set_compression_level - png_set_compression_mem_level - png_set_compression_method - png_set_compression_strategy - png_set_compression_window_bits - png_set_crc_action - png_set_error_fn - png_set_expand - png_set_filler - png_set_filter - png_set_filter_heuristics - png_set_flush - png_set_gAMA - png_set_gAMA_fixed - png_set_gamma - png_set_gray_to_rgb - png_set_hIST - png_set_iCCP - png_set_interlace_handling - png_set_invert_alpha - png_set_invert_mono - png_set_keep_unknown_chunks - png_set_oFFs - png_set_pCAL - png_set_pHYs - png_set_packing - png_set_packswap - png_set_palette_to_rgb - png_set_progressive_read_fn - png_set_read_fn - png_set_read_status_fn - png_set_read_user_chunk_fn - png_set_read_user_transform_fn - png_set_rgb_to_gray - png_set_rgb_to_gray_fixed - png_set_rows - png_set_sBIT - png_set_sCAL - png_set_sPLT - png_set_sRGB - png_set_sRGB_gAMA_and_cHRM - png_set_shift - png_set_sig_bytes - png_set_strip_16 - png_set_strip_alpha - png_set_swap - png_set_swap_alpha - png_set_tIME - png_set_tRNS - png_set_tRNS_to_alpha - png_set_text - png_set_unknown_chunk_location - png_set_unknown_chunks - png_set_user_transform_info - png_set_write_fn - png_set_write_status_fn - png_set_write_user_transform_fn - png_sig_cmp - png_start_read_image - png_warning - png_write_chunk - png_write_chunk_data - png_write_chunk_end - png_write_chunk_start - png_write_end - png_write_flush - png_write_image - png_write_info - png_write_info_before_PLTE - png_write_png - png_write_row - png_write_rows - png_write_sig - png_access_version_number - png_init_io - png_convert_to_rfc1123 - png_set_invalid - -; Added at version 1.2.0: - png_permit_empty_plte - png_permit_mng_features - -; Added at version 1.2.2: - png_handle_as_unknown - -; Added at version 1.2.2 and deleted from 1.2.3: -; png_zalloc -; png_zfree - -; Added at version 1.2.4 - png_malloc_warn - -; Added at version 1.2.6 - png_set_user_limits - png_get_user_height_max - png_get_user_width_max -; Added at version 1.2.7 - png_set_add_alpha - -; Added at version 1.2.9 - png_save_uint_32 - png_save_uint_16 - png_save_int_32 - png_get_uint_31 - png_set_expand_gray_1_2_4_to_8 - -; Added at version 1.2.41 - png_write_sig -; png_benign_error -; png_benign_chunk_error -; png_set_benign_error - png_get_io_chunk_name - png_get_io_state - png_get_chunk_cache_max - png_set_chunk_cache_max - png_check_cHRM_fixed - png_calloc - png_set_longjmp_fn -; Added at version 1.4.1 - png_get_chunk_malloc_max - png_set_chunk_malloc_max - -; These are not present when libpng is compiled with PNG_NO_GLOBAL_ARRAYS - png_libpng_ver - png_pass_start - png_pass_inc - png_pass_ystart - png_pass_yinc - png_pass_mask - png_pass_dsp_mask -; png_pass_width -; png_pass_height - -; These are not present when libpng is compiled with PNG_NO_GLOBAL_ARRAYS - png_IHDR - png_IDAT - png_IEND - png_PLTE - png_bKGD - png_cHRM - png_gAMA - png_hIST - png_iCCP - png_iTXt - png_oFFs - png_pCAL - png_pHYs - png_sBIT - png_sCAL - png_sPLT - png_sRGB - png_tEXt - png_tIME - png_tRNS - png_zTXt diff -ru4NwbB libpng-1.4.1/scripts/pngwin.def libpng-1.5.0beta16/scripts/pngwin.def --- libpng-1.4.1/scripts/pngwin.def 2010-02-25 05:38:32.689186928 -0600 +++ libpng-1.5.0beta16/scripts/pngwin.def 2010-04-01 07:15:55.826979988 -0500 @@ -1,214 +1,204 @@ -;------------------------------------------ -; LIBPNG module definition file for Windows -;------------------------------------------ +;-------------------------------------------------------------- +; LIBPNG module definition file for Windows, WindowsCE and OS/2 +; On OS/2 uncomment lines preceded by ;0S2 +;-------------------------------------------------------------- +; If you give the library an explicit name one or other files +; may need modifying to support the new name on one or more +; systems. LIBRARY +;OS2 DESCRIPTION "PNG image compression library" +;OS2 CODE PRELOAD MOVEABLE DISCARDABLE EXPORTS ;Version 1.5.0beta16 - png_build_grayscale_palette - png_chunk_error - png_chunk_warning - png_convert_from_struct_tm - png_convert_from_time_t - png_create_info_struct - png_create_read_struct - png_create_write_struct - png_data_freer - png_destroy_info_struct - png_destroy_read_struct - png_destroy_write_struct - png_error - png_free - png_free_data - png_get_IHDR - png_get_PLTE - png_get_bKGD - png_get_bit_depth - png_get_cHRM - png_get_cHRM_fixed - png_get_channels - png_get_color_type - png_get_compression_buffer_size - png_get_compression_type - png_get_copyright - png_get_error_ptr - png_get_filter_type - png_get_gAMA - png_get_gAMA_fixed - png_get_hIST - png_get_header_ver - png_get_header_version - png_get_iCCP - png_get_image_height - png_get_image_width - png_get_interlace_type - png_get_io_ptr - png_get_libpng_ver - png_get_oFFs - png_get_pCAL - png_get_pHYs - png_get_pixel_aspect_ratio - png_get_pixels_per_meter - png_get_progressive_ptr - png_get_rgb_to_gray_status - png_get_rowbytes - png_get_rows - png_get_sBIT - png_get_sCAL - png_get_sPLT - png_get_sRGB - png_get_signature - png_get_tIME - png_get_tRNS - png_get_text - png_get_unknown_chunks - png_get_user_chunk_ptr - png_get_user_transform_ptr - png_get_valid - png_get_x_offset_microns - png_get_x_offset_pixels - png_get_x_pixels_per_meter - png_get_y_offset_microns - png_get_y_offset_pixels - png_get_y_pixels_per_meter - png_malloc - png_process_data - png_progressive_combine_row - png_read_end - png_read_image - png_read_info - png_read_png - png_read_row - png_read_rows - png_read_update_info - png_reset_zstream - png_set_IHDR - png_set_PLTE - png_set_bKGD - png_set_background - png_set_bgr - png_set_cHRM - png_set_cHRM_fixed - png_set_compression_buffer_size - png_set_compression_level - png_set_compression_mem_level - png_set_compression_method - png_set_compression_strategy - png_set_compression_window_bits - png_set_crc_action - png_set_error_fn - png_set_expand - png_set_filler - png_set_filter - png_set_filter_heuristics - png_set_flush - png_set_gAMA - png_set_gAMA_fixed - png_set_gamma - png_set_gray_to_rgb - png_set_hIST - png_set_iCCP - png_set_interlace_handling - png_set_invert_alpha - png_set_invert_mono - png_set_keep_unknown_chunks - png_set_oFFs - png_set_pCAL - png_set_pHYs - png_set_packing - png_set_packswap - png_set_palette_to_rgb - png_set_progressive_read_fn - png_set_read_fn - png_set_read_status_fn - png_set_read_user_chunk_fn - png_set_read_user_transform_fn - png_set_rgb_to_gray - png_set_rgb_to_gray_fixed - png_set_rows - png_set_sBIT - png_set_sCAL - png_set_sPLT - png_set_sRGB - png_set_sRGB_gAMA_and_cHRM - png_set_shift - png_set_sig_bytes - png_set_strip_16 - png_set_strip_alpha - png_set_swap - png_set_swap_alpha - png_set_tIME - png_set_tRNS - png_set_tRNS_to_alpha - png_set_text - png_set_unknown_chunk_location - png_set_unknown_chunks - png_set_user_transform_info - png_set_write_fn - png_set_write_status_fn - png_set_write_user_transform_fn - png_sig_cmp - png_start_read_image - png_warning - png_write_chunk - png_write_chunk_data - png_write_chunk_end - png_write_chunk_start - png_write_end - png_write_flush - png_write_image - png_write_info - png_write_info_before_PLTE - png_write_png - png_write_row - png_write_rows - png_access_version_number - png_init_io - png_convert_to_rfc1123 - png_set_invalid -; Added at version 1.0.12 - png_info_init_3 - png_destroy_struct -; Added at version 1.2.0 -; For use with PNG_USER_MEM_SUPPORTED - png_destroy_struct_2 - png_create_read_struct_2 - png_create_write_struct_2 - png_malloc_default - png_free_default -; MNG features - png_permit_mng_features -; Added at version 1.2.2 - png_handle_as_unknown -; Added at version 1.2.2 and deleted from 1.2.3 -; png_zalloc -; png_zfree -; Added at version 1.2.4 - png_malloc_warn - png_get_user_height_max - png_get_user_width_max - png_set_user_limits -; Added at version 1.2.7 - png_set_add_alpha -; Added at version 1.2.9 - png_save_uint_32 - png_save_uint_16 - png_save_int_32 - png_get_uint_31 - png_set_expand_gray_1_2_4_to_8 -; Added at version 1.2.41 - png_write_sig -; png_benign_error -; png_benign_chunk_error -; png_set_benign_error - png_get_io_chunk_name - png_get_io_state - png_get_chunk_cache_max - png_set_chunk_cache_max - png_check_cHRM_fixed - png_calloc - png_set_longjmp_fn -; Added at version 1.4.1 - png_get_chunk_malloc_max - png_set_chunk_malloc_max + png_access_version_number @1 + png_set_sig_bytes @2 + png_sig_cmp @3 + png_create_read_struct @4 + png_create_write_struct @5 + png_get_compression_buffer_size @6 + png_set_compression_buffer_size @7 + png_set_longjmp_fn @8 + png_longjmp @9 + png_reset_zstream @10 + png_create_read_struct_2 @11 + png_create_write_struct_2 @12 + png_write_sig @13 + png_write_chunk @14 + png_write_chunk_start @15 + png_write_chunk_data @16 + png_write_chunk_end @17 + png_create_info_struct @18 + png_info_init_3 @19 + png_write_info_before_PLTE @20 + png_write_info @21 + png_read_info @22 + png_convert_to_rfc1123 @23 + png_convert_from_struct_tm @24 + png_convert_from_time_t @25 + png_set_expand @26 + png_set_expand_gray_1_2_4_to_8 @27 + png_set_palette_to_rgb @28 + png_set_tRNS_to_alpha @29 + png_set_bgr @30 + png_set_gray_to_rgb @31 + png_set_rgb_to_gray @32 + png_set_rgb_to_gray_fixed @33 + png_get_rgb_to_gray_status @34 + png_build_grayscale_palette @35 + png_set_strip_alpha @36 + png_set_swap_alpha @37 + png_set_invert_alpha @38 + png_set_filler @39 + png_set_add_alpha @40 + png_set_swap @41 + png_set_packing @42 + png_set_packswap @43 + png_set_shift @44 + png_set_interlace_handling @45 + png_set_invert_mono @46 + png_set_background @47 + png_set_strip_16 @48 + png_set_gamma @50 + png_set_flush @51 + png_write_flush @52 + png_start_read_image @53 + png_read_update_info @54 + png_read_rows @55 + png_read_row @56 + png_read_image @57 + png_write_row @58 + png_write_rows @59 + png_write_image @60 + png_write_end @61 + png_read_end @62 + png_destroy_info_struct @63 + png_destroy_read_struct @64 + png_destroy_write_struct @65 + png_set_crc_action @66 + png_set_filter @67 + png_set_filter_heuristics @68 + png_set_compression_level @69 + png_set_compression_mem_level @70 + png_set_compression_strategy @71 + png_set_compression_window_bits @72 + png_set_compression_method @73 + png_init_io @74 + png_set_error_fn @75 + png_get_error_ptr @76 + png_set_write_fn @77 + png_set_read_fn @78 + png_get_io_ptr @79 + png_set_read_status_fn @80 + png_set_write_status_fn @81 + png_set_mem_fn @82 + png_get_mem_ptr @83 + png_set_read_user_transform_fn @84 + png_set_write_user_transform_fn @85 + png_set_user_transform_info @86 + png_get_user_transform_ptr @87 + png_set_read_user_chunk_fn @88 + png_get_user_chunk_ptr @89 + png_set_progressive_read_fn @90 + png_get_progressive_ptr @91 + png_process_data @92 + png_progressive_combine_row @93 + png_malloc @94 + png_calloc @95 + png_malloc_warn @96 + png_free @97 + png_free_data @98 + png_data_freer @99 + png_malloc_default @100 + png_free_default @101 + png_error @102 + png_chunk_error @103 + png_warning @105 + png_chunk_warning @106 + png_get_valid @110 + png_get_rowbytes @111 + png_get_rows @112 + png_set_rows @113 + png_get_channels @114 + png_get_image_width @115 + png_get_image_height @116 + png_get_bit_depth @117 + png_get_color_type @118 + png_get_filter_type @119 + png_get_interlace_type @120 + png_get_compression_type @121 + png_get_pixels_per_meter @122 + png_get_x_pixels_per_meter @123 + png_get_y_pixels_per_meter @124 + png_get_pixel_aspect_ratio @125 + png_get_x_offset_pixels @126 + png_get_y_offset_pixels @127 + png_get_x_offset_microns @128 + png_get_y_offset_microns @129 + png_get_signature @130 + png_get_bKGD @131 + png_set_bKGD @132 + png_get_cHRM @133 + png_get_cHRM_fixed @134 + png_set_cHRM @135 + png_set_cHRM_fixed @136 + png_get_gAMA @137 + png_get_gAMA_fixed @138 + png_set_gAMA @139 + png_set_gAMA_fixed @140 + png_get_hIST @141 + png_set_hIST @142 + png_get_IHDR @143 + png_set_IHDR @144 + png_get_oFFs @145 + png_set_oFFs @146 + png_get_pCAL @147 + png_set_pCAL @148 + png_get_pHYs @149 + png_set_pHYs @150 + png_get_PLTE @151 + png_set_PLTE @152 + png_get_sBIT @153 + png_set_sBIT @154 + png_get_sRGB @155 + png_set_sRGB @156 + png_set_sRGB_gAMA_and_cHRM @157 + png_get_iCCP @158 + png_set_iCCP @159 + png_get_sPLT @160 + png_set_sPLT @161 + png_get_text @162 + png_set_text @163 + png_get_tIME @164 + png_set_tIME @165 + png_get_tRNS @166 + png_set_tRNS @167 + png_get_sCAL @168 + png_set_sCAL @170 + png_set_keep_unknown_chunks @172 + png_handle_as_unknown @173 + png_set_unknown_chunks @174 + png_set_unknown_chunk_location @175 + png_get_unknown_chunks @176 + png_set_invalid @177 + png_read_png @178 + png_write_png @179 + png_get_copyright @180 + png_get_header_ver @181 + png_get_header_version @182 + png_get_libpng_ver @183 + png_permit_mng_features @184 + png_set_user_limits @186 + png_get_user_width_max @187 + png_get_user_height_max @188 + png_set_chunk_cache_max @189 + png_get_chunk_cache_max @190 + png_set_chunk_malloc_max @191 + png_get_chunk_malloc_max @192 + png_get_io_state @199 + png_get_io_chunk_name @200 + png_get_uint_31 @204 + png_save_uint_32 @205 + png_save_int_32 @206 + png_save_uint_16 @207 diff -ru4NwbB libpng-1.4.1/scripts/sym.dfn libpng-1.5.0beta16/scripts/sym.dfn --- libpng-1.4.1/scripts/sym.dfn 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta16/scripts/sym.dfn 2010-03-12 20:34:30.144744000 -0600 @@ -0,0 +1,15 @@ + +/* sym.dfn - define format of libpng.sym + * + * Last changed in libpng 1.5.0 [March 12, 2010] + * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +#define PNG_EXPORT(type, name, args, attributes, ordinal)\ + PNG_DEFN_MAGIC-SYMBOL_PREFIX @@@ name-PNG_DEFN_END + +#include "../png.h" diff -ru4NwbB libpng-1.4.1/scripts/symbols.def libpng-1.5.0beta16/scripts/symbols.def --- libpng-1.4.1/scripts/symbols.def 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta16/scripts/symbols.def 2010-04-01 07:15:55.837246929 -0500 @@ -0,0 +1,215 @@ +;-------------------------------------------------------------- +; LIBPNG symbol list as a WIn32 DEF file +; Contains all the symbols that can be exported from libpng +;-------------------------------------------------------------- +LIBRARY + +EXPORTS +;Version 1.5.0beta16 + png_access_version_number @1 + png_set_sig_bytes @2 + png_sig_cmp @3 + png_create_read_struct @4 + png_create_write_struct @5 + png_get_compression_buffer_size @6 + png_set_compression_buffer_size @7 + png_set_longjmp_fn @8 + png_longjmp @9 + png_reset_zstream @10 + png_create_read_struct_2 @11 + png_create_write_struct_2 @12 + png_write_sig @13 + png_write_chunk @14 + png_write_chunk_start @15 + png_write_chunk_data @16 + png_write_chunk_end @17 + png_create_info_struct @18 + png_info_init_3 @19 + png_write_info_before_PLTE @20 + png_write_info @21 + png_read_info @22 + png_convert_to_rfc1123 @23 + png_convert_from_struct_tm @24 + png_convert_from_time_t @25 + png_set_expand @26 + png_set_expand_gray_1_2_4_to_8 @27 + png_set_palette_to_rgb @28 + png_set_tRNS_to_alpha @29 + png_set_bgr @30 + png_set_gray_to_rgb @31 + png_set_rgb_to_gray @32 + png_set_rgb_to_gray_fixed @33 + png_get_rgb_to_gray_status @34 + png_build_grayscale_palette @35 + png_set_strip_alpha @36 + png_set_swap_alpha @37 + png_set_invert_alpha @38 + png_set_filler @39 + png_set_add_alpha @40 + png_set_swap @41 + png_set_packing @42 + png_set_packswap @43 + png_set_shift @44 + png_set_interlace_handling @45 + png_set_invert_mono @46 + png_set_background @47 + png_set_strip_16 @48 + png_set_dither @49 + png_set_gamma @50 + png_set_flush @51 + png_write_flush @52 + png_start_read_image @53 + png_read_update_info @54 + png_read_rows @55 + png_read_row @56 + png_read_image @57 + png_write_row @58 + png_write_rows @59 + png_write_image @60 + png_write_end @61 + png_read_end @62 + png_destroy_info_struct @63 + png_destroy_read_struct @64 + png_destroy_write_struct @65 + png_set_crc_action @66 + png_set_filter @67 + png_set_filter_heuristics @68 + png_set_compression_level @69 + png_set_compression_mem_level @70 + png_set_compression_strategy @71 + png_set_compression_window_bits @72 + png_set_compression_method @73 + png_init_io @74 + png_set_error_fn @75 + png_get_error_ptr @76 + png_set_write_fn @77 + png_set_read_fn @78 + png_get_io_ptr @79 + png_set_read_status_fn @80 + png_set_write_status_fn @81 + png_set_mem_fn @82 + png_get_mem_ptr @83 + png_set_read_user_transform_fn @84 + png_set_write_user_transform_fn @85 + png_set_user_transform_info @86 + png_get_user_transform_ptr @87 + png_set_read_user_chunk_fn @88 + png_get_user_chunk_ptr @89 + png_set_progressive_read_fn @90 + png_get_progressive_ptr @91 + png_process_data @92 + png_progressive_combine_row @93 + png_malloc @94 + png_calloc @95 + png_malloc_warn @96 + png_free @97 + png_free_data @98 + png_data_freer @99 + png_malloc_default @100 + png_free_default @101 + png_error @102 + png_chunk_error @103 + png_err @104 + png_warning @105 + png_chunk_warning @106 + png_benign_error @107 + png_chunk_benign_error @108 + png_set_benign_errors @109 + png_get_valid @110 + png_get_rowbytes @111 + png_get_rows @112 + png_set_rows @113 + png_get_channels @114 + png_get_image_width @115 + png_get_image_height @116 + png_get_bit_depth @117 + png_get_color_type @118 + png_get_filter_type @119 + png_get_interlace_type @120 + png_get_compression_type @121 + png_get_pixels_per_meter @122 + png_get_x_pixels_per_meter @123 + png_get_y_pixels_per_meter @124 + png_get_pixel_aspect_ratio @125 + png_get_x_offset_pixels @126 + png_get_y_offset_pixels @127 + png_get_x_offset_microns @128 + png_get_y_offset_microns @129 + png_get_signature @130 + png_get_bKGD @131 + png_set_bKGD @132 + png_get_cHRM @133 + png_get_cHRM_fixed @134 + png_set_cHRM @135 + png_set_cHRM_fixed @136 + png_get_gAMA @137 + png_get_gAMA_fixed @138 + png_set_gAMA @139 + png_set_gAMA_fixed @140 + png_get_hIST @141 + png_set_hIST @142 + png_get_IHDR @143 + png_set_IHDR @144 + png_get_oFFs @145 + png_set_oFFs @146 + png_get_pCAL @147 + png_set_pCAL @148 + png_get_pHYs @149 + png_set_pHYs @150 + png_get_PLTE @151 + png_set_PLTE @152 + png_get_sBIT @153 + png_set_sBIT @154 + png_get_sRGB @155 + png_set_sRGB @156 + png_set_sRGB_gAMA_and_cHRM @157 + png_get_iCCP @158 + png_set_iCCP @159 + png_get_sPLT @160 + png_set_sPLT @161 + png_get_text @162 + png_set_text @163 + png_get_tIME @164 + png_set_tIME @165 + png_get_tRNS @166 + png_set_tRNS @167 + png_get_sCAL @168 + png_get_sCAL_s @169 + png_set_sCAL @170 + png_set_sCAL_s @171 + png_set_keep_unknown_chunks @172 + png_handle_as_unknown @173 + png_set_unknown_chunks @174 + png_set_unknown_chunk_location @175 + png_get_unknown_chunks @176 + png_set_invalid @177 + png_read_png @178 + png_write_png @179 + png_get_copyright @180 + png_get_header_ver @181 + png_get_header_version @182 + png_get_libpng_ver @183 + png_permit_mng_features @184 + png_set_strip_error_numbers @185 + png_set_user_limits @186 + png_get_user_width_max @187 + png_get_user_height_max @188 + png_set_chunk_cache_max @189 + png_get_chunk_cache_max @190 + png_set_chunk_malloc_max @191 + png_get_chunk_malloc_max @192 + png_get_pixels_per_inch @193 + png_get_x_pixels_per_inch @194 + png_get_y_pixels_per_inch @195 + png_get_x_offset_inches @196 + png_get_y_offset_inches @197 + png_get_pHYs_dpi @198 + png_get_io_state @199 + png_get_io_chunk_name @200 + png_get_uint_32 @201 + png_get_uint_16 @202 + png_get_int_32 @203 + png_get_uint_31 @204 + png_save_uint_32 @205 + png_save_int_32 @206 + png_save_uint_16 @207 diff -ru4NwbB libpng-1.4.1/scripts/vers.dfn libpng-1.5.0beta16/scripts/vers.dfn --- libpng-1.4.1/scripts/vers.dfn 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta16/scripts/vers.dfn 2010-03-12 20:34:39.187831000 -0600 @@ -0,0 +1,26 @@ + +/* vers.dfn - define format of libpng.vers + * + * Last changed in libpng 1.5.0 [March 12, 2010] + * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + */ + +#define HEADER PNG_DEFN_MAGIC-PNGLIB_LIBNAME {global:-PNG_DEFN_END + +/* NOTE: @@@ is interpreted by the calling script as a signal to + * join the two things on either side, so we can do symbol + * substitution within the name, regular C ## joins the pp-tokens, + * not their final values. + */ +#define PNG_EXPORT(type, name, args, attributes, ordinal)\ + PNG_DEFN_MAGIC- SYMBOL_PREFIX @@@ name;-PNG_DEFN_END + +#define TRAILER PNG_DEFN_MAGIC-local: *; };-PNG_DEFN_END + +HEADER +#include "../png.h" +TRAILER