Commit c52a4204 authored by Andrey Filippov's avatar Andrey Filippov

Initial release, cloned from NC353

parent 6e23390b
html/*
attic/*
/.project
/.cproject
/.pydevproject
/.externalToolBuilders
/.settings
.directory
generated*
sysroots
bitbake-logs
/temp/
This diff is collapsed.
#!/bin/bash
args="$@"
while (( "$#" )); do
shift
done
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "Launching bitbake $args"
cd $DIR/../../poky
. ./oe-init-build-env
bitbake $args | sed -u 's@| @@'
exit 0
AXIS_USABLE_LIBS = UCLIBC GLIBC
AXIS_AUTO_DEPEND = yes
include $(AXIS_TOP_DIR)/tools/build/Rules.axis
# makefile for libpng using gcc (generic, static library)
# Copyright (C) 2000 Cosmin Truta
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# For conditions of distribution and use, see copyright notice in png.h
# Location of the zlib library and include files
#ZLIBINC = zlib
#ZLIBLIB = zlib
PNGINC = libpng
PNGLIB = libpng
#ZLIB = zlib
PNGLIB = libpng
INCDIR = $(AXIS_KERNEL_DIR)/include
INSTDIR = $(prefix)/usr/local/bin
CGIDIR = $(prefix)/usr/html
INSTMODE = 0755
INSTDOCMODE = 0644
INSTOWNER = root
INSTGROUP = root
#PGMNAME = pnghist
# Compiler, linker, lib and other tools
# CC = gcc
LD = $(CC)
LN= $(CC)
AR = ar rcs
RANLIB = ranlib
RM = rm -f
CDEBUG = -g -DPNG_DEBUG=5
LDDEBUG =
CRELEASE = -O2
LDRELEASE = -s
CFLAGS += -Wall -g -I$(INCDIR) -I$(AXIS_KERNEL_DIR)/include
LDFLAGS += -L$(LIBDIR)
CFLAGS += -Wall -g -I$(INCDIR) -I$(PNGINC) -I$(AXIS_KERNEL_DIR)/include
LDFLAGS += -L. -L$(PNGLIB) -L$(LIBDIR) -lpng -lz -lm
ifndef UCLIBC
# -lm - to use math library
LDLIBS = -lcrypt -lm
endif
# Variables
PROGS=pnghist.cgi
PNGSRCS = $(PNGLIB)/png.c $(PNGLIB)/pngerror.c $(PNGLIB)/pngget.c $(PNGLIB)/pngmem.c $(PNGLIB)/pngpread.c \
$(PNGLIB)/pngread.c $(PNGLIB)/pngrio.c $(PNGLIB)/pngrtran.c $(PNGLIB)/pngrutil.c $(PNGLIB)/pngset.c \
$(PNGLIB)/pngtrans.c $(PNGLIB)/pngwio.c $(PNGLIB)/pngwrite.c $(PNGLIB)/pngwtran.c $(PNGLIB)/pngwutil.c
PNGOBJS = $(PNGLIB)/png.o $(PNGLIB)/pngerror.o $(PNGLIB)/pngget.o $(PNGLIB)/pngmem.o $(PNGLIB)/pngpread.o \
$(PNGLIB)/pngread.o $(PNGLIB)/pngrio.o $(PNGLIB)/pngrtran.o $(PNGLIB)/pngrutil.o $(PNGLIB)/pngset.o \
$(PNGLIB)/pngtrans.o $(PNGLIB)/pngwio.o $(PNGLIB)/pngwrite.o $(PNGLIB)/pngwtran.o $(PNGLIB)/pngwutil.o
SRCS = pnghist.c $(PNGSRCS) $(ZSRCS)
OBJS = pnghist.o $(PNGOBJS) $(ZOBJS)
#LIBS = $(PNGLIB)/libpng.a $(ZLIB)/libz.a
LIBS = $(PNGLIB)/libpng.a
# Targets
#all: dependency $(PROGS) $(PNGLIB)/libpng.a $(ZLIB)/libz.a
all: dependency $(PROGS)
$(PNGLIB)/libpng.a: $(PNGOBJS)
$(AR) $@ $(PNGOBJS)
$(RANLIB) $@
#$(ZLIB)/libz.a: $(ZOBJS)
# $(AR) $@ $(ZOBJS)
# -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
pnghist.cgi: pnghist.o $(PNGLIB)/libpng.a
$(LD) $^ $(LDLIBS) -o $@ $(LDFLAGS)
cris-strip -s $@
install: $(LIBS) $(PROGS)
$(INSTALL) -d $(INSTDIR)
$(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) pnghist.cgi $(CGIDIR)
clean:
$(RM) $(PNGLIB)/*.o $(PNGLIB)/*~ $(PNGLIB)/*.bak $(PNGLIB)/libpng.a $(PNGLIB)/pngtest $(PNGLIB)/pngout.png \
*.o *~ *.bak dependency $(PROGS)
configsubs:
Libpng 1.2.8 - December 3, 2004
This is a public release of libpng, intended for use in production codes.
Changes since the last public release (1.2.7):
Fixed bug in png_text_compress() that would fail to complete a large block.
Fixed bug, introduced in libpng-1.2.7, that overruns a buffer during
strip alpha operation in png_do_strip_filler().
Added PNG_1_2_X definition in pngconf.h
#ifdef out png_info_init in png.c and png_read_init in pngread.c (as of 1.3.0)
Reduce color_type to a nonalpha type after strip alpha operation in
png_do_strip_filler().
Revised definitions of PNG_MAX_UINT_32, PNG_MAX_SIZE, and PNG_MAXSUM
Fixed (again) definition of PNG_LIBPNG_VER_DLLNUM in png.h (Cosmin).
Added PNG_LIBPNG_BUILD_PRIVATE in png.h (Cosmin).
Set png_ptr->zstream.data_type to Z_BINARY, to avoid unnecessary detection
of data type in deflate (Cosmin).
Deprecated but continue to support SPECIALBUILD and PRIVATEBUILD in favor of
PNG_LIBPNG_BUILD_SPECIAL_STRING and PNG_LIBPNG_BUILD_PRIVATE_STRING.
Despammed mailing addresses by masking "@" with "at".
Added scripts/makefile.elf with supporting code in pngconf.h for symbol
versioning (John Bowler).
Added projects/visualc71 (Simon-pierre).
Send comments/corrections/commendations to
png-implement at ccrc.wustl.edu (subscription required; write to
majordomo at ccrc.wustl.edu with "subscribe png-implement" in the message)
or to glennrp at users.sourceforge.net
Glenn R-P
This diff is collapsed.
This copy of the libpng notices is provided for your convenience. In case of
any discrepancy between this copy and the notices in the file png.h that is
included in the libpng distribution, the latter shall prevail.
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
If you modify libpng you may insert additional notices immediately following
this sentence.
libpng version 1.2.6, December 3, 2004, is
Copyright (c) 2004 Glenn Randers-Pehrson, and is
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
Cosmin Truta
libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.0.6
with the following individuals added to the list of Contributing Authors
Simon-Pierre Cadieux
Eric S. Raymond
Gilles Vollant
and with the following additions to the disclaimer:
There is no warranty against interference with your enjoyment of the
library or against infringement. There is no warranty that our
efforts or the library will fulfill any of your particular purposes
or needs. This library is provided with all faults, and the entire
risk of satisfactory quality, performance, accuracy, and effort is with
the user.
libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-0.96,
with the following individuals added to the list of Contributing Authors:
Tom Lane
Glenn Randers-Pehrson
Willem van Schaik
libpng versions 0.89, June 1996, through 0.96, May 1997, are
Copyright (c) 1996, 1997 Andreas Dilger
Distributed according to the same disclaimer and license as libpng-0.88,
with the following individuals added to the list of Contributing Authors:
John Bowler
Kevin Bracey
Sam Bushell
Magnus Holmgren
Greg Roelofs
Tom Tanner
libpng versions 0.5, May 1995, through 0.88, January 1996, are
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:
Andreas Dilger
Dave Martindale
Guy Eric Schalnat
Paul Schmidt
Tim Wegner
The PNG Reference Library is supplied "AS IS". The Contributing Authors
and Group 42, Inc. disclaim all warranties, expressed or implied,
including, without limitation, the warranties of merchantability and of
fitness for any purpose. The Contributing Authors and Group 42, Inc.
assume no liability for direct, indirect, incidental, special, exemplary,
or consequential damages, which may result from the use of the PNG
Reference Library, even if advised of the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject
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.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
The Contributing Authors and Group 42, Inc. specifically permit, without
fee, and encourage the use of this source code as a component to
supporting the PNG file format in commercial products. If you use this
source code in a product, acknowledgment is not required but would be
appreciated.
A "png_get_copyright" function is available, for convenient use in "about"
boxes and the like:
printf("%s",png_get_copyright(NULL));
Also, the PNG logo (in PNG format, of course) is supplied in the
files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a
certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
December 3, 2004
AXIS_USABLE_LIBS = UCLIBC GLIBC
include $(AXIS_TOP_DIR)/tools/build/Rules.axis
# makefile for libpng using gcc (generic, static library)
# Copyright (C) 2000 Cosmin Truta
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# For conditions of distribution and use, see copyright notice in png.h
# Location of the zlib library and include files
ZLIBINC = ../zlib
ZLIBLIB = ../zlib
INCDIR = $(AXIS_KERNEL_DIR)/include
INSTDIR = $(prefix)/usr/local/bin
INSTMODE = 0755
INSTDOCMODE = 0644
INSTOWNER = root
INSTGROUP = root
# Compiler, linker, lib and other tools
# CC = gcc
LD = $(CC)
LN= $(CC)
AR = ar rcs
RANLIB = ranlib
RM = rm -f
CDEBUG = -g -DPNG_DEBUG=5
LDDEBUG =
CRELEASE = -O2
LDRELEASE = -s
#CFLAGS = -I$(INCDIR) -I$(ZLIBINC) -Wall $(CRELEASE)
#LDFLAGS = -L. -L$(ZLIBLIB) -lpng -lz -lm $(LDRELEASE)
CFLAGS += -Wall -g -I$(INCDIR) -I$(ZLIBINC) -I$(AXIS_KERNEL_DIR)/include $(CRELEASE)
LDFLAGS += -L. -L$(ZLIBLIB) -L$(LIBDIR) -lpng -lz -lm $(LDRELEASE)
ifndef UCLIBC
# -lm - to use math library
LDLIBS = -lcrypt -lm
endif
# Variables
PROGS=pngtest
DOCS=pngtest.png
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 pngtest.c
OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
# Targets
all: dependency libpng.a pngtest
libpng.a: $(OBJS)
$(AR) $@ $(OBJS)
$(RANLIB) $@
#test: pngtest
# ./pngtest
aaa:
echo $(CFLAGS)
pngtest: pngtest.o libpng.a
# $(LD) -o $@ pngtest.o $(LDFLAGS)
$(LD) $^ $(LDLIBS) -o $@ $(LDFLAGS)
cris-strip -s $@
install: $(LIBS)
$(INSTALL) -d $(INSTDIR)
$(INSTALL) -m $(INSTMODE) -o $(INSTOWNER) -g $(INSTGROUP) $(PROGS) $(INSTDIR)
$(INSTALL) -m $(INSTDOCMODE) -o $(INSTOWNER) -g $(INSTGROUP) $(DOCS) $(INSTDIR)
clean:
$(RM) *.o libpng.a pngtest pngout.png
dependency:
make depend
depend:
makedepend -Y -- $(CFLAGS) -- $(SRCS) 2>/dev/null
touch dependency
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngerror.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngget.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngmem.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngpread.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngread.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngrio.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngrtran.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngrutil.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngset.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngtrans.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngwio.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngwrite.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngwtran.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngwutil.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
pngtest.o: png.h ../zlib/zlib.h ../zlib/zconf.h pngconf.h
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
.TH PNG 5 "December 3, 2004"
.SH NAME
png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION
PNG (Portable Network Graphics) is an extensible file format for the
lossless, portable, well-compressed storage of raster images. PNG provides
a patent-free replacement for GIF and can also replace many
common uses of TIFF. Indexed-color, grayscale, and truecolor images are
supported, plus an optional alpha channel. Sample depths range from
1 to 16 bits.
.br
PNG is designed to work well in online viewing applications, such as the
World Wide Web, so it is fully streamable with a progressive display
option. PNG is robust, providing both full file integrity checking and
fast, simple detection of common transmission errors. Also, PNG can store
gamma and chromaticity data for improved color matching on heterogeneous
platforms.
.SH "SEE ALSO"
.IR libpng(3), zlib(3), deflate(5), and zlib(5)
.LP
PNG specification (second edition), November 2003:
.IP
.br
<http://www.w3.org/TR/2003/REC-PNG-20031110/
PNG 1.2 specification, July 1999:
.IP
.br
http://www.libpng.org/pub/png
.LP
PNG 1.0 specification, October 1996:
.IP
.br
RFC 2083
.IP
.br
ftp://ds.internic.net/rfc/rfc2083.txt
.br
or (as a W3C Recommendation) at
.br
http://www.w3.org/TR/REC-png.html
.SH AUTHORS
This man page: Glenn Randers-Pehrson
.LP
Portable Network Graphics (PNG) Specification (Second Edition)
Information technology - Computer graphics and image processing -
Portable Network Graphics (PNG): Functional specification.
ISO/IEC 15948:2003 (E) (November 10, 2003): David Duce and others.
.LP
Portable Network Graphics (PNG) Specification Version 1.2 (July 8, 1999):
Glenn Randers-Pehrson and others (png-list).
.LP
Portable Network Graphics (PNG) Specification Version 1.0 (October 1, 1996):
Thomas Boutell and others (png-list).
.LP
.SH COPYRIGHT NOTICE
.LP
This man page is Copyright (c) 1998-2004 Glenn Randers-Pehrson. See png.h
for conditions of use and distribution.
.LP
The PNG Specification (Second Edition) is
Copyright (c) 2003 W3C. (MIT, ERCIM, Keio), All Rights Reserved.
.LP
The PNG-1.2 specification is copyright (c) 1999 Glenn Randers-Pehrson.
See the specification for conditions of use and distribution.
.LP
The PNG-1.0 specification is copyright (c) 1996 Massachusetts Institute of
Technology. See the specification for conditions of use and distribution.
.LP
.\" end of man page
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* pngerror.c - stub functions for i/o and memory allocation
*
* libpng version 1.2.8 - December 3, 2004
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2004 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.)
*
* This file provides a location for all error handling. Users who
* need special error handling are expected to write replacement functions
* and use png_set_error_fn() to use those functions. See the instructions
* at each function.
*/
#define PNG_INTERNAL
#include "png.h"
static void /* PRIVATE */
png_default_error PNGARG((png_structp png_ptr,
png_const_charp error_message));
static void /* PRIVATE */
png_default_warning PNGARG((png_structp png_ptr,
png_const_charp warning_message));
/* This function is called whenever there is a fatal error. This function
* should not be changed. If there is a need to handle errors differently,
* you should supply a replacement error function and use png_set_error_fn()
* to replace the error function at run-time.
*/
void PNGAPI
png_error(png_structp png_ptr, png_const_charp error_message)
{
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
char msg[16];
if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
{
if (*error_message == '#')
{
int offset;
for (offset=1; offset<15; offset++)
if (*(error_message+offset) == ' ')
break;
if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)
{
int i;
for (i=0; i<offset-1; i++)
msg[i]=error_message[i+1];
msg[i]='\0';
error_message=msg;
}
else
error_message+=offset;
}
else
{
if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)
{
msg[0]='0';
msg[1]='\0';
error_message=msg;
}
}
}
#endif
if (png_ptr != NULL && png_ptr->error_fn != NULL)
(*(png_ptr->error_fn))(png_ptr, error_message);
/* If the custom handler doesn't exist, or if it returns,
use the default handler, which will not return. */
png_default_error(png_ptr, error_message);
}
/* This function is called whenever there is a non-fatal error. This function
* should not be changed. If there is a need to handle warnings differently,
* you should supply a replacement warning function and use
* png_set_error_fn() to replace the warning function at run-time.
*/
void PNGAPI
png_warning(png_structp png_ptr, png_const_charp warning_message)
{
int offset = 0;
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
#endif
{
if (*warning_message == '#')
{
for (offset=1; offset<15; offset++)
if (*(warning_message+offset) == ' ')
break;
}
}
if (png_ptr != NULL && png_ptr->warning_fn != NULL)
(*(png_ptr->warning_fn))(png_ptr, warning_message+offset);
else
png_default_warning(png_ptr, warning_message+offset);
}
/* These utilities are used internally to build an error message that relates
* to the current chunk. The chunk name comes from png_ptr->chunk_name,
* this is used to prefix the message. The message is limited in length
* to 63 bytes, the name characters are output as hex digits wrapped in []
* if the character is invalid.
*/
#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97))
static PNG_CONST char png_digit[16] = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F'
};
static void /* PRIVATE */
png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
error_message)
{
int iout = 0, iin = 0;
while (iin < 4)
{
int c = png_ptr->chunk_name[iin++];
if (isnonalpha(c))
{
buffer[iout++] = '[';
buffer[iout++] = png_digit[(c & 0xf0) >> 4];
buffer[iout++] = png_digit[c & 0x0f];
buffer[iout++] = ']';
}
else
{
buffer[iout++] = (png_byte)c;
}
}
if (error_message == NULL)
buffer[iout] = 0;
else
{
buffer[iout++] = ':';
buffer[iout++] = ' ';
png_strncpy(buffer+iout, error_message, 63);
buffer[iout+63] = 0;
}
}
void PNGAPI
png_chunk_error(png_structp png_ptr, png_const_charp error_message)
{
char msg[18+64];
png_format_buffer(png_ptr, msg, error_message);
png_error(png_ptr, msg);
}
void PNGAPI
png_chunk_warning(png_structp png_ptr, png_const_charp warning_message)
{
char msg[18+64];
png_format_buffer(png_ptr, msg, warning_message);
png_warning(png_ptr, msg);
}
/* This is the default error handling function. Note that replacements for
* 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 /* PRIVATE */
png_default_error(png_structp png_ptr, png_const_charp error_message)
{
#ifndef PNG_NO_CONSOLE_IO
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
if (*error_message == '#')
{
int offset;
char error_number[16];
for (offset=0; offset<15; offset++)
{
error_number[offset] = *(error_message+offset+1);
if (*(error_message+offset) == ' ')
break;
}
if((offset > 1) && (offset < 15))
{
error_number[offset-1]='\0';
fprintf(stderr, "libpng error no. %s: %s\n", error_number,
error_message+offset);
}
else
fprintf(stderr, "libpng error: %s, offset=%d\n", error_message,offset);
}
else
#endif
fprintf(stderr, "libpng error: %s\n", error_message);
#endif
#ifdef PNG_SETJMP_SUPPORTED
# ifdef USE_FAR_KEYWORD
{
jmp_buf jmpbuf;
png_memcpy(jmpbuf,png_ptr->jmpbuf,png_sizeof(jmp_buf));
longjmp(jmpbuf, 1);
}
# else
longjmp(png_ptr->jmpbuf, 1);
# endif
#else
/* make compiler happy */ ;
if (png_ptr)
PNG_ABORT();
#endif
#ifdef PNG_NO_CONSOLE_IO
/* make compiler happy */ ;
if (&error_message != NULL)
return;
#endif
}
/* This function is called when there is a warning, but the library thinks
* it can continue anyway. Replacement functions don't have to do anything
* here if you don't want them to. In the default configuration, png_ptr is
* not used, but it is passed in case it may be useful.
*/
static void /* PRIVATE */
png_default_warning(png_structp png_ptr, png_const_charp warning_message)
{
#ifndef PNG_NO_CONSOLE_IO
# ifdef PNG_ERROR_NUMBERS_SUPPORTED
if (*warning_message == '#')
{
int offset;
char warning_number[16];
for (offset=0; offset<15; offset++)
{
warning_number[offset]=*(warning_message+offset+1);
if (*(warning_message+offset) == ' ')
break;
}
if((offset > 1) && (offset < 15))
{
warning_number[offset-1]='\0';
fprintf(stderr, "libpng warning no. %s: %s\n", warning_number,
warning_message+offset);
}
else
fprintf(stderr, "libpng warning: %s\n", warning_message);
}
else
# endif
fprintf(stderr, "libpng warning: %s\n", warning_message);
#else
/* make compiler happy */ ;
if (warning_message)
return;
#endif
/* make compiler happy */ ;
if (png_ptr)
return;
}
/* 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)
*/
void PNGAPI
png_set_error_fn(png_structp png_ptr, png_voidp error_ptr,
png_error_ptr error_fn, png_error_ptr warning_fn)
{
png_ptr->error_ptr = error_ptr;
png_ptr->error_fn = error_fn;
png_ptr->warning_fn = warning_fn;
}
/* This function returns a pointer to the error_ptr associated with the user
* functions. The application should free any memory associated with this
* pointer before png_write_destroy and png_read_destroy are called.
*/
png_voidp PNGAPI
png_get_error_ptr(png_structp png_ptr)
{
return ((png_voidp)png_ptr->error_ptr);
}
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
void PNGAPI
png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode)
{
if(png_ptr != NULL)
{
png_ptr->flags &=
((~(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode);
}
}
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment