diff -ru4NwbB libpng-1.4.1/Makefile.am libpng-1.5.0beta18/Makefile.am --- libpng-1.4.1/Makefile.am 2010-02-25 05:38:36.627740466 -0600 +++ libpng-1.5.0beta18/Makefile.am 2010-04-17 19:08:02.947287232 -0500 @@ -4,9 +4,9 @@ PNGLIB_BASENAME= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ # libpng does not follow GNU file name conventions -AUTOMAKE_OPTIONS = foreign +AUTOMAKE_OPTIONS = foreign color-tests # test programs - run on make check, make distcheck check_PROGRAMS= pngtest pngtest_SOURCES = pngtest.c @@ -28,9 +28,11 @@ 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 pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h + +nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_CPPFLAGS = @LIBPNG_DEFINES@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \ @@ -45,14 +47,12 @@ 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 +nodist_pkginclude_HEADERS= pnglibconf.h # pkg-config stuff, note that libpng.pc is always required in order # to get the correct library pkgconfigdir = @pkgconfigdir@ @@ -61,9 +61,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,46 +71,116 @@ ${srcdir}/contrib/pngminus/* \ ${srcdir}/contrib/pngsuite/* \ ${srcdir}/contrib/visupng/* \ $(TESTS) \ - example.c libpng-1.5.0beta18.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 +SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk scripts/pnglibconf.dfn + +CLEANFILES= dfn.c dfn?.out pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \ + libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \ + pngwin.def check.new pnglibconf.* symbols.new \ + $(SCRIPT_CLEANFILES) MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \ config.sub configure depcomp install-sh ltmain.sh missing +SUFFIXES = .chk .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: png.h pngconf.h pnglibconf.h +scripts/symbols.out scripts/pngwin.out: png.h pngconf.h scripts/pnglibconf.h -test: check +libpng.sym: scripts/sym.out + rm -f $@ + cp $? $@ +libpng.vers: scripts/vers.out + rm -f $@ + cp $? $@ +pngwin.def: scripts/pngwin.out + rm -f $@ + cp $? $@ +pnglibconf.h: pnglibconf.out + rm -f $@ + cp $? $@ +scripts/pnglibconf.h: + @echo "This is a machine generated file, but if you want to make" >&2 + @echo "a new one simply make 'scripts/pnglibconf.out' and copy that" >&2 + @exit 1 + +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) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) @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| *@@@ *||g' -e 's| *$$||' dfn2.out >dfn3.out + rm -f dfn.c dfn[12].out + mv dfn3.out $@ + +# The .dfn file for pnglibconf.h is machine generated +pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk + rm -f $@ dfn?.out + $(AWK) -f ${srcdir}/scripts/options.awk pre=1 out=dfn1.out\ + ${srcdir}/scripts/pnglibconf.dfa 1>&2 + $(AWK) -f ${srcdir}/scripts/options.awk pre=%RELEASE% out=dfn2.out\ + dfn1.out 1>&2 + rm dfn1.out + mv dfn2.out $@ + +# Symbol checks (.def and .out files should match) +scripts/pngwin.chk: scripts/checksym.awk scripts/pngwin.def scripts/pngwin.out +scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.out +.out.chk: + rm -f $@ symbols.new + $(AWK) -f ${srcdir}/scripts/checksym.awk ${srcdir}/scripts/${*F}.def\ + $< >&2 + mv symbols.new $@ + +# used on demand to regenerate the standard header, CPPFLAGS should +# be empty - no non-standard defines +scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk + rm -f $@ dfn?.out + test -z "$(CPPFLAGS)" + echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\ + $(AWK) -f ${srcdir}/scripts/options.awk pre=1 out=dfn1.out\ + logunsupported=1 - ${srcdir}/scripts/pnglibconf.dfa 1>&2 + $(AWK) -f ${srcdir}/scripts/options.awk pre=%RELEASE% out=dfn2.out\ + logunsupported=1 dfn1.out 1>&2 + rm dfn1.out + mv dfn2.out $@ + +$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \ + pnglibconf.h pngpriv.h pngdebug.h pnginfo.h pngstruct.h + +test: check-am + +# Extra checks +check: scripts/symbols.chk scripts/pngwin.chk + +# Don't distribute the generated script files +dist-hook: + cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES) # install the .../include headers as links to the new ones install-data-hook: - cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h + cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h pnglibconf.h cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/png.h png.h cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngconf.h \ pngconf.h + cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pnglibconf.h \ + pnglibconf.h cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc # do evil things to libpng to cause libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ to be used @@ -127,7 +196,9 @@ fi;\ done uninstall-hook: - cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h + cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h pnglibconf.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.0beta18/configure.ac --- libpng-1.4.1/configure.ac 2010-02-25 05:38:36.634441039 -0600 +++ libpng-1.5.0beta18/configure.ac 2010-04-17 19:08:02.954042374 -0500 @@ -23,10 +23,10 @@ dnl stop configure from automagically running automake AM_MAINTAINER_MODE PNGLIB_VERSION=1.5.0beta18 -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.0beta18/contrib/gregbook/Makefile.sgi --- libpng-1.4.1/contrib/gregbook/Makefile.sgi 2010-02-25 05:38:30.385695920 -0600 +++ libpng-1.5.0beta18/contrib/gregbook/Makefile.sgi 2010-04-17 19:07:56.929926806 -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.0beta18/contrib/gregbook/Makefile.unx --- libpng-1.4.1/contrib/gregbook/Makefile.unx 2010-02-25 05:38:30.398746087 -0600 +++ libpng-1.5.0beta18/contrib/gregbook/Makefile.unx 2010-04-17 19:07:56.940039815 -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.0beta18/contrib/gregbook/readpng2.c --- libpng-1.4.1/contrib/gregbook/readpng2.c 2010-02-25 05:38:30.475500071 -0600 +++ libpng-1.5.0beta18/contrib/gregbook/readpng2.c 2010-04-17 19:07:57.003840501 -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.0beta18/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.0beta18/contrib/gregbook/rpng-win.c 2010-04-17 19:07:57.039084576 -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.0beta18/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.0beta18/contrib/gregbook/rpng-x.c 2010-04-17 19:07:57.053968386 -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.0beta18/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.0beta18/contrib/gregbook/rpng2-win.c 2010-04-17 19:07:57.069488811 -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.0beta18/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.0beta18/contrib/gregbook/rpng2-x.c 2010-04-17 19:07:57.088535081 -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.0beta18/contrib/gregbook/wpng.c --- libpng-1.4.1/contrib/gregbook/wpng.c 2010-02-25 05:38:30.629488120 -0600 +++ libpng-1.5.0beta18/contrib/gregbook/wpng.c 2010-04-17 19:07:57.114329185 -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.0beta18/contrib/gregbook/writepng.c --- libpng-1.4.1/contrib/gregbook/writepng.c 2010-02-25 05:38:30.641393677 -0600 +++ libpng-1.5.0beta18/contrib/gregbook/writepng.c 2010-04-17 19:07:57.125905490 -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/gather.sh libpng-1.5.0beta18/contrib/pngminim/decoder/gather.sh --- libpng-1.4.1/contrib/pngminim/decoder/gather.sh 2010-02-25 05:38:31.150601560 -0600 +++ libpng-1.5.0beta18/contrib/pngminim/decoder/gather.sh 2010-04-17 19:07:57.533766440 -0500 @@ -1,8 +1,15 @@ -cp ../../pngminus/png2pnm.c pngm2pnm.c -cp ../../../*.h . -cp ../../../*.c . +test -n "${PNGSRC}" || PNGSRC=../../.. +cp ${PNGSRC}/contrib/pngminus/png2pnm.c pngm2pnm.c +cp "${PNGSRC}"/*.h . +cp "${PNGSRC}"/*.c . rm example.c pngtest.c pngpread.c pngw*.c -# change the following 2 lines if zlib is somewhere else -cp ../../../../zlib/*.h . -cp ../../../../zlib/*.c . +rm -f pnglibconf.h +test -d scripts || mkdir scripts +cp "${PNGSRC}"/scripts/pnglibconf.mak scripts +cp "${PNGSRC}"/scripts/pnglibconf.dfa scripts +cp "${PNGSRC}"/scripts/options.awk scripts +# change the following if zlib is somewhere else +test -n "${ZLIBSRC}" || ZLIBSRC="${PNGSRC}"/../zlib +cp "${ZLIBSRC}"/*.h . +cp "${ZLIBSRC}"/*.c . rm minigzip.c example.c compress.c deflate.c gz* diff -ru4NwbB libpng-1.4.1/contrib/pngminim/decoder/makefile libpng-1.5.0beta18/contrib/pngminim/decoder/makefile --- libpng-1.4.1/contrib/pngminim/decoder/makefile 2010-02-25 05:38:31.159287289 -0600 +++ libpng-1.5.0beta18/contrib/pngminim/decoder/makefile 2010-04-17 19:07:57.542734449 -0500 @@ -24,9 +24,10 @@ pngset$(O) pngtrans$(O) $(ZOBJS) # implicit make rules ------------------------------------------------------- -.c$(O): png.h pngconf.h pngpriv.h pngusr.h zlib.h +# note: dependencies do not work on implicit rule lines +.c$(O): $(CC) -c $(CFLAGS) $< # dependencies @@ -35,10 +36,22 @@ pngm2pnm$(E): $(OBJS) $(LD) -o pngm2pnm$(E) $(OBJS) strip pngm2pnm$(E) +pnglibconf.h: scripts/pnglibconf.mak scripts/pnglibconf.dfa \ + scripts/options.awk pngusr.h + + rm -f pnglibconf.h + + $(MAKE) $(MAKEFLAGS) -f scripts/pnglibconf.mak\ + CPPFLAGS=-DPNG_USER_CONFIG $@ + clean: + $(MAKE) $(MAKEFLAGS) -f scripts/pnglibconf.mak clean $(RM) pngm2pnm$(O) $(RM) pngm2pnm$(E) $(RM) $(OBJS) +$(OBJS): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h\ + pnginfo.h pngdebug.h zlib.h + # End of makefile for pngm2pnm diff -ru4NwbB libpng-1.4.1/contrib/pngminim/decoder/pngusr.h libpng-1.5.0beta18/contrib/pngminim/decoder/pngusr.h --- libpng-1.4.1/contrib/pngminim/decoder/pngusr.h 2010-02-25 05:38:31.168194019 -0600 +++ libpng-1.5.0beta18/contrib/pngminim/decoder/pngusr.h 2010-04-17 19:07:57.552140281 -0500 @@ -1,7 +1,7 @@ /* minrdpngconf.h: headers to make a minimal png-read-only library * - * Copyright (c) 2007, 2009 Glenn Randers-Pehrson + * Copyright (c) 2007, 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 @@ -15,18 +15,17 @@ #ifdef NJET /* No 16-bit support beyond reading with strip_16 */ #endif +#define PNG_USER_PRIVATEBUILD "PNG minimal build" +#define PNG_USER_DLLFNAME_POSTFIX "MN" + #define PNG_NO_WARNINGS -#define png_warning(s1,s2) "" -#define png_chunk_warning(s1,s2) "" #define PNG_NO_ERROR_TEXT -#define png_error(s1,s2) png_err(s1) -#define png_chunk_error(s1,s2) png_err(s1) #define PNG_NO_READ_GAMMA #define PNG_NO_READ_BACKGROUND -#define PNG_NO_READ_DITHER +#define PNG_NO_READ_QUANTIZE #define PNG_NO_READ_INVERT #define PNG_NO_READ_SHIFT #define PNG_NO_READ_PACK #define PNG_NO_READ_PACKSWAP @@ -70,6 +69,7 @@ #define PNG_NO_EASY_ACCESS #define PNG_NO_PROGRESSIVE_READ #define PNG_NO_USER_LIMITS #define PNG_NO_SET_USER_LIMITS +#define PNG_NO_CONVERT_TIME_RFC1123 #endif /* MINRDPNGCONF_H */ diff -ru4NwbB libpng-1.4.1/contrib/pngminim/encoder/gather.sh libpng-1.5.0beta18/contrib/pngminim/encoder/gather.sh --- libpng-1.4.1/contrib/pngminim/encoder/gather.sh 2010-02-25 05:38:31.194735028 -0600 +++ libpng-1.5.0beta18/contrib/pngminim/encoder/gather.sh 2010-04-17 19:07:57.579243711 -0500 @@ -1,9 +1,17 @@ -cp ../../pngminus/pnm2png.c pnm2pngm.c -cp ../../../*.h . -cp ../../../*.c . +test -n "${PNGSRC}" || PNGSRC=../../.. +cp ${PNGSRC}/contrib/pngminus/pnm2png.c pnm2pngm.c +cp "${PNGSRC}"/*.h . +cp "${PNGSRC}"/*.c . rm example.c pngtest.c pngr*.c pngpread.c -# Change the next 2 lines if zlib is somewhere else. -cp ../../../../zlib/*.h . -cp ../../../../zlib/*.c . +rm -f pnglibconf.h +test -d scripts || mkdir scripts +cp "${PNGSRC}"/scripts/pnglibconf.mak scripts +cp "${PNGSRC}"/scripts/pnglibconf.dfa scripts +cp "${PNGSRC}"/scripts/options.awk scripts +# change the following if zlib is somewhere else +test -n "${ZLIBSRC}" || ZLIBSRC="${PNGSRC}"/../zlib +cp "${ZLIBSRC}"/*.h . +cp "${ZLIBSRC}"/*.c . rm inf*.[ch] rm minigzip.c example.c gz* + diff -ru4NwbB libpng-1.4.1/contrib/pngminim/encoder/makefile libpng-1.5.0beta18/contrib/pngminim/encoder/makefile --- libpng-1.4.1/contrib/pngminim/encoder/makefile 2010-02-25 05:38:31.203884053 -0600 +++ libpng-1.5.0beta18/contrib/pngminim/encoder/makefile 2010-04-17 19:07:57.588442407 -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): $(CC) -c $(CFLAGS) $< # dependencies @@ -34,10 +34,17 @@ pnm2pngm$(E): $(OBJS) $(LD) -o pnm2pngm$(E) $(OBJS) strip pnm2pngm$(E) +pnglibconf.h: scripts/pnglibconf.mak scripts/pnglibconf.dfa scripts/options.awk pngusr.h + rm -f pnglibconf.h + $(MAKE) $(MAKEFLAGS) -f scripts/pnglibconf.mak CPPFLAGS=-DPNG_USER_CONFIG $@ + clean: + $(MAKE) $(MAKEFLAGS) -f scripts/pnglibconf.mak clean $(RM) pnm2pngm$(O) $(RM) pnm2pngm$(E) $(RM) $(OBJS) +$(OBJS): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngusr.h zlib.h + # End of makefile for pnm2pngm diff -ru4NwbB libpng-1.4.1/contrib/pngminim/encoder/pngusr.h libpng-1.5.0beta18/contrib/pngminim/encoder/pngusr.h --- libpng-1.4.1/contrib/pngminim/encoder/pngusr.h 2010-02-25 05:38:31.213167117 -0600 +++ libpng-1.5.0beta18/contrib/pngminim/encoder/pngusr.h 2010-04-17 19:07:57.597725010 -0500 @@ -1,7 +1,7 @@ /* minwrpngconf.h: headers to make a minimal png-write-only library * - * Copyright (c) 2007, 2009 Glenn Randers-Pehrson + * Copyright (c) 2007, 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 @@ -11,20 +11,19 @@ #ifndef MINWRPNGCONF_H #define MINWRPNGCONF_H +#define PNG_USER_PRIVATEBUILD "PNG minimal build" +#define PNG_USER_DLLFNAME_POSTFIX "MN" + #define PNG_NO_READ_SUPPORTED #define PNG_NO_WARNINGS -#define png_warning(s1,s2) "" -#define png_chunk_warning(s1,s2) "" #define PNG_NO_ERROR_TEXT -#define png_error(s1,s2) png_err(s1) -#define png_chunk_error(s1,s2) png_err(s1) #define PNG_NO_WRITE_BACKGROUND #define PNG_NO_WRITE_GAMMA -#define PNG_NO_WRITE_DITHER +#define PNG_NO_WRITE_QUANTIZE #define PNG_NO_WRITE_INVERT #define PNG_NO_WRITE_SHIFT #define PNG_NO_WRITE_PACK #define PNG_NO_WRITE_PACKSWAP @@ -68,6 +67,7 @@ #define PNG_NO_ERROR_NUMBERS #define PNG_NO_EASY_ACCESS #define PNG_NO_USER_LIMITS #define PNG_NO_SET_USER_LIMITS +#define PNG_NO_CONVERT_TIME_RFC1123 #endif /* MINWRPNGCONF_H */ diff -ru4NwbB libpng-1.4.1/contrib/pngminim/preader/gather.sh libpng-1.5.0beta18/contrib/pngminim/preader/gather.sh --- libpng-1.4.1/contrib/pngminim/preader/gather.sh 2010-02-25 05:38:31.230801244 -0600 +++ libpng-1.5.0beta18/contrib/pngminim/preader/gather.sh 2010-04-17 19:07:57.616663101 -0500 @@ -1,9 +1,18 @@ -cp ../../gregbook/rpng2-x.c ../../gregbook/readpng2.[ch] . -cp ../../gregbook/COPYING ../../gregbook/LICENSE . -cp ../../../*.h . -cp ../../../*.c . +test -n "${PNGSRC}" || PNGSRC=../../.. +cp "${PNGSRC}"/contrib/gregbook/rpng2-x.c . +cp "${PNGSRC}"/contrib/gregbook/readpng2.[ch] . +cp "${PNGSRC}"/contrib/gregbook/COPYING . +cp "${PNGSRC}"/contrib/gregbook/LICENSE . +cp "${PNGSRC}"/*.h . +cp "${PNGSRC}"/*.c . rm example.c pngtest.c pngw*.c -# change the following 2 lines if zlib is somewhere else -cp ../../../../zlib/*.h . -cp ../../../../zlib/*.c . +rm -f pnglibconf.h +test -d scripts || mkdir scripts +cp "${PNGSRC}"/scripts/pnglibconf.mak scripts +cp "${PNGSRC}"/scripts/pnglibconf.dfa scripts +cp "${PNGSRC}"/scripts/options.awk scripts +# change the following if zlib is somewhere else +test -n "${ZLIBSRC}" || ZLIBSRC="${PNGSRC}"/../zlib +cp "${ZLIBSRC}"/*.h . +cp "${ZLIBSRC}"/*.c . rm minigzip.c example.c compress.c deflate.c gz* diff -ru4NwbB libpng-1.4.1/contrib/pngminim/preader/makefile libpng-1.5.0beta18/contrib/pngminim/preader/makefile --- libpng-1.4.1/contrib/pngminim/preader/makefile 2010-02-25 05:38:31.239535467 -0600 +++ libpng-1.5.0beta18/contrib/pngminim/preader/makefile 2010-04-17 19:07:57.626224438 -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): $(CC) -c $(CFLAGS) $< # dependencies @@ -51,10 +51,17 @@ rpng2-x$(E): $(OBJS) $(LD) -o rpng2-x$(E) $(OBJS) $(LIBS) strip rpng2-x$(E) +pnglibconf.h: scripts/pnglibconf.mak scripts/pnglibconf.dfa scripts/options.awk pngusr.h + rm -f pnglibconf.h + $(MAKE) $(MAKEFLAGS) -f scripts/pnglibconf.mak CPPFLAGS=-DPNG_USER_CONFIG $@ + clean: + $(MAKE) $(MAKEFLAGS) -f scripts/pnglibconf.mak clean $(RM) rpng2-x$(O) $(RM) rpng2-x$(E) $(RM) $(OBJS) +$(OBJS): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h readpng2.h pngusr.h zlib.h + # End of makefile for rpng2-x diff -ru4NwbB libpng-1.4.1/contrib/pngminim/preader/pngusr.h libpng-1.5.0beta18/contrib/pngminim/preader/pngusr.h --- libpng-1.4.1/contrib/pngminim/preader/pngusr.h 2010-02-25 05:38:31.248375363 -0600 +++ libpng-1.5.0beta18/contrib/pngminim/preader/pngusr.h 2010-04-17 19:07:57.635887698 -0500 @@ -1,7 +1,7 @@ /* minrdpngconf.h: headers to make a minimal png-read-only library * - * Copyright (c) 2009 Glenn Randers-Pehrson + * Copyright (c) 2009, 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 @@ -11,16 +11,15 @@ #ifndef MINPRDPNGCONF_H #define MINPRDPNGCONF_H +#define PNG_USER_PRIVATEBUILD "PNG minimal build" +#define PNG_USER_DLLFNAME_POSTFIX "MN" + #define PNG_NO_WARNINGS -#define png_warning(s1,s2) "" -#define png_chunk_warning(s1,s2) "" #define PNG_NO_ERROR_TEXT -#define png_error(s1,s2) png_err(s1) -#define png_chunk_error(s1,s2) png_err(s1) -#define PNG_NO_READ_DITHER +#define PNG_NO_READ_QUANTIZE #define PNG_NO_READ_INVERT #define PNG_NO_READ_SHIFT #define PNG_NO_READ_PACK #define PNG_NO_READ_PACKSWAP @@ -60,6 +59,7 @@ #define PNG_NO_ERROR_NUMBERS #define PNG_NO_EASY_ACCESS #define PNG_NO_USER_LIMITS #define PNG_NO_SET_USER_LIMITS +#define PNG_NO_CONVERT_TIME_RFC1123 #endif /* MINPRDPNGCONF_H */ diff -ru4NwbB libpng-1.4.1/example.c libpng-1.5.0beta18/example.c --- libpng-1.4.1/example.c 2010-02-25 05:38:30.172040389 -0600 +++ libpng-1.5.0beta18/example.c 2010-04-17 19:07:56.734662025 -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 18, 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. @@ -159,9 +159,9 @@ /* * If you have enough memory to read in the entire image at once, * and you need to specify only transforms that can be controlled * with one of the PNG_TRANSFORM_* bits (this presently excludes - * dithering, filling, setting background, and doing gamma + * quantizing, filling, setting background, and doing gamma * adjustment), then you can read the entire image (including * pixels) into the info structure with this call: */ png_read_png(png_ptr, info_ptr, png_transforms, NULL); @@ -270,9 +270,10 @@ else png_set_gamma(png_ptr, screen_gamma, 0.45455); } - /* Dither RGB files down to 8 bit palette or reduce palettes +#ifdef PNG_READ_QUANTIZE_SUPPORTED + /* Quantize RGB files down to 8 bit palette or reduce palettes * to the number of colors available on your screen. */ if (color_type & PNG_COLOR_MASK_COLOR) { @@ -281,12 +282,12 @@ /* This reduces the image to the application supplied palette */ if (/* We have our own palette */) { - /* An array of colors to which the image should be dithered */ + /* An array of colors to which the image should be quantized */ png_color std_color_cube[MAX_SCREEN_COLORS]; - png_set_dither(png_ptr, std_color_cube, MAX_SCREEN_COLORS, + png_set_quantize(png_ptr, std_color_cube, MAX_SCREEN_COLORS, MAX_SCREEN_COLORS, NULL, 0); } /* This reduces the image to the palette supplied in the file */ else if (png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette)) @@ -294,12 +295,13 @@ png_uint_16p histogram = NULL; png_get_hIST(png_ptr, info_ptr, &histogram); - png_set_dither(png_ptr, palette, num_palette, + png_set_quantize(png_ptr, palette, num_palette, max_screen_colors, histogram, 0); } } +#endif /* PNG_READ_QUANTIZE_SUPPORTED */ /* Invert monochrome files to have 0 as white and 1 as black */ png_set_invert_mono(png_ptr); @@ -675,19 +677,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.0beta18/png.c --- libpng-1.4.1/png.c 2010-02-25 05:38:30.179871619 -0600 +++ libpng-1.5.0beta18/png.c 2010-04-17 19:07:56.742308829 -0500 @@ -1,8 +1,8 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.4.1 [April 18, 2010] + * Last changed in libpng 1.5.0 [April 18, 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.0beta18/png.h --- libpng-1.4.1/png.h 2010-02-25 05:38:30.147965500 -0600 +++ libpng-1.5.0beta18/png.h 2010-04-17 19:07:56.695692538 -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-18 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 @@ -385,15 +385,30 @@ * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ #define PNG_LIBPNG_VER %VER_NUM% /* %MAJOR%.%MINOR%.%RELEASE% */ +/* Library configuration: these options cannot be changed after + * the library has been built. + */ +#ifndef PNGLCONF_H +# include "pnglibconf.h" +#endif + #ifndef PNG_VERSION_INFO_ONLY +/* Standard header files (not needed for the version info) */ +# ifdef PNG_STDIO_SUPPORTED +# include +# endif +# ifdef PNG_SETJMP_SUPPORTED +# include +# endif + /* Include the compression library's header */ #include "zlib.h" -#endif -/* Include all user configurable info, including optional assembler routines */ +/* Machine specific configuration. */ #include "pngconf.h" +#endif /* * Added at libpng-1.2.8 * @@ -407,9 +422,9 @@ * file of the same version number. If this value is given, the * StringFileInfo block must contain a SpecialBuild string. */ -#ifdef PNG_USER_PRIVATEBUILD +#ifdef PNG_USER_PRIVATEBUILD /* From pnglibconf.h */ # define PNG_LIBPNG_BUILD_TYPE \ (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE) #else # ifdef PNG_LIBPNG_SPECIALBUILD @@ -426,23 +441,58 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -/* This file is arranged in several sections. The first section contains - * structure and type definitions. The second section contains the external - * 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 */ - +/* This file is arranged in several sections: + * + * 1. Any configuration options that can be specified by for the application + * code when it is built. (Build time configuration is in pnglibconf.h) + * 2. Type definitions (base types are defined in pngconf.h), structure + * definitions. + * 3. Exported library functions. + * + * The library source code has additional files (principally pngpriv.h) that + * allow configuration of the library. + */ +/* Section 1: run time configuration + * See pnglibconf.h for build time configuration + * + * Run time configuration allows the application to choose between + * implementations of certain arithmetic APIs. The default is set + * at build time and recorded in pnglibconf.h, but it is safe to + * override these (and only these) settings. Note that this won't + * change what the library does, only application code, and the + * settings can (and probably should) be made on a per-file basis + * by setting the #defines before including png.h + * + * Use macros to read integers from PNG data or use the exported + * functions? + * PNG_USE_READ_MACROS: use the macros (see below) Note that + * the macros evaluate their argument multiple times. + * PNG_NO_USE_READ_MACROS: call the relevant library function. + * + * Use the alternative algorithm for compositing alpha samples that + * does not use division? + * PNG_READ_COMPOSITE_NODIV_SUPPORTED: use the 'no division' + * algorithm. + * PNG_NO_READ_COMPOSITE_NODIV: use the 'division' algorithm. + * + * How to handle benign errors if PNG_ALLOW_BENIGN_ERRORS is + * false? + * PNG_ALLOW_BENIGN_ERRORS: map calls to the benign error + * APIs to png_warning. + * Otherwise the calls are mapped to png_error. + */ + +/* Section 2: type definitions, including structures and compile time + * constants. + * See pngconf.h for base types that vary by machine/system + */ /* 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 +576,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 +635,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 +758,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,444 +820,69 @@ #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. */ typedef png_structp version_%_VER_%; typedef png_struct FAR * FAR * png_structpp; -/* Here are the function definitions most commonly used. This is not +/* Section 3: exported functions + * Here are the function definitions most commonly used. This is not * the place to find out how to use libpng. See libpng.txt for the * full explanation, see example.c for the summary. This just provides * 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 +893,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 +1084,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 +#ifdef PNG_READ_QUANTIZE_SUPPORTED +/* Turn on quantizing, 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_quantize,(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_quantize),,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 +1201,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 +1258,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 +1279,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 +1305,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 +1316,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 +1333,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 +1446,58 @@ #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 +#ifdef PNG_ERROR_TEXT_SUPPORTED /* 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)); +# undef png_benign_error +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)); +# undef png_chunk_benign_error +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); +#else +# ifdef PNG_ALLOW_BENIGN_ERRORS +# define png_benign_error png_warning +# define png_chunk_benign_error png_chunk_warning +# else +# define png_benign_error png_error +# define png_chunk_benign_error png_chunk_error +# endif #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 +1511,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 +1778,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 +1840,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 +1891,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)); +#if defined(PNG_INCH_CONVERSIONS_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) +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 */ +#endif /* PNG_INCH_CONVERSIONS_SUPPORTED && 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 */ @@ -2622,9 +2007,8 @@ /* Inline macros to do direct reads of bytes from the input buffer. * The png_get_int_32() routine assumes we are using two's complement * format for negative values, which is almost certainly true. */ -/* We could make special-case BIG_ENDIAN macros that do direct reads here */ # define png_get_uint_32(buf) \ (((png_uint_32)(*(buf)) << 24) + \ ((png_uint_32)(*((buf) + 1)) << 16) + \ ((png_uint_32)(*((buf) + 2)) << 8) + \ @@ -2638,45 +2022,37 @@ ((png_int_32)(*((buf) + 1)) << 16) + \ ((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)); -#ifdef PNG_GET_INT_32_SUPPORTED -extern PNG_EXPORT(png_int_32,png_get_int_32) PNGARG((png_bytep buf)); #endif +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,(png_bytep buf),,203); #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); +#ifdef PNG_SAVE_INT_32_SUPPORTED +extern PNG_EXPORT(void,png_save_int_32,(png_bytep buf, png_int_32 i),,206); +#endif /* 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. */ -/* ************************************************************************* */ - -/* Various modes of operation. Note that after an init, mode is set to - * zero automatically when the structure is created. +/* The last ordinal number (this is the *last* one, the next one to + * use is one more than this.) */ -#define PNG_HAVE_IHDR 0x01 -#define PNG_HAVE_PLTE 0x02 -#define PNG_HAVE_IDAT 0x04 -#define PNG_AFTER_IDAT 0x08 /* Have complete zlib datastream */ -#define PNG_HAVE_IEND 0x10 -#define PNG_HAVE_gAMA 0x20 -#define PNG_HAVE_cHRM 0x40 +#ifdef PNG_EXPORT_LAST_ORDINAL + PNG_EXPORT_LAST_ORDINAL(207); +#endif #ifdef __cplusplus } #endif diff -ru4NwbB libpng-1.4.1/pngconf.h libpng-1.5.0beta18/pngconf.h --- libpng-1.4.1/pngconf.h 2010-02-25 05:38:30.156747672 -0600 +++ libpng-1.5.0beta18/pngconf.h 2010-04-17 19:07:56.702526016 -0500 @@ -1,9 +1,9 @@ /* pngconf.h - machine configurable file for libpng * * libpng version 1.5.0beta18 - April 18, 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.) * @@ -21,283 +21,42 @@ #ifndef PNGCONF_H #define PNGCONF_H -#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 - * includes the resource compiler for Windows DLL configurations. - */ -#ifdef PNG_USER_CONFIG -# ifndef PNG_USER_PRIVATEBUILD -# define PNG_USER_PRIVATEBUILD -# endif -# include "pngusr.h" -#endif - -/* - * If you create a private DLL you need to define in "pngusr.h" the followings: - * #define PNG_USER_PRIVATEBUILD - * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons." - * #define PNG_USER_DLLFNAME_POSTFIX - * e.g. // private DLL "libpng13gx.dll" - * #define PNG_USER_DLLFNAME_POSTFIX "gx" - * - * The following macros are also at your disposal if you want to complete the - * DLL VERSIONINFO structure. - * - PNG_USER_VERSIONINFO_COMMENTS - * - PNG_USER_VERSIONINFO_COMPANYNAME - * - PNG_USER_VERSIONINFO_LEGALTRADEMARKS +/* Need the time information for converting tIME chunks, it + * defines struct tm: */ - -#ifdef __STDC__ -# ifdef SPECIALBUILD -# pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\ - are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.") -# endif - -# ifdef PRIVATEBUILD -# pragma message("PRIVATEBUILD is deprecated.\ - Use PNG_USER_PRIVATEBUILD instead.") -# define PNG_USER_PRIVATEBUILD PRIVATEBUILD +#ifdef PNG_CONVERT_tIME_SUPPORTED + /* "time.h" functions are not supported on WindowsCE */ +# include # endif -#endif /* __STDC__ */ - -/* End of material added to libpng-1.2.8 */ -#ifndef PNG_VERSION_INFO_ONLY - -/* This is the size of the compression buffer, and thus the size of - * an IDAT chunk. Make this whatever size you feel is best for your - * machine. One of these will be allocated per png_struct. When this - * is full, it writes the data to the disk, and does some other - * calculations. Making this an extremely small size will slow - * the library down, but you may want to experiment to determine - * where it becomes significant, if you are concerned with memory - * usage. Note that zlib allocates at least 32Kb also. For readers, - * this describes the size of the buffer available to read the data in. - * Unless this gets smaller than the size of a row (compressed), - * it should not make much difference how big this is. +/* PNG_NO_LIMITS_H may be used to turn off the use of the standard C + * definition file for machine specific limits, this may impact the + * correctness of the definitons below (see uses of INT_MAX). */ - -#ifndef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 8192 -#endif - -/* Enable if you want a write-only libpng */ - -#ifndef PNG_NO_READ_SUPPORTED -# define PNG_READ_SUPPORTED -#endif - -/* Enable if you want a read-only libpng */ - -#ifndef PNG_NO_WRITE_SUPPORTED -# define PNG_WRITE_SUPPORTED -#endif - -/* Enabled in 1.4.0. */ -#ifdef PNG_ALLOW_BENIGN_ERRORS -# define png_benign_error png_warning -# define png_chunk_benign_error png_chunk_warning -#else -# ifndef PNG_BENIGN_ERRORS_SUPPORTED -# define png_benign_error png_error -# define png_chunk_benign_error png_chunk_error -# endif -#endif - -/* Added at libpng version 1.4.0 */ -#if !defined(PNG_NO_WARNINGS) && !defined(PNG_WARNINGS_SUPPORTED) -# define PNG_WARNINGS_SUPPORTED -#endif - -/* Added at libpng version 1.4.0 */ -#if !defined(PNG_NO_ERROR_TEXT) && !defined(PNG_ERROR_TEXT_SUPPORTED) -# define PNG_ERROR_TEXT_SUPPORTED -#endif - -/* Added at libpng version 1.4.0 */ -#if !defined(PNG_NO_CHECK_cHRM) && !defined(PNG_CHECK_cHRM_SUPPORTED) -# define PNG_CHECK_cHRM_SUPPORTED -#endif - -/* Added at libpng version 1.4.0 */ -#if !defined(PNG_NO_ALIGNED_MEMORY) && !defined(PNG_ALIGNED_MEMORY_SUPPORTED) -# 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 */ -#ifndef PNG_NO_MNG_FEATURES -# ifndef PNG_MNG_FEATURES_SUPPORTED -# define PNG_MNG_FEATURES_SUPPORTED -# endif -#endif - -/* Added at libpng version 1.4.0 */ -#ifndef PNG_NO_FLOATING_POINT_SUPPORTED -# ifndef PNG_FLOATING_POINT_SUPPORTED -# define PNG_FLOATING_POINT_SUPPORTED -# endif +#ifndef PNG_NO_LIMITS_H +# include #endif -/* Added at libpng-1.4.0beta49 for testing (this test is no longer used - in libpng and png_calloc() is always present) +/* This controls optimization of the reading of 16 and 32 bit values + * from PNG files. It can be set on a per-app-file basis - it + * just changes whether a macro is used to the function is called. + * The library builder sets the default. */ -#define PNG_CALLOC_SUPPORTED - -/* If you are running on a machine where you cannot allocate more - * than 64K of memory at once, uncomment this. While libpng will not - * normally need that much memory in a chunk (unless you load up a very - * large file), zlib needs to know how big of a chunk it can use, and - * libpng thus makes sure to check any memory allocation to verify it - * will fit into memory. -#define PNG_MAX_MALLOC_64K - */ -#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. - * - * 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 - * - * 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 -# endif -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL -# endif -# ifdef PNG_DLL -# undef PNG_DLL -# endif -# ifndef PNG_STATIC -# define PNG_STATIC -# endif -# else -# ifdef PNG_BUILD_DLL -# ifdef PNG_STATIC -# undef PNG_STATIC -# endif -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL -# endif -# ifndef PNG_DLL -# define PNG_DLL -# endif -# else -# ifdef PNG_STATIC -# ifdef PNG_USE_DLL -# undef PNG_USE_DLL -# endif -# ifdef PNG_DLL -# undef PNG_DLL -# endif -# else -# ifndef PNG_USE_DLL -# define PNG_USE_DLL -# endif -# ifndef PNG_DLL -# define PNG_DLL -# endif -# endif -# endif +#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS) +# if PNG_DEFAULT_READ_MACROS +# define PNG_USE_READ_MACROS # endif #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: - * stdin, stdout, and stderr. The only one currently used is stderr - * in png_error() and png_warning(). #defining PNG_NO_CONSOLE_IO will - * prevent these from being compiled and used. #defining PNG_NO_STDIO - * will also prevent these, plus will prevent the entire set of stdio - * macros and functions (FILE *, printf, etc.) from being compiled and used, - * unless (PNG_DEBUG > 0) has been #defined. +/* COMPILER SPECIFIC OPTIONS. * - * #define PNG_NO_CONSOLE_IO - * #define PNG_NO_STDIO + * These options are provided so that a variety of difficult compilers + * can be used. Some are fixed at build time (e.g. PNG_API_RULE + * below) but still have compiler specific implementations, others + * may be changed on a per-file basis when compiling against libpng. */ - -#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 -# ifdef PNG_DEBUG -# if (PNG_DEBUG > 0) -# include -# endif -# endif -# else -# include -# endif - -#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 @@ -319,761 +78,302 @@ #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. +/* 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: + * + * PNG_API_RULE=0 Use the operating system convention for PNGAPI and + * the 'C' calling convention (from PNGCAPI) for + * callbacks (PNGCBAPI). + * PNG_API_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. + * + * Note that the value must be defined in pnglibconf.h so that what + * the application uses to call the library matches the conventions + * set when building the library. + */ + +/* 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. + * + * 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. + * + * 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. */ -#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 +# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) +# ifndef PNGCAPI +# define PNGCAPI __cdecl # endif -# define _BSD_SOURCE -# undef PNG_SAVE_BSD_SOURCE +# if PNG_API_RULE == 0 && !defined(PNGAPI) +# define PNGAPI __stdcall # endif -# endif /* __linux__ */ -#endif /* PNG_SETJMP_SUPPORTED */ - -#ifdef BSD -# include #else -# include -#endif - -/* Other defines for things like memory and the like can go here. */ - -/* This controls how fine the dithering gets. As this allocates - * a largish chunk of memory (32K), those who are not as concerned - * with dithering quality can decrease some or all of these. - */ -#ifndef PNG_DITHER_RED_BITS -# define PNG_DITHER_RED_BITS 5 -#endif -#ifndef PNG_DITHER_GREEN_BITS -# define PNG_DITHER_GREEN_BITS 5 + /* An older compiler, or one not detected (erroneously) above. */ +# ifndef PNGCAPI +# define PNGCAPI _cdecl #endif -#ifndef PNG_DITHER_BLUE_BITS -# define PNG_DITHER_BLUE_BITS 5 +# if PNG_API_RULE == 0 && !defined(PNGAPI) +# define PNGAPI _stdcall #endif +# endif /* compiler/api */ + /* NOTE: PNGCBAPI always defaults to PNGCAPI. */ -/* This controls how fine the gamma correction becomes when you - * are only interested in 8 bits anyway. Increasing this value - * results in more memory being used, and more pow() functions - * being called to fill in the gamma tables. Don't set this value - * less then 8, and even that may not work (I haven't tested it). +# 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_MAX_GAMMA_8 -# define PNG_MAX_GAMMA_8 11 +# ifndef PNG_EXPORT_TYPE +# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP #endif - -/* This controls how much a difference in gamma we can tolerate before - * we actually start doing gamma conversion. - */ -#ifndef PNG_GAMMA_THRESHOLD -# define PNG_GAMMA_THRESHOLD 0.05 +# 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 */ -/* The following uses const char * instead of char * for error - * and warning message functions, so some compilers won't complain. - * If you do not want to use const, define PNG_NO_CONST here. - */ - -#ifndef PNG_CONST -# ifndef PNG_NO_CONST -# define PNG_CONST const -# else -# define PNG_CONST -# endif -#endif - -/* The following defines give you the ability to remove code from the - * library that you will not be using. I wish I could figure out how to - * automate this, but I can't do that without making it seriously hard - * on the users. So if you are not using an ability, change the #define - * to and #undef, and that part of the library will not be compiled. If - * your linker can't find a function, you may want to make sure the - * ability is defined here. Some of these depend upon some others being - * defined. I haven't figured out all the interactions here, so you may - * have to experiment awhile to get everything to compile. If you are - * creating or using a shared library, you probably shouldn't touch this, - * as it will affect the size of the structures, and this will cause bad - * things to happen if the library and/or application ever change. - */ - -/* Any features you will not be using can be undef'ed here */ - -/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user - * to turn it off with PNG_NO_READ|WRITE_TRANSFORMS on the compile line, - * then pick and choose which ones to define without having to edit this - * file. It is safe to use the PNG_NO_READ|WRITE_TRANSFORMS - * if you only want to have a png-compliant reader/writer but don't need - * any of the extra transformations. This saves about 80 kbytes in a - * typical installation of the library. (PNG_NO_* form added in version - * 1.0.1c, for consistency; PNG_*_TRANSFORMS_NOT_SUPPORTED deprecated in - * 1.4.0) - */ - -/* Ignore attempt to turn off both floating and fixed point support */ -#if !defined(PNG_FLOATING_POINT_SUPPORTED) || \ - !defined(PNG_NO_FIXED_POINT_SUPPORTED) -# define PNG_FIXED_POINT_SUPPORTED -#endif - -#ifdef PNG_READ_SUPPORTED - -/* PNG_READ_TRANSFORMS_NOT_SUPPORTED is deprecated. */ -#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_TRANSFORMS) -# define PNG_READ_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_READ_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_READ_EXPAND -# define PNG_READ_EXPAND_SUPPORTED -# endif -# ifndef PNG_NO_READ_SHIFT -# define PNG_READ_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACK -# define PNG_READ_PACK_SUPPORTED -# endif -# ifndef PNG_NO_READ_BGR -# define PNG_READ_BGR_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP -# define PNG_READ_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_READ_PACKSWAP -# define PNG_READ_PACKSWAP_SUPPORTED -# 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 -# define PNG_READ_16_TO_8_SUPPORTED -# endif -# ifndef PNG_NO_READ_FILLER -# define PNG_READ_FILLER_SUPPORTED -# endif -# ifndef PNG_NO_READ_GAMMA -# define PNG_READ_GAMMA_SUPPORTED -# endif -# ifndef PNG_NO_READ_GRAY_TO_RGB -# define PNG_READ_GRAY_TO_RGB_SUPPORTED -# endif -# ifndef PNG_NO_READ_SWAP_ALPHA -# define PNG_READ_SWAP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_INVERT_ALPHA -# define PNG_READ_INVERT_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_STRIP_ALPHA -# define PNG_READ_STRIP_ALPHA_SUPPORTED -# endif -# ifndef PNG_NO_READ_USER_TRANSFORM -# define PNG_READ_USER_TRANSFORM_SUPPORTED -# endif -# ifndef PNG_NO_READ_RGB_TO_GRAY -# 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: */ - -#define PNG_READ_INTERLACING_SUPPORTED /* required for PNG-compliant decoders */ - -/* PNG_NO_SEQUENTIAL_READ_SUPPORTED is deprecated. */ -#if !defined(PNG_NO_SEQUENTIAL_READ) && \ - !defined(PNG_SEQUENTIAL_READ_SUPPORTED) && \ - !defined(PNG_NO_SEQUENTIAL_READ_SUPPORTED) -# define PNG_SEQUENTIAL_READ_SUPPORTED -#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 */ -# endif -#endif - -#if !defined(PNG_NO_GET_INT_32) || defined(PNG_READ_oFFS_SUPPORTED) || \ - defined(PNG_READ_pCAL_SUPPORTED) -# ifndef PNG_GET_INT_32_SUPPORTED -# define PNG_GET_INT_32_SUPPORTED -# endif -#endif - -#endif /* PNG_READ_SUPPORTED */ - -#ifdef PNG_WRITE_SUPPORTED - -/* PNG_WRITE_TRANSFORMS_NOT_SUPPORTED is deprecated. */ -#if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_TRANSFORMS) -# define PNG_WRITE_TRANSFORMS_SUPPORTED -#endif - -#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED -# ifndef PNG_NO_WRITE_SHIFT -# define PNG_WRITE_SHIFT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACK -# define PNG_WRITE_PACK_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_BGR -# define PNG_WRITE_BGR_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_SWAP -# define PNG_WRITE_SWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_PACKSWAP -# define PNG_WRITE_PACKSWAP_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_INVERT -# define PNG_WRITE_INVERT_SUPPORTED -# endif -# ifndef PNG_NO_WRITE_FILLER -# define PNG_WRITE_FILLER_SUPPORTED /* same as WRITE_STRIP_ALPHA */ +# else /* !Cygwin && !Windows/x86 */ +# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) +# ifndef PNGAPI +# define PNGAPI _System # endif -# ifndef PNG_NO_WRITE_SWAP_ALPHA -# define PNG_WRITE_SWAP_ALPHA_SUPPORTED +# 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_NO_WRITE_INVERT_ALPHA -# define PNG_WRITE_INVERT_ALPHA_SUPPORTED +#ifndef PNGCBAPI +# define PNGCBAPI PNGCAPI # endif -# ifndef PNG_NO_WRITE_USER_TRANSFORM -# define PNG_WRITE_USER_TRANSFORM_SUPPORTED +#ifndef PNGAPI +# define PNGAPI PNGCAPI # endif -#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */ -#if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ - !defined(PNG_WRITE_INTERLACING_SUPPORTED) - /* This is not required for PNG-compliant encoders, but can cause - * trouble if left undefined +/* The default for PNG_IMPEXP depends on whether the library is + * being built or used. */ -# define PNG_WRITE_INTERLACING_SUPPORTED -#endif - -#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ - !defined(PNG_WRITE_WEIGHTED_FILTER) && \ - defined(PNG_FLOATING_POINT_SUPPORTED) -# define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED -#endif - -#ifndef PNG_NO_WRITE_FLUSH -# define PNG_WRITE_FLUSH_SUPPORTED -#endif - -#if !defined(PNG_NO_SAVE_INT_32) || defined(PNG_WRITE_oFFS_SUPPORTED) || \ - defined(PNG_WRITE_pCAL_SUPPORTED) -# ifndef PNG_SAVE_INT_32_SUPPORTED -# define PNG_SAVE_INT_32_SUPPORTED -# endif -#endif - -#endif /* PNG_WRITE_SUPPORTED */ - -#define PNG_NO_ERROR_NUMBERS - -#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ - defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) -# ifndef PNG_NO_USER_TRANSFORM_PTR -# define PNG_USER_TRANSFORM_PTR_SUPPORTED -# endif +#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 - -#if defined(PNG_STDIO_SUPPORTED) && !defined(PNG_TIME_RFC1123_SUPPORTED) -# define PNG_TIME_RFC1123_SUPPORTED #endif -/* This adds extra functions in pngget.c for accessing data from the - * info pointer (added in version 0.99) - * png_get_image_width() - * png_get_image_height() - * png_get_bit_depth() - * png_get_color_type() - * png_get_compression_type() - * png_get_filter_type() - * png_get_interlace_type() - * png_get_pixel_aspect_ratio() - * png_get_pixels_per_meter() - * png_get_x_offset_pixels() - * png_get_y_offset_pixels() - * png_get_x_offset_microns() - * png_get_y_offset_microns() - */ -#if !defined(PNG_NO_EASY_ACCESS) && !defined(PNG_EASY_ACCESS_SUPPORTED) -# define PNG_EASY_ACCESS_SUPPORTED +# ifndef PNG_IMPEXP +# define PNG_IMPEXP #endif - -/* Added at libpng-1.2.0 */ -#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) -# define PNG_USER_MEM_SUPPORTED #endif -/* Added at libpng-1.2.6 */ -#ifndef PNG_NO_SET_USER_LIMITS -# ifndef PNG_SET_USER_LIMITS_SUPPORTED -# define PNG_SET_USER_LIMITS_SUPPORTED -# endif - /* Feature added at libpng-1.4.0, this flag added at 1.4.1 */ -# ifndef PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED -# define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED -# endif - /* Feature added at libpng-1.4.1, this flag added at 1.4.1 */ -# ifndef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED -# define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED +#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 -/* Added at libpng-1.2.43 */ -#ifndef PNG_USER_LIMITS_SUPPORTED -# ifndef PNG_NO_USER_LIMITS -# define PNG_USER_LIMITS_SUPPORTED -# endif +/* Use PNG_REMOVED to comment out a removed interface. */ +#ifndef PNG_REMOVED +# define PNG_REMOVED(name, ordinal) #endif -/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGs no matter - * how large, set these two limits to 0x7fffffffL - */ -#ifndef PNG_USER_WIDTH_MAX -# define PNG_USER_WIDTH_MAX 1000000L -#endif -#ifndef PNG_USER_HEIGHT_MAX -# define PNG_USER_HEIGHT_MAX 1000000L +#ifndef PNG_CALLBACK +# define PNG_CALLBACK(type, name, args, attributes)\ + type (PNGCBAPI name) PNGARG(args) attributes #endif -/* Added at libpng-1.2.43. To accept all valid PNGs no matter - * how large, set these two limits to 0. +/* 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_USER_CHUNK_CACHE_MAX -# define PNG_USER_CHUNK_CACHE_MAX 0 -#endif - -/* Added at libpng-1.2.43 */ -#ifndef PNG_USER_CHUNK_MALLOC_MAX -# define PNG_USER_CHUNK_MALLOC_MAX 0 -#endif - -/* Added at libpng-1.4.0 */ -#if !defined(PNG_NO_IO_STATE) && !defined(PNG_IO_STATE_SUPPORTED) -# define PNG_IO_STATE_SUPPORTED -#endif -#ifndef PNG_LITERAL_SHARP -# define PNG_LITERAL_SHARP 0x23 -#endif -#ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET -# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b -#endif -#ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET -# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d +#ifndef PNG_NO_PEDANTIC_WARNINGS +# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED +# define PNG_PEDANTIC_WARNINGS_SUPPORTED #endif -#ifndef PNG_STRING_NEWLINE -#define PNG_STRING_NEWLINE "\n" #endif -/* These are currently experimental features, define them if you want */ - -/* Very little testing */ -/* -#ifdef PNG_READ_SUPPORTED -# ifndef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED -# define PNG_READ_16_TO_8_ACCURATE_SCALE_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. */ - -/* This is only for PowerPC big-endian and 680x0 systems */ -/* some testing */ -/* -#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED -# define PNG_READ_BIG_ENDIAN_SUPPORTED +# ifdef __GNUC__ +# ifndef PNG_USE_RESULT +# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) #endif -*/ - -#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS) -# define PNG_USE_READ_MACROS +# ifndef PNG_NORETURN +# define PNG_NORETURN __attribute__((__noreturn__)) #endif - -/* Buggy compilers (e.g., gcc 2.7.2.2) need PNG_NO_POINTER_INDEXING */ - -#if !defined(PNG_NO_POINTER_INDEXING) && \ - !defined(PNG_POINTER_INDEXING_SUPPORTED) -# define PNG_POINTER_INDEXING_SUPPORTED +# ifndef PNG_ALLOCATED +# define PNG_ALLOCATED __attribute__((__malloc__)) #endif - -/* Any chunks you are not interested in, you can undef here. The - * ones that allocate memory may be expecially important (hIST, - * tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info - * a bit smaller. - */ - -/* The size of the png_text structure changed in libpng-1.0.6 when - * iTXt support was added. iTXt support was turned off by default through - * libpng-1.2.x, to support old apps that malloc the png_text structure - * instead of calling png_set_text() and letting libpng malloc it. It - * was turned on by default in libpng-1.4.0. + /* This specifically protects structure members that should only be + * accessed from within the library, therefore should be empty during + * a library build. */ - -/* PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED is deprecated. */ -#if defined(PNG_READ_SUPPORTED) && \ - !defined(PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_READ_ANCILLARY_CHUNKS) -# define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED -#endif - -/* PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED is deprecated. */ -#if defined(PNG_WRITE_SUPPORTED) && \ - !defined(PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED) && \ - !defined(PNG_NO_WRITE_ANCILLARY_CHUNKS) -# define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED -#endif - -#ifdef PNG_READ_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_READ_TEXT -# define PNG_NO_READ_iTXt -# define PNG_NO_READ_tEXt -# define PNG_NO_READ_zTXt -#endif - -#ifndef PNG_NO_READ_bKGD -# define PNG_READ_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -#endif -#ifndef PNG_NO_READ_cHRM -# define PNG_READ_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -#endif -#ifndef PNG_NO_READ_gAMA -# define PNG_READ_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -#endif -#ifndef PNG_NO_READ_hIST -# define PNG_READ_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -#endif -#ifndef PNG_NO_READ_iCCP -# define PNG_READ_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -#endif -#ifndef PNG_NO_READ_iTXt -# ifndef PNG_READ_iTXt_SUPPORTED -# define PNG_READ_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_READ_oFFs -# define PNG_READ_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -#endif -#ifndef PNG_NO_READ_pCAL -# define PNG_READ_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_sCAL -# define PNG_READ_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -#endif -#ifndef PNG_NO_READ_pHYs -# define PNG_READ_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -#endif -#ifndef PNG_NO_READ_sBIT -# define PNG_READ_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sPLT -# define PNG_READ_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -#endif -#ifndef PNG_NO_READ_sRGB -# define PNG_READ_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -#endif -#ifndef PNG_NO_READ_tEXt -# define PNG_READ_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -#endif -#ifndef PNG_NO_READ_tIME -# define PNG_READ_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -#endif -#ifndef PNG_NO_READ_tRNS -# define PNG_READ_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -#endif -#ifndef PNG_NO_READ_zTXt -# 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 */ -#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 -#endif - -#endif /* PNG_READ_ANCILLARY_CHUNKS_SUPPORTED */ - -#ifndef PNG_NO_READ_UNKNOWN_CHUNKS -# ifndef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED -# endif -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED -# endif -# ifndef PNG_READ_USER_CHUNKS_SUPPORTED -# define PNG_READ_USER_CHUNKS_SUPPORTED -# endif -#endif -#ifndef PNG_NO_READ_USER_CHUNKS -# ifndef PNG_READ_USER_CHUNKS_SUPPORTED -# define PNG_READ_USER_CHUNKS_SUPPORTED -# endif -# ifndef PNG_USER_CHUNKS_SUPPORTED -# define PNG_USER_CHUNKS_SUPPORTED -# endif -#endif -#ifndef PNG_NO_HANDLE_AS_UNKNOWN -# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# endif -#endif - -#ifdef PNG_WRITE_SUPPORTED -#ifdef PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED - -#ifdef PNG_NO_WRITE_TEXT -# define PNG_NO_WRITE_iTXt -# define PNG_NO_WRITE_tEXt -# define PNG_NO_WRITE_zTXt -#endif -#ifndef PNG_NO_WRITE_bKGD -# define PNG_WRITE_bKGD_SUPPORTED -# ifndef PNG_bKGD_SUPPORTED -# define PNG_bKGD_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_cHRM -# define PNG_WRITE_cHRM_SUPPORTED -# ifndef PNG_cHRM_SUPPORTED -# define PNG_cHRM_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_gAMA -# define PNG_WRITE_gAMA_SUPPORTED -# ifndef PNG_gAMA_SUPPORTED -# define PNG_gAMA_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_hIST -# define PNG_WRITE_hIST_SUPPORTED -# ifndef PNG_hIST_SUPPORTED -# define PNG_hIST_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iCCP -# define PNG_WRITE_iCCP_SUPPORTED -# ifndef PNG_iCCP_SUPPORTED -# define PNG_iCCP_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_iTXt -# ifndef PNG_WRITE_iTXt_SUPPORTED -# define PNG_WRITE_iTXt_SUPPORTED -# endif -# ifndef PNG_iTXt_SUPPORTED -# define PNG_iTXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_oFFs -# define PNG_WRITE_oFFs_SUPPORTED -# ifndef PNG_oFFs_SUPPORTED -# define PNG_oFFs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pCAL -# define PNG_WRITE_pCAL_SUPPORTED -# ifndef PNG_pCAL_SUPPORTED -# define PNG_pCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sCAL -# define PNG_WRITE_sCAL_SUPPORTED -# ifndef PNG_sCAL_SUPPORTED -# define PNG_sCAL_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_pHYs -# define PNG_WRITE_pHYs_SUPPORTED -# ifndef PNG_pHYs_SUPPORTED -# define PNG_pHYs_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sBIT -# define PNG_WRITE_sBIT_SUPPORTED -# ifndef PNG_sBIT_SUPPORTED -# define PNG_sBIT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sPLT -# define PNG_WRITE_sPLT_SUPPORTED -# ifndef PNG_sPLT_SUPPORTED -# define PNG_sPLT_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_sRGB -# define PNG_WRITE_sRGB_SUPPORTED -# ifndef PNG_sRGB_SUPPORTED -# define PNG_sRGB_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tEXt -# define PNG_WRITE_tEXt_SUPPORTED -# ifndef PNG_tEXt_SUPPORTED -# define PNG_tEXt_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tIME -# define PNG_WRITE_tIME_SUPPORTED -# ifndef PNG_tIME_SUPPORTED -# define PNG_tIME_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_tRNS -# define PNG_WRITE_tRNS_SUPPORTED -# ifndef PNG_tRNS_SUPPORTED -# define PNG_tRNS_SUPPORTED -# endif -#endif -#ifndef PNG_NO_WRITE_zTXt -# define PNG_WRITE_zTXt_SUPPORTED -# ifndef PNG_zTXt_SUPPORTED -# define PNG_zTXt_SUPPORTED -# endif -#endif -#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 -# endif -#endif - -#ifdef PNG_WRITE_tIME_SUPPORTED -# ifndef PNG_NO_CONVERT_tIME -# ifndef _WIN32_WCE -/* The "tm" structure is not supported on WindowsCE */ -# ifndef PNG_CONVERT_tIME_SUPPORTED -# define PNG_CONVERT_tIME_SUPPORTED -# endif +# 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 +# define PNG_PRIVATE \ + __attribute__((__deprecated__)) #endif +# endif /* PNG_PRIVATE */ +# endif /* PNGLIB_BUILD */ +# endif /* __GNUC__ */ +#endif /* PNG_PEDANTIC_WARNINGS */ -#endif /* PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED */ - -#ifndef PNG_NO_WRITE_FILTER -# ifndef PNG_WRITE_FILTER_SUPPORTED -# define PNG_WRITE_FILTER_SUPPORTED +#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_NO_WRITE_UNKNOWN_CHUNKS -# define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED -# ifndef PNG_UNKNOWN_CHUNKS_SUPPORTED -# define PNG_UNKNOWN_CHUNKS_SUPPORTED +#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_NO_HANDLE_AS_UNKNOWN -# ifndef PNG_HANDLE_AS_UNKNOWN_SUPPORTED -# define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +#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 -#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. +/* The following uses const char * instead of char * for error + * and warning message functions, so some compilers won't complain. + * If you do not want to use const, define PNG_NO_CONST here. + * + * This should not change how the APIs are called, so it can be done + * on a per-file basis in the application. */ -#ifndef PNG_NO_INFO_IMAGE -# define PNG_INFO_IMAGE_SUPPORTED +#ifndef PNG_CONST +# ifndef PNG_NO_CONST +# define PNG_CONST const +# else +# define PNG_CONST #endif - -/* Need the time information for converting tIME chunks */ -#ifdef PNG_CONVERT_tIME_SUPPORTED - /* "time.h" functions are not supported on WindowsCE */ -# include #endif /* Some typedefs to get us started. These should be safe on most of the * common platforms. The typedefs should be at least as large as the @@ -1120,9 +420,9 @@ # define LDATA 0 # endif /* GRR: why is Cygwin in here? Cygwin is not Borland C... */ # if !defined(__WIN32__) && !defined(__FLAT__) && !defined(__CYGWIN__) -# define PNG_MAX_MALLOC_64K +# define PNG_MAX_MALLOC_64K /* only used in build */ # if (LDATA != 1) # ifndef FAR # define FAR __far # endif @@ -1161,9 +461,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; @@ -1175,9 +476,9 @@ typedef PNG_CONST char FAR * png_const_charp; typedef char FAR * png_charp; typedef png_fixed_point FAR * png_fixed_point_p; -#ifndef PNG_NO_STDIO +#ifdef PNG_STDIO_SUPPORTED typedef FILE * png_FILE_p; #endif #ifdef PNG_FLOATING_POINT_SUPPORTED @@ -1199,204 +500,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 @@ -1494,17 +606,5 @@ # endif #endif /* End of memory model/platform independent support */ -/* Just a little check that someone hasn't tried to define something - * contradictory. - */ -#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) -# undef PNG_ZBUF_SIZE -# define PNG_ZBUF_SIZE 65536L -#endif - - -/* Added at libpng-1.2.8 */ -#endif /* PNG_VERSION_INFO_ONLY */ - #endif /* PNGCONF_H */ diff -ru4NwbB libpng-1.4.1/pngdebug.h libpng-1.5.0beta18/pngdebug.h --- libpng-1.4.1/pngdebug.h 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta18/pngdebug.h 2010-04-17 19:07:56.726963300 -0500 @@ -0,0 +1,157 @@ + +/* 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 18, 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 +/* These settings control the formatting of messages in pngerror.c */ +/* Moved to pngdebug.h at 1.5.0 */ +# ifndef PNG_LITERAL_SHARP +# define PNG_LITERAL_SHARP 0x23 +# endif +# ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET +# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b +# endif +# ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET +# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d +# endif +# ifndef PNG_STRING_NEWLINE +# define PNG_STRING_NEWLINE "\n" +# endif + +#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_STDIO_SUPPORTED +# include /* not included yet */ +# endif +# 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.0beta18/pngerror.c --- libpng-1.4.1/pngerror.c 2010-02-25 05:38:30.185638465 -0600 +++ libpng-1.5.0beta18/pngerror.c 2010-04-17 19:07:56.748242784 -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 18, 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 @@ -184,10 +183,11 @@ png_memcpy(buffer + iout, error_message, PNG_MAX_ERROR_TEXT); buffer[iout + PNG_MAX_ERROR_TEXT - 1] = '\0'; } } +#endif /* PNG_WARNINGS_SUPPORTED || PNG_ERROR_TEXT_SUPPORTED */ -#ifdef PNG_READ_SUPPORTED +#if defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED) void PNGAPI png_chunk_error(png_structp png_ptr, png_const_charp error_message) { char msg[18+PNG_MAX_ERROR_TEXT]; @@ -198,10 +198,9 @@ png_format_buffer(png_ptr, msg, error_message); png_error(png_ptr, msg); } } -#endif /* PNG_READ_SUPPORTED */ -#endif /* PNG_WARNINGS_SUPPORTED || PNG_ERROR_TEXT_SUPPORTED */ +#endif /* PNG_READ_SUPPORTED && PNG_ERROR_TEXT_SUPPORTED */ #ifdef PNG_WARNINGS_SUPPORTED void PNGAPI png_chunk_warning(png_structp png_ptr, png_const_charp warning_message) @@ -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.0beta18/pngget.c --- libpng-1.4.1/pngget.c 2010-02-25 05:38:30.192877855 -0600 +++ libpng-1.5.0beta18/pngget.c 2010-04-17 19:07:56.755684481 -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) @@ -290,9 +289,10 @@ #endif return (0); } -#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) +#if defined(PNG_INCH_CONVERSIONS_SUPPORTED) && \ + defined(PNG_FLOATING_POINT_SUPPORTED) png_uint_32 PNGAPI png_get_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) { return ((png_uint_32)((float)png_get_pixels_per_meter(png_ptr, info_ptr) @@ -361,9 +361,9 @@ } return (retval); } #endif /* PNG_pHYs_SUPPORTED */ -#endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */ +#endif /* PNG_INCH_CONVERSIONS_SUPPORTED && PNG_FLOATING_POINT_SUPPORTED */ /* png_get_channels really belongs in here, too, but it's been around longer */ #endif /* PNG_EASY_ACCESS_SUPPORTED */ @@ -766,10 +766,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 +901,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.0beta18/pnginfo.h --- libpng-1.4.1/pnginfo.h 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta18/pnginfo.h 2010-04-17 19:07:56.721655791 -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 18, 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.0beta18/pngmem.c --- libpng-1.4.1/pngmem.c 2010-02-25 05:38:30.199420289 -0600 +++ libpng-1.5.0beta18/pngmem.c 2010-04-17 19:07:56.762178311 -0500 @@ -1,8 +1,8 @@ /* pngmem.c - stub functions for memory allocation * - * Last changed in libpng 1.4.0 [April 18, 2010] + * Last changed in libpng 1.5.0 [April 18, 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.0beta18/pngpread.c --- libpng-1.4.1/pngpread.c 2010-02-25 05:38:30.208407619 -0600 +++ libpng-1.5.0beta18/pngpread.c 2010-04-17 19:07:56.771024116 -0500 @@ -1,8 +1,8 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.4.1 [April 18, 2010] + * Last changed in libpng 1.5.0 [April 18, 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.0beta18/pngpriv.h --- libpng-1.4.1/pngpriv.h 2010-02-25 05:38:30.164470109 -0600 +++ libpng-1.5.0beta18/pngpriv.h 2010-04-17 19:07:56.710209446 -0500 @@ -23,11 +23,126 @@ #ifndef PNGPRIV_H #define PNGPRIV_H -#ifndef PNG_VERSION_INFO_ONLY +#define PNGLIB_BUILD +#ifdef PNG_USER_CONFIG +# include "pngusr.h" +#endif +#include "png.h" +#include "pnginfo.h" +#include "pngstruct.h" #include +#ifdef BSD +# include +#else +# include +#endif + +/* 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. We may need it here to get the correct configuration on things + * like limits. + */ +#ifdef PNG_CONFIGURE_LIBPNG +# ifdef HAVE_CONFIG_H +# include "config.h" +# endif +#endif + +/* Moved to pngpriv.h at libpng-1.5.0 */ +/* If you are running on a machine where you cannot allocate more + * than 64K of memory at once, uncomment this. While libpng will not + * normally need that much memory in a chunk (unless you load up a very + * large file), zlib needs to know how big of a chunk it can use, and + * libpng thus makes sure to check any memory allocation to verify it + * will fit into memory. + * + * zlib provides 'MAXSEG_64K' which, if defined, indicates the + * same limit and pngconf.h (already included) sets the limit + * if certain operating systems are detected. + */ +#if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) +# define PNG_MAX_MALLOC_64K +#endif + +/* Moved to pngpriv.h at libpng-1.5.0 */ +/* Feature support: in 1.4 this was in pngconf.h, but these + * features have no affect on the libpng API. Add library + * only features to the end of this list. Add features that + * affect the API to scipts/config.dfn using png_on or png_off + * as determined by the default and update scripts/config.std + */ +/* Added at libpng version 1.4.0 */ +#if !defined(PNG_NO_WARNINGS) && !defined(PNG_WARNINGS_SUPPORTED) +# define PNG_WARNINGS_SUPPORTED +#endif + +/* If warnings or errors are turned off the code is disabled + * or redirected here. + */ +#ifndef PNG_WARNINGS_SUPPORTED +# define png_warning(s1,s2) ((void)0) +# define png_chunk_warning(s1,s2) ((void)0) +#endif +#ifndef PNG_ERROR_TEXT_SUPPORTED +# define png_error(s1,s2) png_err(s1) +# define png_chunk_error(s1,s2) png_err(s1) +#endif + +/* Added at libpng version 1.4.0 */ +#if !defined(PNG_NO_CHECK_cHRM) && !defined(PNG_CHECK_cHRM_SUPPORTED) +# define PNG_CHECK_cHRM_SUPPORTED +#endif + +/* Added at libpng version 1.4.0 */ +#if !defined(PNG_NO_ALIGNED_MEMORY) && !defined(PNG_ALIGNED_MEMORY_SUPPORTED) +# define PNG_ALIGNED_MEMORY_SUPPORTED +#endif + +/* Buggy compilers (e.g., gcc 2.7.2.2) need PNG_NO_POINTER_INDEXING + * See png[wr]util.c + */ +#if !defined(PNG_NO_POINTER_INDEXING) && \ + !defined(PNG_POINTER_INDEXING_SUPPORTED) +# define PNG_POINTER_INDEXING_SUPPORTED +#endif + +/* Other defines for things like memory and the like can go here. */ + +/* This controls how fine the quantizing gets. As this allocates + * a largish chunk of memory (32K), those who are not as concerned + * with quantizing quality can decrease some or all of these. + */ +#ifndef PNG_QUANTIZE_RED_BITS +# define PNG_QUANTIZE_RED_BITS 5 +#endif +#ifndef PNG_QUANTIZE_GREEN_BITS +# define PNG_QUANTIZE_GREEN_BITS 5 +#endif +#ifndef PNG_QUANTIZE_BLUE_BITS +# define PNG_QUANTIZE_BLUE_BITS 5 +#endif + +/* This controls how fine the gamma correction becomes when you + * are only interested in 8 bits anyway. Increasing this value + * results in more memory being used, and more pow() functions + * being called to fill in the gamma tables. Don't set this value + * less then 8, and even that may not work (I haven't tested it). + */ +#ifndef PNG_MAX_GAMMA_8 +# define PNG_MAX_GAMMA_8 11 +#endif + +/* This controls how much a difference in gamma we can tolerate before + * we actually start doing gamma conversion. + */ +#ifndef PNG_GAMMA_THRESHOLD +# define PNG_GAMMA_THRESHOLD 0.05 +#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 @@ -41,9 +156,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 +176,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 @@ -80,8 +191,33 @@ # include # endif #endif +/* This is the size of the compression buffer, and thus the size of + * an IDAT chunk. Make this whatever size you feel is best for your + * machine. One of these will be allocated per png_struct. When this + * is full, it writes the data to the disk, and does some other + * calculations. Making this an extremely small size will slow + * the library down, but you may want to experiment to determine + * where it becomes significant, if you are concerned with memory + * usage. Note that zlib allocates at least 32Kb also. For readers, + * this describes the size of the buffer available to read the data in. + * Unless this gets smaller than the size of a row (compressed), + * it should not make much difference how big this is. + */ + +#ifndef PNG_ZBUF_SIZE +# define PNG_ZBUF_SIZE 8192 +#endif + +/* Just a little check that someone hasn't tried to define something + * contradictory. + */ +#if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) +# undef PNG_ZBUF_SIZE +# define PNG_ZBUF_SIZE 65536L +#endif + /* Various modes of operation. Note that after an init, mode is set to * zero automatically when the structure is created. */ #define PNG_HAVE_IHDR 0x01 @@ -105,9 +241,9 @@ #define PNG_PACK 0x0004 #define PNG_SHIFT 0x0008 #define PNG_SWAP_BYTES 0x0010 #define PNG_INVERT_MONO 0x0020 -#define PNG_DITHER 0x0040 +#define PNG_QUANTIZE 0x0040 #define PNG_BACKGROUND 0x0080 #define PNG_BACKGROUND_EXPAND 0x0100 /* 0x0200 unused */ #define PNG_16_TO_8 0x0400 @@ -264,25 +400,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 */ @@ -587,11 +725,11 @@ #ifdef PNG_READ_16_TO_8_SUPPORTED PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info, png_bytep row)); #endif -#ifdef PNG_READ_DITHER_SUPPORTED -PNG_EXTERN void png_do_dither PNGARG((png_row_infop row_info, - png_bytep row, png_bytep palette_lookup, png_bytep dither_lookup)); +#ifdef PNG_READ_QUANTIZE_SUPPORTED +PNG_EXTERN void png_do_quantize PNGARG((png_row_infop row_info, + png_bytep row, png_bytep palette_lookup, png_bytep quantize_lookup)); # ifdef PNG_CORRECT_PALETTE_SUPPORTED PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr, png_colorp palette, int num_palette)); @@ -838,119 +976,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.0beta18/pngread.c --- libpng-1.4.1/pngread.c 2010-02-25 05:38:30.217312332 -0600 +++ libpng-1.5.0beta18/pngread.c 2010-04-17 19:07:56.780025559 -0500 @@ -1,8 +1,8 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.4.1 [April 18, 2010] + * Last changed in libpng 1.5.0 [April 18, 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 { @@ -1079,11 +1075,11 @@ png_free(png_ptr, png_ptr->zbuf); png_free(png_ptr, png_ptr->big_row_buf); png_free(png_ptr, png_ptr->prev_row); png_free(png_ptr, png_ptr->chunkdata); -#ifdef PNG_READ_DITHER_SUPPORTED +#ifdef PNG_READ_QUANTIZE_SUPPORTED png_free(png_ptr, png_ptr->palette_lookup); - png_free(png_ptr, png_ptr->dither_index); + png_free(png_ptr, png_ptr->quantize_index); #endif #ifdef PNG_READ_GAMMA_SUPPORTED png_free(png_ptr, png_ptr->gamma_table); #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 } @@ -1256,9 +1252,9 @@ (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) png_set_expand(png_ptr); #endif - /* We don't handle background color or gamma transformation or dithering. + /* We don't handle background color or gamma transformation or quantizing. */ #ifdef PNG_READ_INVERT_SUPPORTED /* Invert monochrome files to have 0 as white and 1 as black @@ -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.0beta18/pngrio.c --- libpng-1.4.1/pngrio.c 2010-02-25 05:38:30.222455681 -0600 +++ libpng-1.5.0beta18/pngrio.c 2010-04-17 19:07:56.785368321 -0500 @@ -1,8 +1,8 @@ /* pngrio.c - functions for data input * - * Last changed in libpng 1.4.1 [April 18, 2010] + * Last changed in libpng 1.5.0 [April 18, 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.0beta18/pngrtran.c --- libpng-1.4.1/pngrtran.c 2010-02-25 05:38:30.238164331 -0600 +++ libpng-1.5.0beta18/pngrtran.c 2010-04-17 19:07:56.800828735 -0500 @@ -1,8 +1,8 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.4.1 [April 18, 2010] + * Last changed in libpng 1.5.0 [April 18, 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) { @@ -140,15 +139,15 @@ png_ptr->flags |= PNG_FLAG_STRIP_ALPHA; } #endif -#ifdef PNG_READ_DITHER_SUPPORTED +#ifdef PNG_READ_QUANTIZE_SUPPORTED /* Dither file to 8 bit. Supply a palette, the current number * of elements in the palette, the maximum number of elements * allowed, and a histogram if possible. If the current number * of colors is greater then the maximum number, the palette will be - * modified to fit in the maximum number. "full_dither" indicates - * whether we need a dithering cube set up for RGB images, or if we + * modified to fit in the maximum number. "full_quantize" indicates + * whether we need a quantizing cube set up for RGB images, or if we * simply are reducing the number of colors in a paletted image. */ typedef struct png_dsort_struct @@ -160,26 +159,26 @@ typedef png_dsort FAR * png_dsortp; typedef png_dsort FAR * FAR * png_dsortpp; void PNGAPI -png_set_dither(png_structp png_ptr, png_colorp palette, +png_set_quantize(png_structp png_ptr, png_colorp palette, int num_palette, int maximum_colors, png_uint_16p histogram, - int full_dither) + int full_quantize) { - png_debug(1, "in png_set_dither"); + png_debug(1, "in png_set_quantize"); if (png_ptr == NULL) return; - png_ptr->transformations |= PNG_DITHER; + png_ptr->transformations |= PNG_QUANTIZE; - if (!full_dither) + if (!full_quantize) { int i; - png_ptr->dither_index = (png_bytep)png_malloc(png_ptr, + png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr, (png_uint_32)(num_palette * png_sizeof(png_byte))); for (i = 0; i < num_palette; i++) - png_ptr->dither_index[i] = (png_byte)i; + png_ptr->quantize_index[i] = (png_byte)i; } if (num_palette > maximum_colors) { @@ -191,14 +190,14 @@ int i; /* Initialize an array to sort colors */ - png_ptr->dither_sort = (png_bytep)png_malloc(png_ptr, + png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr, (png_uint_32)(num_palette * png_sizeof(png_byte))); - /* Initialize the dither_sort array */ + /* Initialize the quantize_sort array */ for (i = 0; i < num_palette; i++) - png_ptr->dither_sort[i] = (png_byte)i; + png_ptr->quantize_sort[i] = (png_byte)i; /* Find the least used palette entries by starting a * bubble sort, and running it until we have sorted * out enough colors. Note that we don't care about @@ -213,38 +212,38 @@ done = 1; for (j = 0; j < i; j++) { - if (histogram[png_ptr->dither_sort[j]] - < histogram[png_ptr->dither_sort[j + 1]]) + if (histogram[png_ptr->quantize_sort[j]] + < histogram[png_ptr->quantize_sort[j + 1]]) { png_byte t; - t = png_ptr->dither_sort[j]; - png_ptr->dither_sort[j] = png_ptr->dither_sort[j + 1]; - png_ptr->dither_sort[j + 1] = t; + t = png_ptr->quantize_sort[j]; + png_ptr->quantize_sort[j] = png_ptr->quantize_sort[j + 1]; + png_ptr->quantize_sort[j + 1] = t; done = 0; } } if (done) break; } /* Swap the palette around, and set up a table, if necessary */ - if (full_dither) + if (full_quantize) { int j = num_palette; /* Put all the useful colors within the max, but don't * move the others. */ for (i = 0; i < maximum_colors; i++) { - if ((int)png_ptr->dither_sort[i] >= maximum_colors) + if ((int)png_ptr->quantize_sort[i] >= maximum_colors) { do j--; - while ((int)png_ptr->dither_sort[j] >= maximum_colors); + while ((int)png_ptr->quantize_sort[j] >= maximum_colors); palette[i] = palette[j]; } } } @@ -257,34 +256,34 @@ */ for (i = 0; i < maximum_colors; i++) { /* Only move the colors we need to */ - if ((int)png_ptr->dither_sort[i] >= maximum_colors) + if ((int)png_ptr->quantize_sort[i] >= maximum_colors) { png_color tmp_color; do j--; - while ((int)png_ptr->dither_sort[j] >= maximum_colors); + while ((int)png_ptr->quantize_sort[j] >= maximum_colors); tmp_color = palette[j]; palette[j] = palette[i]; palette[i] = tmp_color; /* Indicate where the color went */ - png_ptr->dither_index[j] = (png_byte)i; - png_ptr->dither_index[i] = (png_byte)j; + png_ptr->quantize_index[j] = (png_byte)i; + png_ptr->quantize_index[i] = (png_byte)j; } } /* Find closest color for those colors we are not using */ for (i = 0; i < num_palette; i++) { - if ((int)png_ptr->dither_index[i] >= maximum_colors) + if ((int)png_ptr->quantize_index[i] >= maximum_colors) { int min_d, k, min_k, d_index; /* Find the closest color to one we threw out */ - d_index = png_ptr->dither_index[i]; + d_index = png_ptr->quantize_index[i]; min_d = PNG_COLOR_DIST(palette[d_index], palette[0]); for (k = 1, min_k = 0; k < maximum_colors; k++) { int d; @@ -297,14 +296,14 @@ min_k = k; } } /* Point to closest color */ - png_ptr->dither_index[i] = (png_byte)min_k; + png_ptr->quantize_index[i] = (png_byte)min_k; } } } - png_free(png_ptr, png_ptr->dither_sort); - png_ptr->dither_sort = NULL; + png_free(png_ptr, png_ptr->quantize_sort); + png_ptr->quantize_sort = NULL; } else { /* This is much harder to do simply (and quickly). Perhaps @@ -409,21 +408,21 @@ num_new_palette--; palette[png_ptr->index_to_palette[j]] = palette[num_new_palette]; - if (!full_dither) + if (!full_quantize) { int k; for (k = 0; k < num_palette; k++) { - if (png_ptr->dither_index[k] == + if (png_ptr->quantize_index[k] == png_ptr->index_to_palette[j]) - png_ptr->dither_index[k] = + png_ptr->quantize_index[k] = png_ptr->index_to_palette[next_j]; - if ((int)png_ptr->dither_index[k] == + if ((int)png_ptr->quantize_index[k] == num_new_palette) - png_ptr->dither_index[k] = + png_ptr->quantize_index[k] = png_ptr->index_to_palette[j]; } } @@ -474,17 +473,17 @@ png_ptr->palette = palette; } png_ptr->num_palette = (png_uint_16)num_palette; - if (full_dither) + if (full_quantize) { int i; png_bytep distance; - int total_bits = PNG_DITHER_RED_BITS + PNG_DITHER_GREEN_BITS + - PNG_DITHER_BLUE_BITS; - int num_red = (1 << PNG_DITHER_RED_BITS); - int num_green = (1 << PNG_DITHER_GREEN_BITS); - int num_blue = (1 << PNG_DITHER_BLUE_BITS); + int total_bits = PNG_QUANTIZE_RED_BITS + PNG_QUANTIZE_GREEN_BITS + + PNG_QUANTIZE_BLUE_BITS; + int num_red = (1 << PNG_QUANTIZE_RED_BITS); + int num_green = (1 << PNG_QUANTIZE_GREEN_BITS); + int num_blue = (1 << PNG_QUANTIZE_BLUE_BITS); png_size_t num_entries = ((png_size_t)1 << total_bits); png_ptr->palette_lookup = (png_bytep )png_calloc(png_ptr, (png_uint_32)(num_entries * png_sizeof(png_byte))); @@ -495,26 +494,26 @@ for (i = 0; i < num_palette; i++) { int ir, ig, ib; - int r = (palette[i].red >> (8 - PNG_DITHER_RED_BITS)); - int g = (palette[i].green >> (8 - PNG_DITHER_GREEN_BITS)); - int b = (palette[i].blue >> (8 - PNG_DITHER_BLUE_BITS)); + int r = (palette[i].red >> (8 - PNG_QUANTIZE_RED_BITS)); + int g = (palette[i].green >> (8 - PNG_QUANTIZE_GREEN_BITS)); + int b = (palette[i].blue >> (8 - PNG_QUANTIZE_BLUE_BITS)); for (ir = 0; ir < num_red; ir++) { /* int dr = abs(ir - r); */ int dr = ((ir > r) ? ir - r : r - ir); - int index_r = (ir << (PNG_DITHER_BLUE_BITS + - PNG_DITHER_GREEN_BITS)); + int index_r = (ir << (PNG_QUANTIZE_BLUE_BITS + + PNG_QUANTIZE_GREEN_BITS)); for (ig = 0; ig < num_green; ig++) { /* int dg = abs(ig - g); */ int dg = ((ig > g) ? ig - g : g - ig); int dt = dr + dg; int dm = ((dr > dg) ? dr : dg); - int index_g = index_r | (ig << PNG_DITHER_BLUE_BITS); + int index_g = index_r | (ig << PNG_QUANTIZE_BLUE_BITS); for (ib = 0; ib < num_blue; ib++) { int d_index = index_g | ib; @@ -535,9 +534,9 @@ png_free(png_ptr, distance); } } -#endif +#endif /* PNG_READ_QUANTIZE_SUPPORTED */ #if defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) /* Transform the image from the file_gamma to the screen_gamma. We * only do transformations on images where the file_gamma and screen_gamma @@ -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); @@ -1228,10 +1232,10 @@ if (png_ptr->transformations & PNG_RGB_TO_GRAY) info_ptr->color_type &= ~PNG_COLOR_MASK_COLOR; #endif -#ifdef PNG_READ_DITHER_SUPPORTED - if (png_ptr->transformations & PNG_DITHER) +#ifdef PNG_READ_QUANTIZE_SUPPORTED + if (png_ptr->transformations & PNG_QUANTIZE) { if (((info_ptr->color_type == PNG_COLOR_TYPE_RGB) || (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)) && png_ptr->palette_lookup && info_ptr->bit_depth == 8) @@ -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, @@ -1450,17 +1454,17 @@ if (png_ptr->transformations & PNG_16_TO_8) png_do_chop(&(png_ptr->row_info), png_ptr->row_buf + 1); #endif -#ifdef PNG_READ_DITHER_SUPPORTED - if (png_ptr->transformations & PNG_DITHER) +#ifdef PNG_READ_QUANTIZE_SUPPORTED + if (png_ptr->transformations & PNG_QUANTIZE) { - png_do_dither((png_row_infop)&(png_ptr->row_info), png_ptr->row_buf + 1, - png_ptr->palette_lookup, png_ptr->dither_index); + png_do_quantize((png_row_infop)&(png_ptr->row_info), png_ptr->row_buf + 1, + png_ptr->palette_lookup, png_ptr->quantize_index); if (png_ptr->row_info.rowbytes == (png_uint_32)0) - png_error(png_ptr, "png_do_dither returned rowbytes=0"); + png_error(png_ptr, "png_do_quantize returned rowbytes=0"); } -#endif +#endif /* PNG_READ_QUANTIZE_SUPPORTED */ #ifdef PNG_READ_INVERT_SUPPORTED if (png_ptr->transformations & PNG_INVERT_MONO) png_do_invert(&(png_ptr->row_info), png_ptr->row_buf + 1); @@ -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 @@ -3789,18 +3807,18 @@ } } #endif -#ifdef PNG_READ_DITHER_SUPPORTED +#ifdef PNG_READ_QUANTIZE_SUPPORTED void /* PRIVATE */ -png_do_dither(png_row_infop row_info, png_bytep row, - png_bytep palette_lookup, png_bytep dither_lookup) +png_do_quantize(png_row_infop row_info, png_bytep row, + png_bytep palette_lookup, png_bytep quantize_lookup) { png_bytep sp, dp; png_uint_32 i; png_uint_32 row_width=row_info->width; - png_debug(1, "in png_do_dither"); + png_debug(1, "in png_do_quantize"); { if (row_info->color_type == PNG_COLOR_TYPE_RGB && palette_lookup && row_info->bit_depth == 8) @@ -3820,16 +3838,16 @@ * p = (((r >> 3) & 0x1f) << 10) | * (((g >> 3) & 0x1f) << 5) | * ((b >> 3) & 0x1f); */ - p = (((r >> (8 - PNG_DITHER_RED_BITS)) & - ((1 << PNG_DITHER_RED_BITS) - 1)) << - (PNG_DITHER_GREEN_BITS + PNG_DITHER_BLUE_BITS)) | - (((g >> (8 - PNG_DITHER_GREEN_BITS)) & - ((1 << PNG_DITHER_GREEN_BITS) - 1)) << - (PNG_DITHER_BLUE_BITS)) | - ((b >> (8 - PNG_DITHER_BLUE_BITS)) & - ((1 << PNG_DITHER_BLUE_BITS) - 1)); + p = (((r >> (8 - PNG_QUANTIZE_RED_BITS)) & + ((1 << PNG_QUANTIZE_RED_BITS) - 1)) << + (PNG_QUANTIZE_GREEN_BITS + PNG_QUANTIZE_BLUE_BITS)) | + (((g >> (8 - PNG_QUANTIZE_GREEN_BITS)) & + ((1 << PNG_QUANTIZE_GREEN_BITS) - 1)) << + (PNG_QUANTIZE_BLUE_BITS)) | + ((b >> (8 - PNG_QUANTIZE_BLUE_BITS)) & + ((1 << PNG_QUANTIZE_BLUE_BITS) - 1)); *dp++ = palette_lookup[p]; } row_info->color_type = PNG_COLOR_TYPE_PALETTE; @@ -3849,16 +3867,16 @@ g = *sp++; b = *sp++; sp++; - p = (((r >> (8 - PNG_DITHER_RED_BITS)) & - ((1 << PNG_DITHER_RED_BITS) - 1)) << - (PNG_DITHER_GREEN_BITS + PNG_DITHER_BLUE_BITS)) | - (((g >> (8 - PNG_DITHER_GREEN_BITS)) & - ((1 << PNG_DITHER_GREEN_BITS) - 1)) << - (PNG_DITHER_BLUE_BITS)) | - ((b >> (8 - PNG_DITHER_BLUE_BITS)) & - ((1 << PNG_DITHER_BLUE_BITS) - 1)); + p = (((r >> (8 - PNG_QUANTIZE_RED_BITS)) & + ((1 << PNG_QUANTIZE_RED_BITS) - 1)) << + (PNG_QUANTIZE_GREEN_BITS + PNG_QUANTIZE_BLUE_BITS)) | + (((g >> (8 - PNG_QUANTIZE_GREEN_BITS)) & + ((1 << PNG_QUANTIZE_GREEN_BITS) - 1)) << + (PNG_QUANTIZE_BLUE_BITS)) | + ((b >> (8 - PNG_QUANTIZE_BLUE_BITS)) & + ((1 << PNG_QUANTIZE_BLUE_BITS) - 1)); *dp++ = palette_lookup[p]; } row_info->color_type = PNG_COLOR_TYPE_PALETTE; @@ -3866,19 +3884,19 @@ row_info->pixel_depth = row_info->bit_depth; row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_width); } else if (row_info->color_type == PNG_COLOR_TYPE_PALETTE && - dither_lookup && row_info->bit_depth == 8) + quantize_lookup && row_info->bit_depth == 8) { sp = row; for (i = 0; i < row_width; i++, sp++) { - *sp = dither_lookup[*sp]; + *sp = quantize_lookup[*sp]; } } } } -#endif +#endif /* PNG_READ_QUANTIZE_SUPPORTED */ #ifdef PNG_FLOATING_POINT_SUPPORTED #ifdef PNG_READ_GAMMA_SUPPORTED static PNG_CONST int png_gamma_shift[] = diff -ru4NwbB libpng-1.4.1/pngrutil.c libpng-1.5.0beta18/pngrutil.c --- libpng-1.4.1/pngrutil.c 2010-02-25 05:38:30.252231541 -0600 +++ libpng-1.5.0beta18/pngrutil.c 2010-04-17 19:07:56.814895102 -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) { @@ -29,25 +28,26 @@ return (i); } #ifndef PNG_USE_READ_MACROS /* 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 (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); } /* Grab a signed 32-bit integer from a buffer in big-endian format. The * data is stored in the PNG file in two's complement format, and it is * assumed that the machine format for signed integers is the same. */ -png_int_32 PNGAPI -png_get_int_32(png_bytep buf) +png_int_32 (PNGAPI +png_get_int_32)(png_bytep buf) { png_int_32 i = ((png_int_32)(*buf) << 24) + ((png_int_32)(*(buf + 1)) << 16) + ((png_int_32)(*(buf + 2)) << 8) + @@ -56,10 +56,10 @@ return (i); } /* Grab an unsigned 16-bit integer from a buffer in big-endian format. */ -png_uint_16 PNGAPI -png_get_uint_16(png_bytep buf) +png_uint_16 (PNGAPI +png_get_uint_16)(png_bytep buf) { png_uint_16 i = (png_uint_16)(((png_uint_16)(*buf) << 8) + (png_uint_16)(*(buf + 1))); @@ -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) { @@ -889,11 +903,13 @@ fprintf(stderr, "gx=%f, gy=%f, bx=%f, by=%f\n", green_x, green_y, blue_x, blue_y); #else fprintf(stderr, "wx=%ld, wy=%ld, rx=%ld, ry=%ld\n", - int_x_white, int_y_white, int_x_red, int_y_red); + (long)int_x_white, (long)int_y_white, + (long)int_x_red, (long)int_y_red); fprintf(stderr, "gx=%ld, gy=%ld, bx=%ld, by=%ld\n", - int_x_green, int_y_green, int_x_blue, int_y_blue); + (long)int_x_green, (long)int_y_green, + (long)int_x_blue, (long)int_y_blue); #endif #endif /* PNG_CONSOLE_IO_SUPPORTED */ } return; @@ -1118,17 +1134,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 +1466,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 +1673,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 +1701,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 +1720,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 +1813,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 +2051,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 +2105,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 +2170,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 +2225,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 +2334,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 +2450,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 +2470,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 +2683,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 +2909,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 +3357,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.0beta18/pngset.c --- libpng-1.4.1/pngset.c 2010-02-25 05:38:30.260562697 -0600 +++ libpng-1.5.0beta18/pngset.c 2010-04-17 19:07:56.823210651 -0500 @@ -1,8 +1,8 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.4.1 [April 18, 2010] + * Last changed in libpng 1.5.0 [April 18, 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.0beta18/pngstruct.h --- libpng-1.4.1/pngstruct.h 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta18/pngstruct.h 2010-04-17 19:07:56.715924145 -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 18, 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_QUANTIZE_SUPPORTED + png_bytep palette_lookup; /* lookup table for quantizing */ + png_bytep quantize_index; /* index translation for palette files */ +#endif + +#if defined(PNG_READ_QUANTIZE_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_QUANTIZE_SUPPORTED +/* The following three members were added at version 1.0.14 and 1.2.4 */ + png_bytep quantize_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.0beta18/pngtest.c --- libpng-1.4.1/pngtest.c 2010-02-25 05:38:30.269808116 -0600 +++ libpng-1.5.0beta18/pngtest.c 2010-04-17 19:07:56.832387223 -0500 @@ -1,8 +1,8 @@ /* pngtest.c - a simple test program to test libpng * - * Last changed in libpng 1.4.1 [April 18, 2010] + * Last changed in libpng 1.5.0 [April 18, 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,23 +31,36 @@ * of files at once by typing "pngtest -m file1.png file2.png ..." */ #include "png.h" -#include "pngpriv.h" - +/* Copied from pngpriv.h but only used in error messages below. */ +#ifndef PNG_ZBUF_SIZE +# define PNG_ZBUF_SIZE 8192 +#endif # include # include +# include # define FCLOSE(file) fclose(file) #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 +94,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 +104,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 +126,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 +143,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 +160,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 +271,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 +300,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 +340,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 +354,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 +374,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 +420,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 +437,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 +474,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 +519,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 +569,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 +591,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 +668,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 +689,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 +726,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 +755,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 +777,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 +842,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 +1032,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 +1102,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 +1145,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 +1169,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 +1196,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 +1210,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 +1220,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 +1281,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 +1397,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.0beta18/pngtrans.c --- libpng-1.4.1/pngtrans.c 2010-02-25 05:38:30.276418365 -0600 +++ libpng-1.5.0beta18/pngtrans.c 2010-04-17 19:07:56.839378118 -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 18, 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.0beta18/pngwio.c --- libpng-1.4.1/pngwio.c 2010-02-25 05:38:30.281788194 -0600 +++ libpng-1.5.0beta18/pngwio.c 2010-04-17 19:07:56.844640530 -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 18, 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.0beta18/pngwrite.c --- libpng-1.4.1/pngwrite.c 2010-02-25 05:38:30.290604661 -0600 +++ libpng-1.5.0beta18/pngwrite.c 2010-04-17 19:07:56.853684870 -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 18, 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.0beta18/pngwtran.c --- libpng-1.4.1/pngwtran.c 2010-02-25 05:38:30.297152013 -0600 +++ libpng-1.5.0beta18/pngwtran.c 2010-04-17 19:07:56.860019586 -0500 @@ -1,8 +1,8 @@ /* pngwtran.c - transforms the data in a row for PNG writers * - * Last changed in libpng 1.4.1 [April 18, 2010] + * Last changed in libpng 1.5.0 [April 18, 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.0beta18/pngwutil.c --- libpng-1.4.1/pngwutil.c 2010-02-25 05:38:30.309075604 -0600 +++ libpng-1.5.0beta18/pngwutil.c 2010-04-17 19:07:56.871895502 -0500 @@ -1,8 +1,8 @@ /* pngwutil.c - utilities to write a PNG file * - * Last changed in libpng 1.4.1 [April 18, 2010] + * Last changed in libpng 1.5.0 [April 18, 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.0beta18/projects/visualc6/README.txt --- libpng-1.4.1/projects/visualc6/README.txt 2010-02-25 05:38:32.709699497 -0600 +++ libpng-1.5.0beta18/projects/visualc6/README.txt 2010-04-17 19:07:59.021453775 -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.0beta18/projects/visualc6/libpng.dsp --- libpng-1.4.1/projects/visualc6/libpng.dsp 2010-02-25 05:38:32.719705133 -0600 +++ libpng-1.5.0beta18/projects/visualc6/libpng.dsp 2010-04-17 19:07:59.032049927 -0500 @@ -43,24 +43,24 @@ # 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 "..\..\scripts" /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 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" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG" BSC32=bscmake.exe # 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,24 +74,24 @@ # 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 "..\..\scripts" /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 RSC=rc.exe -# ADD BASE RSC /l 0x409 /d "PNG_NO_PEDANTIC_WARNINGS" /d "_DEBUG" -# ADD RSC /l 0x409 /i "..\.." /d "PNG_NO_PEDANTIC_WARNINGS" /d "_DEBUG" /d PNG_DEBUG=1 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /i "..\.." /d "_DEBUG" /d PNG_DEBUG=1 BSC32=bscmake.exe # 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,27 +105,27 @@ # 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" /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 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" /dPNG_LIBPNG_DLLFNAME_POSTFIX=""""VB"""" /dPNG_LIBPNG_SPECIALBUILD=""""__stdcall calling convention used for exported functions"""" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /i "." /i "..\.." /d "NDEBUG" BSC32=bscmake.exe # 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,15 +141,15 @@ # 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 "..\..\scripts" /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" +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /i "..\.." /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib @@ -168,15 +168,15 @@ # 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 "..\..\scripts" /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" +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib diff -ru4NwbB libpng-1.4.1/projects/visualc6/pnglibconf.h libpng-1.5.0beta18/projects/visualc6/pnglibconf.h --- libpng-1.4.1/projects/visualc6/pnglibconf.h 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta18/projects/visualc6/pnglibconf.h 2010-04-17 08:41:30.475582000 -0500 @@ -0,0 +1,151 @@ +/* pnglibconf.h - library build configuration */ + +/* libpng version 1.5.0beta17 - April 2, 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 */ + +/* This file generates a libpng library with no STDIO support, + * it is provided to allow generation of a DLL suitable for use + * with Visual Basic and for no other purpose. + */ +/* Machine generated file: DO NOT EDIT */ +/* Derived from: scripts/pnglibconf.dfa with PNG_NO_STDIO */ +#ifndef PNGLCONF_H +#define PNGLCONF_H +/* settings */ +#define PNG_USER_PRIVATEBUILD "libpng DLL for use with Visual Basic" +#define PNG_USER_DLLFNAME_POSTFIX "VB" +#define PNG_CALLOC_SUPPORTED +#define PNG_USER_WIDTH_MAX 1000000L +#define PNG_API_RULE 0 +#define PNG_USER_CHUNK_CACHE_MAX 0 +#define PNG_USER_HEIGHT_MAX 1000000L +#define PNG_USER_CHUNK_MALLOC_MAX 0 +#define PNG_DEFAULT_READ_MACROS 1 +/* end of settings */ +/* options */ +#define PNG_INFO_IMAGE_SUPPORTED +#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +#define PNG_WRITE_SUPPORTED +#define PNG_WRITE_INTERLACING_SUPPORTED +#define PNG_EASY_ACCESS_SUPPORTED +#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_USER_LIMITS_SUPPORTED +#define PNG_FIXED_POINT_SUPPORTED +#define PNG_ERROR_TEXT_SUPPORTED +#define PNG_READ_SUPPORTED +#define PNG_SETJMP_SUPPORTED +#define PNG_WRITE_FLUSH_SUPPORTED +#define PNG_MNG_FEATURES_SUPPORTED +#define PNG_FLOATING_POINT_SUPPORTED +#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_USER_MEM_SUPPORTED +#define PNG_IO_STATE_SUPPORTED +#define PNG_SET_USER_LIMITS_SUPPORTED +#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED +#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED +#define PNG_WRITE_FILTER_SUPPORTED +#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED +#define PNG_WRITE_iCCP_SUPPORTED +#define PNG_READ_TRANSFORMS_SUPPORTED +#define PNG_READ_GAMMA_SUPPORTED +#define PNG_READ_bKGD_SUPPORTED +#define PNG_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_READ_sCAL_SUPPORTED +#define PNG_WRITE_hIST_SUPPORTED +#define PNG_READ_OPT_PLTE_SUPPORTED +#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED +#define PNG_WRITE_gAMA_SUPPORTED +#define PNG_READ_GRAY_TO_RGB_SUPPORTED +#define PNG_WRITE_pCAL_SUPPORTED +#define PNG_READ_INVERT_ALPHA_SUPPORTED +#define PNG_WRITE_TRANSFORMS_SUPPORTED +#define PNG_READ_sBIT_SUPPORTED +#define PNG_READ_PACK_SUPPORTED +#define PNG_WRITE_SWAP_SUPPORTED +#define PNG_READ_cHRM_SUPPORTED +#define PNG_WRITE_tIME_SUPPORTED +#define PNG_READ_INTERLACING_SUPPORTED +#define PNG_READ_tRNS_SUPPORTED +#define PNG_WRITE_pHYs_SUPPORTED +#define PNG_WRITE_INVERT_SUPPORTED +#define PNG_READ_RGB_TO_GRAY_SUPPORTED +#define PNG_WRITE_sRGB_SUPPORTED +#define PNG_READ_oFFs_SUPPORTED +#define PNG_WRITE_FILLER_SUPPORTED +#define PNG_WRITE_TEXT_SUPPORTED +#define PNG_WRITE_SHIFT_SUPPORTED +#define PNG_PROGRESSIVE_READ_SUPPORTED +#define PNG_READ_SHIFT_SUPPORTED +#define PNG_CONVERT_tIME_SUPPORTED +#define PNG_READ_USER_TRANSFORM_SUPPORTED +#define PNG_READ_USER_CHUNKS_SUPPORTED +#define PNG_READ_hIST_SUPPORTED +#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED +#define PNG_READ_SWAP_ALPHA_SUPPORTED +#define PNG_READ_COMPOSITE_NODIV_SUPPORTED +#define PNG_SEQUENTIAL_READ_SUPPORTED +#define PNG_READ_BACKGROUND_SUPPORTED +#define PNG_READ_iCCP_SUPPORTED +#define PNG_READ_STRIP_ALPHA_SUPPORTED +#define PNG_READ_PACKSWAP_SUPPORTED +#define PNG_READ_sRGB_SUPPORTED +#define PNG_WRITE_tEXt_SUPPORTED +#define PNG_READ_gAMA_SUPPORTED +#define PNG_READ_pCAL_SUPPORTED +#define PNG_READ_EXPAND_SUPPORTED +#define PNG_WRITE_sPLT_SUPPORTED +#define PNG_READ_SWAP_SUPPORTED +#define PNG_READ_tIME_SUPPORTED +#define PNG_READ_pHYs_SUPPORTED +#define PNG_WRITE_SWAP_ALPHA_SUPPORTED +#define PNG_READ_TEXT_SUPPORTED +#define PNG_WRITE_BGR_SUPPORTED +#define PNG_USER_CHUNKS_SUPPORTED +#define PNG_GET_INT_32_SUPPORTED +#define PNG_WRITE_PACK_SUPPORTED +#define PNG_READ_FILLER_SUPPORTED +#define PNG_WRITE_bKGD_SUPPORTED +#define PNG_WRITE_tRNS_SUPPORTED +#define PNG_READ_sPLT_SUPPORTED +#define PNG_WRITE_sCAL_SUPPORTED +#define PNG_WRITE_oFFs_SUPPORTED +#define PNG_READ_tEXt_SUPPORTED +#define PNG_WRITE_sBIT_SUPPORTED +#define PNG_READ_INVERT_SUPPORTED +#define PNG_READ_16_TO_8_SUPPORTED +#define PNG_WRITE_cHRM_SUPPORTED +#define PNG_WRITE_USER_TRANSFORM_SUPPORTED +#define PNG_READ_BGR_SUPPORTED +#define PNG_WRITE_PACKSWAP_SUPPORTED +#define PNG_WRITE_INVERT_ALPHA_SUPPORTED +#define PNG_sCAL_SUPPORTED +#define PNG_WRITE_zTXt_SUPPORTED +#define PNG_sBIT_SUPPORTED +#define PNG_cHRM_SUPPORTED +#define PNG_bKGD_SUPPORTED +#define PNG_tRNS_SUPPORTED +#define PNG_WRITE_iTXt_SUPPORTED +#define PNG_oFFs_SUPPORTED +#define PNG_USER_TRANSFORM_PTR_SUPPORTED +#define PNG_hIST_SUPPORTED +#define PNG_iCCP_SUPPORTED +#define PNG_sRGB_SUPPORTED +#define PNG_READ_zTXt_SUPPORTED +#define PNG_gAMA_SUPPORTED +#define PNG_pCAL_SUPPORTED +#define PNG_tIME_SUPPORTED +#define PNG_pHYs_SUPPORTED +#define PNG_READ_iTXt_SUPPORTED +#define PNG_TEXT_SUPPORTED +#define PNG_SAVE_INT_32_SUPPORTED +#define PNG_sPLT_SUPPORTED +#define PNG_tEXt_SUPPORTED +#define PNG_zTXt_SUPPORTED +#define PNG_iTXt_SUPPORTED +/* end of options */ +#endif /* PNGLCONF_H */ diff -ru4NwbB libpng-1.4.1/projects/visualc6/pngtest.dsp libpng-1.5.0beta18/projects/visualc6/pngtest.dsp --- libpng-1.4.1/projects/visualc6/pngtest.dsp 2010-02-25 05:38:32.729326139 -0600 +++ libpng-1.5.0beta18/projects/visualc6/pngtest.dsp 2010-04-17 19:07:59.042174341 -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" /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" /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.0beta18/projects/visualc71/README.txt --- libpng-1.4.1/projects/visualc71/README.txt 2009-11-14 06:16:20.000000000 -0600 +++ libpng-1.5.0beta18/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.0beta18/projects/visualc71/libpng.vcproj --- libpng-1.4.1/projects/visualc71/libpng.vcproj 2009-12-04 07:53:56.000000000 -0600 +++ libpng-1.5.0beta18/projects/visualc71/libpng.vcproj 2010-04-17 08:43:53.123877000 -0500 @@ -10,30 +10,29 @@ + OutputFile="$(OutDir)\libpng%DLLNUM%.dll" + LinkIncremental="1"/> @@ -44,9 +43,9 @@ + AdditionalIncludeDirectories="..\..\scripts;..\..\..\zlib;$(IntDir)"/> @@ -58,29 +57,28 @@ Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + AdditionalIncludeDirectories="..\..\scripts;..\..\..\zlib;$(IntDir)"/> @@ -106,28 +104,28 @@ Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + AdditionalIncludeDirectories="..\..\scripts;..\..\..\zlib;$(IntDir)"/> @@ -154,28 +151,28 @@ Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + OutputFile="$(OutDir)\libpng.lib"/> @@ -195,28 +192,28 @@ Name="VCAuxiliaryManagedWrapperGeneratorTool"/> + OutputFile="$(OutDir)\libpngd.lib"/> @@ -335,29 +332,8 @@ - - - - - - - - - - - @@ -380,8 +356,20 @@ + + + + + + + + @@ -401,9 +389,9 @@ + RelativePath="PRJ0041.mak"> - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - libpng - CFBundleIconFile - - CFBundleIdentifier - com.apple.carbonframeworktemplate - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - FMWK - CFBundleSignature - ???? - CFBundleVersion - 1.0 - CFBundleShortVersionString - 1.0 - CSResourcesFileMapped - - - diff -ru4NwbB libpng-1.4.1/projects/xcode/README.txt libpng-1.5.0beta18/projects/xcode/README.txt --- libpng-1.4.1/projects/xcode/README.txt 2009-12-04 07:54:02.000000000 -0600 +++ libpng-1.5.0beta18/projects/xcode/README.txt 1969-12-31 18:00:00.000000000 -0600 @@ -1,9 +0,0 @@ -The xcode project has not been entirely updated to libpng-1.4.0. - -It needs to *not* depend on pnggccrd.c or pngvcrd.c - -It needs to PNG_NO_PEDANTIC_WARNINGS in the CFLAGS while building -the library, but not while building an application. - -If an updated version is not received, this project will -be removed when libpng-1.4.0 is released. diff -ru4NwbB libpng-1.4.1/projects/xcode/libpng.xcodeproj/.gitignore libpng-1.5.0beta18/projects/xcode/libpng.xcodeproj/.gitignore --- libpng-1.4.1/projects/xcode/libpng.xcodeproj/.gitignore 2009-10-05 12:08:58.000000000 -0500 +++ libpng-1.5.0beta18/projects/xcode/libpng.xcodeproj/.gitignore 1969-12-31 18:00:00.000000000 -0600 @@ -1,2 +0,0 @@ -*.mode1* -*.pbxuser diff -ru4NwbB libpng-1.4.1/projects/xcode/libpng.xcodeproj/project.pbxproj libpng-1.5.0beta18/projects/xcode/libpng.xcodeproj/project.pbxproj --- libpng-1.4.1/projects/xcode/libpng.xcodeproj/project.pbxproj 2010-02-25 05:38:31.620976336 -0600 +++ libpng-1.5.0beta18/projects/xcode/libpng.xcodeproj/project.pbxproj 1969-12-31 18:00:00.000000000 -0600 @@ -1,353 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 44; - objects = { - -/* Begin PBXBuildFile section */ - 14461C7109C3C37F005840C0 /* png.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C5D09C3C37F005840C0 /* png.c */; }; - 14461C7209C3C37F005840C0 /* png.h in Headers */ = {isa = PBXBuildFile; fileRef = 14461C5E09C3C37F005840C0 /* png.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 14461C7309C3C37F005840C0 /* pngconf.h in Headers */ = {isa = PBXBuildFile; fileRef = 14461C5F09C3C37F005840C0 /* pngconf.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 14461C7409C3C37F005840C0 /* pngerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6009C3C37F005840C0 /* pngerror.c */; }; - 14461C7509C3C37F005840C0 /* pnggccrd.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6109C3C37F005840C0 /* pnggccrd.c */; }; - 14461C7609C3C37F005840C0 /* pngget.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6209C3C37F005840C0 /* pngget.c */; }; - 14461C7709C3C37F005840C0 /* pngmem.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6309C3C37F005840C0 /* pngmem.c */; }; - 14461C7809C3C37F005840C0 /* pngpread.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6409C3C37F005840C0 /* pngpread.c */; }; - 14461C7909C3C37F005840C0 /* pngread.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6509C3C37F005840C0 /* pngread.c */; }; - 14461C7A09C3C37F005840C0 /* pngrio.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6609C3C37F005840C0 /* pngrio.c */; }; - 14461C7B09C3C37F005840C0 /* pngrtran.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6709C3C37F005840C0 /* pngrtran.c */; }; - 14461C7C09C3C37F005840C0 /* pngrutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6809C3C37F005840C0 /* pngrutil.c */; }; - 14461C7D09C3C37F005840C0 /* pngset.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6909C3C37F005840C0 /* pngset.c */; }; - 14461C7F09C3C37F005840C0 /* pngtrans.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6B09C3C37F005840C0 /* pngtrans.c */; }; - 14461C8009C3C37F005840C0 /* pngvcrd.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6C09C3C37F005840C0 /* pngvcrd.c */; }; - 14461C8109C3C37F005840C0 /* pngwio.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6D09C3C37F005840C0 /* pngwio.c */; }; - 14461C8209C3C37F005840C0 /* pngwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6E09C3C37F005840C0 /* pngwrite.c */; }; - 14461C8309C3C37F005840C0 /* pngwtran.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6F09C3C37F005840C0 /* pngwtran.c */; }; - 14461C8409C3C37F005840C0 /* pngwutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C7009C3C37F005840C0 /* pngwutil.c */; }; - 67FA470510693F6B0078FB9E /* pngpriv.h in Headers */ = {isa = PBXBuildFile; fileRef = 67FA470410693F6B0078FB9E /* pngpriv.h */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 14461C5D09C3C37F005840C0 /* png.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = png.c; path = ../../png.c; sourceTree = SOURCE_ROOT; }; - 14461C5E09C3C37F005840C0 /* png.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = png.h; path = ../../png.h; sourceTree = SOURCE_ROOT; }; - 14461C5F09C3C37F005840C0 /* pngconf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = pngconf.h; path = ../../pngconf.h; sourceTree = SOURCE_ROOT; }; - 14461C6009C3C37F005840C0 /* pngerror.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngerror.c; path = ../../pngerror.c; sourceTree = SOURCE_ROOT; }; - 14461C6109C3C37F005840C0 /* pnggccrd.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pnggccrd.c; path = ../../pnggccrd.c; sourceTree = SOURCE_ROOT; }; - 14461C6209C3C37F005840C0 /* pngget.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngget.c; path = ../../pngget.c; sourceTree = SOURCE_ROOT; }; - 14461C6309C3C37F005840C0 /* pngmem.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngmem.c; path = ../../pngmem.c; sourceTree = SOURCE_ROOT; }; - 14461C6409C3C37F005840C0 /* pngpread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngpread.c; path = ../../pngpread.c; sourceTree = SOURCE_ROOT; }; - 14461C6509C3C37F005840C0 /* pngread.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngread.c; path = ../../pngread.c; sourceTree = SOURCE_ROOT; }; - 14461C6609C3C37F005840C0 /* pngrio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngrio.c; path = ../../pngrio.c; sourceTree = SOURCE_ROOT; }; - 14461C6709C3C37F005840C0 /* pngrtran.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngrtran.c; path = ../../pngrtran.c; sourceTree = SOURCE_ROOT; }; - 14461C6809C3C37F005840C0 /* pngrutil.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngrutil.c; path = ../../pngrutil.c; sourceTree = SOURCE_ROOT; }; - 14461C6909C3C37F005840C0 /* pngset.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngset.c; path = ../../pngset.c; sourceTree = SOURCE_ROOT; }; - 14461C6B09C3C37F005840C0 /* pngtrans.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngtrans.c; path = ../../pngtrans.c; sourceTree = SOURCE_ROOT; }; - 14461C6C09C3C37F005840C0 /* pngvcrd.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngvcrd.c; path = ../../pngvcrd.c; sourceTree = SOURCE_ROOT; }; - 14461C6D09C3C37F005840C0 /* pngwio.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngwio.c; path = ../../pngwio.c; sourceTree = SOURCE_ROOT; }; - 14461C6E09C3C37F005840C0 /* pngwrite.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngwrite.c; path = ../../pngwrite.c; sourceTree = SOURCE_ROOT; }; - 14461C6F09C3C37F005840C0 /* pngwtran.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngwtran.c; path = ../../pngwtran.c; sourceTree = SOURCE_ROOT; }; - 14461C7009C3C37F005840C0 /* pngwutil.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngwutil.c; path = ../../pngwutil.c; sourceTree = SOURCE_ROOT; }; - 67FA470410693F6B0078FB9E /* pngpriv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pngpriv.h; path = ../../pngpriv.h; sourceTree = SOURCE_ROOT; }; - 8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D07F2C80486CC7A007CD1D0 /* libpng.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = libpng.framework; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D07F2C30486CC7A007CD1D0 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 034768DDFF38A45A11DB9C8B /* Products */ = { - isa = PBXGroup; - children = ( - 8D07F2C80486CC7A007CD1D0 /* libpng.framework */, - ); - name = Products; - sourceTree = ""; - }; - 0867D691FE84028FC02AAC07 /* libpng */ = { - isa = PBXGroup; - children = ( - 08FB77ACFE841707C02AAC07 /* Source */, - 089C1665FE841158C02AAC07 /* Resources */, - 034768DDFF38A45A11DB9C8B /* Products */, - ); - name = libpng; - sourceTree = ""; - }; - 089C1665FE841158C02AAC07 /* Resources */ = { - isa = PBXGroup; - children = ( - 8D07F2C70486CC7A007CD1D0 /* Info.plist */, - ); - name = Resources; - sourceTree = ""; - }; - 08FB77ACFE841707C02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - 67FA470410693F6B0078FB9E /* pngpriv.h */, - 14461C5D09C3C37F005840C0 /* png.c */, - 14461C5E09C3C37F005840C0 /* png.h */, - 14461C5F09C3C37F005840C0 /* pngconf.h */, - 14461C6009C3C37F005840C0 /* pngerror.c */, - 14461C6109C3C37F005840C0 /* pnggccrd.c */, - 14461C6209C3C37F005840C0 /* pngget.c */, - 14461C6309C3C37F005840C0 /* pngmem.c */, - 14461C6409C3C37F005840C0 /* pngpread.c */, - 14461C6509C3C37F005840C0 /* pngread.c */, - 14461C6609C3C37F005840C0 /* pngrio.c */, - 14461C6709C3C37F005840C0 /* pngrtran.c */, - 14461C6809C3C37F005840C0 /* pngrutil.c */, - 14461C6909C3C37F005840C0 /* pngset.c */, - 14461C6B09C3C37F005840C0 /* pngtrans.c */, - 14461C6C09C3C37F005840C0 /* pngvcrd.c */, - 14461C6D09C3C37F005840C0 /* pngwio.c */, - 14461C6E09C3C37F005840C0 /* pngwrite.c */, - 14461C6F09C3C37F005840C0 /* pngwtran.c */, - 14461C7009C3C37F005840C0 /* pngwutil.c */, - ); - name = Source; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 8D07F2BD0486CC7A007CD1D0 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 14461C7209C3C37F005840C0 /* png.h in Headers */, - 14461C7309C3C37F005840C0 /* pngconf.h in Headers */, - 67FA470510693F6B0078FB9E /* pngpriv.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 8D07F2BC0486CC7A007CD1D0 /* libpng */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "libpng" */; - buildPhases = ( - 8D07F2BD0486CC7A007CD1D0 /* Headers */, - 8D07F2BF0486CC7A007CD1D0 /* Resources */, - 8D07F2C10486CC7A007CD1D0 /* Sources */, - 8D07F2C30486CC7A007CD1D0 /* Frameworks */, - 8D07F2C50486CC7A007CD1D0 /* Rez */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = libpng; - productInstallPath = "$(HOME)/Library/Frameworks"; - productName = libpng; - productReference = 8D07F2C80486CC7A007CD1D0 /* libpng.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 0867D690FE84028FC02AAC07 /* Project object */ = { - isa = PBXProject; - buildConfigurationList = 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "libpng" */; - compatibilityVersion = "Xcode 2.4"; - hasScannedForEncodings = 1; - mainGroup = 0867D691FE84028FC02AAC07 /* libpng */; - productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */; - projectDirPath = ""; - projectRoot = ../..; - targets = ( - 8D07F2BC0486CC7A007CD1D0 /* libpng */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D07F2BF0486CC7A007CD1D0 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXRezBuildPhase section */ - 8D07F2C50486CC7A007CD1D0 /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXRezBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D07F2C10486CC7A007CD1D0 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 14461C7109C3C37F005840C0 /* png.c in Sources */, - 14461C7409C3C37F005840C0 /* pngerror.c in Sources */, - 14461C7509C3C37F005840C0 /* pnggccrd.c in Sources */, - 14461C7609C3C37F005840C0 /* pngget.c in Sources */, - 14461C7709C3C37F005840C0 /* pngmem.c in Sources */, - 14461C7809C3C37F005840C0 /* pngpread.c in Sources */, - 14461C7909C3C37F005840C0 /* pngread.c in Sources */, - 14461C7A09C3C37F005840C0 /* pngrio.c in Sources */, - 14461C7B09C3C37F005840C0 /* pngrtran.c in Sources */, - 14461C7C09C3C37F005840C0 /* pngrutil.c in Sources */, - 14461C7D09C3C37F005840C0 /* pngset.c in Sources */, - 14461C7F09C3C37F005840C0 /* pngtrans.c in Sources */, - 14461C8009C3C37F005840C0 /* pngvcrd.c in Sources */, - 14461C8109C3C37F005840C0 /* pngwio.c in Sources */, - 14461C8209C3C37F005840C0 /* pngwrite.c in Sources */, - 14461C8309C3C37F005840C0 /* pngwtran.c in Sources */, - 14461C8409C3C37F005840C0 /* pngwutil.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 4FADC24308B4156D00ABE55E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - DYLIB_COMPATIBILITY_VERSION = 14; - DYLIB_CURRENT_VERSION = 14; - FRAMEWORK_VERSION = 1.4.1; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREFIX_HEADER = ""; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "@executable_path/../Frameworks"; - LIBRARY_STYLE = DYNAMIC; - MACH_O_TYPE = mh_dylib; - OTHER_LDFLAGS = "-lz"; - PRODUCT_NAME = libpng; - WRAPPER_EXTENSION = framework; - }; - name = Debug; - }; - 4FADC24408B4156D00ABE55E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DYLIB_COMPATIBILITY_VERSION = 14; - DYLIB_CURRENT_VERSION = 14; - FRAMEWORK_VERSION = 1.4.1; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREFIX_HEADER = ""; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "@executable_path/../Frameworks"; - LIBRARY_STYLE = DYNAMIC; - MACH_O_TYPE = mh_dylib; - OTHER_LDFLAGS = "-lz"; - PRODUCT_NAME = libpng; - WRAPPER_EXTENSION = framework; - }; - name = Release; - }; - 4FADC24708B4156D00ABE55E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - i386, - ppc, - ppc64, - x86_64, - ); - DEPLOYMENT_POSTPROCESSING = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; - GCC_VERSION_i386 = 4.0; - GCC_VERSION_ppc = 3.3; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.5; - "MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.4; - "MACOSX_DEPLOYMENT_TARGET[arch=ppc]" = 10.2; - MACOSX_DEPLOYMENT_TARGET_i386 = 10.4; - MACOSX_DEPLOYMENT_TARGET_ppc = 10.2; - PREBINDING = NO; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; - "SDKROOT[arch=i386]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - "SDKROOT[arch=ppc]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk"; - SDKROOT_i386 = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - SDKROOT_ppc = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk"; - ZERO_LINK = NO; - }; - name = Debug; - }; - 4FADC24808B4156D00ABE55E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - i386, - ppc, - ppc64, - x86_64, - ); - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_OPTIMIZATION_LEVEL = 2; - GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; - GCC_VERSION_i386 = 4.0; - GCC_VERSION_ppc = 3.3; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.5; - "MACOSX_DEPLOYMENT_TARGET[arch=i386]" = 10.4; - "MACOSX_DEPLOYMENT_TARGET[arch=ppc]" = 10.2; - MACOSX_DEPLOYMENT_TARGET_i386 = 10.4; - MACOSX_DEPLOYMENT_TARGET_ppc = 10.2; - PREBINDING = NO; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; - "SDKROOT[arch=i386]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - "SDKROOT[arch=ppc]" = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk"; - SDKROOT_i386 = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; - SDKROOT_ppc = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk"; - ZERO_LINK = NO; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "libpng" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4FADC24308B4156D00ABE55E /* Debug */, - 4FADC24408B4156D00ABE55E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "libpng" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4FADC24708B4156D00ABE55E /* Debug */, - 4FADC24808B4156D00ABE55E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 0867D690FE84028FC02AAC07 /* Project object */; -} diff -ru4NwbB libpng-1.4.1/scripts/README.txt libpng-1.5.0beta18/scripts/README.txt --- libpng-1.4.1/scripts/README.txt 2010-02-25 05:38:32.224070266 -0600 +++ libpng-1.5.0beta18/scripts/README.txt 2010-04-17 19:07:58.547619809 -0500 @@ -1,7 +1,8 @@ Makefiles for libpng version 1.5.0beta18 - April 18, 2010 +pnglibconf.h => Stores configuration settings makefile.linux => Linux/ELF makefile (gcc, creates libpng%SONAME%.so.%SONUM%.1.5.0beta18) makefile.gcc => Generic makefile (gcc, creates static libpng.a) makefile.knr => Archaic UNIX Makefile that converts files with @@ -14,9 +15,8 @@ makefile.bc32 => 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 +27,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.0beta18) makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib) @@ -53,15 +52,26 @@ smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC compiler (Requires SCOPTIONS, copied from scripts/SCOPTIONS.ppc) Other supporting scripts: + README.txt => This file 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. + pngwin.def => Used by makefile.os2 + pngwin.dfn => Used to maintain pngwin.def SCOPTIONS.ppc => Used with smakefile.ppc +checksym.awk => Used for maintaining pnglibconf.h +def.dfn => Used for maintaining pnglibconf.h +options.awk => Used for maintaining pnglibconf.h +pnglibconf.dfa => Used for maintaining pnglibconf.h +pnglibconf.mak => Used for maintaining pnglibconf.h +sym.dfn => Used for symbol versioning +symbols.def => Used for symbol versioning +symbols.dfn => Used for symbol versioning +vers.dfn => Used for symbol versioning + + Further information can be found in comments in the individual makefiles. diff -ru4NwbB libpng-1.4.1/scripts/checksym.awk libpng-1.5.0beta18/scripts/checksym.awk --- libpng-1.4.1/scripts/checksym.awk 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta18/scripts/checksym.awk 2010-04-16 22:05:18.419891000 -0500 @@ -0,0 +1,155 @@ +#!/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 symbols.dfn or pngwin.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+substr($2,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+substr($3,2) + 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+substr($2,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 + } + unexported=0 + for (o=1; o<=lasto; ++o) { + if (symbol[o] == "" && removed[o] == "") { + if (unexported == 0) unexported = o + if (official[o] == "") { + # missing in export list too, so ok + if (o < lasto) continue + } + } + if (unexported != 0) { + # Symbols in the .def but not in the new file are errors + if (o-1 > unexported) + print "png.h: warning: unexported symbol definitions:", + unexported "-" o-1 + else + print "png.h: warning: unexported symbol definition:", + unexported + unexported = 0 + } + 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 the symbol is missing somewhere or it changed + err = 1 + if (symbol[o] == "") + print "png.h: symbol", o, + "is 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/makefile.32sunu libpng-1.5.0beta18/scripts/makefile.32sunu --- libpng-1.4.1/scripts/makefile.32sunu 2010-02-25 05:38:32.263554797 -0600 +++ libpng-1.5.0beta18/scripts/makefile.32sunu 2010-04-17 19:07:58.586903049 -0500 @@ -81,8 +81,12 @@ $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config +include scripts/pnglibconf.mak +DELETE = $(RM_F) +DFNFLAGS = $(DEFS) $(CPPFLAGS) + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -130,14 +134,14 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -233,5 +237,5 @@ pngwtran.o pngwtran.pic.o: %HEADERS% pngwutil.o pngwutil.pic.o: %HEADERS% pngpread.o pngpread.pic.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.64sunu libpng-1.5.0beta18/scripts/makefile.64sunu --- libpng-1.4.1/scripts/makefile.64sunu 2010-02-25 05:38:32.274566895 -0600 +++ libpng-1.5.0beta18/scripts/makefile.64sunu 2010-04-17 19:07:58.598263328 -0500 @@ -81,8 +81,12 @@ $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config +include scripts/pnglibconf.mak +DELETE = $(RM_F) +DFNFLAGS = $(DEFS) $(CPPFLAGS) + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -133,11 +137,11 @@ install-headers: png.h pngconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -233,5 +237,5 @@ pngwtran.o pngwtran.pic.o: %HEADERS% pngwutil.o pngwutil.pic.o: %HEADERS% pngpread.o pngpread.pic.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.acorn libpng-1.5.0beta18/scripts/makefile.acorn --- libpng-1.4.1/scripts/makefile.acorn 2009-11-25 08:20:24.000000000 -0600 +++ libpng-1.5.0beta18/scripts/makefile.acorn 2010-04-16 22:31:54.118614000 -0500 @@ -42,9 +42,16 @@ MemCheck.CC cc $(ccflags) -o $@ LibPng:$< .c.o: cc $(ccflags) -o $@ $< +# See scripts.mak.libpngconf for how to generate this: +@.h.libpngconf: @.scripts.h.libpngconf + copy @.scripts.h.libpngconf $@ # Static dependencies: +@.o.png @.o.pngerror @.o.pngrio @.o.pngwio @.o.pngmem \ +@.o.pngpread @.o.pngset @.o.pngget @.o.pngread @.o.pngrtran \ +@.o.pngrutil @.o.pngtrans @.o.pngwrite @.o.pngwtran @.o.pngwutil \ +@.o.pngtest: @.h.libpngconf # Dynamic dependencies: diff -ru4NwbB libpng-1.4.1/scripts/makefile.aix libpng-1.5.0beta18/scripts/makefile.aix --- libpng-1.4.1/scripts/makefile.aix 2010-02-25 05:38:32.284706311 -0600 +++ libpng-1.5.0beta18/scripts/makefile.aix 2010-04-17 19:07:58.608550486 -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 @@ -61,8 +61,12 @@ # Targets all: $(LIBNAME)$(A) pngtest$(E) +include scripts/pnglibconf.mak +REMOVE = $(RM_F) +DFNFLAGS = $(DEFS) $(CPPFLAGS) + $(LIBNAME)$(A): $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -77,13 +81,16 @@ -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi -@$(RM_F) $(DI)/$(LIBNAME)/png.h -@$(RM_F) $(DI)/$(LIBNAME)/pngconf.h + -@$(RM_F) $(DI)/$(LIBNAME)/pnglibconf.h -@$(RM_F) $(DI)/png.h -@$(RM_F) $(DI)/pngconf.h - cp png.h pngconf.h $(DI)/$(LIBNAME) + -@$(RM_F) $(DI)/pnglibconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) chmod 644 $(DI)/$(LIBNAME)/png.h \ - $(DI)/$(LIBNAME)/pngconf.h + $(DI)/$(LIBNAME)/pngconf.h \ + $(DI)/$(LIBNAME)/pnglibconf.h -@$(RM_F) -r $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) -@$(RM_F) $(DL)/$(LIBNAME)$(A) -@$(RM_F) $(DL)/libpng$(A) @@ -92,9 +99,9 @@ (cd $(DL); $(LN_SF) $(LIBNAME)$(A) libpng$(A)) (cd $(DI); $(LN_SF) libpng/* .;) clean: - $(RM_F) *.o $(LIBNAME)$(A) pngtest pngout.png + $(RM_F) *.o $(LIBNAME)$(A) pngtest pngout.png pnglibconf.h png$(O): %HEADERS% pngerror$(O): %HEADERS% pngget$(O): %HEADERS% @@ -110,5 +117,5 @@ pngwrite$(O): %HEADERS% pngwtran$(O): %HEADERS% pngwutil$(O): %HEADERS% -pngtest$(O): png.h pngconf.h +pngtest$(O): png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.amiga libpng-1.5.0beta18/scripts/makefile.amiga --- libpng-1.4.1/scripts/makefile.amiga 2009-11-25 08:20:34.000000000 -0600 +++ libpng-1.5.0beta18/scripts/makefile.amiga 2010-04-16 22:31:54.180613000 -0500 @@ -5,10 +5,8 @@ # This code is released under the libpng license. # For conditions of distribution and use, see the disclaimer # and license in png.h # -# Note: Use #define PNG_READ_BIG_ENDIAN_SUPPORTED in pngconf.h -# # Location/path of zlib include files ZLIB=/zlib #compiler CC=sc @@ -25,8 +23,10 @@ # linker LN= slink # file deletion command RM= delete quiet +# file copy command? +CP= copy # library (.lib) file creation command AR= oml # make directory command MKDIR= makedir @@ -40,8 +40,13 @@ libpng.lib: $(OBJS) -$(RM) libpng.lib $(AR) libpng.lib r $(OBJS) +$(OBJS): pngpriv.h png.h pngconf.h pnglibconf.h pnginfo.h pngstruct.h pngdebug.h + +pnglibconf.h: scripts/pnglibconf.h +$(CP) scripts/pnglibconf.h pnglibconf.h + pngtest: pngtest.o libpng.lib $(LN) 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.darwin libpng-1.5.0beta18/scripts/makefile.darwin --- libpng-1.4.1/scripts/makefile.darwin 2010-02-25 05:38:32.346344940 -0600 +++ libpng-1.5.0beta18/scripts/makefile.darwin 2010-04-17 19:07:58.659812034 -0500 @@ -8,9 +8,10 @@ # This code is released under the libpng license. # For conditions of distribution and use, see the disclaimer # and license in png.h -# where "make install" puts libpng.a, libpng%NN%.dylib, png.h and pngconf.h +# where "make install" puts libpng.a, libpng%NN%.dylib, png.h, pngconf.h, +# and pnglibconf.h prefix=/usr/local exec_prefix=$(prefix) # Where the zlib library and include files are located @@ -73,8 +74,12 @@ $(CC) -c $(CFLAGS) -fno-common -o $@ $*.c all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -109,14 +114,14 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -186,9 +191,9 @@ ./pngtesti pngtest.png clean: $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \ - libpng.pc $(LIBNAME).*dylib pngtesti + libpng.pc $(LIBNAME).*dylib pngtesti pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -210,5 +215,5 @@ pngwtran.o pngwtran.pic.o: %HEADERS% pngwutil.o pngwutil.pic.o: %HEADERS% pngpread.o pngpread.pic.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.dec libpng-1.5.0beta18/scripts/makefile.dec --- libpng-1.4.1/scripts/makefile.dec 2010-02-25 05:38:32.356674071 -0600 +++ libpng-1.5.0beta18/scripts/makefile.dec 2010-04-17 19:07:58.670374955 -0500 @@ -61,8 +61,12 @@ pngwtran.o pngmem.o pngerror.o pngpread.o all: $(LIBSO) libpng.a pngtest libpng.pc libpng-config +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -95,14 +99,14 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@/bin/rm -f $(DI)/libpng (cd $(DI); $(LN_SF)(LIBNAME) libpng; $(LN_SF)(LIBNAME)/* .) install-static: install-headers libpng.a @@ -174,9 +178,9 @@ clean: /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png \ libpng-config $(LIBSO) $(LIBSOMAJ)* \ - libpng.pc + libpng.pc pnglibconf.h # DO NOT DELETE THIS LINE -- make depend depends on it. png.o: %HEADERS% @@ -194,5 +198,5 @@ pngwtran.o: %HEADERS% pngwutil.o: %HEADERS% pngpread.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.dj2 libpng-1.5.0beta18/scripts/makefile.dj2 --- libpng-1.4.1/scripts/makefile.dj2 2010-02-25 05:38:32.366159934 -0600 +++ libpng-1.5.0beta18/scripts/makefile.dj2 2010-04-17 19:07:58.679996370 -0500 @@ -23,8 +23,12 @@ pngmem.o pngerror.o pngpread.o all: libpng.a pngtest +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ @@ -34,9 +38,9 @@ test: pngtest ./pngtest clean: - rm -f *.o libpng.a pngtest pngout.png + rm -f *.o libpng.a pngtest pngout.png pnglibconf.h # DO NOT DELETE THIS LINE -- make depend depends on it. png.o: %HEADERS% @@ -54,5 +58,5 @@ pngwrite.o: %HEADERS% pngwtran.o: %HEADERS% pngwutil.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.elf libpng-1.5.0beta18/scripts/makefile.elf --- libpng-1.4.1/scripts/makefile.elf 2010-02-25 05:38:32.377148538 -0600 +++ libpng-1.5.0beta18/scripts/makefile.elf 2010-04-17 19:07:58.691151370 -0500 @@ -32,9 +32,9 @@ RANLIB=ranlib RM_F=/bin/rm -f # where "make install" puts libpng%N%.a, libpng%N%.so*, -# libpng%N%/png.h and libpng%N%/pngconf.h +# libpng%N%/png.h, libpng%N%/pngconf.h, and libpng%N%/pnglibconf.h # Prefix must be a full pathname. prefix=/usr/local exec_prefix=$(prefix) @@ -94,8 +94,12 @@ $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -105,9 +109,9 @@ -e s!@libdir@!$(LIBPATH)! \ -e s!@includedir@!$(INCPATH)! \ -e s!-lpng%N%!-lpng%N%\ -lz\ -lm! > libpng.pc -libpng.syms: png.h pngconf.h +libpng.syms: png.h pngconf.h pnglibconf.h $(CC) $(CFLAGS) -E -DPNG_BUILDSYMS -DPNG_INTERNAL png.h |\ awk -F '[\t [\\]();]' -v PNGMAJ=$(PNGMAJ) 'BEGIN{printf("PNG%N%_%s {global:\n",PNGMAJ)}\ { for (i=1;i+2<=NF;++i)\ if ($$(i)=="PNG_FUNCTION_EXPORT" && $$(i+2)=="END")\ @@ -154,14 +158,14 @@ @echo " Running pngtest statically linked with libpng.a:" @echo "" ./pngtest-static -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -231,9 +235,9 @@ clean: $(RM_F) *.o libpng.a libpng.syms pngtest pngout.png libpng-config \ $(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \ - libpng.pc + libpng.pc pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -255,5 +259,5 @@ pngwtran.o pngwtran.pic.o: %HEADERS% pngwutil.o pngwutil.pic.o: %HEADERS% pngpread.o pngpread.pic.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.freebsd libpng-1.5.0beta18/scripts/makefile.freebsd --- libpng-1.4.1/scripts/makefile.freebsd 2010-02-25 05:38:32.386276178 -0600 +++ libpng-1.5.0beta18/scripts/makefile.freebsd 2010-04-17 19:07:58.700632740 -0500 @@ -22,9 +22,10 @@ INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk MAN= libpng.3 libpngpf.3 png.5 MANDIR= /man/man SYMLINKS= libpng/png.h ${INCSDIR}/../png.h \ - libpng/pngconf.h ${INCSDIR}/../pngconf.h + libpng/pngconf.h ${INCSDIR}/../pngconf.h \ + libpng/pnglibconf.h ${INCSDIR}/../pnglibconf.h LDADD+= -lm -lz DPADD+= ${LIBM} ${LIBZ} CFLAGS+= -I. @@ -40,8 +41,12 @@ test: pngtest ./pngtest +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* diff -ru4NwbB libpng-1.4.1/scripts/makefile.gcc libpng-1.5.0beta18/scripts/makefile.gcc --- libpng-1.4.1/scripts/makefile.gcc 2010-02-25 05:38:32.395727453 -0600 +++ libpng-1.5.0beta18/scripts/makefile.gcc 2010-04-17 19:07:58.710276409 -0500 @@ -40,8 +40,12 @@ # Targets all: static +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + .c$(O): $(CC) -c $(CFLAGS) -I$(ZLIBINC) $< static: libpng$(A) pngtest$(EXE) @@ -61,9 +65,9 @@ pngtest$(EXE): pngtest$(O) libpng$(A) $(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest$(O) libpng$(A) $(LIBS) clean: - $(RM_F) *$(O) libpng$(A) pngtest$(EXE) pngout.png + $(RM_F) *$(O) libpng$(A) pngtest$(EXE) pngout.png pnglibconf.h png$(O): %HEADERS% pngerror$(O): %HEADERS% pngget$(O): %HEADERS% @@ -79,5 +83,5 @@ pngwrite$(O): %HEADERS% pngwtran$(O): %HEADERS% pngwutil$(O): %HEADERS% -pngtest$(O): png.h pngconf.h +pngtest$(O): png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.hp64 libpng-1.5.0beta18/scripts/makefile.hp64 --- libpng-1.4.1/scripts/makefile.hp64 2010-02-25 05:38:32.406155149 -0600 +++ libpng-1.5.0beta18/scripts/makefile.hp64 2010-04-17 19:07:58.720882229 -0500 @@ -79,8 +79,12 @@ $(CC) -c $(CFLAGS) +z -o $@ $*.c all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -113,14 +117,14 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -192,9 +196,9 @@ clean: $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ libpng-config $(LIBSO) $(LIBSOMAJ)* \ - libpng.pc + libpng.pc pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -216,5 +220,5 @@ pngwtran.o: %HEADERS% pngwutil.o: %HEADERS% pngpread.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.hpgcc libpng-1.5.0beta18/scripts/makefile.hpgcc --- libpng-1.4.1/scripts/makefile.hpgcc 2010-02-25 05:38:32.416553871 -0600 +++ libpng-1.5.0beta18/scripts/makefile.hpgcc 2010-04-17 19:07:58.732049962 -0500 @@ -26,9 +26,10 @@ LN_SF=ln -sf RANLIB=ranlib RM_F=/bin/rm -f -# where "make install" puts libpng.a, $(OLDSO)*, png.h and pngconf.h +# where "make install" puts libpng.a, $(OLDSO)*, png.h, pngconf.h +# and pnglibconf.h prefix=/usr/local exec_prefix=$(prefix) # Where the zlib library and include files are located @@ -122,14 +123,14 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -201,9 +202,9 @@ clean: $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ libpng-config $(LIBSO) $(LIBSOMAJ)* \ - libpng.pc + libpng.pc pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -225,5 +226,5 @@ pngwtran.o pngwtran.pic.o: %HEADERS% pngwutil.o pngwutil.pic.o: %HEADERS% pngpread.o pngpread.pic.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.hpux libpng-1.5.0beta18/scripts/makefile.hpux --- libpng-1.4.1/scripts/makefile.hpux 2010-02-25 05:38:32.427058275 -0600 +++ libpng-1.5.0beta18/scripts/makefile.hpux 2010-04-17 19:07:58.742872046 -0500 @@ -76,8 +76,12 @@ $(CC) -c $(CFLAGS) +z -o $@ $*.c all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -110,14 +114,14 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -189,9 +193,9 @@ clean: $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ libpng-config $(LIBSO) $(LIBSOMAJ)* \ - libpng.pc + libpng.pc pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -213,5 +217,5 @@ pngwtran.o: %HEADERS% pngwutil.o: %HEADERS% pngpread.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.ibmc libpng-1.5.0beta18/scripts/makefile.ibmc --- libpng-1.4.1/scripts/makefile.ibmc 2010-02-25 05:38:32.436517267 -0600 +++ libpng-1.5.0beta18/scripts/makefile.ibmc 2010-04-17 19:07:58.752611236 -0500 @@ -40,8 +40,12 @@ # Targets all: libpng$(A) pngtest$(E) +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng$(A): $(OBJS) $(AR) -out:$@ $(OBJS) test: pngtest$(E) @@ -54,8 +58,9 @@ clean: $(RM) *$(O) $(RM) libpng$(A) + $(RM) pnglibconf.h $(RM) pngtest$(E) $(RM) pngout.png png$(O): %HEADERS% @@ -73,5 +78,5 @@ pngwrite$(O): %HEADERS% pngwtran$(O): %HEADERS% pngwutil$(O): %HEADERS% -pngtest$(O): png.h pngconf.h +pngtest$(O): png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.intel libpng-1.5.0beta18/scripts/makefile.intel --- libpng-1.4.1/scripts/makefile.intel 2010-02-25 05:38:32.445928975 -0600 +++ libpng-1.5.0beta18/scripts/makefile.intel 2010-04-17 19:07:58.762538194 -0500 @@ -43,8 +43,12 @@ pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) all: test +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + png$(O): %HEADERS% $(CC) $(CFLAGS) $*.c $(ERRFILE) pngset$(O): %HEADERS% @@ -95,9 +99,9 @@ pngtest.exe: pngtest.obj libpng.lib $(LD) $(LDFLAGS) /OUT:pngtest.exe pngtest.obj libpng.lib $(ZLIBLIB)\zlib.lib -pngtest$(O): png.h pngconf.h +pngtest$(O): png.h pngconf.h pnglibconf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) test: pngtest.exe pngtest.exe diff -ru4NwbB libpng-1.4.1/scripts/makefile.knr libpng-1.5.0beta18/scripts/makefile.knr --- libpng-1.4.1/scripts/makefile.knr 2010-02-25 05:38:32.455447404 -0600 +++ libpng-1.5.0beta18/scripts/makefile.knr 2010-04-17 19:07:58.772571260 -0500 @@ -40,8 +40,12 @@ pngwtran.o pngmem.o pngerror.o pngpread.o all: ansi2knr libpng.a pngtest +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + # general rule to allow ansi2knr to work .c.o: ./ansi2knr $*.c T$*.c $(CC) $(CFLAGS) -c T$*.c @@ -60,24 +64,26 @@ test: pngtest ./pngtest -install: libpng.a png.h pngconf.h +install: libpng.a png.h pngconf.h pnglibconf.h -@mkdir $(DESTDIR)$(INCPATH) -@mkdir $(DESTDIR)$(INCPATH)/libpng -@mkdir $(DESTDIR)$(LIBPATH) -@rm -f $(DESTDIR)$(INCPATH)/png.h -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h cp png.h $(DESTDIR)$(INCPATH)/libpng cp pngconf.h $(DESTDIR)$(INCPATH)/libpng + cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h + chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .) cp libpng.a $(DESTDIR)$(LIBPATH) chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a clean: - rm -f *.o libpng.a pngtest pngout.png ansi2knr + rm -f *.o libpng.a pngtest pngout.png ansi2knr pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -99,5 +105,5 @@ pngwrite.o: %HEADERS% pngwtran.o: %HEADERS% pngwutil.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.linux libpng-1.5.0beta18/scripts/makefile.linux --- libpng-1.4.1/scripts/makefile.linux 2010-02-25 05:38:32.465953941 -0600 +++ libpng-1.5.0beta18/scripts/makefile.linux 2010-04-17 19:07:58.783641398 -0500 @@ -26,9 +26,9 @@ RANLIB=ranlib RM_F=/bin/rm -f # where "make install" puts libpng%N%.a, libpng%N%.so*, -# libpng%N%/png.h and libpng%N%/pngconf.h +# libpng%N%/png.h, libpng%N%/pngconf.h, and libpng%N%/pnglibconf.h # Prefix must be a full pathname. prefix=/usr/local exec_prefix=$(prefix) @@ -86,8 +86,12 @@ $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -129,14 +133,14 @@ @echo " Running pngtest statically linked with libpng.a:" @echo "" ./pngtest-static -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -207,9 +211,9 @@ clean: $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \ $(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \ - libpng.pc + libpng.pc pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* diff -ru4NwbB libpng-1.4.1/scripts/makefile.mingw libpng-1.5.0beta18/scripts/makefile.mingw --- libpng-1.4.1/scripts/makefile.mingw 2010-02-25 05:38:32.477139267 -0600 +++ libpng-1.5.0beta18/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.mips libpng-1.5.0beta18/scripts/makefile.mips --- libpng-1.4.1/scripts/makefile.mips 2010-02-25 05:38:32.486647989 -0600 +++ libpng-1.5.0beta18/scripts/makefile.mips 2010-04-17 19:07:58.793377141 -0500 @@ -34,8 +34,12 @@ pngwtran.o pngmem.o pngerror.o pngpread.o all: libpng.a pngtest +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) ar rc $@ $(OBJS) $(RANLIB) $@ @@ -50,18 +54,21 @@ -@mkdir $(DESTDIR)$(INCPATH)/libpng -@mkdir $(DESTDIR)$(LIBPATH) -@rm -f $(DESTDIR)$(INCPATH)/png.h -@rm -f $(DESTDIR)$(INCPATH)/pngconf.h + -@rm -f $(DESTDIR)$(INCPATH)/pnglibconf.h cp png.h $(DESTDIR)$(INCPATH)/libpng cp pngconf.h $(DESTDIR)$(INCPATH)/libpng + cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h + chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .) cp libpng.a $(DESTDIR)$(LIBPATH) chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a clean: - rm -f *.o libpng.a pngtest pngout.png + rm -f *.o libpng.a pngtest pngout.png pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -83,5 +90,5 @@ pngwrite.o: %HEADERS% pngwtran.o: %HEADERS% pngwutil.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.msc libpng-1.5.0beta18/scripts/makefile.msc --- libpng-1.4.1/scripts/makefile.msc 2010-02-25 05:38:32.496245144 -0600 +++ libpng-1.5.0beta18/scripts/makefile.msc 2010-04-17 19:07:58.803095538 -0500 @@ -26,8 +26,12 @@ OBJS3 = pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O) all: libpng.lib +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + png$(O): %HEADERS% $(CC) -c $(CFLAGS) $*.c $(ERRFILE) pngset$(O): %HEADERS% @@ -77,9 +81,9 @@ lib libpng $(OBJS1); lib libpng $(OBJS2); lib libpng $(OBJS3); -pngtest$(O): png.h pngconf.h +pngtest$(O): png.h pngconf.h pnglibconf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) pngtest.exe: pngtest.obj libpng.lib $(LD) $(LDFLAGS) pngtest.obj,,,libpng.lib ..\zlib\zlib.lib ; diff -ru4NwbB libpng-1.4.1/scripts/makefile.ne12bsd libpng-1.5.0beta18/scripts/makefile.ne12bsd --- libpng-1.4.1/scripts/makefile.ne12bsd 2010-02-25 05:38:32.505696214 -0600 +++ libpng-1.5.0beta18/scripts/makefile.ne12bsd 2010-04-17 19:07:58.812561605 -0500 @@ -20,9 +20,9 @@ SHLIB_MINOR= 1.5.0beta18 SRCS= 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 -INCS= png.h pngconf.h +INCS= png.h pngconf.h pnglibconf.h MAN= libpng.3 libpngpf.3 png.5 CPPFLAGS+=-I${.CURDIR} @@ -31,9 +31,13 @@ # .if ${MACHINE_ARCH} == "i386" # MKLINT= no # .endif -CLEANFILES+=pngtest.o pngtest +CLEANFILES+=pngtest.o pngtest pnglibconf.h + +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ pngtest.o: pngtest.c ${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET} diff -ru4NwbB libpng-1.4.1/scripts/makefile.netbsd libpng-1.5.0beta18/scripts/makefile.netbsd --- libpng-1.4.1/scripts/makefile.netbsd 2010-02-25 05:38:32.515063081 -0600 +++ libpng-1.5.0beta18/scripts/makefile.netbsd 2010-04-17 19:07:58.822175643 -0500 @@ -20,9 +20,9 @@ SHLIB_MINOR= 1.5.0beta18 SRCS= 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 -INCS= png.h pngconf.h +INCS= png.h pngconf.h pnglibconf.h MAN= libpng.3 libpngpf.3 png.5 CPPFLAGS+=-I${.CURDIR} @@ -31,9 +31,13 @@ # .if ${MACHINE_ARCH} == "i386" # MKLINT= no # .endif -CLEANFILES+=pngtest.o pngtest +CLEANFILES+=pngtest.o pngtest pnglibconf.h + +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ pngtest.o: pngtest.c ${CC} -c ${CPPFLAGS} ${CFLAGS} ${.ALLSRC} -o ${.TARGET} diff -ru4NwbB libpng-1.4.1/scripts/makefile.openbsd libpng-1.5.0beta18/scripts/makefile.openbsd --- libpng-1.4.1/scripts/makefile.openbsd 2010-02-25 05:38:32.524521329 -0600 +++ libpng-1.5.0beta18/scripts/makefile.openbsd 2010-04-17 19:07:58.831975729 -0500 @@ -17,20 +17,24 @@ SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \ pngread.c pngrio.c pngrtran.c pngrutil.c pngset.c pngtrans.c \ pngwio.c pngwrite.c pngwtran.c pngwutil.c -HDRS= png.h pngconf.h +HDRS= png.h pngconf.h pnglibconf.h CFLAGS+= -W -Wall CPPFLAGS+= -I${.CURDIR} NOPROFILE= Yes -CLEANFILES+= pngtest.o pngtest +CLEANFILES+= pngtest.o pngtest pnglibconf.h MAN= libpng.3 libpngpf.3 png.5 DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO libpng.txt +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + pngtest.o: pngtest.c ${CC} ${CPPFLAGS} ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET} pngtest: pngtest.o @@ -64,8 +68,9 @@ @rm -f ${DESTDIR}${LIBDIR}/libpng_pic.a @rm -f ${DESTDIR}${LIBDIR}/debug/libpng.a @rm -f ${DESTDIR}${PREFIX}/include/png.h @rm -f ${DESTDIR}${PREFIX}/include/pngconf.h + @rm -f ${DESTDIR}${PREFIX}/include/pnglibconf.h @rmdir ${DESTDIR}${LIBDIR}/debug 2>/dev/null || true ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ -m ${NONBINMODE} ${HDRS} ${DESTDIR}${PREFIX}/include ${INSTALL} ${INSTALL_COPY} -o ${SHAREOWN} -g ${SHAREGRP} \ diff -ru4NwbB libpng-1.4.1/scripts/makefile.os2 libpng-1.5.0beta18/scripts/makefile.os2 --- libpng-1.4.1/scripts/makefile.os2 2010-02-25 05:38:32.533938333 -0600 +++ libpng-1.5.0beta18/scripts/makefile.os2 2010-04-17 19:07:58.841688177 -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 @@ -32,15 +32,19 @@ .SUFFIXES: .c .o all: $(PNGLIB) $(SHAREDLIB) $(SHAREDLIBIMP) +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + $(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) @@ -48,9 +52,10 @@ test: pngtest.exe ./pngtest.exe clean: - rm -f *.o $(PNGLIB) png.dll pngdll.lib pngtest.exe pngout.png + rm -f *.o $(PNGLIB) png.dll pngdll.lib pngtest.exe pngout.png \ + pnglibconf.h # DO NOT DELETE THIS LINE -- make depend depends on it. png.o png.pic.o: %HEADERS% @@ -68,5 +73,5 @@ pngwtran.o pngwtran.pic.o: %HEADERS% pngwutil.o pngwutil.pic.o: %HEADERS% pngpread.o pngpread.pic.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.sco libpng-1.5.0beta18/scripts/makefile.sco --- libpng-1.4.1/scripts/makefile.sco 2010-02-25 05:38:32.544338561 -0600 +++ libpng-1.5.0beta18/scripts/makefile.sco 2010-04-17 19:07:58.852726242 -0500 @@ -72,8 +72,12 @@ $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -106,16 +110,17 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@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 - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + -@$(RM_F) $(DI)/pnglibconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -185,9 +190,9 @@ clean: $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \ $(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \ - libpng.pc + pnglibconf.h libpng.pc DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -209,5 +214,5 @@ pngwtran.o pngwtran.pic.o: %HEADERS% pngwutil.o pngwutil.pic.o: %HEADERS% pngpread.o pngpread.pic.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.sggcc libpng-1.5.0beta18/scripts/makefile.sggcc --- libpng-1.4.1/scripts/makefile.sggcc 2010-02-25 05:38:32.554998128 -0600 +++ libpng-1.5.0beta18/scripts/makefile.sggcc 2010-04-17 19:07:58.863704358 -0500 @@ -75,8 +75,12 @@ pngwtran.o pngmem.o pngerror.o pngpread.o all: libpng.a pngtest shared libpng.pc libpng-config +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -116,14 +120,14 @@ echo echo Testing local static library. ./pngtest -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -196,9 +200,9 @@ ./pngtesti pngtest.png clean: $(RM_F) libpng.a pngtest pngtesti pngout.png libpng.pc \ - so_locations libpng-config $(LIBSO) $(LIBSOMAJ)* + so_locations libpng-config $(LIBSO) $(LIBSOMAJ)* pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -220,5 +224,5 @@ pngwtran.o: %HEADERS% pngwutil.o: %HEADERS% pngpread.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.sgi libpng-1.5.0beta18/scripts/makefile.sgi --- libpng-1.4.1/scripts/makefile.sgi 2010-02-25 05:38:32.565476441 -0600 +++ libpng-1.5.0beta18/scripts/makefile.sgi 2010-04-17 19:07:58.874703341 -0500 @@ -78,8 +78,12 @@ pngwtran.o pngmem.o pngerror.o pngpread.o all: libpng.a pngtest shared libpng.pc libpng-config +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -116,14 +120,14 @@ echo echo Testing local static library. ./pngtest -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -197,9 +201,9 @@ clean: $(RM_F) *.o libpng.a pngtest pngtesti pngout.png libpng.pc libpng-config \ $(LIBSO) $(LIBSOMAJ)* \ - so_locations + so_locations pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -221,5 +225,5 @@ pngwtran.o: %HEADERS% pngwutil.o: %HEADERS% pngpread.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.so9 libpng-1.5.0beta18/scripts/makefile.so9 --- libpng-1.4.1/scripts/makefile.so9 2010-02-25 05:38:32.576001091 -0600 +++ libpng-1.5.0beta18/scripts/makefile.so9 2010-04-17 19:07:58.885710818 -0500 @@ -82,8 +82,12 @@ $(CC) -c $(CFLAGS) -KPIC -o $@ $*.c all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -128,14 +132,14 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -207,9 +211,9 @@ clean: $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ libpng-config $(LIBSO) $(LIBSOMAJ)* \ - libpng.pc + libpng.pc pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -231,5 +235,5 @@ pngwtran.o pngwtran.pic.o: %HEADERS% pngwutil.o pngwutil.pic.o: %HEADERS% pngpread.o pngpread.pic.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.solaris libpng-1.5.0beta18/scripts/makefile.solaris --- libpng-1.4.1/scripts/makefile.solaris 2010-02-25 05:38:32.586630629 -0600 +++ libpng-1.5.0beta18/scripts/makefile.solaris 2010-04-17 19:07:58.896854330 -0500 @@ -78,8 +78,12 @@ $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -125,14 +129,14 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -204,9 +208,9 @@ clean: $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ libpng-config $(LIBSO) $(LIBSOMAJ)* \ - libpng.pc + libpng.pc pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -228,5 +232,5 @@ pngwtran.o pngwtran.pic.o: %HEADERS% pngwutil.o pngwutil.pic.o: %HEADERS% pngpread.o pngpread.pic.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.solaris-x86 libpng-1.5.0beta18/scripts/makefile.solaris-x86 --- libpng-1.4.1/scripts/makefile.solaris-x86 2010-02-25 05:38:32.597577583 -0600 +++ libpng-1.5.0beta18/scripts/makefile.solaris-x86 2010-04-17 19:07:58.907573746 -0500 @@ -78,8 +78,12 @@ $(CC) -c $(CFLAGS) -fPIC -o $@ $*.c all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -125,14 +129,14 @@ test: pngtest ./pngtest -install-headers: png.h pngconf.h +install-headers: png.h pngconf.h pnglibconf.h -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi - cp png.h pngconf.h $(DI)/$(LIBNAME) - chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h - -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h + cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME) + chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h + -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h -@$(RM_F) $(DI)/libpng (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .) install-static: install-headers libpng.a @@ -204,9 +208,9 @@ clean: $(RM_F) *.o libpng.a pngtest pngtesti pngout.png \ libpng-config $(LIBSO) $(LIBSOMAJ)* \ - libpng.pc + libpng.pc pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -228,5 +232,5 @@ pngwtran.o pngwtran.pic.o: %HEADERS% pngwutil.o pngwutil.pic.o: %HEADERS% pngpread.o pngpread.pic.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.std libpng-1.5.0beta18/scripts/makefile.std --- libpng-1.4.1/scripts/makefile.std 2010-02-25 05:38:32.607318393 -0600 +++ libpng-1.5.0beta18/scripts/makefile.std 2010-04-17 19:07:58.917601153 -0500 @@ -32,9 +32,14 @@ MKDIR_P=mkdir LN_SF=ln -sf RANLIB=ranlib RM_F=rm -f +AWK = awk +SED = sed +CPP = $(CC) -E +ECHO = echo +DFNFLAGS = # DFNFLAGS contains -D options to use in the libpng build CFLAGS=-I$(ZLIBINC) -O # -g -DPNG_DEBUG=5 LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ @@ -42,8 +47,28 @@ pngwtran.o pngmem.o pngerror.o pngpread.o all: libpng.a pngtest +# The standard pnglibconf.h exists as scripts/pnglibconf.h, +# copy this if the following doesn't work. +pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk + $(RM_F) $@ dfn?.out + $(AWK) -f scripts/options.awk pre=1 out=dfn1.out\ + scripts/pnglibconf.dfa 1>&2 + $(AWK) -f scripts/options.awk pre=0 out=dfn2.out dfn1.out 1>&2 + cp dfn2.out $@ + $(RM_F) dfn?.out + +pnglibconf.h: pnglibconf.dfn + $(RM_F) $@ dfn.c dfn?.out + $(ECHO) '#include "pnglibconf.dfn"' >dfn.c + $(CPP) $(DFNFLAGS) dfn.c >dfn1.out + $(SED) -n -e 's|^.*PNG_DEFN_MAGIC-\(.*\)-PNG_DEFN_END.*$$|\1|p'\ + dfn1.out >dfn2.out + $(SED) -e 's| *@@@ *||g' -e 's| *$$||' dfn2.out >dfn3.out + cp dfn3.out $@ + $(RM_F) dfn.c dfn?.out + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -52,24 +77,27 @@ test: pngtest ./pngtest -install: libpng.a +install: libpng.a pnglibconf.h -@$(MKDIR_P) $(DESTDIR)$(INCPATH) -@$(MKDIR_P) $(DESTDIR)$(INCPATH)/libpng -@$(MKDIR_P) $(DESTDIR)$(LIBPATH) -@$(RM_F) $(DESTDIR)$(INCPATH)/png.h -@$(RM_F) $(DESTDIR)$(INCPATH)/pngconf.h + -@$(RM_F) $(DESTDIR)$(INCPATH)/pnglibconf.h cp png.h $(DESTDIR)$(INCPATH)/libpng cp pngconf.h $(DESTDIR)$(INCPATH)/libpng + cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h + chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h (cd $(DESTDIR)$(INCPATH); ln -f -s libpng/* .) cp libpng.a $(DESTDIR)$(LIBPATH) chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a clean: - $(RM_F) *.o libpng.a pngtest pngout.png + $(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.* dfn.c dfn?.out DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -91,5 +119,5 @@ pngwtran.o: %HEADERS% pngwutil.o: %HEADERS% pngpread.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.sunos libpng-1.5.0beta18/scripts/makefile.sunos --- libpng-1.4.1/scripts/makefile.sunos 2010-02-25 05:38:32.617324228 -0600 +++ libpng-1.5.0beta18/scripts/makefile.sunos 2010-04-17 19:07:58.927595926 -0500 @@ -47,8 +47,12 @@ pngwtran.o pngmem.o pngerror.o pngpread.o all: libpng.a pngtest +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + libpng.a: $(OBJS) $(AR_RC) $@ $(OBJS) $(RANLIB) $@ @@ -63,18 +67,21 @@ -@$(MKDIR_P) $(DESTDIR)$(INCPATH)/libpng -@$(MKDIR_P) $(DESTDIR)$(LIBPATH) -@$(RM_F) $(DESTDIR)$(INCPATH)/png.h -@$(RM_F) $(DESTDIR)$(INCPATH)/pngconf.h + -@$(RM_F) $(DESTDIR)$(INCPATH)/pnglibconf.h cp png.h $(DESTDIR)$(INCPATH)/libpng cp pngconf.h $(DESTDIR)$(INCPATH)/libpng + cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h + chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h (cd $(DESTDIR)$(INCPATH); $(LN_SF) libpng/* .) cp libpng.a $(DESTDIR)$(LIBPATH) chmod 644 $(DESTDIR)$(LIBPATH)/libpng.a clean: - $(RM_F) *.o libpng.a pngtest pngout.png + $(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO writelock: chmod a-w *.[ch35] $(DOCS) scripts/* @@ -96,5 +103,5 @@ pngwtran.o: %HEADERS% pngwutil.o: %HEADERS% pngpread.o: %HEADERS% -pngtest.o: png.h pngconf.h +pngtest.o: png.h pngconf.h pnglibconf.h diff -ru4NwbB libpng-1.4.1/scripts/makefile.tc3 libpng-1.5.0beta18/scripts/makefile.tc3 --- libpng-1.4.1/scripts/makefile.tc3 2010-02-25 05:38:32.627031820 -0600 +++ libpng-1.5.0beta18/scripts/makefile.tc3 2010-04-17 19:07:58.937631295 -0500 @@ -24,8 +24,12 @@ OBJSL3 = +pngwrite$(O) +pngrtran$(O) +pngwtran$(O) +pngrio$(O) +pngwio$(O) all: libpng$(MODEL).lib pngtest$(E) +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + pngtest: pngtest$(E) test: pngtest$(E) pngtest$(E) @@ -62,9 +66,9 @@ pngwio$(O): %HEADERS% $(CC) -c $(CFLAGS) $*.c -pngtest$(O): png.h pngconf.h +pngtest$(O): png.h pngconf.h pnglibconf.h $(CC) -c $(CFLAGS) $*.c pngtrans$(O): %HEADERS% $(CC) -c $(CFLAGS) $*.c diff -ru4NwbB libpng-1.4.1/scripts/makefile.vcwin32 libpng-1.5.0beta18/scripts/makefile.vcwin32 --- libpng-1.4.1/scripts/makefile.vcwin32 2010-02-25 05:38:32.636840435 -0600 +++ libpng-1.5.0beta18/scripts/makefile.vcwin32 2010-04-17 19:07:58.947606381 -0500 @@ -34,8 +34,12 @@ # Targets all: libpng.lib +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + png$(O): %HEADERS% $(CC) -c $(CFLAGS) $*.c $(ERRFILE) pngset$(O): %HEADERS% @@ -83,9 +87,9 @@ libpng.lib: $(OBJS) -$(RM) $@ $(AR) $(ARFLAGS) -out:$@ $(OBJS) $(ERRFILE) -pngtest$(O): png.h pngconf.h +pngtest$(O): png.h pngconf.h pnglibconf.h $(CC) -c $(CFLAGS) $*.c $(ERRFILE) pngtest.exe: pngtest$(O) libpng.lib $(LD) $(LDFLAGS) -out:$@ pngtest$(O) libpng.lib ..\zlib\zlib.lib $(ERRFILE) @@ -95,8 +99,9 @@ clean: -$(RM) *$(O) -$(RM) libpng.lib + -$(RM) pnglibconf.h -$(RM) pngtest.exe -$(RM) pngout.png # End of makefile for libpng diff -ru4NwbB libpng-1.4.1/scripts/makefile.watcom libpng-1.5.0beta18/scripts/makefile.watcom --- libpng-1.4.1/scripts/makefile.watcom 2010-02-25 05:38:32.646686864 -0600 +++ libpng-1.5.0beta18/scripts/makefile.watcom 2010-04-17 19:07:58.957803530 -0500 @@ -48,8 +48,12 @@ all: test +# see scripts/pnglibconf.mak for more options +pnglibconf.h: scripts/pnglibconf.h + cp scripts/pnglibconf.h $@ + png$(O): %HEADERS% $(CC) $(CFLAGS) $*.c $(ERRFILE) pngset$(O): %HEADERS% @@ -81,9 +85,9 @@ pngwio$(O): %HEADERS% $(CC) $(CFLAGS) $*.c $(ERRFILE) -pngtest$(O): png.h pngconf.h +pngtest$(O): png.h pngconf.h pnglibconf.h $(CC) $(CFLAGS) $*.c $(ERRFILE) pngtrans$(O): %HEADERS% $(CC) $(CFLAGS) $*.c $(ERRFILE) diff -ru4NwbB libpng-1.4.1/scripts/makevms.com libpng-1.5.0beta18/scripts/makevms.com --- libpng-1.4.1/scripts/makevms.com 2010-02-25 05:38:32.656778276 -0600 +++ libpng-1.5.0beta18/scripts/makevms.com 2010-04-17 19:07:58.967988532 -0500 @@ -86,9 +86,9 @@ $ write sys$output "Building Libpng ..." $ CALL MAKE libpng.OLB "lib/crea libpng.olb *.obj" *.OBJ $ write sys$output "Building pngtest..." $ CALL MAKE pngtest.OBJ "cc ''CCOPT' pngtest" - - pngtest.c png.h pngconf.h + pngtest.c png.h pngconf.h pnglibconf.h $ call make pngtest.exe - "LINK pngtest,libpng.olb/lib,''zlibsrc'libz.olb/lib" - pngtest.obj libpng.olb $ write sys$output "Testing Libpng..." diff -ru4NwbB libpng-1.4.1/scripts/options.awk libpng-1.5.0beta18/scripts/options.awk --- libpng-1.4.1/scripts/options.awk 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta18/scripts/options.awk 2010-04-16 22:22:06.045762000 -0500 @@ -0,0 +1,566 @@ +#!/bin/awk -f +# scripts/options.awk - library build configuration control +# +# libpng version 1.5.0beta17 - April 2, 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 + +# The output of this script is written to the file given by +# the variable 'out'. The script is run twice, once with +# an intermediate output file, 'options.tmp' then again on +# that file to produce the final output. Each time the +# output files and whether or not to pre-prrocess must be +# specified: +# +# awk -f scripts/options.awk pre=1 out=options.tmp scripts/options.dat 1>&2 +# awk -f scripts/options.awk pre=0 out=options.dfn options.tmp 1>&2 + +BEGIN{ + out="/dev/null" # intermediate, preprocessed, file + pre=-1 # preprocess + start="PNG_DEFN_MAGIC-" # Arbitrary start + end="-PNG_DEFN_END" # Arbitrary end + cx= "/@@@*" # Open C comment for output file + comment=start cx # Comment start + cend="*/" end # Comment end + def=start "#define PNG_@@@" # Arbitrary define + sup="@@@_SUPPORTED" end # end supported option + und=comment "#undef PNG_@@@" # Unsupported option + une="@@@_SUPPORTED" cend # end unsupported option + error=start "ERROR:" # error message + deb=0 # debug - set on command line + logunsupported=0 # write unsupported options too + + # Precreate arrays + option[""] = "" # list of all options: default on/off/"" + done[""] = 1 # marks option as having been output + requires[""] = "" # requires by option + iffs[""] = "" # if by option + enabledby[""] = "" # options that enable it by option + setting[""] = "" # requires by setting + defaults[""] = "" # used for a defaulted value + doneset[""] = 1 # marks setting as having been output + r[""] = "" # Temporary array + + # For decorating the output file + protect = "" +} + +# Preprocessing - this just copies the input file with lines +# that need preprocessing (just chunk at present) expanded +pre && $1 != "chunk"{ + print >out + next +} + +# The first characters of the line determine how it is processed, +# leading spaces are ignored. In general tokens that are not +# keywords are the names of options. An option 'name' is +# controlled by the definition of the corresponding macros: +# +# PNG_name_SUPPORTED The option is turned on +# PNG_NO_name +# PNG_NO_name_SUPPORTED If the first macro is not defined +# either of these will turn the option off +# +# If none of these macros are defined the option is turned on, unless +# the keyword 'off' is given in a line relating to the option. The +# keyword 'on' can also be given, but it will be ignored (since it is +# the default.) +# +# In the syntax below a 'name' is indicated by "NAME", other macro +# values are indicated by "MACRO", as with "NAME" the leading "PNG_" +# is omitted, but in this case the "NO_" prefix and the "_SUPPORTED" +# suffix are never used. +# +# Each line is introduced by a keyword - the first non-space characters +# on the line. A line starting with a '#' is a comment - it is totally +# ignored. Keywords are as follows, a NAME, is simply a macro name +# without the leading PNG_, PNG_NO_ or the trailing _SUPPORTED. + +$1 ~ /^#/ || $0 ~ /^[ ]*$/{ + next +} + +# com +# The whole line is placed in the output file as a comment with +# the preceding 'com' removed +$1 == "com"{ + if (NF > 1) { + sub(/^[ ]*com[ ]*/, "") + print comment, $0, cend >out + } else + print start end >out + next +} + +# file output input protect +# Informational: the official name of the input file (without +# make generated local directories), the official name of the +# output file and, if required, a name to use in a protection +# macro for the contents. +$1 == "file" && NF >= 2{ + print comment, $2, cend >out + print comment, "Machine generated file: DO NOT EDIT", cend >out + if (NF >= 3) + print comment, "Derived from:", $3, cend >out + protect = $4 + if (protect != "") { + print start "#ifndef", protect end >out + print start "#define", protect end >out + } + next +} + +# option NAME ( (requires|enables|if) NAME* | on | off )* +# Declares an option 'NAME' and describes its default setting (on|off) +# and its relationship to other options. The option is disabled +# unless *all* the options listed after 'requires' are set and at +# least one of the options listed after 'if' is set. If the +# option is set then it turns on all the options listed after 'enables'. + +$1 == "option" && NF >= 2{ + onoff = option[$2] # records default on or default off + key = "" + for (i=3; i<=NF; ++i) { + if ($(i) == "on" || $(i) == "off") { + key = "" + if (onoff != $(i)) { + if (onoff == "") + onoff = $(i) + else { + # Print a message, otherwise the error + # below is incomprehensible + print $2 ": currently", onoff ": attempt to turn", $(i) + break + } + } + } else if ($(i) == "requires" || $(i) == "if" || $(i) == "enables") { + key = $(i) + } else if (key == "requires") { + requires[$2] = requires[$2] " " $(i) + } else if (key == "if") { + iffs[$2] = iffs[$2] " " $(i) + } else if (key == "enables") { + enabledby[$(i)] = enabledby[$(i)] " " $2 + } else + break # bad line format + } + + if (i > NF) { + # Set the option - this may explicitly set it to "", that's good + # becaue we need to ensure it exists and we can't rely on some + # actually quite sensible awk implementation not optimising the + # read above away (gawk doesn't) + option[$2] = onoff + next + } + # Else fall through to the error handler +} + +# chunk NAME [requires OPT] [off] +# Expands to the 'option' settings appropriate to the reading and +# writing of an ancilliary PNG chunk 'NAME': +# +# option READ_NAME requires READ_ANCILLARY_CHUNKS [READ_OPT] +# option READ_NAME enables NAME +# [option READ_NAME off] +# option WRITE_NAME requires WRITE_ANCILLARY_CHUNKS [WRITE_OPT] +# option WRITE_NAME enables NAME +# [option WRITE_NAME off] + +pre && $1 == "chunk" && NF >= 2{ + # 'chunk' is handled on the first pass by writing appropriate + # 'option' lines into the intermediate file. + onoff = "" + reqread = "" + reqwrite = "" + i = 3 # indicates format error + if (NF > 2) { + # read the keywords/additional OPTS + req = 0 + for (i=3; i<=NF; ++i) { + if ($(i) == "on" || $(i) == "off") { + if (onoff != $(i)) { + if (onoff == "") + onoff = $(i) + else + break # on/off conflict + } + } else if ($(i) == "requires") + req = 1 + else if (req != 1) + break # bad line: handled below + else { + reqread = reqread " READ_" $(i) + reqwrite = reqwrite " WRITE_" $(i) + } + } + } + + if (i > NF) { + # Output new 'option' lines to the intermediate file (out) + print "option READ_" $2, + "requires READ_ANCILLARY_CHUNKS" reqread, + "enables", $2, onoff >out + print "option WRITE_" $2, + "requires WRITE_ANCILLARY_CHUNKS" reqwrite, + "enables", $2, onoff >out + next + } + # Else hit the error handler below - bad line format! +} + +# setting MACRO ( requires MACRO* )* [ default VALUE ] +# Behaves in a similar way to 'option' without looking for NO_ or +# _SUPPORTED; the macro is enabled if it is defined so long as all +# the 'requires' macros are also defined. The definitions may be +# empty, an error will be issued if the 'requires' macros are +# *not* defined. If given the 'default' value is used if the +# macro is not defined. The default value will be re-tokenised. +# (BTW: this is somewhat restrictive, it mainly exists for the +# support of non-standard configurations and numeric parameters, +# see the uses in scripts/options.dat + +$1 == "setting" && (NF == 2 || NF >= 3 && ($3 == "requires" || $3 == "default")){ + reqs = "" + deflt = "" + isdef = 0 + key = "" + for (i=3; i<=NF; ++i) + if ($(i) == "requires" || $(i) == "default") { + key = $(i) + if (key == "default") isdef = 1 + } else if (key == "requires") + reqs = reqs " " $(i) + else if (key == "default") + deflt = deflt " " $(i) + else + break # Format error, handled below + + setting[$2] = reqs + if (isdef && deflt == "") + deflt = " " # as a flag to force output + defaults[$2] = deflt + next +} + +# The order of the dependency lines (option, chunk, setting) is irrelevant +# - the 'enables', 'requires' and 'if' settings will be used to determine +# the correct order in the output and the final values in pnglibconf.h are +# not order dependent. 'requires' and 'if' entries take precedence over +# 'enables' from other options; if an option requires another option it +# won't be set regardless of any options that enable it unless the other +# option is also enabled. +# +# Similarly 'enables' trumps a NO_ definition in CFLAGS or pngusr.h +# +# For simplicity cycles in the definitions are regarded as errors, +# even if they are not ambiguous. +# A given NAME can be specified in as many 'option' lines as required, the +# definitions are additive. + +# For backwards compatibility equivalent macros may be listed thus: +# +# = [NO_]NAME MACRO +# Makes -DMACRO equivalent to -DPNG_NO_NAME or -DPNG_NAME_SUPPORTED +# as appropriate. +# +# The definition is injected into the C compiler input when encountered +# in the second pass (so all these definitions appear *after* the @ +# lines!) +# +# 'NAME' is as above, but 'MACRO' is the full text of the equivalent +# old, deprecated, macro. + +$1 == "=" && NF == 3{ + print "#ifdef PNG_" $3 >out + if ($2 ~ /^NO_/) + print "# define PNG_" $2 >out + else + print "# define PNG_" $2 "_SUPPORTED" >out + print "#endif" >out + next +} + +# Lines may be injected into the C compiler input by preceding them +# with an "@" character. The line is copied with just the leading +# @ removed. + +$1 ~ /^@/{ + sub(/^[ ]*@/, "") + print >out + next +} + +# Check for unreognized lines, because of the preprocessing chunk +# format errors will be detected on the first pass independent of +# any other format errors. +{ + print "options.awk: bad line (" NR "):", $0 + exit 1 +} + +# For checking purposes names that start with "ok_" or "fail_" are +# not output to pnglibconf.h and must be either enabled or disabled +# respectively for the build to succeed. This allows interdependencies +# between options of the form "at least one of" or "at most one of" +# to be checked. For example: +# +# option FLOATING_POINT enables ok_math +# option FIXED_POINT enables ok_math +# This ensures that at least one of FLOATING_POINT and FIXED_POINT +# must be set for the build to succeed. +# +# option fail_math requires FLOATING_POINT FIXED_POINT +# This means the build will fail if *both* FLOATING_POINT and +# FIXED_POINT are set (this is an example; in fact both are allowed.) +# +# If all these options were given the build would require exactly one +# of the names to be enabled. + +END{ + if (out == "/dev/null") { + print "out=output.file must be given on the command line" + exit 1 + } + if (pre) { + if (pre != 1) { + print "pre=0 or pre=1 must be given on command line" + exit 1 + } + exit 0 + } + + # Do the 'setting' values first, the algorithm the standard + # tree walk (O(1)) done in an O(2) while/for loop; interations + # settings x depth, outputing the deepest required macros + # first. + print "" >out + print "/* SETTINGS */" >out + print comment, "settings", cend >out + finished = 0 + while (!finished) { + finished = 1 + movement = 0 # done nothing + for (i in setting) if (!doneset[i]) { + nreqs = split(setting[i], r) + if (nreqs > 0) { + for (j=1; j<=nreqs; ++j) if (!doneset[r[j]]) + break + if (j<=nreqs) { + finished = 0 + continue # try a different setting + } + } + + # All the requirements have been processed, output + # this setting. + if (deb) print "setting", i + print "" >out + print "/* setting: ", i >out + print " * requires:" setting[i] >out + print " * default: ", defaults[i], "*/" >out + if (defaults[i] == "") # no default, only check if defined + print "#ifdef PNG_" i >out + for (j=1; j<=nreqs; ++j) { + print "# ifndef PNG_" r[j] >out + print error, i, "requires", r[j] end >out + print "# endif" >out + } + if (defaults[i] != "") # default handling + print "#ifdef PNG_" i >out + print def i, "PNG_" i end >out + if (defaults[i] != "") { + print "#else /*default*/" >out + print def i defaults[i] end >out + } + print "#endif" >out + + doneset[i] = 1 + ++movement + } + + if (!finished && !movement) { + print "setting: loop or missing setting in 'requires', cannot process:" + for (i in setting) if (!doneset[i]) + print " setting", i, "requires" setting[i] + exit 1 + } + } + print comment, "end of settings", cend >out + + # Now do the options - somewhat more complex. The dependency + # tree is thus: + # + # name > name + # name requires name + # name if name + # name enabledby name + # + # First build a list 'tree' by option of all the things on which + # it depends. + print "" >out + print "/* OPTIONS */" >out + print comment, "options", cend >out + for (opt in enabledby) tree[opt] = 1 # may not be explicit options + for (opt in option) tree[opt] = "" # so unlisted options marked + for (opt in tree) { + if (tree[opt] == 1) { + tree[opt] = "" + if (option[opt] != "") { + print "internal error (1)" + exit 1 + } + # Macros only listed in 'enables' remain off unless + # one of the enabling macros is on. + option[opt] = "off" + } + + split("", list) # clear 'list' + # Now add every requires, iffs or enabledby entry to 'list' + # so that we can add a unique list of requirements to tree[i] + split(requires[opt] iffs[opt] enabledby[opt], r) + for (i in r) list[r[i]] = 1 + for (i in list) tree[opt] = tree[opt] " " i + } + + # print the tree for extreme debugging + if (deb > 2) for (i in tree) if (i != "") print i, "depends-on" tree[i] + + # option[i] is now the complete list of all the tokens we may + # need to output, go through it as above, depth first. + finished = 0 + while (!finished) { + finished = 1 + movement = 0 # done nothing + for (i in option) if (!done[i]) { + nreqs = split(tree[i], r) + if (nreqs > 0) { + for (j=1; j<=nreqs; ++j) if (!done[r[j]]) + break + if (j<=nreqs) { + finished = 0 + continue # next option + } + } + + # All the requirements have been processed, output + # this option. An option is _SUPPORTED if: + # + # all 'requires' are _SUPPORTED AND + # at least one of the 'if' options are _SUPPORTED AND + # EITHER: + # The name is _SUPPORTED (on the command line) + # OR: + # an 'enabledby' is _SUPPORTED + # OR: + # NO_name is not defined AND + # the option is not marked "off" + if (deb) print "option", i + print "" >out + print "/* option:", i, option[i] >out + print " * requires: " requires[i] >out + print " * if: " iffs[i] >out + print " * enabled-by:" enabledby[i], "*/" >out + print "#undef PNG_on" >out + print "#define PNG_on 1" >out + + # requires + nreqs = split(requires[i], r) + for (j=1; j<=nreqs; ++j) { + print "#ifndef PNG_" r[j] "_SUPPORTED" >out + print "# undef PNG_on /*!" r[j] "*/" >out + print "#endif" >out + } + + # if + nreqs = split(iffs[i], r) + print "#undef PNG_no_if" >out + if (nreqs > 0) { + print "/* if" iffs[i], "*/" >out + print "#define PNG_no_if 1" >out + for (j=1; j<=nreqs; ++j) { + print "#ifdef PNG_" r[j] "_SUPPORTED" >out + print "# undef PNG_no_if /*" r[j] "*/" >out + print "#endif" >out + } + print "#ifdef PNG_no_if /*missing if*/" >out + print "# undef PNG_on" >out + print "#endif" >out + } + + print "#ifdef PNG_on /*requires, if*/" >out + # enables + print "# undef PNG_not_enabled" >out + print "# define PNG_not_enabled 1" >out + print " /* enabled by" enabledby[i], "*/" >out + nreqs = split(enabledby[i], r) + for (j=1; j<=nreqs; ++j) { + print "#ifdef PNG_" r[j] "_SUPPORTED" >out + print "# undef PNG_not_enabled /*" r[j] "*/" >out + print "#endif" >out + } + + print "# ifndef PNG_" i "_SUPPORTED /*!command line*/" >out + print "# ifdef PNG_not_enabled /*!enabled*/" >out + if (option[i] == "off") { + print "# undef PNG_on /*default off*/" >out + } else { + print "# ifdef PNG_NO_" i >out + print "# undef PNG_on /*turned off*/" >out + print "# endif" >out + print "# ifdef PNG_NO_" i "_SUPPORTED" >out + print "# undef PNG_on /*turned off*/" >out + print "# endif" >out + } + print "# endif /*!enabled*/" >out + print "# ifdef PNG_on" >out + # The _SUPPORTED macro must be defined so that dependent + # options output later work. + print "# define PNG_" i "_SUPPORTED" >out + print "# endif" >out + print "# endif /*!command line*/" >out + # If PNG_on is still set the option should be defined in + # pnglibconf.h + print "# ifdef PNG_on" >out + if (i ~ /^fail_/) + print error, i, "if" iffs[i], "requires" requires[i] end >out + else if (i !~ /^ok_/) + print def i sup >out + print "# endif /* definition */" >out + print "#endif /*requires, if*/" >out + if (logunsupported || i ~ /^ok_/) { + print "#ifndef PNG_on" >out + if (logunsupported) + print und i une >out + if (i ~ /^ok_/) + print error, i, "if" iffs[i], "requires" requires[i] end >out + print "#endif" >out + } + + done[i] = 1 + ++movement + } + + if (!finished && !movement) { + print "option: loop or missing option in dependency tree, cannot process:" + for (i in option) if (!done[i]) { + print " option", i, "depends on" tree[i], "needs:" + nreqs = split(tree[i], r) + if (nreqs > 0) for (j=1; j<=nreqs; ++j) if (!done[r[j]]) + print " " r[j] + } + exit 1 + } + } + print comment, "end of options", cend >out + + # Regular end - everything looks ok + if (protect != "") + print start "#endif", cx, protect, "*/" end >out +} diff -ru4NwbB libpng-1.4.1/scripts/png32ce.def libpng-1.5.0beta18/scripts/png32ce.def --- libpng-1.4.1/scripts/png32ce.def 2010-02-25 05:38:32.667725680 -0600 +++ libpng-1.5.0beta18/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.0beta18 - 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/pnglibconf.dfa libpng-1.5.0beta18/scripts/pnglibconf.dfa --- libpng-1.4.1/scripts/pnglibconf.dfa 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta18/scripts/pnglibconf.dfa 2010-04-17 11:43:35.418823000 -0500 @@ -0,0 +1,376 @@ +# scripts/pnglibconf.dfa - library build configuration control +# +@/*- pnglibconf.dfn intermediate file +@ * generated from scripts/pnglibconf.dfa +@ */ +# +com pnglibconf.h - library build configuration +com +com libpng version PNGLIB_VERSION - April 2, 2010 +com +com Copyright (c) 1998-2010 Glenn Randers-Pehrson +com +com This code is released under the libpng license. +com For conditions of distribution and use, see the disclaimer +com and license in png.h +com +file pnglibconf.h scripts/pnglibconf.dfa PNGLCONF_H + +# This file is preprocessed by scripts/options.awk and the +# C compiler to generate 'pnglibconf.h' - a list of all the +# configuration options. The file lists the various options +# that can *only* be specified during the libpng build; +# pnglibconf.h freezes the definitons selected for the specific +# build. +# +# The syntax is detailed in scripts/options.awk, this is a summary +# only: +# +# setting [requires ...] [default] +# #define PNG_ /* value comes from current setting */ +# option [requires ...] [if ...] [enables ...] [on|off] +# #define PNG__SUPPORTED if the requirements are met and +# enable the other options listed +# chunk [requires ...] [on|off] +# Enable chunk processing for the given ancillary chunk + +#---------------------------------------------------------------------- + +# The following setting, option and chunk values can all be changed +# while building libpng: +# +# setting: change 'setting' lines to fine tune library performance, +# changes to the settings don't affect the libpng API functionally +# +# option: change 'option' lines to remove or add capabilities from +# or to the library; options change the library API +# +# chunk: change 'chunk' lines to remove capabilities to process +# optional ('ancillary') chunks. This does not prevent PNG +# decoding but does change the libpng API because some chunks +# will be ignored. +# +# There are three ways of disabling features, in order of correctness: +# +# 1) Create 'pngusr.h', enter the required private build information +# detailed below and #define PNG_NO_