diff -ru4NwbB libpng-1.4.3/Makefile.am libpng-1.5.0beta34/Makefile.am --- libpng-1.4.3/Makefile.am 2010-06-25 19:32:32.228797313 -0500 +++ libpng-1.5.0beta34/Makefile.am 2010-07-12 06:43:48.265011831 -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 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,57 +61,116 @@ #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/* \ - ${srcdir}/contrib/gregbook/* \ - ${srcdir}/contrib/pngminim/* \ - ${srcdir}/contrib/pngminus/* \ - ${srcdir}/contrib/pngsuite/* \ - ${srcdir}/contrib/visupng/* \ + ${srcdir}/contrib ${srcdir}/projects ${srcdir}/scripts \ $(TESTS) \ - example.c libpng-1.5.0beta34.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 out=dfn1.out\ + ${srcdir}/scripts/pnglibconf.dfa $(DFA_XTRA) 1>&2 + $(AWK) -f ${srcdir}/scripts/options.awk 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 out=dfn1.out\ + logunsupported=1 - ${srcdir}/scripts/pnglibconf.dfa 1>&2 + $(AWK) -f ${srcdir}/scripts/options.awk out=dfn2.out 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 +186,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.3/configure.ac libpng-1.5.0beta34/configure.ac --- libpng-1.4.3/configure.ac 2010-06-25 19:32:32.235225398 -0500 +++ libpng-1.5.0beta34/configure.ac 2010-07-12 06:43:48.270949202 -0500 @@ -24,9 +24,9 @@ AM_MAINTAINER_MODE PNGLIB_VERSION=1.5.0beta34 PNGLIB_MAJOR=1 -PNGLIB_MINOR=4 +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.3/contrib/gregbook/Makefile.sgi libpng-1.5.0beta34/contrib/gregbook/Makefile.sgi --- libpng-1.4.3/contrib/gregbook/Makefile.sgi 2010-06-25 19:32:26.204646483 -0500 +++ libpng-1.5.0beta34/contrib/gregbook/Makefile.sgi 2010-07-12 06:43:41.054660056 -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.3/contrib/gregbook/Makefile.unx libpng-1.5.0beta34/contrib/gregbook/Makefile.unx --- libpng-1.4.3/contrib/gregbook/Makefile.unx 2010-06-25 19:32:26.213954735 -0500 +++ libpng-1.5.0beta34/contrib/gregbook/Makefile.unx 2010-07-12 06:43:41.069872774 -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.3/contrib/gregbook/readpng2.c libpng-1.5.0beta34/contrib/gregbook/readpng2.c --- libpng-1.4.3/contrib/gregbook/readpng2.c 2010-06-25 19:32:26.271402013 -0500 +++ libpng-1.5.0beta34/contrib/gregbook/readpng2.c 2010-07-12 06:43:41.154616086 -0500 @@ -479,6 +479,13 @@ fflush(stderr); exit(99); } + /* Now we have our data structure we can use the information in it + * to return control to our own higher level code (all the points + * where 'setjmp' is called in this file.) This will work with other + * error handling mechanisms as well - libpng always calls png_error + * when it can proceed no further, thus, so long as the error handler + * is intercepted, application code can do its own error recovery. + */ longjmp(mainprog_ptr->jmpbuf, 1); } diff -ru4NwbB libpng-1.4.3/contrib/gregbook/rpng2-x.c libpng-1.5.0beta34/contrib/gregbook/rpng2-x.c --- libpng-1.4.3/contrib/gregbook/rpng2-x.c 2010-06-25 19:32:26.346066715 -0500 +++ libpng-1.5.0beta34/contrib/gregbook/rpng2-x.c 2010-07-12 06:43:41.267545887 -0500 @@ -783,10 +783,11 @@ if (rpng2_x_create_window()) { /* GRR TEMPORARY HACK: this is fundamentally no different from cases - * above; libpng should longjmp() back to us when png_ptr goes away. - * If we/it segfault instead, seems like a libpng bug... */ + * above; libpng should call our error handler to longjmp() back to us + * when png_ptr goes away. If we/it segfault instead, seems like a + * libpng bug... */ /* we're here via libpng callback, so if window fails, clean and bail */ readpng2_cleanup(&rpng2_info); rpng2_x_cleanup(); diff -ru4NwbB libpng-1.4.3/contrib/gregbook/writepng.c libpng-1.5.0beta34/contrib/gregbook/writepng.c --- libpng-1.4.3/contrib/gregbook/writepng.c 2010-06-25 19:32:26.380991395 -0500 +++ libpng-1.5.0beta34/contrib/gregbook/writepng.c 2010-07-12 06:43:41.320234693 -0500 @@ -103,9 +103,10 @@ /* setjmp() must be called in every function that calls a PNG-writing * libpng function, unless an alternate error handler was installed-- * but compatible error handlers must either use longjmp() themselves - * (as in this program) or exit immediately, so here we go: */ + * (as in this program) or some other method to return control to + * application code, so here we go: */ if (setjmp(mainprog_ptr->jmpbuf)) { png_destroy_write_struct(&png_ptr, &info_ptr); return 2; @@ -387,6 +388,13 @@ fflush(stderr); exit(99); } + /* Now we have our data structure we can use the information in it + * to return control to our own higher level code (all the points + * where 'setjmp' is called in this file.) This will work with other + * error handling mechanisms as well - libpng always calls png_error + * when it can proceed no further, thus, so long as the error handler + * is intercepted, application code can do its own error recovery. + */ longjmp(mainprog_ptr->jmpbuf, 1); } diff -ru4NwbB libpng-1.4.3/contrib/pngminim/README libpng-1.5.0beta34/contrib/pngminim/README --- libpng-1.4.3/contrib/pngminim/README 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta34/contrib/pngminim/README 2010-04-28 07:21:10.817901000 -0500 @@ -0,0 +1,4 @@ +This demonstrates the use of PNG_USER_CONFIG, pngusr.h and pngusr.dfa +to build minimal decoder, encoder, and progressive reader applications. + +See the individual README and pngusr.dfa files for more explanation. diff -ru4NwbB libpng-1.4.3/contrib/pngminim/decoder/README libpng-1.5.0beta34/contrib/pngminim/decoder/README --- libpng-1.4.3/contrib/pngminim/decoder/README 2010-06-25 19:32:26.798511553 -0500 +++ libpng-1.5.0beta34/contrib/pngminim/decoder/README 2010-07-12 06:43:41.969956948 -0500 @@ -1,9 +1,10 @@ -This demonstrates the use of PNG_USER_CONFIG and pngusr.h +This demonstrates the use of PNG_USER_CONFIG, pngusr.h and pngusr.dfa -To build a minimal read-only decoder with embedded libpng and zlib, run +The makefile builds a minimal read-only decoder with embedded libpng +and zlib. - gather.sh # to collect needed files from pngminus, libpng, and zlib - make +Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC +on the make command line. If you prefer to use the shared libraries, go to contrib/pngminus and build the png2pnm application there. diff -ru4NwbB libpng-1.4.3/contrib/pngminim/decoder/gather.sh libpng-1.5.0beta34/contrib/pngminim/decoder/gather.sh --- libpng-1.4.3/contrib/pngminim/decoder/gather.sh 2010-06-25 19:32:26.807345545 -0500 +++ libpng-1.5.0beta34/contrib/pngminim/decoder/gather.sh 1969-12-31 18:00:00.000000000 -0600 @@ -1,8 +0,0 @@ -cp ../../pngminus/png2pnm.c pngm2pnm.c -cp ../../../*.h . -cp ../../../*.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 minigzip.c example.c compress.c deflate.c gz* diff -ru4NwbB libpng-1.4.3/contrib/pngminim/decoder/makefile libpng-1.5.0beta34/contrib/pngminim/decoder/makefile --- libpng-1.4.3/contrib/pngminim/decoder/makefile 2010-06-25 19:32:26.816077187 -0500 +++ libpng-1.5.0beta34/contrib/pngminim/decoder/makefile 2010-07-12 06:43:41.978951249 -0500 @@ -3,42 +3,147 @@ #CC=cc CC=gcc LD=$(CC) +STRIP=strip + +# If awk fails try +# make AWK=nawk RM=rm -f +COPY=cp -CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \ - -DdeflateParams\(a,b,c\)=Z_OK -I. -O1 +CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP -I. -O1 C=.c O=.o L=.a E= +# Where to find the source code: +PNGSRC =../../.. +ZLIBSRC=$(PNGSRC)/../zlib +PROGSRC=$(PNGSRC)/contrib/pngminus + +# Zlib (minimal inflate requirements - crc32 is used by libpng) +# zutil can be eliminated if you provide your own zcalloc and zcfree +ZSRCS = adler32$(C) crc32$(C) \ + inffast$(C) inflate$(C) inftrees$(C) \ + zutil$(C) + +# Standard headers +ZH = zlib.h crc32.h inffast.h inffixed.h \ + inflate.h inftrees.h zutil.h + +# Machine generated headers +ZCONF = zconf.h + +# Headers callers use +ZINC = zlib.h $(ZCONF) + +# Headers the Zlib source uses +ZHDRS = $(ZH) $(ZCONF) + ZOBJS = adler32$(O) crc32$(O) \ - infback$(O) inffast$(O) inflate$(O) inftrees$(O) \ - trees$(O) uncompr$(O) zutil$(O) + inffast$(O) inflate$(O) inftrees$(O) \ + zutil$(O) + +# libpng +PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \ + pngread$(C) pngrio$(C) pngrtran$(C) pngrutil$(C) \ + pngset$(C) pngtrans$(C) + +# Standard headers +PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h -OBJS = pngm2pnm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ +# Machine generated headers +PNGCONF=pnglibconf.h + +# Headers callers use +PNGINC= png.h pngconf.h pngusr.h $(PNGCONF) + +# Headers the PNG library uses +PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h + +PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \ - pngset$(O) pngtrans$(O) $(ZOBJS) + pngset$(O) pngtrans$(O) + +PROGSRCS= pngm2pnm$(C) +PROGHDRS= +PROGDOCS= +PROGOBJS= pngm2pnm$(O) + +OBJS = $(PROGOBJS) $(PNGOBJS) $(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 all: pngm2pnm$(E) pngm2pnm$(E): $(OBJS) $(LD) -o pngm2pnm$(E) $(OBJS) - strip pngm2pnm$(E) + $(STRIP) pngm2pnm$(E) + +# The DFA_XTRA setting turns all libpng options off then +# turns on those required for this minimal build. +# The CPP_FLAGS setting causes pngusr.h to be included in +# both the build of pnglibconf.h and, subsequently, when +# building libpng itself. +$(PNGCONF): $(PNGSRC)/scripts/pnglibconf.mak\ + $(PNGSRC)/scripts/pnglibconf.dfa \ + $(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa + $(RM) pnglibconf.h pnglibconf.dfn + $(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\ + srcdir=$(PNGSRC) CPPFLAGS="-DPNG_USER_CONFIG"\ + DFA_XTRA="pngusr.dfa" $@ clean: + $(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\ + srcdir=$(PNGSRC) clean $(RM) pngm2pnm$(O) $(RM) pngm2pnm$(E) $(RM) $(OBJS) +# distclean also removes the copied source and headers +distclean: clean + $(RM) -r scripts # historical reasons + $(RM) $(PNGSRCS) $(PNGH) + $(RM) $(ZSRCS) $(ZH) $(ZCONF) + $(RM) $(PROGSRCS) $(PROGHDRS) $(PROGDOCS) + +# Header file dependencies: +$(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC) +$(PNGOBJS): $(PNGHDRS) $(ZINC) +$(ZOBJS): $(ZHDRS) + +# Gather the source code from the respective directories +$(PNGSRCS) $(PNGH): $(PNGSRC)/$@ + $(RM) $@ + $(COPY) $(PNGSRC)/$@ $@ + +# No dependency on the ZLIBSRC target so that it only needs +# to be specified once. +$(ZSRCS) $(ZH): + $(RM) $@ + $(COPY) $(ZLIBSRC)/$@ $@ + +# The unconfigured zconf.h varies in name according to the +# zlib release +$(ZCONF): + $(RM) $@ + @for f in zconf.h.in zconf.in.h zconf.h; do\ + test -r $(ZLIBSRC)/$$f &&\ + echo $(COPY) $(ZLIBSRC)/$$f $@ &&\ + $(COPY) $(ZLIBSRC)/$$f $@ && exit 0;\ + done; echo copy: $(ZLIBSRC)/zconf.h not found; exit 1 + +pngm2pnm.c: $(PROGSRC)/png2pnm.c + $(RM) $@ + $(COPY) $(PROGSRC)/png2pnm.c $@ + # End of makefile for pngm2pnm diff -ru4NwbB libpng-1.4.3/contrib/pngminim/decoder/pngusr.dfa libpng-1.5.0beta34/contrib/pngminim/decoder/pngusr.dfa --- libpng-1.4.3/contrib/pngminim/decoder/pngusr.dfa 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta34/contrib/pngminim/decoder/pngusr.dfa 2010-07-12 06:43:41.987604505 -0500 @@ -0,0 +1,27 @@ +# pngminim/decoder/pngusr.dfa +# +# Copyright (c) 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 + +# First all the build options off: +everything = off + +# All that is required is some read code. This example switches +# on the sequential read code (see ../preader for a progressive +# read example). +option SEQUENTIAL_READ on + +# You must choose fixed or floating point arithmetic: +option FLOATING_POINT on +# option FIXED_POINT on + +# Your program will probably need other options. The example +# program here, pngm2pnm, requires the following. Take a look +# at pnglibconf.h to find out the full set of what has to be +# enabled to make the following work. +option SETJMP on +option STDIO on +option READ_EXPAND on diff -ru4NwbB libpng-1.4.3/contrib/pngminim/decoder/pngusr.h libpng-1.5.0beta34/contrib/pngminim/decoder/pngusr.h --- libpng-1.4.3/contrib/pngminim/decoder/pngusr.h 2010-06-25 19:32:26.824867573 -0500 +++ libpng-1.5.0beta34/contrib/pngminim/decoder/pngusr.h 2010-07-12 06:43:41.996105736 -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 @@ -11,69 +11,18 @@ #ifndef MINRDPNGCONF_H #define MINRDPNGCONF_H -#ifdef NJET - /* No 16-bit support beyond reading with strip_16 */ -#endif +/* If pngusr.h is included during the build the following must + * be defined either here or in the .dfa file (pngusr.dfa in + * this case). To include pngusr.h set -DPNG_USER_CONFIG in + * CPPFLAGS + */ +#define PNG_USER_PRIVATEBUILD "libpng minimal conformant PNG decoder" +#define PNG_USER_DLLFNAME_POSTFIX "mr" +/* List options to turn off features of the build that do not + * affect the API (so are not recorded in pnglibconf.h) + */ #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_BGR -#define PNG_NO_READ_GAMMA -#define PNG_NO_READ_BACKGROUND -#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 -#define PNG_NO_READ_FILLER -#define PNG_NO_READ_SWAP -#define PNG_NO_READ_SWAP_ALPHA -#define PNG_NO_READ_INVERT_ALPHA -#define PNG_NO_READ_RGB_TO_GRAY -#define PNG_NO_READ_USER_TRANSFORM -#define PNG_NO_READ_bKGD -#define PNG_NO_READ_cHRM -#define PNG_NO_READ_gAMA -#define PNG_NO_READ_hIST -#define PNG_NO_READ_iCCP -#define PNG_NO_READ_pCAL -#define PNG_NO_READ_pHYs -#define PNG_NO_READ_sBIT -#define PNG_NO_READ_sCAL -#define PNG_NO_READ_sPLT -#define PNG_NO_READ_sRGB -#define PNG_NO_READ_TEXT -#define PNG_NO_READ_tIME -#define PNG_NO_READ_UNKNOWN_CHUNKS -#define PNG_NO_READ_USER_CHUNKS -#define PNG_NO_READ_EMPTY_PLTE -#define PNG_NO_READ_OPT_PLTE -#define PNG_NO_READ_STRIP_ALPHA -#define PNG_NO_READ_oFFs - -#define PNG_NO_WRITE_SUPPORTED - -#define PNG_NO_INFO_IMAGE -#define PNG_NO_IO_STATE -#define PNG_NO_USER_MEM -#define PNG_NO_FIXED_POINT_SUPPORTED -#define PNG_NO_MNG_FEATURES -#define PNG_NO_USER_TRANSFORM_PTR -#define PNG_NO_HANDLE_AS_UNKNOWN -#define PNG_NO_CONSOLE_IO -#define PNG_NO_ZALLOC_ZERO -#define PNG_NO_ERROR_NUMBERS -#define PNG_NO_EASY_ACCESS -#define PNG_NO_PROGRESSIVE_READ -#define PNG_NO_USER_LIMITS -#define PNG_NO_SET_USER_LIMITS -#define PNG_NO_TIME_RFC1123 #endif /* MINRDPNGCONF_H */ - diff -ru4NwbB libpng-1.4.3/contrib/pngminim/encoder/README libpng-1.5.0beta34/contrib/pngminim/encoder/README --- libpng-1.4.3/contrib/pngminim/encoder/README 2010-06-25 19:32:26.833493876 -0500 +++ libpng-1.5.0beta34/contrib/pngminim/encoder/README 2010-07-12 06:43:42.009109954 -0500 @@ -1,9 +1,10 @@ This demonstrates the use of PNG_USER_CONFIG and pngusr.h -To build a minimal write-only decoder with embedded libpng and zlib, run +The makefile builds a minimal write-only decoder with embedded libpng +and zlib. - gather.sh # to collect needed files from pngminus, libpng, and zlib - make +Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC +on the make command line. If you prefer to use the shared libraries, go to contrib/pngminus and build the pnm2png application there. diff -ru4NwbB libpng-1.4.3/contrib/pngminim/encoder/gather.sh libpng-1.5.0beta34/contrib/pngminim/encoder/gather.sh --- libpng-1.4.3/contrib/pngminim/encoder/gather.sh 2010-06-25 19:32:26.841989759 -0500 +++ libpng-1.5.0beta34/contrib/pngminim/encoder/gather.sh 1969-12-31 18:00:00.000000000 -0600 @@ -1,9 +0,0 @@ -cp ../../pngminus/pnm2png.c pnm2pngm.c -cp ../../../*.h . -cp ../../../*.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 inf*.[ch] -rm uncompr.c minigzip.c example.c gz* diff -ru4NwbB libpng-1.4.3/contrib/pngminim/encoder/makefile libpng-1.5.0beta34/contrib/pngminim/encoder/makefile --- libpng-1.4.3/contrib/pngminim/encoder/makefile 2010-06-25 19:32:26.850807045 -0500 +++ libpng-1.5.0beta34/contrib/pngminim/encoder/makefile 2010-07-12 06:43:42.018416654 -0500 @@ -3,40 +3,146 @@ #CC=cc CC=gcc LD=$(CC) +STRIP=strip + +# If awk fails try +# make AWK=nawk RM=rm -f +COPY=cp CFLAGS=-DPNG_USER_CONFIG -DNO_GZIP -I. -O1 C=.c O=.o L=.a E= +# Where to find the source code: +PNGSRC =../../.. +ZLIBSRC=$(PNGSRC)/../zlib +PROGSRC=$(PNGSRC)/contrib/pngminus + +# Zlib +ZSRCS = adler32$(C) compress$(C) crc32$(C) deflate$(C) \ + trees$(C) zutil$(C) + +# Standard headers +#ZH = zlib.h crc32.h deflate.h trees.h zutil.h +ZH = zlib.h crc32.h deflate.h trees.h zutil.h + +# Machine generated headers +ZCONF = zconf.h + +# Headers callers use +ZINC = zlib.h $(ZCONF) + +# Headers the Zlib source uses +ZHDRS = $(ZH) $(ZCONF) + +# compress is not required; it is needed to link the zlib +# code because deflate defines an unused API function deflateBound +# which itself calls compressBound from compress. ZOBJS = adler32$(O) compress$(O) crc32$(O) deflate$(O) \ trees$(O) zutil$(O) -OBJS = pnm2pngm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ +# libpng +PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \ + pngset$(C) pngtrans$(C) pngwio$(C) pngwrite$(C) \ + pngwtran$(C) pngwutil$(C) + +# Standard headers +PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h + +# Machine generated headers +PNGCONF=pnglibconf.h + +# Headers callers use +PNGINC= png.h pngconf.h pngusr.h $(PNGCONF) + +# Headers the PNG library uses +PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h + +PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ pngset$(O) pngtrans$(O) pngwio$(O) pngwrite$(O) \ - pngwtran$(O) pngwutil$(O) $(ZOBJS) + pngwtran$(O) pngwutil$(O) + +PROGSRCS= pnm2pngm$(C) +PROGHDRS= +PROGDOCS= +PROGOBJS= pnm2pngm$(O) + +OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS) # implicit make rules ------------------------------------------------------- -.c$(O): png.h pngconf.h pngpriv.h pngusr.h zlib.h +.c$(O): $(CC) -c $(CFLAGS) $< # dependencies all: pnm2pngm$(E) pnm2pngm$(E): $(OBJS) $(LD) -o pnm2pngm$(E) $(OBJS) - strip pnm2pngm$(E) + $(STRIP) pnm2pngm$(E) + +# The DFA_XTRA setting turns all libpng options off then +# turns on those required for this minimal build. +# The CPP_FLAGS setting causes pngusr.h to be included in +# both the build of pnglibconf.h and, subsequently, when +# building libpng itself. +$(PNGCONF): $(PNGSRC)/scripts/pnglibconf.mak\ + $(PNGSRC)/scripts/pnglibconf.dfa \ + $(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa + $(RM) pnglibconf.h pnglibconf.dfn + $(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\ + srcdir=$(PNGSRC) CPPFLAGS="-DPNG_USER_CONFIG"\ + DFA_XTRA="pngusr.dfa" $@ clean: + $(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\ + srcdir=$(PNGSRC) clean $(RM) pnm2pngm$(O) $(RM) pnm2pngm$(E) $(RM) $(OBJS) +# distclean also removes the copied source and headers +distclean: clean + $(RM) -r scripts # historical reasons + $(RM) $(PNGSRCS) $(PNGH) + $(RM) $(ZSRCS) $(ZH) $(ZCONF) + $(RM) $(PROGSRCS) $(PROGHDRS) $(PROGDOCS) + +# Header file dependencies: +$(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC) +$(PNGOBJS): $(PNGHDRS) $(ZINC) +$(ZOBJS): $(ZHDRS) + +# Gather the source code from the respective directories +$(PNGSRCS) $(PNGH): $(PNGSRC)/$@ + $(RM) $@ + $(COPY) $(PNGSRC)/$@ $@ + +# No dependency on the ZLIBSRC target so that it only needs +# to be specified once. +$(ZSRCS) $(ZH): + $(RM) $@ + $(COPY) $(ZLIBSRC)/$@ $@ + +# The unconfigured zconf.h varies in name according to the +# zlib release +$(ZCONF): + $(RM) $@ + @for f in zconf.h.in zconf.in.h zconf.h; do\ + test -r $(ZLIBSRC)/$$f &&\ + echo $(COPY) $(ZLIBSRC)/$$f $@ &&\ + $(COPY) $(ZLIBSRC)/$$f $@ && exit 0;\ + done; echo copy: $(ZLIBSRC)/zconf.h not found; exit 1 + +pnm2pngm.c: $(PROGSRC)/pnm2png.c + $(RM) $@ + $(COPY) $(PROGSRC)/pnm2png.c $@ + # End of makefile for pnm2pngm diff -ru4NwbB libpng-1.4.3/contrib/pngminim/encoder/pngusr.dfa libpng-1.5.0beta34/contrib/pngminim/encoder/pngusr.dfa --- libpng-1.4.3/contrib/pngminim/encoder/pngusr.dfa 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta34/contrib/pngminim/encoder/pngusr.dfa 2010-07-12 06:43:42.027203497 -0500 @@ -0,0 +1,24 @@ +# pngminim/encoder/pngusr.dfa +# +# Copyright (c) 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 + +# First all the build options off: +everything = off + +# Switch on the write code - this makes a minimalist encoder +option WRITE on + +# You must choose fixed or floating point arithmetic: +option FLOATING_POINT on +# option FIXED_POINT on + +# Your program will probably need other options. The example +# program here, pnm2pngm, requires the following. Take a look +# at pnglibconf.h to find out the full set of what has to be +# enabled to make the following work. +option SETJMP on +option STDIO on diff -ru4NwbB libpng-1.4.3/contrib/pngminim/encoder/pngusr.h libpng-1.5.0beta34/contrib/pngminim/encoder/pngusr.h --- libpng-1.4.3/contrib/pngminim/encoder/pngusr.h 2010-06-25 19:32:26.859731821 -0500 +++ libpng-1.5.0beta34/contrib/pngminim/encoder/pngusr.h 2010-07-12 06:43:42.035960326 -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,66 +11,18 @@ #ifndef MINWRPNGCONF_H #define MINWRPNGCONF_H -#define PNG_NO_READ_SUPPORTED +/* If pngusr.h is included during the build the following must + * be defined either here or in the .dfa file (pngusr.dfa in + * this case). To include pngusr.h set -DPNG_USER_CONFIG in + * CPPFLAGS + */ +#define PNG_USER_PRIVATEBUILD "libpng minimal conformant PNG encoder" +#define PNG_USER_DLLFNAME_POSTFIX "me" +/* List options to turn off features of the build that do not + * affect the API (so are not recorded in pnglibconf.h) + */ #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_BGR -#define PNG_NO_WRITE_GAMMA -#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 -#define PNG_NO_WRITE_FILLER -#define PNG_NO_WRITE_SWAP -#define PNG_NO_WRITE_SWAP_ALPHA -#define PNG_NO_WRITE_INVERT_ALPHA -#define PNG_NO_WRITE_RGB_TO_GRAY -#define PNG_NO_WRITE_USER_TRANSFORM -#define PNG_NO_WRITE_bKGD -#define PNG_NO_WRITE_cHRM -#define PNG_NO_WRITE_gAMA -#define PNG_NO_WRITE_hIST -#define PNG_NO_WRITE_iCCP -#define PNG_NO_WRITE_oFFs -#define PNG_NO_WRITE_pCAL -#define PNG_NO_WRITE_pHYs -#define PNG_NO_WRITE_sBIT -#define PNG_NO_WRITE_sCAL -#define PNG_NO_WRITE_sPLT -#define PNG_NO_WRITE_sRGB -#define PNG_NO_WRITE_TEXT -#define PNG_NO_WRITE_tIME -#define PNG_NO_WRITE_UNKNOWN_CHUNKS -#define PNG_NO_WRITE_USER_CHUNKS -#define PNG_NO_WRITE_EMPTY_PLTE -#define PNG_NO_WRITE_OPT_PLTE -#define PNG_NO_WRITE_FILTER -#define PNG_NO_WRITE_WEIGHTED_FILTER -#define PNG_NO_WRITE_INTERLACING_SUPPORTED -#define PNG_NO_WRITE_FLUSH - -#define PNG_NO_INFO_IMAGE -#define PNG_NO_IO_STATE -#define PNG_NO_USER_MEM -#define PNG_NO_FIXED_POINT_SUPPORTED -#define PNG_NO_MNG_FEATURES -#define PNG_NO_USER_TRANSFORM_PTR -#define PNG_NO_HANDLE_AS_UNKNOWN -#define PNG_NO_CONSOLE_IO -#define PNG_NO_ZALLOC_ZERO -#define PNG_NO_ERROR_NUMBERS -#define PNG_NO_EASY_ACCESS -#define PNG_NO_USER_LIMITS -#define PNG_NO_SET_USER_LIMITS -#define PNG_NO_TIME_RFC1143 #endif /* MINWRPNGCONF_H */ diff -ru4NwbB libpng-1.4.3/contrib/pngminim/preader/README libpng-1.5.0beta34/contrib/pngminim/preader/README --- libpng-1.4.3/contrib/pngminim/preader/README 2010-06-25 19:32:26.868355467 -0500 +++ libpng-1.5.0beta34/contrib/pngminim/preader/README 2010-07-12 06:43:42.044807265 -0500 @@ -1,14 +1,15 @@ This demonstrates the use of PNG_USER_CONFIG and pngusr.h -To build a minimal read-only progressive decoder embedded libpng and -zlib and with your system's X library, run +The makefile builds a minimal read-only progressive decoder with +embedded libpng, zlib and your system's X library. - gather.sh # to collect needed files from gregbook, libpng, and zlib +Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC +on the make command line. Edit makefile if required, to find your X library and include files, then - make + make ZLIBSRC=directory If you prefer to use the shared libraries, go to contrib/gregbook and build the rpng2-x application there. diff -ru4NwbB libpng-1.4.3/contrib/pngminim/preader/gather.sh libpng-1.5.0beta34/contrib/pngminim/preader/gather.sh --- libpng-1.4.3/contrib/pngminim/preader/gather.sh 2010-06-25 19:32:26.876855237 -0500 +++ libpng-1.5.0beta34/contrib/pngminim/preader/gather.sh 1969-12-31 18:00:00.000000000 -0600 @@ -1,9 +0,0 @@ -cp ../../gregbook/rpng2-x.c ../../gregbook/readpng2.[ch] . -cp ../../gregbook/COPYING ../../gregbook/LICENSE . -cp ../../../*.h . -cp ../../../*.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 minigzip.c example.c compress.c deflate.c gz* diff -ru4NwbB libpng-1.4.3/contrib/pngminim/preader/makefile libpng-1.5.0beta34/contrib/pngminim/preader/makefile --- libpng-1.4.3/contrib/pngminim/preader/makefile 2010-06-25 19:32:26.885497868 -0500 +++ libpng-1.5.0beta34/contrib/pngminim/preader/makefile 2010-07-12 06:43:42.053963014 -0500 @@ -3,10 +3,15 @@ #CC=cc CC=gcc LD=$(CC) +STRIP=strip + +# If awk fails try +# make AWK=nawk RM=rm -f +COPY=cp #XINC = -I/usr/include # old-style, stock X distributions #XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX) @@ -22,39 +27,138 @@ #LIBS = $(XLIB) LIBS = $(XLIB) -lm #platforms that need libm -CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \ - -DdeflateParams\(a,b,c\)=Z_OK -I. $(XINC) -O1 +CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP -I. $(XINC) -O1 C=.c O=.o L=.a E= +# Where to find the source code: +PNGSRC =../../.. +ZLIBSRC=$(PNGSRC)/../zlib +PROGSRC=$(PNGSRC)/contrib/gregbook + +# Zlib (minimal inflate requirements - crc32 is used by libpng) +# zutil can be eliminated if you provide your own zcalloc and zcfree +ZSRCS = adler32$(C) crc32$(C) \ + inffast$(C) inflate$(C) inftrees$(C) \ + zutil$(C) + +# Standard headers +ZH = zlib.h crc32.h inffast.h inffixed.h \ + inflate.h inftrees.h zutil.h + +# Machine generated headers +ZCONF = zconf.h + +# Headers callers use +ZINC = zlib.h $(ZCONF) + +# Headers the Zlib source uses +ZHDRS = $(ZH) $(ZCONF) + ZOBJS = adler32$(O) crc32$(O) \ - infback$(O) inffast$(O) inflate$(O) inftrees$(O) \ - trees$(O) uncompr$(O) zutil$(O) + inffast$(O) inflate$(O) inftrees$(O) \ + zutil$(O) + +# libpng +PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \ + pngpread$(C) pngread$(C) pngrio$(C) pngrtran$(C) pngrutil$(C) \ + pngset$(C) pngtrans$(C) + +# Standard headers +PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h -OBJS = rpng2-x$(O) readpng2$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ +# Machine generated headers +PNGCONF=pnglibconf.h + +# Headers callers use +PNGINC= png.h pngconf.h pngusr.h $(PNGCONF) + +# Headers the PNG library uses +PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h + +PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \ pngpread$(O) pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \ - pngset$(O) pngtrans$(O) $(ZOBJS) + pngset$(O) pngtrans$(O) + +PROGSRCS= rpng2-x$(C) readpng2$(C) +PROGHDRS= readpng2.h +PROGDOCS= COPYING LICENSE +PROGOBJS= rpng2-x$(O) readpng2$(O) + +OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS) # implicit make rules ------------------------------------------------------- -.c$(O): png.h pngconf.h pngpriv.h readpng2.h pngusr.h zlib.h +.c$(O): $(CC) -c $(CFLAGS) $< # dependencies -all: rpng2-x$(E) +all: $(PROGDOCS) rpng2-x$(E) rpng2-x$(E): $(OBJS) $(LD) -o rpng2-x$(E) $(OBJS) $(LIBS) - strip rpng2-x$(E) + $(STRIP) rpng2-x$(E) + +# The DFA_XTRA setting turns all libpng options off then +# turns on those required for this minimal build. +# The CPP_FLAGS setting causes pngusr.h to be included in +# both the build of pnglibconf.h and, subsequently, when +# building libpng itself. +$(PNGCONF): $(PNGSRC)/scripts/pnglibconf.mak\ + $(PNGSRC)/scripts/pnglibconf.dfa \ + $(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa + $(RM) pnglibconf.h pnglibconf.dfn + $(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\ + srcdir=$(PNGSRC) CPPFLAGS="-DPNG_USER_CONFIG"\ + DFA_XTRA="pngusr.dfa" $@ clean: + $(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\ + srcdir=$(PNGSRC) clean $(RM) rpng2-x$(O) $(RM) rpng2-x$(E) $(RM) $(OBJS) +# distclean also removes the copied source and headers +distclean: clean + $(RM) -r scripts # historical reasons + $(RM) $(PNGSRCS) $(PNGH) + $(RM) $(ZSRCS) $(ZH) $(ZCONF) + $(RM) $(PROGSRCS) $(PROGHDRS) $(PROGDOCS) + +# Header file dependencies: +$(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC) +$(PNGOBJS): $(PNGHDRS) $(ZINC) +$(ZOBJS): $(ZHDRS) + +# Gather the source code from the respective directories +$(PNGSRCS) $(PNGH): $(PNGSRC)/$@ + $(RM) $@ + $(COPY) $(PNGSRC)/$@ $@ + +# No dependency on the ZLIBSRC target so that it only needs +# to be specified once. +$(ZSRCS) $(ZH): + $(RM) $@ + $(COPY) $(ZLIBSRC)/$@ $@ + +# The unconfigured zconf.h varies in name according to the +# zlib release +$(ZCONF): + $(RM) $@ + @for f in zconf.h.in zconf.in.h zconf.h; do\ + test -r $(ZLIBSRC)/$$f &&\ + echo $(COPY) $(ZLIBSRC)/$$f $@ &&\ + $(COPY) $(ZLIBSRC)/$$f $@ && exit 0;\ + done; echo copy: $(ZLIBSRC)/zconf.h not found; exit 1 + +$(PROGSRCS) $(PROGHDRS) $(PROGDOCS): $(PROGSRC)/$@ + $(RM) $@ + $(COPY) $(PROGSRC)/$@ $@ + # End of makefile for rpng2-x diff -ru4NwbB libpng-1.4.3/contrib/pngminim/preader/pngusr.dfa libpng-1.5.0beta34/contrib/pngminim/preader/pngusr.dfa --- libpng-1.4.3/contrib/pngminim/preader/pngusr.dfa 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta34/contrib/pngminim/preader/pngusr.dfa 2010-07-12 06:43:42.062431588 -0500 @@ -0,0 +1,29 @@ +# pngminim/preader/pngusr.dfa +# +# Copyright (c) 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 + +# First all the build options off: +everything = off + +# Just switch on the progressive read code +option PROGRESSIVE_READ on + +# You must choose fixed or floating point arithmetic: +option FLOATING_POINT on +# option FIXED_POINT on + +# Your program will probably need other options. The example +# program here, rpng2-x, requires the following. Take a look +# at pnglibconf.h to find out the full set of what has to be +# enabled to make the following work. +option SETJMP on +option STDIO on +option READ_bKGD on +option READ_GAMMA on +option READ_EXPAND on +option READ_16_TO_8 on +option READ_GRAY_TO_RGB on diff -ru4NwbB libpng-1.4.3/contrib/pngminim/preader/pngusr.h libpng-1.5.0beta34/contrib/pngminim/preader/pngusr.h --- libpng-1.4.3/contrib/pngminim/preader/pngusr.h 2010-06-25 19:32:26.894447060 -0500 +++ libpng-1.5.0beta34/contrib/pngminim/preader/pngusr.h 2010-07-12 06:43:42.070952652 -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,58 +11,18 @@ #ifndef MINPRDPNGCONF_H #define MINPRDPNGCONF_H -#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_BGR -#define PNG_NO_READ_DITHER -#define PNG_NO_READ_INVERT -#define PNG_NO_READ_SHIFT -#define PNG_NO_READ_PACK -#define PNG_NO_READ_PACKSWAP -#define PNG_NO_READ_FILLER -#define PNG_NO_READ_SWAP -#define PNG_NO_READ_SWAP_ALPHA -#define PNG_NO_READ_INVERT_ALPHA -#define PNG_NO_READ_RGB_TO_GRAY -#define PNG_NO_READ_USER_TRANSFORM -#define PNG_NO_READ_cHRM -#define PNG_NO_READ_hIST -#define PNG_NO_READ_iCCP -#define PNG_NO_READ_pCAL -#define PNG_NO_READ_pHYs -#define PNG_NO_READ_sBIT -#define PNG_NO_READ_sCAL -#define PNG_NO_READ_sPLT -#define PNG_NO_READ_TEXT -#define PNG_NO_READ_tIME -#define PNG_NO_READ_UNKNOWN_CHUNKS -#define PNG_NO_READ_USER_CHUNKS -#define PNG_NO_READ_EMPTY_PLTE -#define PNG_NO_READ_OPT_PLTE -#define PNG_NO_READ_STRIP_ALPHA -#define PNG_NO_READ_oFFs - -#define PNG_NO_WRITE_SUPPORTED +/* If pngusr.h is included during the build the following must + * be defined either here or in the .dfa file (pngusr.dfa in + * this case). To include pngusr.h set -DPNG_USER_CONFIG in + * CPPFLAGS + */ +#define PNG_USER_PRIVATEBUILD "libpng minimal conformant PNG progressive reader" +#define PNG_USER_DLLFNAME_POSTFIX "mp" -#define PNG_NO_INFO_IMAGE -#define PNG_NO_IO_STATE -#define PNG_NO_USER_MEM -#define PNG_NO_FIXED_POINT_SUPPORTED -#define PNG_NO_MNG_FEATURES -#define PNG_NO_USER_TRANSFORM_PTR -#define PNG_NO_HANDLE_AS_UNKNOWN -#define PNG_NO_CONSOLE_IO -#define PNG_NO_ZALLOC_ZERO -#define PNG_NO_ERROR_NUMBERS -#define PNG_NO_EASY_ACCESS -#define PNG_NO_USER_LIMITS -#define PNG_NO_SET_USER_LIMITS -#define PNG_NO_TIME_RFC1143 +/* List options to turn off features of the build that do not + * affect the API (so are not recorded in pnglibconf.h) + */ +#define PNG_NO_WARNINGS #endif /* MINPRDPNGCONF_H */ diff -ru4NwbB libpng-1.4.3/example.c libpng-1.5.0beta34/example.c --- libpng-1.4.3/example.c 2010-06-25 19:32:26.011908322 -0500 +++ libpng-1.5.0beta34/example.c 2010-07-12 06:43:40.829505838 -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.2 [May 6, 2010] + * Last changed in libpng 1.5.0 [July 12, 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. @@ -285,9 +285,8 @@ { /* An array of colors to which the image should be quantized */ png_color std_color_cube[MAX_SCREEN_COLORS]; - /* Prior to libpng-1.4.2, this was png_set_dither(). */ 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 */ @@ -675,22 +678,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[0].lang_key = NULL; - text_ptr[1].lang = NULL; - text_ptr[1].lang_key = NULL; + text_ptr[2].itxt_length = 0; text_ptr[2].lang = NULL; text_ptr[2].lang_key = NULL; -#endif 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.3/new_push_process_row.c libpng-1.5.0beta34/new_push_process_row.c --- libpng-1.4.3/new_push_process_row.c 2010-06-25 19:32:26.017067726 -0500 +++ libpng-1.5.0beta34/new_push_process_row.c 1969-12-31 18:00:00.000000000 -0600 @@ -1,204 +0,0 @@ -void /* PRIVATE */ -png_push_process_row(png_structp png_ptr) -{ - png_ptr->row_info.color_type = png_ptr->color_type; - png_ptr->row_info.width = png_ptr->iwidth; - png_ptr->row_info.channels = png_ptr->channels; - png_ptr->row_info.bit_depth = png_ptr->bit_depth; - png_ptr->row_info.pixel_depth = png_ptr->pixel_depth; - - png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, - png_ptr->row_info.width); - - png_read_filter_row(png_ptr, &(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->prev_row + 1, - (int)(png_ptr->row_buf[0])); - - png_memcpy(png_ptr->prev_row, png_ptr->row_buf, png_ptr->rowbytes + 1); - - if (png_ptr->transformations || (png_ptr->flags&PNG_FLAG_STRIP_ALPHA)) - png_do_read_transformations(png_ptr); - -#ifdef PNG_READ_INTERLACING_SUPPORTED - /* Blow up interlaced rows to full size */ - if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE)) - { - if (png_ptr->pass < 6) -/* old interface (pre-1.0.9): - png_do_read_interlace(&(png_ptr->row_info), - png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations); - */ - png_do_read_interlace(png_ptr); - - switch (png_ptr->pass) - { - case 0: - { - int i; - for (i = 0; i < 8 && png_ptr->pass == 0; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); /* Updates png_ptr->pass */ - } - - if (png_ptr->pass == 2) /* Pass 1 might be empty */ - { - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - } - - if (png_ptr->pass == 4 && png_ptr->height <= 4) - { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - } - - if (png_ptr->pass == 6 && png_ptr->height <= 4) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - - break; - } - - case 1: - { - int i; - for (i = 0; i < 8 && png_ptr->pass == 1; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 2) /* Skip top 4 generated rows */ - { - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - } - - break; - } - - case 2: - { - int i; - - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - for (i = 0; i < 4 && png_ptr->pass == 2; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 4) /* Pass 3 might be empty */ - { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - } - - break; - } - - case 3: - { - int i; - - for (i = 0; i < 4 && png_ptr->pass == 3; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 4) /* Skip top two generated rows */ - { - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - } - - break; - } - - case 4: - { - int i; - - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - for (i = 0; i < 2 && png_ptr->pass == 4; i++) - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 6) /* Pass 5 might be empty */ - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - - break; - } - - case 5: - { - int i; - - for (i = 0; i < 2 && png_ptr->pass == 5; i++) - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } - - if (png_ptr->pass == 6) /* Skip top generated row */ - { - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - - break; - } - case 6: - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - - if (png_ptr->pass != 6) - break; - - png_push_have_row(png_ptr, NULL); - png_read_push_finish_row(png_ptr); - } - } - } - else -#endif - { - png_push_have_row(png_ptr, png_ptr->row_buf + 1); - png_read_push_finish_row(png_ptr); - } -} diff -ru4NwbB libpng-1.4.3/png.c libpng-1.5.0beta34/png.c --- libpng-1.4.3/png.c 2010-06-25 19:32:26.024705152 -0500 +++ libpng-1.5.0beta34/png.c 2010-07-12 06:43:40.836636188 -0500 @@ -1,8 +1,8 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.4.2 [May 6, 2010] + * Last changed in libpng 1.5.0 [July 12, 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 +585,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.3/png.h libpng-1.5.0beta34/png.h --- libpng-1.4.3/png.h 2010-06-25 19:32:25.987938871 -0500 +++ libpng-1.5.0beta34/png.h 2010-07-12 06:43:40.791789749 -0500 @@ -136,16 +136,12 @@ * 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.4.2beta01 14 10402 14.so.14.2[.0] - * 1.4.2rc02-06 14 10402 14.so.14.2[.0] * 1.4.2 14 10402 14.so.14.2[.0] - * 1.4.3beta01-05 14 10403 14.so.14.3[.0] - * 1.4.3rc01-03 14 10403 14.so.14.3[.0] * 1.4.3 14 10403 14.so.14.3[.0] + * 1.5.0beta01-34 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 @@ -247,10 +243,10 @@ * to the following restrictions: * * 1. The origin of this source code must not be misrepresented. * - * 2. Altered versions must be plainly marked as such and - * must not be misrepresented as being the original source. + * 2. Altered versions must be plainly marked as such and must not + * be misrepresented as being the original source. * * 3. This Copyright notice may not be removed or altered from * any source or altered source distribution. * @@ -391,15 +387,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 * @@ -413,9 +424,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 @@ -432,23 +443,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). */ @@ -532,15 +578,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 @@ -593,310 +637,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 */ @@ -1017,43 +760,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 */ @@ -1079,449 +822,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_QUANTIZE_SUPPORTED - png_bytep palette_lookup PNG_DEPSTRUCT; /* lookup table for quantizing */ - png_bytep quantize_index PNG_DEPSTRUCT; /* index translation for palette - files */ -#endif - -#if defined(PNG_READ_QUANTIZE_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_QUANTIZE_SUPPORTED -/* The following three members were added at version 1.0.14 and 1.2.4 */ - png_bytep quantize_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)); +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)); +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)); +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; +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; +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)); +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)); +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. */ @@ -1532,288 +895,293 @@ * 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)); +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. + */ +PNG_EXPORT(void, png_longjmp, (png_structp png_ptr, int val), + PNG_NORETURN,9); #ifdef PNG_READ_SUPPORTED /* Reset the compression stream */ -extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr)); +PNG_EXPORT(int,png_reset_zstream,(png_structp png_ptr),,10); #endif /* 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, +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); +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)); +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)); +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)); +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)); +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)); +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; +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)); +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)); +PNG_EXPORT(void,png_write_info_before_PLTE,(png_structp png_ptr, + png_infop info_ptr),,20); +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)); +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)); +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)); +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)); +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)); +PNG_EXPORT(void,png_set_expand,(png_structp png_ptr),,26); +PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8,(png_structp png_ptr),, + 27); +PNG_EXPORT(void,png_set_palette_to_rgb,(png_structp png_ptr),,28); +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)); +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)); -#endif +PNG_EXPORT(void,png_set_gray_to_rgb,(png_structp png_ptr),,31); -#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 )); +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)); +# ifdef PNG_FIXED_POINT_SUPPORTED +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); +# endif + +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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, +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 +/* TODO: png_set_background_fixed */ #define PNG_BACKGROUND_GAMMA_UNKNOWN 0 #define PNG_BACKGROUND_GAMMA_SCREEN 1 #define PNG_BACKGROUND_GAMMA_FILE 2 #define PNG_BACKGROUND_GAMMA_UNIQUE 3 #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)); +PNG_EXPORT(void,png_set_strip_16,(png_structp png_ptr),,48); #endif #ifdef PNG_READ_QUANTIZE_SUPPORTED /* Turn on quantizing, and reduce the palette to the number of colors - * available. Prior to libpng-1.4.2, this was png_set_dither(). + * available. */ -extern PNG_EXPORT(void,png_set_quantize) PNGARG((png_structp png_ptr, +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_quantize)); + png_uint_16p histogram, int full_quantize),,49); #endif -/* This migration aid will be removed from libpng-1.5.0 */ -#define png_set_dither png_set_quantize #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)); +PNG_EXPORT(void,png_set_gamma,(png_structp png_ptr, + double screen_gamma, double default_file_gamma),,50); #endif +/* TODO: png_set_gamma_fixed */ #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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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 @@ -1840,10 +1208,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)); +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. @@ -1897,12 +1265,13 @@ * 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, +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 +/* TODO: png_set_filter_heuristics_fixed */ #endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ /* Heuristic used for row filter selection. These defines should NOT be * changed. @@ -1918,22 +1287,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)); +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)); +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)); +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)); +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)); +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 @@ -1944,10 +1313,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)); +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 @@ -1956,13 +1324,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)); +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)); +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 @@ -1972,103 +1341,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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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); +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)); +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)); +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)); +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)); +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; +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; +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; +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)); +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)); +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)); +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 @@ -2087,48 +1454,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)); +PNG_EXPORT(png_voidp,png_malloc_default,(png_structp png_ptr, + png_alloc_size_t size),PNG_ALLOCATED,100); +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; +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; +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; +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)); +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)); +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 +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 +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)); +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 @@ -2142,260 +1519,270 @@ * 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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +PNG_EXPORT(png_uint_32, png_get_pixels_per_meter,(png_structp png_ptr, + png_infop info_ptr),,122); +PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter, + (png_structp png_ptr, png_infop info_ptr),,123); +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)); +PNG_EXPORT(float, png_get_pixel_aspect_ratio, + (png_structp png_ptr, png_infop info_ptr),,125); #endif +/* TODO: png_get_pixel_aspect_ratio_fixed */ /* 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)); +PNG_EXPORT(png_int_32, png_get_x_offset_pixels, + (png_structp png_ptr, png_infop info_ptr),,126); +PNG_EXPORT(png_int_32, png_get_y_offset_pixels, + (png_structp png_ptr, png_infop info_ptr),,127); +PNG_EXPORT(png_int_32, png_get_x_offset_microns, + (png_structp png_ptr, png_infop info_ptr),,128); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +PNG_EXPORT(png_uint_32,png_get_gAMA,(png_structp png_ptr, + png_infop info_ptr, double *file_gamma),,137); +# endif +# ifdef PNG_FIXED_POINT_SUPPORTED +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 -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)); #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)); +PNG_EXPORT(void,png_set_gAMA,(png_structp png_ptr, + png_infop info_ptr, double file_gamma),,139); +# endif +# ifdef PNG_FIXED_POINT_SUPPORTED +PNG_EXPORT(void,png_set_gAMA_fixed,(png_structp png_ptr, + png_infop info_ptr, png_fixed_point int_file_gamma),,140); #endif -extern PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point int_file_gamma)); #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)); +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)); +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, +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, +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, +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, +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, +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, +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)); +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)); +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)); +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)); +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)); +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)); +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)); +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)); +PNG_EXPORT(void,png_set_sRGB,(png_structp png_ptr, + png_infop info_ptr, int intent),,156); +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, +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, +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)); +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)); +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)); +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 @@ -2404,58 +1791,55 @@ * 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)); +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)); +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)); +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, +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, +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)); -#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)); +PNG_EXPORT(png_uint_32,png_get_sCAL,(png_structp png_ptr, + png_infop info_ptr, int *unit, double *width, double *height),,168); #endif +# ifdef PNG_FIXED_POINT_SUPPORTED +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 /* 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)); -#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)); +PNG_EXPORT(void,png_set_sCAL,(png_structp png_ptr, + png_infop info_ptr, int unit, double width, double height),,170); #endif +# ifdef PNG_FIXED_POINT_SUPPORTED +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 /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */ #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED @@ -2467,50 +1851,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)); +PNG_EXPORT(void, png_set_keep_unknown_chunks,(png_structp png_ptr, + int keep, png_bytep chunk_list, int num_chunks),,172); +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)); +PNG_EXPORT(void, png_set_unknown_chunks,(png_structp png_ptr, + png_infop info_ptr, png_unknown_chunkp unknowns, + int num_unknowns),,174); +PNG_EXPORT(void, png_set_unknown_chunk_location, + (png_structp png_ptr, png_infop info_ptr, int chunk, + int location),,175); +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)); +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)); +PNG_EXPORT(void, png_read_png,(png_structp png_ptr, + png_infop info_ptr, int transforms, png_voidp params),,178); +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)); +PNG_EXPORT(png_charp,png_get_copyright,(png_structp png_ptr),,180); +PNG_EXPORT(png_charp,png_get_header_ver,(png_structp png_ptr),,181); +PNG_EXPORT(png_charp,png_get_header_version,(png_structp png_ptr),,182); +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)); +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 @@ -2521,60 +1902,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)); +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)); +PNG_EXPORT(void,png_set_user_limits,(png_structp png_ptr, + png_uint_32 user_width_max, png_uint_32 user_height_max),,186); +PNG_EXPORT(png_uint_32,png_get_user_width_max, + (png_structp png_ptr),,187); +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)); +PNG_EXPORT(void,png_set_chunk_cache_max,(png_structp png_ptr, + png_uint_32 user_chunk_cache_max),,189); +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)); +PNG_EXPORT(void,png_set_chunk_malloc_max,(png_structp png_ptr, + png_alloc_size_t user_chunk_cache_max),,191); +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)); +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)); +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 */ @@ -2637,9 +2018,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) + \ @@ -2653,45 +2033,45 @@ ((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 + +#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED +PNG_EXPORT(png_uint_32,png_get_uint_32,(png_bytep buf),,201); +PNG_EXPORT(png_uint_16,png_get_uint_16,(png_bytep buf),,202); +#endif +#ifdef PNG_GET_INT_32_SUPPORTED +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)); + +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)); +#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED +PNG_EXPORT(void,png_save_uint_32,(png_bytep buf, png_uint_32 i),,205); +#endif +#ifdef PNG_SAVE_INT_32_SUPPORTED +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)); +#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED +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. */ +#endif -/* ************************************************************************* */ - -/* 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.3/pngconf.h libpng-1.5.0beta34/pngconf.h --- libpng-1.4.3/pngconf.h 2010-06-25 19:32:25.996648919 -0500 +++ libpng-1.5.0beta34/pngconf.h 2010-07-12 06:43:40.798636739 -0500 @@ -1,9 +1,9 @@ /* pngconf.h - machine configurable file for libpng * * libpng version 1.5.0beta34 - July 12, 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,46 @@ #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, if read functions are not + * built into the library the macro implementation is forced on. */ -#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 +#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED +# define PNG_USE_READ_MACROS # 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,776 +82,290 @@ #endif /* OF */ #endif /* PNGARG */ -/* Try to determine if we are compiling on a Mac. Note that testing for - * just __MWERKS__ is not good enough, because the Codewarrior is now used - * on non-Mac platforms. - */ -#ifndef MACOS -# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ - defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) -# define MACOS -# endif -#endif - -/* Enough people need this for various reasons to include it here */ -#if !defined(MACOS) && !defined(RISCOS) -# include -#endif - -/* PNG_SETJMP_NOT_SUPPORTED and PNG_NO_SETJMP_SUPPORTED are deprecated. */ -#if !defined(PNG_NO_SETJMP) && \ - !defined(PNG_SETJMP_NOT_SUPPORTED) && !defined(PNG_NO_SETJMP_SUPPORTED) -# define PNG_SETJMP_SUPPORTED -#endif - -#ifdef PNG_SETJMP_SUPPORTED -/* This is an attempt to force a single setjmp behaviour on Linux. If - * the X config stuff didn't define _BSD_SOURCE we wouldn't need this. - * - * You can bypass this test if you know that your application uses exactly - * the same setjmp.h that was included when libpng was built. Only define - * PNG_SKIP_SETJMP_CHECK while building your application, prior to the - * application's '#include "png.h"'. Don't define PNG_SKIP_SETJMP_CHECK - * while building a separate libpng library for general use. +/* 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 specifies the calling convention of every exported function and + * every function called via a user supplied function pointer. This is + * done in this file 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). + * + * These macros should never be overridden. If it is necessary to + * change calling convention in a private build this can be done + * by setting PNG_API_RULE (which defaults to 0) to one of the values + * below to select the correct 'API' variants. + * + * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout. + * This is correct in every known environment. + * PNG_API_RULE=1 Use the operating system convention for PNGAPI and + * the 'C' calling convention (from PNGCAPI) for + * callbacks (PNGCBAPI). This is no longer required + * in any known environment - if it has to be used + * please post an explanation of the problem to the + * libpng mailing list. + * + * 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. On Windows/x86 systems it also sets + * compiler-specific macros to the values required to change the calling + * conventions of the various functions. + */ +#if ( defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\ + defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) ) &&\ + ( defined(_X86_) || defined(_X64_) || defined(_M_IX86) ||\ + defined(_M_X64) || defined(_M_IA64) ) + /* Windows system (DOS doesn't support DLLs) running on x86/x64. + * Includes builds under Cygwin or MinGW. */ - -# ifndef PNG_SKIP_SETJMP_CHECK -# ifdef __linux__ -# ifdef _BSD_SOURCE -# define PNG_SAVE_BSD_SOURCE -# undef _BSD_SOURCE -# endif -# ifdef _SETJMP_H - /* If you encounter a compiler error here, see the explanation - * near the end of INSTALL. - */ - __pngconf.h__ in libpng already includes setjmp.h; - __dont__ include it again.; -# endif -# endif /* __linux__ */ -# endif /* PNG_SKIP_SETJMP_CHECK */ - - /* Include setjmp.h for error handling */ -# include - -# ifdef __linux__ -# ifdef PNG_SAVE_BSD_SOURCE -# ifdef _BSD_SOURCE -# undef _BSD_SOURCE -# endif -# define _BSD_SOURCE -# undef PNG_SAVE_BSD_SOURCE +# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) +# define PNGCAPI __cdecl +# if PNG_API_RULE == 1 +# 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 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. + /* An older compiler, or one not detected (erroneously) above, + * if necessary override on the command line to get the correct + * variants for the compiler. */ - -/* Prior to libpng-1.4.2, these were PNG_DITHER_*_BITS - * These migration aids will be removed from libpng-1.5.0. - */ -#ifdef PNG_DITHER_RED_BITS -# define PNG_QUANTIZE_RED_BITS PNG_DITHER_RED_BITS +# ifndef PNGCAPI +# define PNGCAPI _cdecl #endif -#ifdef PNG_DITHER_GREEN_BITS -# define PNG_QUANTIZE_GREEN_BITS PNG_DITHER_GREEN_BITS -#endif -#ifdef PNG_DITHER_BLUE_BITS -# define PNG_QUANTIZE_BLUE_BITS PNG_DITHER_BLUE_BITS +# if PNG_API_RULE == 1 && !defined(PNGAPI) +# define PNGAPI _stdcall #endif +# endif /* compiler/api */ + /* NOTE: PNGCBAPI always defaults to PNGCAPI. */ -#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 +# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD) + ERROR: PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed #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). +# 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 -# ifndef PNG_NO_READ_QUANTIZE - /* Prior to libpng-1.4.0 this was PNG_READ_DITHER_SUPPORTED */ -# ifndef PNG_NO_READ_DITHER /* This migration aid will be removed */ -# define PNG_READ_QUANTIZE_SUPPORTED -# endif -# endif -# 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 */ -# endif -# ifndef PNG_NO_WRITE_SWAP_ALPHA -# define PNG_WRITE_SWAP_ALPHA_SUPPORTED +#else /* !Windows/x86 */ +# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) +# define PNGAPI _System +# else /* !Windows/x86 && !OS/2 */ + /* Use the defaults, or define PNG*API on the command line (but + * this will have to be done for every compile!) + */ +# endif /* other system, !OS/2 */ +#endif /* !Windows/x86 */ + +/* 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(_USRDLL) ||\ + 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(type, name, args, attributes, 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 @@ -1135,9 +412,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 @@ -1176,9 +453,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; @@ -1190,9 +468,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 @@ -1214,204 +492,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 @@ -1509,17 +598,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.3/pngdebug.h libpng-1.5.0beta34/pngdebug.h --- libpng-1.4.3/pngdebug.h 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta34/pngdebug.h 2010-07-12 06:43:40.822261831 -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 - July 12, 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 png.c and 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.3/pngerror.c libpng-1.5.0beta34/pngerror.c --- libpng-1.4.3/pngerror.c 2010-06-25 19:32:26.030486270 -0500 +++ libpng-1.5.0beta34/pngerror.c 2010-07-12 06:43:40.842326305 -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 [July 12, 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 +188,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 +204,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 +248,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 +296,34 @@ 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 +378,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 +414,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.3/pngget.c libpng-1.5.0beta34/pngget.c --- libpng-1.4.3/pngget.c 2010-06-25 19:32:26.037548583 -0500 +++ libpng-1.5.0beta34/pngget.c 2010-07-12 06:43:40.849294673 -0500 @@ -1,8 +1,8 @@ /* pngget.c - retrieval of values from info struct * - * Last changed in libpng 1.4.2 [May 6, 2010] + * Last changed in libpng 1.4.1 [July 12, 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.) * @@ -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 +363,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 */ @@ -669,11 +680,12 @@ *width = info_ptr->scal_pixel_width; *height = info_ptr->scal_pixel_height; return (PNG_INFO_sCAL); } + return(0); } -#else +#endif #ifdef PNG_FIXED_POINT_SUPPORTED png_uint_32 PNGAPI png_get_sCAL_s(png_structp png_ptr, png_infop info_ptr, int *unit, png_charpp width, png_charpp height) @@ -689,9 +702,8 @@ return(0); } #endif #endif -#endif #ifdef PNG_pHYs_SUPPORTED png_uint_32 PNGAPI png_get_pHYs(png_structp png_ptr, png_infop info_ptr, @@ -766,10 +781,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 +923,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.3/pnginfo.h libpng-1.5.0beta34/pnginfo.h --- libpng-1.4.3/pnginfo.h 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta34/pnginfo.h 2010-07-12 06:43:40.817293665 -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 - July 12, 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.3/pngmem.c libpng-1.5.0beta34/pngmem.c --- libpng-1.4.3/pngmem.c 2010-06-25 19:32:26.043778474 -0500 +++ libpng-1.5.0beta34/pngmem.c 2010-07-12 06:43:40.855601322 -0500 @@ -1,8 +1,8 @@ /* pngmem.c - stub functions for memory allocation * - * Last changed in libpng 1.4.2 [May 6, 2010] + * Last changed in libpng 1.5.0 [July 12, 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 */ @@ -333,12 +355,10 @@ } } if (ptr != NULL) - { farfree(ptr); } -} #else /* Not the Borland DOS special memory handler */ /* Allocate memory for a png_struct or a png_info. The malloc and diff -ru4NwbB libpng-1.4.3/pngpread.c libpng-1.5.0beta34/pngpread.c --- libpng-1.4.3/pngpread.c 2010-06-25 19:32:26.052596370 -0500 +++ libpng-1.5.0beta34/pngpread.c 2010-07-12 06:43:40.864111092 -0500 @@ -1,8 +1,8 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.4.3 [June 26, 2010] + * Last changed in libpng 1.5.0 [July 12, 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 +626,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; @@ -847,9 +855,9 @@ { int ret; /* We have data for zlib, but we must check that zlib - * has somewhere to put the results. It doesn't matter + * has someplace to put the results. It doesn't matter * if we don't expect any results -- it may be the input * data is just the LZ end code. */ if (!(png_ptr->zstream.avail_out > 0)) @@ -860,13 +869,13 @@ png_ptr->zstream.next_out = png_ptr->row_buf; } /* Using Z_SYNC_FLUSH here means that an unterminated - * LZ stream can still be handled (a stream with a missing - * end code), otherwise (Z_NO_FLUSH) a future zlib - * implementation might defer output and, therefore, - * change the current behavior. (See comments in inflate.c - * for why this doesn't happen at present with zlib 1.2.5.) + * LZ stream (a stream with a missing end code) can still + * be handled, otherwise (Z_NO_FLUSH) a future zlib + * implementation might defer output and therefore + * change the current behavior (see comments in inflate.c + * for why this doesn't happen at present with zlib 1.2.5). */ ret = inflate(&png_ptr->zstream, Z_SYNC_FLUSH); /* Check for any failure before proceeding. */ @@ -921,9 +932,9 @@ * is left at this point we have bytes of IDAT data * after the zlib end code. */ if (png_ptr->zstream.avail_in > 0) - png_warning(png_ptr, "Extra compression data"); + png_warning(png_ptr, "Extra compression data in IDAT"); } void /* PRIVATE */ png_push_process_row(png_structp png_ptr) @@ -1159,10 +1170,10 @@ #ifdef PNG_READ_INTERLACING_SUPPORTED if (png_ptr->interlaced) { png_ptr->row_number = 0; - png_memset(png_ptr->prev_row, 0, - png_ptr->rowbytes + 1); + png_memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1); + do { png_ptr->pass++; if ((png_ptr->pass == 1 && png_ptr->width < 5) || @@ -1269,16 +1280,14 @@ if (text < key + png_ptr->current_text_size) text++; - text_ptr = (png_textp)png_malloc(png_ptr, - png_sizeof(png_text)); + 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); @@ -1475,12 +1487,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.3/pngpriv.h libpng-1.5.0beta34/pngpriv.h --- libpng-1.4.3/pngpriv.h 2010-06-25 19:32:26.004448928 -0500 +++ libpng-1.5.0beta34/pngpriv.h 2010-07-12 06:43:40.806198710 -0500 @@ -23,27 +23,145 @@ #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 + +#ifndef PNG_EXTERN /* The functions exported by PNG_EXTERN are internal functions, which * aren't usually used outside the library (as far as I know), so it is * debatable if they should be exported at all. In the future, when it * is possible to have run-time registry of chunk-handling functions, * some of these will be made available again. #define PNG_EXTERN extern */ #define PNG_EXTERN +#endif /* Other defines specific to compilers can go here. Try to keep * 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 +178,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 +193,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 +243,9 @@ #define PNG_PACK 0x0004 #define PNG_SHIFT 0x0008 #define PNG_SWAP_BYTES 0x0010 #define PNG_INVERT_MONO 0x0020 -#define PNG_QUANTIZE 0x0040 /* formerly PNG_DITHER */ +#define PNG_QUANTIZE 0x0040 #define PNG_BACKGROUND 0x0080 #define PNG_BACKGROUND_EXPAND 0x0100 /* 0x0200 unused */ #define PNG_16_TO_8 0x0400 @@ -264,25 +402,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 */ @@ -671,9 +811,9 @@ png_uint_32 length)); #endif #ifdef PNG_READ_iCCP_SUPPORTED -extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr, +PNG_EXTERN void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr, png_uint_32 length)); #endif /* PNG_READ_iCCP_SUPPORTED */ #ifdef PNG_READ_iTXt_SUPPORTED @@ -706,9 +846,9 @@ png_uint_32 length)); #endif #ifdef PNG_READ_sPLT_SUPPORTED -extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr, +PNG_EXTERN void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr, png_uint_32 length)); #endif /* PNG_READ_sPLT_SUPPORTED */ #ifdef PNG_READ_sRGB_SUPPORTED @@ -827,130 +967,24 @@ int color_type, int interlace_type, int compression_type, int filter_type)); /* Free all memory used by the read (old method - NOT DLL EXPORTED) */ -extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr, +PNG_EXTERN void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr)); /* Free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */ -extern void png_write_destroy PNGARG((png_structp png_ptr)); +PNG_EXTERN void png_write_destroy PNGARG((png_structp png_ptr)); #ifdef USE_FAR_KEYWORD /* memory model conversion function */ -extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr, +PNG_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.3/pngread.c libpng-1.5.0beta34/pngread.c --- libpng-1.4.3/pngread.c 2010-06-25 19:32:26.061337464 -0500 +++ libpng-1.5.0beta34/pngread.c 2010-07-12 06:43:40.872174105 -0500 @@ -1,8 +1,8 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.4.1 [February 25, 2010] + * Last changed in libpng 1.5.0 [July 12, 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 +84,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 +126,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; } } @@ -152,13 +153,14 @@ if (!png_cleanup_needed) { /* Initialize zbuf - compression buffer */ png_ptr->zbuf_size = PNG_ZBUF_SIZE; - png_ptr->zbuf = (png_bytep)png_malloc_warn(png_ptr, - png_ptr->zbuf_size); + png_ptr->zbuf = (png_bytep)png_malloc_warn(png_ptr, png_ptr->zbuf_size); + if (png_ptr->zbuf == NULL) png_cleanup_needed = 1; } + png_ptr->zstream.zalloc = png_zalloc; png_ptr->zstream.zfree = png_zfree; png_ptr->zstream.opaque = (voidpf)png_ptr; @@ -165,14 +167,26 @@ if (!png_cleanup_needed) { switch (inflateInit(&png_ptr->zstream)) { - case Z_OK: /* Do nothing */ break; + case Z_OK: + break; /* Do nothing */ + case Z_MEM_ERROR: - case Z_STREAM_ERROR: png_warning(png_ptr, "zlib memory error"); - png_cleanup_needed = 1; break; - case Z_VERSION_ERROR: png_warning(png_ptr, "zlib version error"); - png_cleanup_needed = 1; break; + png_warning(png_ptr, "zlib memory error"); + png_cleanup_needed = 1; + break; + + case Z_STREAM_ERROR: + png_warning(png_ptr, "zlib stream error"); + png_cleanup_needed = 1; + break; + + case Z_VERSION_ERROR: + png_warning(png_ptr, "zlib version error"); + png_cleanup_needed = 1; + break; + default: png_warning(png_ptr, "Unknown zlib error"); png_cleanup_needed = 1; } } @@ -428,13 +471,16 @@ png_debug(1, "in png_read_update_info"); if (png_ptr == NULL) return; + 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,14 +736,14 @@ */ 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 { if (row != NULL) @@ -1157,9 +1263,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 +1283,9 @@ png_ptr->free_fn = free_fn; #endif #ifdef PNG_SETJMP_SUPPORTED - png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf)); + png_memcpy(png_ptr->png_jmpbuf, tmp_jmp, png_sizeof(jmp_buf)); #endif } @@ -1282,40 +1389,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.3/pngrio.c libpng-1.5.0beta34/pngrio.c --- libpng-1.4.3/pngrio.c 2010-06-25 19:32:26.066255903 -0500 +++ libpng-1.5.0beta34/pngrio.c 2010-07-12 06:43:40.877631736 -0500 @@ -1,8 +1,8 @@ /* pngrio.c - functions for data input * - * Last changed in libpng 1.4.1 [February 25, 2010] + * Last changed in libpng 1.5.0 [July 12, 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 +46,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 +71,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 +158,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.3/pngrtran.c libpng-1.5.0beta34/pngrtran.c --- libpng-1.4.3/pngrtran.c 2010-06-25 19:32:26.081580070 -0500 +++ libpng-1.5.0beta34/pngrtran.c 2010-07-12 06:43:40.892337808 -0500 @@ -1,8 +1,8 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.4.2 [May 6, 2010] + * Last changed in libpng 1.5.0 [July 12, 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) { @@ -141,14 +143,14 @@ } #endif #ifdef PNG_READ_QUANTIZE_SUPPORTED -/* Quantize file to 8 bit. Supply a palette, the current number +/* 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_quantize" indicates - * whether we need a quantizeing cube set up for RGB images, or if we + * 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 @@ -650,26 +661,14 @@ } #endif #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED -#ifdef PNG_FLOATING_POINT_SUPPORTED -/* Convert a RGB image to a grayscale of the same width. This allows us, - * for example, to convert a 24 bpp RGB image into an 8 bpp grayscale image. - */ - -void PNGAPI -png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red, - double green) -{ - int red_fixed = (int)((float)red*100000.0 + 0.5); - int green_fixed = (int)((float)green*100000.0 + 0.5); - if (png_ptr == NULL) - return; - png_set_rgb_to_gray_fixed(png_ptr, error_action, red_fixed, green_fixed); -} +void +#ifdef PNG_FIXED_POINT_SUPPORTED + PNGAPI +#else + /* PRIVATE */ #endif - -void PNGAPI png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action, png_fixed_point red, png_fixed_point green) { png_debug(1, "in png_set_rgb_to_gray"); @@ -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; @@ -720,8 +726,28 @@ png_ptr->rgb_to_gray_blue_coeff = (png_uint_16)(32768 - red_int - green_int); } } + +#ifdef PNG_FLOATING_POINT_SUPPORTED +/* Convert a RGB image to a grayscale of the same width. This allows us, + * for example, to convert a 24 bpp RGB image into an 8 bpp grayscale image. + */ + +void PNGAPI +png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red, + double green) +{ + int red_fixed = (int)((float)red*100000.0 + 0.5); + int green_fixed = (int)((float)green*100000.0 + 0.5); + + if (png_ptr == NULL) + return; + + png_set_rgb_to_gray_fixed(png_ptr, error_action, red_fixed, green_fixed); +} +#endif /* FLOATING POINT */ + #endif #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) @@ -772,9 +798,11 @@ 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 +980,10 @@ back.green = (png_byte)(pow( (double)png_ptr->background.green/%F255%, gs) * 255.0 + .5); back.blue = (png_byte)(pow( - (double)png_ptr->background.blue/%F255%, gs) * 255.0 + .5); + (double)png_ptr->background.blue/%F255%, gs) * 255.0 + + .5); } back_1.red = (png_byte)(pow( (double)png_ptr->background.red/%F255%, g) * 255.0 + .5); @@ -1306,9 +1359,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, @@ -1455,12 +1511,13 @@ if (png_ptr->transformations & PNG_QUANTIZE) { 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_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 +1961,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 +2016,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 +2029,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 +2050,8 @@ } } } } -} #endif #ifdef PNG_READ_FILLER_SUPPORTED /* Add filler channel if we have RGB color */ @@ -2004,11 +2071,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 +2086,12 @@ 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++) { @@ -2034,13 +2102,14 @@ row_info->pixel_depth = 16; row_info->rowbytes = row_width * 2; } } + 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 +2123,12 @@ 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 +2146,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 +2163,12 @@ 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++) { @@ -2110,13 +2181,14 @@ row_info->pixel_depth = 32; row_info->rowbytes = row_width * 4; } } + 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 +2206,12 @@ 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 +2250,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++) { @@ -2185,10 +2260,12 @@ *(dp--) = *sp; *(dp--) = *(sp--); } } + 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 +2282,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++) { @@ -2214,10 +2293,12 @@ *(dp--) = *sp; *(dp--) = *(sp--); } } + 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++) { @@ -2344,17 +2429,18 @@ blue = (png_uint_16)(((*(sp))<<8) | *(sp+1)); sp+=2; 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 +2843,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 +2965,15 @@ 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 +3008,14 @@ 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 +3046,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 +3074,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 +3099,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 +3143,14 @@ 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 @@ -3261,10 +3412,9 @@ png_uint_32 row_width=row_info->width; png_debug(1, "in png_do_gamma"); - if ( - ((row_info->bit_depth <= 8 && gamma_table != NULL) || + if (((row_info->bit_depth <= 8 && gamma_table != NULL) || (row_info->bit_depth == 16 && gamma_16_table != NULL))) { switch (row_info->color_type) { @@ -3447,10 +3607,9 @@ png_uint_32 row_width=row_info->width; png_debug(1, "in png_do_expand_palette"); - if ( - row_info->color_type == PNG_COLOR_TYPE_PALETTE) + if (row_info->color_type == PNG_COLOR_TYPE_PALETTE) { if (row_info->bit_depth < 8) { switch (row_info->bit_depth) @@ -3876,9 +4063,9 @@ } } } } -#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.3/pngrutil.c libpng-1.5.0beta34/pngrutil.c --- libpng-1.4.3/pngrutil.c 2010-06-25 19:32:26.095302257 -0500 +++ libpng-1.5.0beta34/pngrutil.c 2010-07-12 06:43:40.905906967 -0500 @@ -1,8 +1,8 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.4.3 [June 26, 2010] + * Last changed in libpng 1.4.1 [July 12, 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,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) { @@ -27,46 +26,54 @@ if (i > PNG_UINT_31_MAX) png_error(png_ptr, "PNG unsigned integer out of range"); return (i); } -#ifndef PNG_USE_READ_MACROS +#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED +/* NOTE: the read macros will obscure these definitions, so that if + * PNG_USE_READ_MACROS is set the library will not use them internally, + * but the APIs will still be available externally. + */ /* 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. + * Only used internally in this file. */ -png_int_32 PNGAPI -png_get_int_32(png_bytep buf) +#if defined(PNG_GET_INT_32_SUPPORTED) +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) + (png_int_32)(*(buf + 3)); return (i); } +#endif /* 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))); return (i); } -#endif /* PNG_USE_READ_MACROS */ +#endif /* PNG_READ_INT_FUNCTIONS_SUPPORTED */ /* Read the chunk header (length + type name). * Put the type name into png_ptr->chunk_name, and return the length. */ @@ -89,9 +96,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 +242,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; } @@ -254,15 +267,16 @@ * buffer if available. */ { PNG_CONST 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 - char umsg[52]; - +#ifdef PNG_CONSOLE_IO_SUPPORTED switch (ret) { case Z_BUF_ERROR: msg = "Buffer error in compressed datastream in %s chunk"; @@ -284,9 +300,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; } @@ -316,9 +332,10 @@ { 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. */ @@ -339,11 +356,12 @@ * error case below. */ #if defined(PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED) || \ defined(PNG_USER_CHUNK_MALLOC_MAX) - else -#endif + 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, @@ -378,10 +396,10 @@ { #ifdef PNG_STDIO_SUPPORTED char umsg[50]; - 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 @@ -480,9 +498,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); } @@ -567,9 +585,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. */ @@ -582,11 +600,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) { @@ -723,10 +745,10 @@ # ifdef PNG_READ_GAMMA_SUPPORTED png_ptr->gamma = file_gamma; # endif png_set_gAMA(png_ptr, info_ptr, file_gamma); -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED +#else + /* Fixed point must be set! */ png_set_gAMA_fixed(png_ptr, info_ptr, igamma); #endif } #endif @@ -1129,17 +1165,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 @@ -1462,9 +1515,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) @@ -1668,12 +1738,13 @@ 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) { png_warning(png_ptr, "No memory for pCAL purpose"); return; @@ -1696,9 +1768,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); @@ -1714,9 +1787,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)) @@ -1806,11 +1883,12 @@ 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) { png_warning(png_ptr, "Out of memory while processing sCAL chunk"); png_crc_finish(png_ptr, length); @@ -2056,15 +2146,14 @@ png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; 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); @@ -2114,9 +2205,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); @@ -2176,15 +2273,14 @@ png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = NULL; 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); @@ -2235,9 +2333,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); @@ -2343,12 +2454,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; @@ -2458,12 +2581,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 */ @@ -2477,17 +2601,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) { @@ -2689,12 +2828,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); @@ -2919,9 +3071,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; @@ -3031,9 +3186,9 @@ } break; } default: - png_warning(png_ptr, "Ignoring bad adaptive filter type"); + png_error(png_ptr, "Ignoring bad adaptive filter type"); *row = 0; break; } } @@ -3340,10 +3525,11 @@ #ifdef PNG_ALIGNED_MEMORY_SUPPORTED /* Use 16-byte aligned memory for row_buf with at least 16 bytes * of padding before and after row_buf. */ - png_ptr->row_buf = png_ptr->big_row_buf + 32 - - (((png_alloc_size_t)&(png_ptr->big_row_buf[0]) + 15) % 16); + png_ptr->row_buf = png_ptr->big_row_buf + 32 - + (((png_alloc_size_t)png_ptr->big_row_buf + 15) & 0x0F); + png_ptr->old_big_row_buf_size = row_bytes + 48; #else /* Use 32 bytes of padding before and 16 bytes after row_buf. */ png_ptr->row_buf = png_ptr->big_row_buf + 32; @@ -3367,14 +3556,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.3/pngset.c libpng-1.5.0beta34/pngset.c --- libpng-1.4.3/pngset.c 2010-06-25 19:32:26.103627142 -0500 +++ libpng-1.5.0beta34/pngset.c 2010-07-12 06:43:40.913938451 -0500 @@ -1,8 +1,8 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.4.1 [February 25, 2010] + * Last changed in libpng 1.5.0 [July 12, 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) { @@ -46,8 +45,9 @@ if (png_ptr == NULL || info_ptr == NULL) return; + /* TODO: call png_check_cHRM_fixed */ info_ptr->x_white = (float)white_x; info_ptr->y_white = (float)white_y; info_ptr->x_red = (float)red_x; info_ptr->y_red = (float)red_y; @@ -138,8 +141,9 @@ if (png_gamma == 0.0) png_warning(png_ptr, "Setting gamma=0"); } #endif +#ifdef PNG_FIXED_POINT_SUPPORTED void PNGAPI png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point int_gamma) { @@ -167,12 +173,11 @@ } #ifdef PNG_FLOATING_POINT_SUPPORTED info_ptr->gamma = (float)(png_gamma/100000.); #endif -#ifdef PNG_FIXED_POINT_SUPPORTED info_ptr->int_gamma = png_gamma; -#endif info_ptr->valid |= PNG_INFO_gAMA; + if (png_gamma == 0) png_warning(png_ptr, "Setting gamma=0"); } #endif @@ -175,8 +180,9 @@ if (png_gamma == 0) png_warning(png_ptr, "Setting gamma=0"); } #endif +#endif #ifdef PNG_hIST_SUPPORTED void PNGAPI png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist) @@ -251,9 +263,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 */ @@ -349,9 +368,9 @@ info_ptr->free_me |= PNG_FREE_PCAL; } #endif -#if defined(PNG_READ_sCAL_SUPPORTED) || defined(PNG_WRITE_sCAL_SUPPORTED) +#ifdef PNG_sCAL_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED void PNGAPI png_set_sCAL(png_structp png_ptr, png_infop info_ptr, int unit, double width, double height) @@ -366,9 +385,9 @@ info_ptr->scal_pixel_height = height; info_ptr->valid |= PNG_INFO_sCAL; } -#else +#endif #ifdef PNG_FIXED_POINT_SUPPORTED void PNGAPI png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr, int unit, png_charp swidth, png_charp sheight) @@ -411,9 +440,8 @@ info_ptr->free_me |= PNG_FREE_SCAL; } #endif #endif -#endif #ifdef PNG_pHYs_SUPPORTED void PNGAPI png_set_pHYs(png_structp png_ptr, png_infop info_ptr, @@ -504,70 +534,42 @@ void PNGAPI png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr, int intent) { -#ifdef PNG_gAMA_SUPPORTED -#ifdef PNG_FLOATING_POINT_SUPPORTED - float file_gamma; -#endif -#ifdef PNG_FIXED_POINT_SUPPORTED - png_fixed_point int_file_gamma; -#endif -#endif -#ifdef PNG_cHRM_SUPPORTED -#ifdef PNG_FLOATING_POINT_SUPPORTED - float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; -#endif - png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, - int_green_y, int_blue_x, int_blue_y; -#endif png_debug1(1, "in %s storage function", "sRGB_gAMA_and_cHRM"); if (png_ptr == NULL || info_ptr == NULL) return; png_set_sRGB(png_ptr, info_ptr, intent); #ifdef PNG_gAMA_SUPPORTED -#ifdef PNG_FLOATING_POINT_SUPPORTED - file_gamma = (float).45455; - png_set_gAMA(png_ptr, info_ptr, file_gamma); -#endif #ifdef PNG_FIXED_POINT_SUPPORTED - int_file_gamma = 45455L; - png_set_gAMA_fixed(png_ptr, info_ptr, int_file_gamma); + png_set_gAMA_fixed(png_ptr, info_ptr, 45455L); +#else + /* Floating point must be set! */ + png_set_gAMA(png_ptr, info_ptr, .45455); #endif #endif #ifdef PNG_cHRM_SUPPORTED - int_white_x = 31270L; - int_white_y = 32900L; - int_red_x = 64000L; - int_red_y = 33000L; - int_green_x = 30000L; - int_green_y = 60000L; - int_blue_x = 15000L; - int_blue_y = 6000L; - -#ifdef PNG_FLOATING_POINT_SUPPORTED - white_x = (float).3127; - white_y = (float).3290; - red_x = (float).64; - red_y = (float).33; - green_x = (float).30; - green_y = (float).60; - blue_x = (float).15; - blue_y = (float).06; -#endif - #ifdef PNG_FIXED_POINT_SUPPORTED png_set_cHRM_fixed(png_ptr, info_ptr, - int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, - int_green_y, int_blue_x, int_blue_y); -#endif -#ifdef PNG_FLOATING_POINT_SUPPORTED + /* color x y */ + /* white */ 31270L, 32900L, + /* red */ 64000L, 33000L, + /* green */ 30000L, 60000L, + /* blue */ 15000L, 6000L + ); +#else + /* Floating point must be supported! */ png_set_cHRM(png_ptr, info_ptr, - white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y); + /* color x y */ + /* while */ .3127, .3290, + /* red */ .64, .33, + /* green */ .30, .60, + /* blue */ .15, .06 + ); #endif #endif /* cHRM */ } #endif /* sRGB */ @@ -747,9 +762,9 @@ (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); @@ -758,20 +773,20 @@ png_memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len); *(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, (png_size_t)(text_length)); + *(textp->text + text_length) = '\0'; #ifdef PNG_iTXt_SUPPORTED if (textp->compression > 0) @@ -778,17 +793,16 @@ { textp->text_length = 0; 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); } return(0); @@ -846,10 +862,11 @@ (int)trans_color->green > sample_max || (int)trans_color->blue > sample_max))) png_warning(png_ptr, "tRNS chunk has out-of-range samples for bit_depth"); - png_memcpy(&(info_ptr->trans_color), trans_color, - png_sizeof(png_color_16)); + + png_memcpy(&(info_ptr->trans_color), trans_color, png_sizeof(png_color_16)); + if (num_trans == 0) num_trans = 1; } diff -ru4NwbB libpng-1.4.3/pngstruct.h libpng-1.5.0beta34/pngstruct.h --- libpng-1.4.3/pngstruct.h 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta34/pngstruct.h 2010-07-12 06:43:40.811815331 -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 - July 12, 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.3/pngtest.c libpng-1.5.0beta34/pngtest.c --- libpng-1.4.3/pngtest.c 2010-06-25 19:32:26.112778757 -0500 +++ libpng-1.5.0beta34/pngtest.c 2010-07-12 06:43:40.922519984 -0500 @@ -1,8 +1,8 @@ /* pngtest.c - a simple test program to test libpng * - * Last changed in libpng 1.4.1 [February 25, 2010] + * Last changed in libpng 1.5.0 [July 12, 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; @@ -115,14 +126,15 @@ { fprintf(stdout, "\n "); status_dots=30; } + 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 +148,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,15 +165,16 @@ */ 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; + if (png_ptr == NULL) + return; /* Contents of row_info: * png_uint_32 width width of row * png_uint_32 rowbytes number of bytes in row @@ -263,9 +287,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 +316,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 +358,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 +372,15 @@ * 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 +393,19 @@ #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 +443,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 +462,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 +499,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 @@ -510,11 +548,13 @@ pinfo->next = pinformation; 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); } } @@ -518,9 +558,9 @@ } } /* 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 +606,10 @@ } /* 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 +629,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 +708,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 +729,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 +766,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 +795,16 @@ 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 { @@ -769,15 +817,16 @@ FCLOSE(fpin); 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 +888,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 +1080,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 +1152,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 +1198,15 @@ #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,17 +1223,19 @@ 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); #ifdef PNG_WRITE_SUPPORTED @@ -1189,9 +1252,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 +1266,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 +1276,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 +1340,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); @@ -1387,13 +1457,12 @@ /* Show the version of libpng used in building the library */ fprintf(STDERR, " library (%lu):%s", (unsigned long)png_access_version_number(), 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 @@ -1536,13 +1613,19 @@ int kerror; #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG int allocation_now = current_allocation; #endif - if (i == 1) status_dots_requested = 1; - else if (verbose == 0)status_dots_requested = 0; + if (i == 1) + status_dots_requested = 1; + + else if (verbose == 0) + status_dots_requested = 0; + if (i == 0 || verbose == 1 || ierror != 0) fprintf(STDERR, "\n Testing %s:", inname); + kerror = test_one_file(inname, outname); + if (kerror == 0) { if (verbose == 1 || i == 2) { diff -ru4NwbB libpng-1.4.3/pngtrans.c libpng-1.5.0beta34/pngtrans.c --- libpng-1.4.3/pngtrans.c 2010-06-25 19:32:26.119519791 -0500 +++ libpng-1.5.0beta34/pngtrans.c 2010-07-12 06:43:40.929166292 -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.2 [April 29, 2010] + * Last changed in libpng 1.5.0 [July 12, 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 +141,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; @@ -251,10 +264,9 @@ png_do_swap(png_row_infop row_info, png_bytep row) { png_debug(1, "in png_do_swap"); - if ( - row_info->bit_depth == 16) + if (row_info->bit_depth == 16) { png_bytep rp = row; png_uint_32 i; png_uint_32 istop= row_info->width * row_info->channels; @@ -380,10 +392,9 @@ png_do_packswap(png_row_infop row_info, png_bytep row) { png_debug(1, "in png_do_packswap"); - if ( - row_info->bit_depth < 8) + if (row_info->bit_depth < 8) { png_bytep rp, end, table; end = row + row_info->rowbytes; @@ -504,20 +523,21 @@ 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++; @@ -566,10 +591,9 @@ png_do_bgr(png_row_infop row_info, png_bytep row) { png_debug(1, "in png_do_bgr"); - if ( - (row_info->color_type & PNG_COLOR_MASK_COLOR)) + if ((row_info->color_type & PNG_COLOR_MASK_COLOR)) { png_uint_32 row_width = row_info->width; if (row_info->bit_depth == 8) { diff -ru4NwbB libpng-1.4.3/pngwio.c libpng-1.5.0beta34/pngwio.c --- libpng-1.4.3/pngwio.c 2010-06-25 19:32:26.124848494 -0500 +++ libpng-1.5.0beta34/pngwio.c 2010-07-12 06:43:40.934306781 -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 [July 12, 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 +45,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 +67,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,14 +131,16 @@ (*(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) return; + io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); fflush(io_ptr); } #endif @@ -199,12 +211,12 @@ /* It is an error to read while writing a png file */ 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.3/pngwrite.c libpng-1.5.0beta34/pngwrite.c --- libpng-1.4.3/pngwrite.c 2010-06-25 19:32:26.133513514 -0500 +++ libpng-1.5.0beta34/pngwrite.c 2010-07-12 06:43:40.942673908 -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 [July 12, 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 +494,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 +521,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 +557,27 @@ 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 +681,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 +803,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 +906,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 +1042,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 +1062,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. */ @@ -1062,20 +1092,27 @@ case 7: png_warning(png_ptr, "Unknown row filter for method 0"); #endif /* PNG_WRITE_FILTER_SUPPORTED */ case PNG_FILTER_VALUE_NONE: png_ptr->do_filter = PNG_FILTER_NONE; break; + #ifdef PNG_WRITE_FILTER_SUPPORTED case PNG_FILTER_VALUE_SUB: png_ptr->do_filter = PNG_FILTER_SUB; break; + case PNG_FILTER_VALUE_UP: png_ptr->do_filter = PNG_FILTER_UP; break; + 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.3/pngwtran.c libpng-1.5.0beta34/pngwtran.c --- libpng-1.4.3/pngwtran.c 2010-06-25 19:32:26.139873927 -0500 +++ libpng-1.5.0beta34/pngwtran.c 2010-07-12 06:43:40.948904808 -0500 @@ -1,8 +1,8 @@ /* pngwtran.c - transforms the data in a row for PNG writers * - * Last changed in libpng 1.4.1 [February 25, 2010] + * Last changed in libpng 1.5.0 [July 12, 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 */ @@ -216,10 +239,9 @@ png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth) { png_debug(1, "in png_do_shift"); - if ( - row_info->color_type != PNG_COLOR_TYPE_PALETTE) + if (row_info->color_type != PNG_COLOR_TYPE_PALETTE) { int shift_start[4], shift_dec[4]; int channels = 0; @@ -340,14 +374,15 @@ { 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++) { png_byte save = *(sp++); *(dp++) = *(sp++); @@ -355,11 +390,12 @@ *(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; @@ -378,13 +414,14 @@ *(dp++) = save[1]; } } } + 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 +431,12 @@ *(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,14 +464,15 @@ { 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++) { /* Does nothing *(dp++) = *(sp++); @@ -443,11 +482,12 @@ 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; @@ -466,13 +506,14 @@ *(dp++) = (png_byte)(255 - *(sp++)); } } } + 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 +522,12 @@ *(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; @@ -511,10 +553,9 @@ png_do_write_intrapixel(png_row_infop row_info, png_bytep row) { png_debug(1, "in png_do_write_intrapixel"); - if ( - (row_info->color_type & PNG_COLOR_MASK_COLOR)) + if ((row_info->color_type & PNG_COLOR_MASK_COLOR)) { int bytes_per_pixel; png_uint_32 row_width = row_info->width; if (row_info->bit_depth == 8) diff -ru4NwbB libpng-1.4.3/pngwutil.c libpng-1.5.0beta34/pngwutil.c --- libpng-1.4.3/pngwutil.c 2010-06-25 19:32:26.151727158 -0500 +++ libpng-1.5.0beta34/pngwutil.c 2010-07-12 06:43:40.960257195 -0500 @@ -1,8 +1,8 @@ /* pngwutil.c - utilities to write a PNG file * - * Last changed in libpng 1.4.1 [February 25, 2010] + * Last changed in libpng 1.5.0 [July 12, 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,13 @@ * 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 + +#ifdef PNG_WRITE_INT_FUNCTIONS_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. */ @@ -53,8 +53,9 @@ { buf[0] = (png_byte)((i >> 8) & 0xff); buf[1] = (png_byte)(i & 0xff); } +#endif /* Simple function to write the signature. If we have already written * the magic bytes of the signature, or more likely, the PNG stream is * being embedded into another stream and doesn't need its own signature, @@ -220,9 +223,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,18 +446,23 @@ 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: if (bit_depth != 8 && bit_depth != 16) png_error(png_ptr, "Invalid bit depth for RGB image"); + png_ptr->channels = 3; break; + case PNG_COLOR_TYPE_PALETTE: switch (bit_depth) { case 1: @@ -450,22 +467,30 @@ { 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) png_error(png_ptr, "Invalid bit depth for grayscale+alpha image"); + png_ptr->channels = 2; break; + case PNG_COLOR_TYPE_RGB_ALPHA: if (bit_depth != 8 && bit_depth != 16) png_error(png_ptr, "Invalid bit depth for RGBA image"); + png_ptr->channels = 4; break; + default: png_error(png_ptr, "Invalid image color type specified"); } @@ -559,27 +587,39 @@ png_ptr->zlib_strategy = Z_DEFAULT_STRATEGY; } if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_LEVEL)) png_ptr->zlib_level = Z_DEFAULT_COMPRESSION; + if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL)) png_ptr->zlib_mem_level = 8; + if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS)) png_ptr->zlib_window_bits = 15; + if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_METHOD)) png_ptr->zlib_method = 8; + ret = deflateInit2(&png_ptr->zstream, png_ptr->zlib_level, 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; png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; /* libpng is not interested in zstream.data_type */ /* Set it to a predefined value, to avoid its evaluation inside zlib */ @@ -716,10 +763,9 @@ PNG_IEND; png_debug(1, "in png_write_IEND"); - png_write_chunk(png_ptr, (png_bytep)png_IEND, NULL, - (png_size_t)0); + png_write_chunk(png_ptr, (png_bytep)png_IEND, NULL, (png_size_t)0); png_ptr->mode |= PNG_HAVE_IEND; } #ifdef PNG_WRITE_gAMA_SUPPORTED @@ -793,10 +840,9 @@ comp.output_ptr = NULL; comp.input = NULL; comp.input_len = 0; - if ((name_len = png_check_keyword(png_ptr, name, - &new_name)) == 0) + if ((name_len = png_check_keyword(png_ptr, name, &new_name)) == 0) return; if (compression_type != PNG_COMPRESSION_TYPE_BASE) png_warning(png_ptr, "Unknown compression type in iCCP chunk"); @@ -1252,9 +1318,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,15 +1577,18 @@ 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; + /* Set the compression method */ cbuf[1] = 0; + png_write_chunk_data(png_ptr, cbuf, (png_size_t)2); cbuf[0] = 0; png_write_chunk_data(png_ptr, (new_lang ? (png_bytep)new_lang : cbuf), @@ -1571,9 +1654,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 +2167,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 +2262,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.3/projects/visualc6/README.txt libpng-1.5.0beta34/projects/visualc6/README.txt --- libpng-1.4.3/projects/visualc6/README.txt 2010-06-25 19:32:28.317645029 -0500 +++ libpng-1.5.0beta34/projects/visualc6/README.txt 1969-12-31 18:00:00.000000000 -0600 @@ -1,57 +0,0 @@ -Microsoft Developer Studio Project File, Format Version 6.00 for libpng. - -Copyright (C) 2000-2004 Simon-Pierre Cadieux. -Copyright (C) 2004 Cosmin Truta. - -This code is released under the libpng license. -For conditions of distribution and use, see copyright notice in png.h - -NOTE: This project will be removed from libpng-1.5.0. It has -been replaced with the "vstudio" project. - -Assumptions: -* The libpng source files are in ..\.. -* The zlib source files are in ..\..\..\zlib -* The zlib project files are in ..\..\..\zlib\projects\visualc6 - - -To use: - -1) On the main menu, select "File | Open Workspace". - Open "libpng.dsw". - -2) Select "Build | Set Active Configuration". - Choose the configuration you wish to build. - (Choose libpng or pngtest; zlib will be built automatically.) - -3) Select "Build | Clean". - -4) Select "Build | Build ... (F7)". Ignore warning messages about - not being able to find certain include files (e.g. alloc.h). - -5) If you built the sample program (pngtest), - select "Build | Execute ... (Ctrl+F5)". - - -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_LIB_Release\libpng.lib static build -* Win32_LIB_Debug\libpngd.lib static build (debug version) - - -Notes: - -If you change anything in the source files, or select different compiler -settings, please change the DLL name to something different than any of -the above names. Also, make sure that in your "pngusr.h" you define -PNG_USER_PRIVATEBUILD and PNG_USER_DLLFNAME_POSTFIX according to the -instructions provided in "pngconf.h". - -All DLLs built by this project use the Microsoft dynamic C runtime library -MSVCRT.DLL (MSVCRTD.DLL for debug versions). If you distribute any of the -above mentioned libraries you should also include this DLL in your package. -For a list of files that are redistributable in Visual C++ 6.0, see -Common\Redist\Redist.txt on Disc 1 of the Visual C++ 6.0 product CDs. diff -ru4NwbB libpng-1.4.3/projects/visualc6/libpng.dsp libpng-1.5.0beta34/projects/visualc6/libpng.dsp --- libpng-1.4.3/projects/visualc6/libpng.dsp 2010-06-25 19:32:28.327786662 -0500 +++ libpng-1.5.0beta34/projects/visualc6/libpng.dsp 1969-12-31 18:00:00.000000000 -0600 @@ -1,328 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libpng" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=libpng - Win32 DLL Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libpng.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libpng.mak" CFG="libpng - Win32 DLL Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libpng - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libpng - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libpng - Win32 DLL VB" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libpng - Win32 LIB Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libpng - Win32 LIB Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" - -!IF "$(CFG)" == "libpng - Win32 DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "libpng___Win32_DLL_Release" -# PROP BASE Intermediate_Dir "libpng___Win32_DLL_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_DLL_Release" -# 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 -# 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 -# 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" -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" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "libpng___Win32_DLL_Release" -# PROP BASE Intermediate_Dir "libpng___Win32_DLL_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Win32_DLL_Debug" -# 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 -# 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 -# 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 -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" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "libpng___Win32_DLL_VB" -# PROP BASE Intermediate_Dir "libpng___Win32_DLL_VB" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Win32_DLL_VB" -# 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 -# 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 -# 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"""" -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" -# Begin Special Build Tool -OutDir=.\Win32_DLL_VB -TargetName=libpng14vb -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 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "libpng___Win32_LIB_Release" -# PROP BASE Intermediate_Dir "libpng___Win32_LIB_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# 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 -# SUBTRACT BASE CPP /YX /Yc /Yu -# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /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" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "libpng___Win32_LIB_Debug" -# PROP BASE Intermediate_Dir "libpng___Win32_LIB_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# 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 -# 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 -# 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" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Win32_LIB_Debug\libpngd.lib" - -!ENDIF - -# Begin Target - -# Name "libpng - Win32 DLL Release" -# Name "libpng - Win32 DLL Debug" -# Name "libpng - Win32 DLL VB" -# Name "libpng - Win32 LIB Release" -# Name "libpng - Win32 LIB Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\png.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngerror.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngget.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngmem.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngpread.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngread.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngrio.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngrtran.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngrutil.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngset.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngtrans.c -# End Source File -# Begin Source File - -SOURCE=..\..\scripts\pngwin.def - -!IF "$(CFG)" == "libpng - Win32 DLL Release" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\..\pngwio.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngwrite.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngwtran.c -# End Source File -# Begin Source File - -SOURCE=..\..\pngwutil.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\..\png.h -# End Source File -# Begin Source File - -SOURCE=..\..\pngconf.h -# End Source File -# Begin Source File - -SOURCE=..\..\pngpriv.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=..\..\scripts\pngwin.rc - -!IF "$(CFG)" == "libpng - Win32 DLL Release" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug" - -!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB" - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug" - -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# End Group -# Begin Source File - -SOURCE=.\README.txt -# End Source File -# End Target -# End Project diff -ru4NwbB libpng-1.4.3/projects/visualc6/libpng.dsw libpng-1.5.0beta34/projects/visualc6/libpng.dsw --- libpng-1.4.3/projects/visualc6/libpng.dsw 2006-02-21 13:32:54.000000000 -0600 +++ libpng-1.5.0beta34/projects/visualc6/libpng.dsw 1969-12-31 18:00:00.000000000 -0600 @@ -1,59 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "libpng"=".\libpng.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name zlib - End Project Dependency -}}} - -############################################################################### - -Project: "pngtest"=".\pngtest.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libpng - End Project Dependency -}}} - -############################################################################### - -Project: "zlib"="..\..\..\zlib\projects\visualc6\zlib.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff -ru4NwbB libpng-1.4.3/projects/visualc6/pngtest.dsp libpng-1.5.0beta34/projects/visualc6/pngtest.dsp --- libpng-1.4.3/projects/visualc6/pngtest.dsp 2010-06-25 19:32:28.337140486 -0500 +++ libpng-1.5.0beta34/projects/visualc6/pngtest.dsp 1969-12-31 18:00:00.000000000 -0600 @@ -1,178 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pngtest" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=pngtest - Win32 DLL Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "pngtest.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "pngtest.mak" CFG="pngtest - Win32 DLL Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "pngtest - Win32 DLL Release" (based on "Win32 (x86) Console Application") -!MESSAGE "pngtest - Win32 DLL Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "pngtest - Win32 LIB Release" (based on "Win32 (x86) Console Application") -!MESSAGE "pngtest - Win32 LIB Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "pngtest - Win32 DLL Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "pngtest___Win32_DLL_Release" -# PROP BASE Intermediate_Dir "pngtest___Win32_DLL_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# 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 -# 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 -# 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 -# Begin Special Build Tool -OutDir=.\Win32_DLL_Release -SOURCE="$(InputPath)" -PostBuild_Desc=[Run Test] -PostBuild_Cmds=set path=$(outdir);..\..\..\zlib\projects\visualc6\Win32_DLL_Release; $(outdir)\pngtest.exe ..\..\pngtest.png -# End Special Build Tool - -!ELSEIF "$(CFG)" == "pngtest - Win32 DLL Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "pngtest___Win32_DLL_Debug" -# PROP BASE Intermediate_Dir "pngtest___Win32_DLL_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# 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 -# 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 -# 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 -# Begin Special Build Tool -OutDir=.\Win32_DLL_Debug -SOURCE="$(InputPath)" -PostBuild_Desc=[Run Test] -PostBuild_Cmds=set path=$(outdir);..\..\..\zlib\projects\visualc6\Win32_DLL_Debug; $(outdir)\pngtest.exe ..\..\pngtest.png -# End Special Build Tool - -!ELSEIF "$(CFG)" == "pngtest - Win32 LIB Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "pngtest___Win32_LIB_Release" -# PROP BASE Intermediate_Dir "pngtest___Win32_LIB_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# 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 -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MD /W3 /O2 /I "..\..\..\zlib" /D "WIN32" /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_LIB_Release\libpng.lib ..\..\..\zlib\projects\visualc6\Win32_LIB_Release\zlib.lib /nologo /subsystem:console /machine:I386 -# Begin Special Build Tool -OutDir=.\Win32_LIB_Release -SOURCE="$(InputPath)" -PostBuild_Desc=[Run Test] -PostBuild_Cmds=$(outdir)\pngtest.exe ..\..\pngtest.png -# End Special Build Tool - -!ELSEIF "$(CFG)" == "pngtest - Win32 LIB Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "pngtest___Win32_LIB_Debug" -# PROP BASE Intermediate_Dir "pngtest___Win32_LIB_Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# 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 -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\..\..\zlib" /D "WIN32" /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_LIB_Debug\libpngd.lib ..\..\..\zlib\projects\visualc6\Win32_LIB_Debug\zlibd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# Begin Special Build Tool -OutDir=.\Win32_LIB_Debug -SOURCE="$(InputPath)" -PostBuild_Desc=[Run Test] -PostBuild_Cmds=$(outdir)\pngtest.exe ..\..\pngtest.png -# End Special Build Tool - -!ENDIF - -# Begin Target - -# Name "pngtest - Win32 DLL Release" -# Name "pngtest - Win32 DLL Debug" -# Name "pngtest - Win32 LIB Release" -# Name "pngtest - Win32 LIB Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\..\pngtest.c -# End Source File -# End Group -# End Target -# End Project diff -ru4NwbB libpng-1.4.3/projects/visualc71/PRJ0041.mak libpng-1.5.0beta34/projects/visualc71/PRJ0041.mak --- libpng-1.4.3/projects/visualc71/PRJ0041.mak 2006-08-15 14:08:14.000000000 -0500 +++ libpng-1.5.0beta34/projects/visualc71/PRJ0041.mak 1969-12-31 18:00:00.000000000 -0600 @@ -1,21 +0,0 @@ -# Prevent "Cannot find missing dependency..." warnings while compiling -# pngwin.rc (PRJ0041). - -all: $(IntDir)\alloc.h \ - $(IntDir)\fp.h \ - $(IntDir)\m68881.h \ - $(IntDir)\mem.h \ - $(IntDir)\pngusr.h \ - $(IntDir)\strings.h \ - $(IntDir)\unistd.h \ - $(IntDir)\unixio.h - -$(IntDir)\alloc.h \ -$(IntDir)\fp.h \ -$(IntDir)\m68881.h \ -$(IntDir)\mem.h \ -$(IntDir)\pngusr.h \ -$(IntDir)\strings.h \ -$(IntDir)\unistd.h \ -$(IntDir)\unixio.h: - @!echo.>$@ diff -ru4NwbB libpng-1.4.3/projects/visualc71/README.txt libpng-1.5.0beta34/projects/visualc71/README.txt --- libpng-1.4.3/projects/visualc71/README.txt 2010-04-26 16:13:45.383523000 -0500 +++ libpng-1.5.0beta34/projects/visualc71/README.txt 1969-12-31 18:00:00.000000000 -0600 @@ -1,58 +0,0 @@ -Microsoft Developer Studio Project File, Format Version 7.10 for libpng. - -Copyright (C) 2004 Simon-Pierre Cadieux. - -This code is released under the libpng license. -For conditions of distribution and use, see copyright notice in png.h - -NOTE: This project will be removed from libpng-1.5.0. It has -been replaced with the "vstudio" project. - -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 - files get intergrated into the next zlib release. The final zlib project - directory will then be ..\..\..\zlib\projects\visualc71. */ - -To use: - -1) On the main menu, select "File | Open Solution". - Open "libpng.sln". - -2) Display the Solution Explorer view (Ctrl+Alt+L) - -3) Set one of the project as the StartUp project. If you just want to build the - binaries set "libpng" as the startup project (Select "libpng" tree view - item + Project | Set as StartUp project). If you want to build and test the - binaries set it to "pngtest" (Select "pngtest" tree view item + - Project | Set as StartUp project) - -4) Select "Build | Configuration Manager...". - Choose the configuration you wish to build. - -5) Select "Build | Clean Solution". - -6) Select "Build | Build Solution (Ctrl-Shift-B)" - -This project builds the libpng binaries as follows: - -* Win32_DLL_Release\libpng%DLLNUM%.dll DLL build -* Win32_DLL_Debug\libpng%DLLNUM%d.dll DLL build (debug version) -* Win32_DLL_VB\libpng%DLLNUM%vb.dll DLL build for Visual Basic, using stdcall -* Win32_LIB_Release\libpng.lib static build -* Win32_LIB_Debug\libpngd.lib static build (debug version) - -Notes: - -If you change anything in the source files, or select different compiler -settings, please change the DLL name to something different than any of -the above names. Also, make sure that in your "pngusr.h" you define -PNG_USER_PRIVATEBUILD and PNG_USER_DLLFNAME_POSTFIX according to the -instructions provided in "pngconf.h". - -All DLLs built by this project use the Microsoft dynamic C runtime library -MSVCR71.DLL (MSVCR71D.DLL for debug versions). If you distribute any of the -above mentioned libraries you may have to include this DLL in your package. -For a list of files that are redistributable in Visual Studio see -$(VCINSTALLDIR)\redist.txt. diff -ru4NwbB libpng-1.4.3/projects/visualc71/README_zlib.txt libpng-1.5.0beta34/projects/visualc71/README_zlib.txt --- libpng-1.4.3/projects/visualc71/README_zlib.txt 2010-04-26 16:13:53.805370000 -0500 +++ libpng-1.5.0beta34/projects/visualc71/README_zlib.txt 1969-12-31 18:00:00.000000000 -0600 @@ -1,44 +0,0 @@ -/* WARNING: This file was put in the LibPNG distribution for convenience only. - It is expected to be part of the next zlib release under - "projects\visualc71\README.txt." */ - -Microsoft Developer Studio Project File, Format Version 7.10 for zlib. - -Copyright (C) 2004 Simon-Pierre Cadieux. -Copyright (C) 2004 Cosmin Truta. - -This code is released under the libpng license. -For conditions of distribution and use, see copyright notice in zlib.h. - -NOTE: This project will be removed from libpng-1.5.0. It has -been replaced with the "vstudio" project. - -To use: - -1) On the main menu, select "File | Open Solution". - Open "zlib.sln". - -2) Display the Solution Explorer view (Ctrl+Alt+L) - -3) Set one of the project as the StartUp project. If you just want to build the - binaries set "zlib" as the startup project (Select "zlib" tree view item + - Project | Set as StartUp project). If you want to build and test the - binaries set it to "example" (Select "example" tree view item + Project | - Set as StartUp project), If you want to build the minigzip utility set it to - "minigzip" (Select "minigzip" tree view item + Project | Set as StartUp - project - -4) Select "Build | Configuration Manager...". - Choose the configuration you wish to build. - -5) Select "Build | Clean Solution". - -6) Select "Build | Build Solution (Ctrl-Shift-B)" - -This project builds the zlib binaries as follows: - -* Win32_DLL_Release\zlib1.dll DLL build -* Win32_DLL_Debug\zlib1d.dll DLL build (debug version) -* Win32_LIB_Release\zlib.lib static build -* Win32_LIB_Debug\zlibd.lib static build (debug version) - diff -ru4NwbB libpng-1.4.3/projects/visualc71/libpng.sln libpng-1.5.0beta34/projects/visualc71/libpng.sln --- libpng-1.4.3/projects/visualc71/libpng.sln 2009-11-11 13:28:26.000000000 -0600 +++ libpng-1.5.0beta34/projects/visualc71/libpng.sln 1969-12-31 18:00:00.000000000 -0600 @@ -1,60 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "libpng.vcproj", "{0008960E-E0DD-41A6-8265-00B31DDB4C21}" - ProjectSection(ProjectDependencies) = postProject - {2D4F8105-7D21-454C-9932-B47CAB71A5C0} = {2D4F8105-7D21-454C-9932-B47CAB71A5C0} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pngtest", "pngtest.vcproj", "{FD1C2F86-9EEF-47BD-95A4-530917E17FDA}" - ProjectSection(ProjectDependencies) = postProject - {0008960E-E0DD-41A6-8265-00B31DDB4C21} = {0008960E-E0DD-41A6-8265-00B31DDB4C21} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib.vcproj", "{2D4F8105-7D21-454C-9932-B47CAB71A5C0}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - DLL Debug = DLL Debug - DLL Release = DLL Release - DLL VB = DLL VB - LIB Debug = LIB Debug - LIB Release = LIB Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {0008960E-E0DD-41A6-8265-00B31DDB4C21}.DLL Debug.ActiveCfg = DLL Debug|Win32 - {0008960E-E0DD-41A6-8265-00B31DDB4C21}.DLL Debug.Build.0 = DLL Debug|Win32 - {0008960E-E0DD-41A6-8265-00B31DDB4C21}.DLL Release.ActiveCfg = DLL Release|Win32 - {0008960E-E0DD-41A6-8265-00B31DDB4C21}.DLL Release.Build.0 = DLL Release|Win32 - {0008960E-E0DD-41A6-8265-00B31DDB4C21}.DLL VB.ActiveCfg = DLL VB|Win32 - {0008960E-E0DD-41A6-8265-00B31DDB4C21}.DLL VB.Build.0 = DLL VB|Win32 - {0008960E-E0DD-41A6-8265-00B31DDB4C21}.LIB Debug.ActiveCfg = LIB Debug|Win32 - {0008960E-E0DD-41A6-8265-00B31DDB4C21}.LIB Debug.Build.0 = LIB Debug|Win32 - {0008960E-E0DD-41A6-8265-00B31DDB4C21}.LIB Release.ActiveCfg = LIB Release|Win32 - {0008960E-E0DD-41A6-8265-00B31DDB4C21}.LIB Release.Build.0 = LIB Release|Win32 - {FD1C2F86-9EEF-47BD-95A4-530917E17FDA}.DLL Debug.ActiveCfg = DLL Debug|Win32 - {FD1C2F86-9EEF-47BD-95A4-530917E17FDA}.DLL Debug.Build.0 = DLL Debug|Win32 - {FD1C2F86-9EEF-47BD-95A4-530917E17FDA}.DLL Release.ActiveCfg = DLL Release|Win32 - {FD1C2F86-9EEF-47BD-95A4-530917E17FDA}.DLL Release.Build.0 = DLL Release|Win32 - {FD1C2F86-9EEF-47BD-95A4-530917E17FDA}.DLL VB.ActiveCfg = DLL VB|Win32 - {FD1C2F86-9EEF-47BD-95A4-530917E17FDA}.DLL VB.Build.0 = DLL VB|Win32 - {FD1C2F86-9EEF-47BD-95A4-530917E17FDA}.LIB Debug.ActiveCfg = LIB Debug|Win32 - {FD1C2F86-9EEF-47BD-95A4-530917E17FDA}.LIB Debug.Build.0 = LIB Debug|Win32 - {FD1C2F86-9EEF-47BD-95A4-530917E17FDA}.LIB Release.ActiveCfg = LIB Release|Win32 - {FD1C2F86-9EEF-47BD-95A4-530917E17FDA}.LIB Release.Build.0 = LIB Release|Win32 - {2D4F8105-7D21-454C-9932-B47CAB71A5C0}.DLL Debug.ActiveCfg = DLL Debug|Win32 - {2D4F8105-7D21-454C-9932-B47CAB71A5C0}.DLL Debug.Build.0 = DLL Debug|Win32 - {2D4F8105-7D21-454C-9932-B47CAB71A5C0}.DLL Release.ActiveCfg = DLL Release|Win32 - {2D4F8105-7D21-454C-9932-B47CAB71A5C0}.DLL Release.Build.0 = DLL Release|Win32 - {2D4F8105-7D21-454C-9932-B47CAB71A5C0}.DLL VB.ActiveCfg = DLL Release|Win32 - {2D4F8105-7D21-454C-9932-B47CAB71A5C0}.DLL VB.Build.0 = DLL Release|Win32 - {2D4F8105-7D21-454C-9932-B47CAB71A5C0}.LIB Debug.ActiveCfg = LIB Debug|Win32 - {2D4F8105-7D21-454C-9932-B47CAB71A5C0}.LIB Debug.Build.0 = LIB Debug|Win32 - {2D4F8105-7D21-454C-9932-B47CAB71A5C0}.LIB Release.ActiveCfg = LIB Release|Win32 - {2D4F8105-7D21-454C-9932-B47CAB71A5C0}.LIB Release.Build.0 = LIB Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff -ru4NwbB libpng-1.4.3/projects/visualc71/libpng.vcproj libpng-1.5.0beta34/projects/visualc71/libpng.vcproj --- libpng-1.4.3/projects/visualc71/libpng.vcproj 2009-12-04 07:53:56.000000000 -0600 +++ libpng-1.5.0beta34/projects/visualc71/libpng.vcproj 1969-12-31 18:00:00.000000000 -0600 @@ -1,437 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -ru4NwbB libpng-1.4.3/projects/visualc71/pngtest.vcproj libpng-1.5.0beta34/projects/visualc71/pngtest.vcproj --- libpng-1.4.3/projects/visualc71/pngtest.vcproj 2009-11-14 06:20:33.000000000 -0600 +++ libpng-1.5.0beta34/projects/visualc71/pngtest.vcproj 1969-12-31 18:00:00.000000000 -0600 @@ -1,267 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -ru4NwbB libpng-1.4.3/projects/visualc71/zlib.vcproj libpng-1.5.0beta34/projects/visualc71/zlib.vcproj --- libpng-1.4.3/projects/visualc71/zlib.vcproj 2009-11-12 11:44:08.000000000 -0600 +++ libpng-1.5.0beta34/projects/visualc71/zlib.vcproj 1969-12-31 18:00:00.000000000 -0600 @@ -1,382 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -ru4NwbB libpng-1.4.3/projects/vstudio/libpng/libpng.vcxproj libpng-1.5.0beta34/projects/vstudio/libpng/libpng.vcxproj --- libpng-1.4.3/projects/vstudio/libpng/libpng.vcxproj 2010-04-26 16:12:01.929524000 -0500 +++ libpng-1.5.0beta34/projects/vstudio/libpng/libpng.vcxproj 2010-07-12 06:43:43.857713339 -0500 @@ -62,40 +62,40 @@ false - $(ProjectName)14 + $(ProjectName)15 false - $(ProjectName)14 + $(ProjectName)15 false - $(ProjectName)14 + $(ProjectName)15 false - $(ProjectName)14 + $(ProjectName)15 - NotUsing + Use Level4 false ProgramDatabase EnableFastChecks MultiThreadedDebugDLL - WIN32;PNG_BUILD_DLL;PNG_NO_MODULEDEF;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true true false false - png.h + pngpriv.h true CompileAsC true 4996;4127 @@ -107,15 +107,15 @@ Windows true zlib.lib;msvcrtd.lib;kernel32.lib true - 14 + 15 $(OutDir) - NotUsing + Use Level4 false ProgramDatabase Disabled @@ -125,9 +125,9 @@ true true false false - png.h + pngpriv.h true CompileAsC true 4996;4127 @@ -141,17 +141,17 @@ Level4 - NotUsing + Use ProgramDatabase MultiThreadedDLL true true - WIN32;PNG_BUILD_DLL;PNG_NO_MODULEDEF;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) false false - png.h + pngpriv.h true CompileAsC true false @@ -166,24 +166,24 @@ true true zdll.lib;msvcrt.lib;kernel32.lib true - 14 + 15 $(ZLib1Dir) Level4 - NotUsing + Use ProgramDatabase MultiThreadedDLL true true WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) false false - png.h + pngpriv.h true CompileAsC true false diff -ru4NwbB libpng-1.4.3/projects/vstudio/pngtest/pngtest.vcxproj libpng-1.5.0beta34/projects/vstudio/pngtest/pngtest.vcxproj --- libpng-1.4.3/projects/vstudio/pngtest/pngtest.vcxproj 2010-04-26 11:42:27.000000000 -0500 +++ libpng-1.5.0beta34/projects/vstudio/pngtest/pngtest.vcxproj 2010-07-12 06:43:43.868284255 -0500 @@ -94,9 +94,9 @@ Console true - libpng14.lib;zlib.lib;msvcrtd.lib;kernel32.lib + libpng15.lib;zlib.lib;msvcrtd.lib;kernel32.lib true $(OutDir) @@ -127,9 +127,9 @@ Console true - libpng14.lib;zlib.lib;msvcrtd.lib;kernel32.lib + libpng15.lib;zlib.lib;msvcrtd.lib;kernel32.lib true $(OutDir) @@ -161,9 +161,9 @@ Console true true true - libpng14.lib;msvcrt.lib;kernel32.lib + libpng15.lib;msvcrt.lib;kernel32.lib true $(OutDir) @@ -195,9 +195,9 @@ Console true true true - libpng14.lib;zlib.lib;msvcrt.lib;kernel32.lib + libpng15.lib;zlib.lib;msvcrt.lib;kernel32.lib true $(OutDir);$(ZLib1Dir) diff -ru4NwbB libpng-1.4.3/projects/vstudio/readme.txt libpng-1.5.0beta34/projects/vstudio/readme.txt --- libpng-1.4.3/projects/vstudio/readme.txt 2010-06-25 19:32:28.293894611 -0500 +++ libpng-1.5.0beta34/projects/vstudio/readme.txt 2010-07-12 06:43:43.835479041 -0500 @@ -12,14 +12,8 @@ This directory contains support for building libpng under MicroSoft VisualStudio 2010. It may also work under later versions of VisualStudio. You should be familiar with VisualStudio before using this directory. -This is a slightly modified copy of the 'vstudio' solution from libpng -1.5; it is intended to provide compatibility for libpng 1.4 with later -releases of zlib (from 1.2.4) and to provide a migration aid for 1.5. - -A 'VB' DLL is no longer produced - use the standard 'Release' DLL. - Initial preparations ==================== You should install the 'official' build of zlib on your system - follow the instructions provided on http://www.zlib.net. When a new release is being diff -ru4NwbB libpng-1.4.3/projects/vstudio/vstudio.sln libpng-1.5.0beta34/projects/vstudio/vstudio.sln --- libpng-1.4.3/projects/vstudio/vstudio.sln 2010-04-26 11:42:27.000000000 -0500 +++ libpng-1.5.0beta34/projects/vstudio/vstudio.sln 2010-04-24 21:30:24.077436000 -0500 @@ -1,17 +2,17 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual C++ Express 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "libpng\libpng.vcxproj", "{D6973076-9317-4EF2-A0B8-B7A18AC0713E}" ProjectSection(ProjectDependencies) = postProject - {18040998-CC22-2BAE-FE7A-C0A3038F1D5C} = {18040998-CC22-2BAE-FE7A-C0A3038F1D5C} + {E5A897B8-320E-6490-784B-11B374DD242A} = {E5A897B8-320E-6490-784B-11B374DD242A} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pngtest", "pngtest\pngtest.vcxproj", "{228BA965-50D5-42B2-8BCF-AFCC227E3C1D}" ProjectSection(ProjectDependencies) = postProject {D6973076-9317-4EF2-A0B8-B7A18AC0713E} = {D6973076-9317-4EF2-A0B8-B7A18AC0713E} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcxproj", "{18040998-CC22-2BAE-FE7A-C0A3038F1D5C}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib\zlib.vcxproj", "{E5A897B8-320E-6490-784B-11B374DD242A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug Library|Win32 = Debug Library|Win32 @@ -35,14 +36,14 @@ {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release Library|Win32.ActiveCfg = Release Library|Win32 {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release Library|Win32.Build.0 = Release Library|Win32 {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release|Win32.ActiveCfg = Release|Win32 {228BA965-50D5-42B2-8BCF-AFCC227E3C1D}.Release|Win32.Build.0 = Release|Win32 - {18040998-CC22-2BAE-FE7A-C0A3038F1D5C}.Debug Library|Win32.ActiveCfg = Debug Library|Win32 - {18040998-CC22-2BAE-FE7A-C0A3038F1D5C}.Debug Library|Win32.Build.0 = Debug Library|Win32 - {18040998-CC22-2BAE-FE7A-C0A3038F1D5C}.Debug|Win32.ActiveCfg = Debug|Win32 - {18040998-CC22-2BAE-FE7A-C0A3038F1D5C}.Debug|Win32.Build.0 = Debug|Win32 - {18040998-CC22-2BAE-FE7A-C0A3038F1D5C}.Release Library|Win32.ActiveCfg = Debug|Win32 - {18040998-CC22-2BAE-FE7A-C0A3038F1D5C}.Release|Win32.ActiveCfg = Debug|Win32 + {E5A897B8-320E-6490-784B-11B374DD242A}.Debug Library|Win32.ActiveCfg = Debug Library|Win32 + {E5A897B8-320E-6490-784B-11B374DD242A}.Debug Library|Win32.Build.0 = Debug Library|Win32 + {E5A897B8-320E-6490-784B-11B374DD242A}.Debug|Win32.ActiveCfg = Debug|Win32 + {E5A897B8-320E-6490-784B-11B374DD242A}.Debug|Win32.Build.0 = Debug|Win32 + {E5A897B8-320E-6490-784B-11B374DD242A}.Release Library|Win32.ActiveCfg = Debug|Win32 + {E5A897B8-320E-6490-784B-11B374DD242A}.Release|Win32.ActiveCfg = Debug|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection diff -ru4NwbB libpng-1.4.3/projects/xcode/Info.plist libpng-1.5.0beta34/projects/xcode/Info.plist --- libpng-1.4.3/projects/xcode/Info.plist 2009-07-05 13:05:07.000000000 -0500 +++ libpng-1.5.0beta34/projects/xcode/Info.plist 1969-12-31 18:00:00.000000000 -0600 @@ -1,26 +0,0 @@ - - - - - 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.3/projects/xcode/README.txt libpng-1.5.0beta34/projects/xcode/README.txt --- libpng-1.4.3/projects/xcode/README.txt 2009-12-04 07:54:02.000000000 -0600 +++ libpng-1.5.0beta34/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.3/projects/xcode/libpng.xcodeproj/.gitignore libpng-1.5.0beta34/projects/xcode/libpng.xcodeproj/.gitignore --- libpng-1.4.3/projects/xcode/libpng.xcodeproj/.gitignore 2009-10-05 12:08:58.000000000 -0500 +++ libpng-1.5.0beta34/projects/xcode/libpng.xcodeproj/.gitignore 1969-12-31 18:00:00.000000000 -0600 @@ -1,2 +0,0 @@ -*.mode1* -*.pbxuser diff -ru4NwbB libpng-1.4.3/projects/xcode/libpng.xcodeproj/project.pbxproj libpng-1.5.0beta34/projects/xcode/libpng.xcodeproj/project.pbxproj --- libpng-1.4.3/projects/xcode/libpng.xcodeproj/project.pbxproj 2010-06-25 19:32:27.287348886 -0500 +++ libpng-1.5.0beta34/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.3; - 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.3; - 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.3/scripts/README.txt libpng-1.5.0beta34/scripts/README.txt --- libpng-1.4.3/scripts/README.txt 2010-06-25 19:32:27.811195781 -0500 +++ libpng-1.5.0beta34/scripts/README.txt 2010-07-12 06:43:43.310925249 -0500 @@ -1,7 +1,8 @@ Makefiles for libpng version 1.5.0beta34 - July 12, 2010 +pnglibconf.h => Stores configuration settings makefile.linux => Linux/ELF makefile (gcc, creates libpng%SONAME%.so.%SONUM%.1.5.0beta34) makefile.gcc => Generic makefile (gcc, creates static libpng.a) makefile.knr => Archaic UNIX Makefile that converts files with @@ -14,27 +15,25 @@ 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, - gcc, creates libpng%SONAME%.so.%SONUM%.1.5.0beta34) + (gcc, creates libpng%SONAME%.so.%SONUM%.1.5.0beta34) makefile.freebsd => FreeBSD makefile makefile.gcc => Generic gcc makefile makefile.hpgcc => HPUX makefile using gcc 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.0beta34) 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.3/scripts/checksym.awk libpng-1.5.0beta34/scripts/checksym.awk --- libpng-1.4.3/scripts/checksym.awk 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta34/scripts/checksym.awk 2010-04-28 06:25:21.025701000 -0500 @@ -0,0 +1,155 @@ +#!/bin/awk -f +# 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.3/scripts/makefile.32sunu libpng-1.5.0beta34/scripts/makefile.32sunu --- libpng-1.4.3/scripts/makefile.32sunu 2010-06-25 19:32:27.849139546 -0500 +++ libpng-1.5.0beta34/scripts/makefile.32sunu 2010-07-12 06:43:43.349257877 -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.3/scripts/makefile.64sunu libpng-1.5.0beta34/scripts/makefile.64sunu --- libpng-1.4.3/scripts/makefile.64sunu 2010-06-25 19:32:27.859908981 -0500 +++ libpng-1.5.0beta34/scripts/makefile.64sunu 2010-07-12 06:43:43.360000485 -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.3/scripts/makefile.acorn libpng-1.5.0beta34/scripts/makefile.acorn --- libpng-1.4.3/scripts/makefile.acorn 2009-11-25 08:20:24.000000000 -0600 +++ libpng-1.5.0beta34/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.3/scripts/makefile.aix libpng-1.5.0beta34/scripts/makefile.aix --- libpng-1.4.3/scripts/makefile.aix 2010-06-25 19:32:27.869556361 -0500 +++ libpng-1.5.0beta34/scripts/makefile.aix 2010-07-12 06:43:43.369908253 -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.3/scripts/makefile.amiga libpng-1.5.0beta34/scripts/makefile.amiga --- libpng-1.4.3/scripts/makefile.amiga 2009-11-25 08:20:34.000000000 -0600 +++ libpng-1.5.0beta34/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.3/scripts/makefile.darwin libpng-1.5.0beta34/scripts/makefile.darwin --- libpng-1.4.3/scripts/makefile.darwin 2010-06-25 19:32:27.930060870 -0500 +++ libpng-1.5.0beta34/scripts/makefile.darwin 2010-07-12 06:43:43.420055664 -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.3/scripts/makefile.dec libpng-1.5.0beta34/scripts/makefile.dec --- libpng-1.4.3/scripts/makefile.dec 2010-06-25 19:32:27.940227490 -0500 +++ libpng-1.5.0beta34/scripts/makefile.dec 2010-07-12 06:43:43.430380272 -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.3/scripts/makefile.dj2 libpng-1.5.0beta34/scripts/makefile.dj2 --- libpng-1.4.3/scripts/makefile.dj2 2010-06-25 19:32:27.949505280 -0500 +++ libpng-1.5.0beta34/scripts/makefile.dj2 2010-07-12 06:43:43.439589847 -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.3/scripts/makefile.elf libpng-1.5.0beta34/scripts/makefile.elf --- libpng-1.4.3/scripts/makefile.elf 2010-06-25 19:32:27.960128434 -0500 +++ libpng-1.5.0beta34/scripts/makefile.elf 2010-07-12 06:43:43.450630977 -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.3/scripts/makefile.freebsd libpng-1.5.0beta34/scripts/makefile.freebsd --- libpng-1.4.3/scripts/makefile.freebsd 2010-06-25 19:32:27.969249069 -0500 +++ libpng-1.5.0beta34/scripts/makefile.freebsd 2010-07-12 06:43:43.459997521 -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.3/scripts/makefile.gcc libpng-1.5.0beta34/scripts/makefile.gcc --- libpng-1.4.3/scripts/makefile.gcc 2010-06-25 19:32:27.978649322 -0500 +++ libpng-1.5.0beta34/scripts/makefile.gcc 2010-07-12 06:43:43.469369793 -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.3/scripts/makefile.hp64 libpng-1.5.0beta34/scripts/makefile.hp64 --- libpng-1.4.3/scripts/makefile.hp64 2010-06-25 19:32:27.988873008 -0500 +++ libpng-1.5.0beta34/scripts/makefile.hp64 2010-07-12 06:43:43.479762077 -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.3/scripts/makefile.hpgcc libpng-1.5.0beta34/scripts/makefile.hpgcc --- libpng-1.4.3/scripts/makefile.hpgcc 2010-06-25 19:32:27.999383196 -0500 +++ libpng-1.5.0beta34/scripts/makefile.hpgcc 2010-07-12 06:43:43.490519901 -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.3/scripts/makefile.hpux libpng-1.5.0beta34/scripts/makefile.hpux --- libpng-1.4.3/scripts/makefile.hpux 2010-06-25 19:32:28.011272631 -0500 +++ libpng-1.5.0beta34/scripts/makefile.hpux 2010-07-12 06:43:43.500858212 -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.3/scripts/makefile.ibmc libpng-1.5.0beta34/scripts/makefile.ibmc --- libpng-1.4.3/scripts/makefile.ibmc 2010-06-25 19:32:28.020723566 -0500 +++ libpng-1.5.0beta34/scripts/makefile.ibmc 2010-07-12 06:43:43.510100372 -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.3/scripts/makefile.intel libpng-1.5.0beta34/scripts/makefile.intel --- libpng-1.4.3/scripts/makefile.intel 2010-06-25 19:32:28.030277720 -0500 +++ libpng-1.5.0beta34/scripts/makefile.intel 2010-07-12 06:43:43.519519218 -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.3/scripts/makefile.knr libpng-1.5.0beta34/scripts/makefile.knr --- libpng-1.4.3/scripts/makefile.knr 2010-06-25 19:32:28.039912213 -0500 +++ libpng-1.5.0beta34/scripts/makefile.knr 2010-07-12 06:43:43.529164370 -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.3/scripts/makefile.linux libpng-1.5.0beta34/scripts/makefile.linux --- libpng-1.4.3/scripts/makefile.linux 2010-06-25 19:32:28.050538963 -0500 +++ libpng-1.5.0beta34/scripts/makefile.linux 2010-07-12 06:43:43.539787192 -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.3/scripts/makefile.mingw libpng-1.5.0beta34/scripts/makefile.mingw --- libpng-1.4.3/scripts/makefile.mingw 2010-06-25 19:32:28.061725791 -0500 +++ libpng-1.5.0beta34/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.3/scripts/makefile.mips libpng-1.5.0beta34/scripts/makefile.mips --- libpng-1.4.3/scripts/makefile.mips 2010-06-25 19:32:28.070969985 -0500 +++ libpng-1.5.0beta34/scripts/makefile.mips 2010-07-12 06:43:43.549465405 -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.3/scripts/makefile.msc libpng-1.5.0beta34/scripts/makefile.msc --- libpng-1.4.3/scripts/makefile.msc 2010-06-25 19:32:28.080358904 -0500 +++ libpng-1.5.0beta34/scripts/makefile.msc 2010-07-12 06:43:43.558838665 -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.3/scripts/makefile.ne12bsd libpng-1.5.0beta34/scripts/makefile.ne12bsd --- libpng-1.4.3/scripts/makefile.ne12bsd 2010-06-25 19:32:28.089530868 -0500 +++ libpng-1.5.0beta34/scripts/makefile.ne12bsd 2010-07-12 06:43:43.568068099 -0500 @@ -20,9 +20,9 @@ SHLIB_MINOR= 1.5.0beta34 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.3/scripts/makefile.netbsd libpng-1.5.0beta34/scripts/makefile.netbsd --- libpng-1.4.3/scripts/makefile.netbsd 2010-06-25 19:32:28.098943090 -0500 +++ libpng-1.5.0beta34/scripts/makefile.netbsd 2010-07-12 06:43:43.577562162 -0500 @@ -20,9 +20,9 @@ SHLIB_MINOR= 1.5.0beta34 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.3/scripts/makefile.openbsd libpng-1.5.0beta34/scripts/makefile.openbsd --- libpng-1.4.3/scripts/makefile.openbsd 2010-06-25 19:32:28.108403757 -0500 +++ libpng-1.5.0beta34/scripts/makefile.openbsd 2010-07-12 06:43:43.587139064 -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.3/scripts/makefile.os2 libpng-1.5.0beta34/scripts/makefile.os2 --- libpng-1.4.3/scripts/makefile.os2 2010-06-25 19:32:28.117921277 -0500 +++ libpng-1.5.0beta34/scripts/makefile.os2 2010-07-12 06:43:43.596674321 -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.3/scripts/makefile.sco libpng-1.5.0beta34/scripts/makefile.sco --- libpng-1.4.3/scripts/makefile.sco 2010-06-25 19:32:28.128176687 -0500 +++ libpng-1.5.0beta34/scripts/makefile.sco 2010-07-12 06:43:43.607298637 -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.3/scripts/makefile.sggcc libpng-1.5.0beta34/scripts/makefile.sggcc --- libpng-1.4.3/scripts/makefile.sggcc 2010-06-25 19:32:28.138704375 -0500 +++ libpng-1.5.0beta34/scripts/makefile.sggcc 2010-07-12 06:43:43.617928388 -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.3/scripts/makefile.sgi libpng-1.5.0beta34/scripts/makefile.sgi --- libpng-1.4.3/scripts/makefile.sgi 2010-06-25 19:32:28.149215154 -0500 +++ libpng-1.5.0beta34/scripts/makefile.sgi 2010-07-12 06:43:43.628576863 -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.3/scripts/makefile.so9 libpng-1.5.0beta34/scripts/makefile.so9 --- libpng-1.4.3/scripts/makefile.so9 2010-06-25 19:32:28.159856712 -0500 +++ libpng-1.5.0beta34/scripts/makefile.so9 2010-07-12 06:43:43.639322021 -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.3/scripts/makefile.solaris libpng-1.5.0beta34/scripts/makefile.solaris --- libpng-1.4.3/scripts/makefile.solaris 2010-06-25 19:32:28.170797213 -0500 +++ libpng-1.5.0beta34/scripts/makefile.solaris 2010-07-12 06:43:43.649960653 -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.3/scripts/makefile.solaris-x86 libpng-1.5.0beta34/scripts/makefile.solaris-x86 --- libpng-1.4.3/scripts/makefile.solaris-x86 2010-06-25 19:32:28.181717948 -0500 +++ libpng-1.5.0beta34/scripts/makefile.solaris-x86 2010-07-12 06:43:43.660571098 -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.3/scripts/makefile.std libpng-1.5.0beta34/scripts/makefile.std --- libpng-1.4.3/scripts/makefile.std 2010-06-25 19:32:28.191346070 -0500 +++ libpng-1.5.0beta34/scripts/makefile.std 2010-07-12 06:43:43.670348845 -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 out=dfn1.out\ + scripts/pnglibconf.dfa $(DFA_XTRA) 1>&2 + $(AWK) -f scripts/options.awk 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.3/scripts/makefile.sunos libpng-1.5.0beta34/scripts/makefile.sunos --- libpng-1.4.3/scripts/makefile.sunos 2010-06-25 19:32:28.200927496 -0500 +++ libpng-1.5.0beta34/scripts/makefile.sunos 2010-07-12 06:43:43.679936683 -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.3/scripts/makefile.tc3 libpng-1.5.0beta34/scripts/makefile.tc3 --- libpng-1.4.3/scripts/makefile.tc3 2010-06-25 19:32:28.210536495 -0500 +++ libpng-1.5.0beta34/scripts/makefile.tc3 2010-07-12 06:43:43.689626900 -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.3/scripts/makefile.vcwin32 libpng-1.5.0beta34/scripts/makefile.vcwin32 --- libpng-1.4.3/scripts/makefile.vcwin32 2010-06-25 19:32:28.220180569 -0500 +++ libpng-1.5.0beta34/scripts/makefile.vcwin32 2010-07-12 06:43:43.699182220 -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.3/scripts/makefile.watcom libpng-1.5.0beta34/scripts/makefile.watcom --- libpng-1.4.3/scripts/makefile.watcom 2010-06-25 19:32:28.229937587 -0500 +++ libpng-1.5.0beta34/scripts/makefile.watcom 2010-07-12 06:43:43.708652775 -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.3/scripts/makevms.com libpng-1.5.0beta34/scripts/makevms.com --- libpng-1.4.3/scripts/makevms.com 2010-06-25 19:32:28.239861456 -0500 +++ libpng-1.5.0beta34/scripts/makevms.com 2010-07-12 06:43:43.718520732 -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.3/scripts/options.awk libpng-1.5.0beta34/scripts/options.awk --- libpng-1.4.3/scripts/options.awk 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta34/scripts/options.awk 2010-07-12 06:43:43.732848647 -0500 @@ -0,0 +1,734 @@ +#!/bin/awk -f +# scripts/options.awk - library build configuration control +# +# last changed in libpng version 1.5.0 - July 12, 2010 +# +# Copyright (c) 1998-2010 Glenn Randers-Pehrson +# +# This code is released under the libpng license. +# For conditions of distribution and use, see the disclaimer +# and license in png.h + +# 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: +# +# awk -f scripts/options.awk out=options.tmp scripts/options.dfa 1>&2 +# awk -f scripts/options.awk out=options.dfn options.tmp 1>&2 +# +# Some options may be specified on the command line: +# +# deb=1 Causes debugging to be output +# logunsupported=1 Causes all options to be recorded in the output +# everything=off Causes all options to be disabled by default +# everything=on Causes all options to be enabled by default +# +# If awk fails on your platform, try nawk instead. +# +# These options may also be specified in the original input file (and +# are copied to the preprocessed file). + +BEGIN{ + out="/dev/null" # intermediate, preprocessed, file + pre=-1 # preprocess (first line) + err=0 # in-line exit sets this + 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 + + # Variables + deb=0 # debug - set on command line + everything="" # do not override defaults + logunsupported=0 # write unsupported options too + + # Precreate arrays + option[""] = "" # list of all options: default enabled/disabled + 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 = "" +} + +# The output file must be specified before any input: +out == "/dev/null" { + print "out=output.file must be given on the command line" + err = 1 + exit 1 +} + +# The very first line indicates whether we are reading pre-processed +# input or not, this must come *first* because 'PREPROCESSED' needs +# to be the very first line in the temporary file. +pre == -1{ + if ($0 == "PREPROCESSED") { + pre = 0 + next + } else { + pre = 1 + print "PREPROCESSED" >out + # And fall through to continue processing + } +} + +# variable=value +# Sets the given variable to the given value (the syntax is fairly +# free form, except for deb (you are expected to understand how to +# set the debug variable...) +# +# This happens before the check on 'pre' below skips most of the +# rest of the actions, so the variable settings happen during +# preprocessing but are recorded in the END action too. This +# allows them to be set on the command line too. +$0 ~ /^[ ]*everything[ =]*off[ ]*$/{ + everything = "off" + next +} +$0 ~ /^[ ]*everything[ =]*on[ ]*$/{ + everything = "on" + next +} +$0 ~ /^[ ]*logunsupported[ =]*0[ ]*$/{ + logunsupported = 0 + next +} +$0 ~ /^[ ]*logunsupported[ =]*1[ ]*$/{ + logunsupported = 1 + next +} +$1 == "deb" && $2 == "=" && NF == 3{ + deb = $3 + next +} + +# Preprocessing - this just copies the input file with lines +# that need preprocessing (just chunk at present) expanded +# The bare "pre" instead of "pre != 0" crashes under Sunos awk +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[ ]*/, "") + $1 = "" + 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 | disabled )* +# Declares an option 'NAME' and describes its default setting (disabled) +# 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'. +# +# Note that "enables" takes priority over the required/if/disabled/off +# setting of the target option. +# +# The definition file may list an option as 'disabled': off by default, +# otherwise the option is enabled: on by default. A later (and it must +# be later) entry may turn an option on or off explicitly. + +$1 == "option" && NF >= 2{ + onoff = option[$2] # records current (and the default is "", enabled) + key = "" + for (i=3; i<=NF; ++i) { + if ($(i) == "on" || $(i) == "off" || $(i) == "disabled") { + key = "" + if (onoff != $(i)) { + # on or off can zap disabled or enabled: + if (onoff == "" || (onoff == "disabled" || onoff == "enabled") && ($(i) == "on" || $(i) == "off")) { + # It's easy to mis-spell the option when turning it + # on or off, so warn about it here: + if (onoff == "" && ($(i) == "on" || $(i) == "off")) { + print $2 ": ERROR: turning unrecognized option", $(i) + # For the moment error out - it is safer + err = 1 # prevent END{} running + exit 1 + } + 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, defaulting to 'enabled' + if (onoff == "") onoff = "enabled" + option[$2] = onoff + next + } + # Else fall through to the error handler +} + +# chunk NAME [requires OPT] [on|off|disabled] +# 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 != 0 && $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" || $(i) == "disabled") { + 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 + # NOTE: this overwrites a previous value silently + 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(/^[ ]*@/, "") + $1 = substr($1, 2) + 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 + err = 1 # prevent END{} running + 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{ + # END{} gets run on an exit (a traditional awk feature) + if (err) exit 1 + + if (pre) { + # Record the final value of the variables + print "deb =", deb >out + if (everything != "") { + print "everything =", everything >out + } + print "logunsupported =", logunsupported >out + 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 + # And add the default definition for the benefit + # of later settings an options test: + print "# define PNG_" i defaults[i] >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) if (opt != "") { + o = option[opt] + # option should always be one of the following values + if (o != "on" && o != "off" && o != "disabled" && o != "enabled") { + print "internal option error (" o ")" + exit 1 + } + tree[opt] = "" # so unlisted options marked + } + for (opt in tree) if (opt != "") { + 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] = "disabled" + } + + 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] + + # Ok, now check all options marked explicitly 'on' or 'off': + # + # If an option[opt] is 'on' then turn on all requires[opt] + # If an option[opt] is 'off' then turn off all enabledby[opt] + # + # Error out if we have to turn 'on' an 'off' option or vice versa. + npending = 0 + for (opt in option) if (opt != "") { + if (option[opt] == "on" || option[opt] == "off") { + pending[++npending] = opt + } + } + + err = 0 # set on error + while (npending > 0) { + opt = pending[npending--] + if (option[opt] == "on") { + nreqs = split(requires[opt], r) + for (j=1; j<=nreqs; ++j) { + if (option[r[j]] == "off") { + print "option", opt, "turned on, but requirement", r[j], "is turned off" + err = 1 + } else if (option[r[j]] != "on") { + option[r[j]] = "on" + pending[++npending] = r[j] + } + } + } else { + if (option[opt] != "off") { + print "internal error (2)" + exit 1 + } + nreqs = split(enabledby[opt], r) + for (j=1; j<=nreqs; ++j) { + if (option[r[j]] == "on") { + print "option", opt, "turned off, but enabled by", r[j], "which is turned on" + err = 1 + } else if (option[r[j]] != "off") { + option[r[j]] = "off" + pending[++npending] = r[j] + } + } + } + } + if (err) exit 1 + + # 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 disabled; an option is disabled if: + # option == off + # option == disabled && everything != on + # option == "" && everything == 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 + # this error appears in the final output if something + # was switched 'on' but the processing above to force + # the requires did not work + if (option[i] == "on") { + print error, i, "requires", r[j] end >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 + # There is no checking above for this, because we + # don't know which 'if' to choose, so whine about + # it here: + if (option[i] == "on") { + print error, i, "needs one of:", iffs[i] end >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 + # Oops, probably not intended (should be factored + # out by the checks above). + if (option[i] == "off") { + print error, i, "enabled by:", r[j] end >out + } + print "#endif" >out + } + + print "# ifndef PNG_" i "_SUPPORTED /*!command line*/" >out + print "# ifdef PNG_not_enabled /*!enabled*/" >out + if (option[i] == "off" || option[i] == "disabled" && everything != "on" || option[i] == "enabled" && everything == "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, "is on: enabled by:" iffs[i] enabledby[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, "not enabled: requires:" requires[i] ", enabled by:" iffs[i] enabledby[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.3/scripts/png32ce.def libpng-1.5.0beta34/scripts/png32ce.def --- libpng-1.4.3/scripts/png32ce.def 2010-06-25 19:32:28.250427777 -0500 +++ libpng-1.5.0beta34/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_quantize - 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.0beta34 - 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_quantize @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.3/scripts/pnglibconf.dfa libpng-1.5.0beta34/scripts/pnglibconf.dfa --- libpng-1.4.3/scripts/pnglibconf.dfa 1969-12-31 18:00:00.000000000 -0600 +++ libpng-1.5.0beta34/scripts/pnglibconf.dfa 2010-07-12 06:43:43.745086915 -0500 @@ -0,0 +1,404 @@ +# 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 - last changed on July 12, 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 ...] [disabled] +# #define PNG__SUPPORTED if the requirements are met and +# enable the other options listed +# chunk [requires ...] [disabled] +# Enable chunk processing for the given ancillary chunk +# +# Note that the 'on' and 'off' keywords, while valid on both option +# and chunk, should not be used in this file because they force the +# relevant options on or off. + +#---------------------------------------------------------------------- + +# 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 no particular order: +# +# 1) Create 'pngusr.h', enter the required private build information +# detailed below and #define PNG_NO_