pngerror.c revision 0
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Sun in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC. 0N/A * This file is available under and governed by the GNU General Public 0N/A * License version 2 only, as published by the Free Software Foundation. 0N/A * However, the following notice accompanied the original version of this 0N/A * file and, per its terms, should not be removed: 0N/A * Last changed in libpng 1.2.13 November 13, 2006 0N/A * For conditions of distribution and use, see copyright notice in png.h 0N/A * Copyright (c) 1998-2006 Glenn Randers-Pehrson 0N/A * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) 0N/A * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) 0N/A * This file provides a location for all error handling. Users who 0N/A * need special error handling are expected to write replacement functions 0N/A * and use png_set_error_fn() to use those functions. See the instructions 0N/Astatic void /* PRIVATE */ 0N/Astatic void /* PRIVATE */ 0N/A/* This function is called whenever there is a fatal error. This function 0N/A * should not be changed. If there is a need to handle errors differently, 0N/A * you should supply a replacement error function and use png_set_error_fn() 0N/A * to replace the error function at run-time. 0N/A /* If the custom handler doesn't exist, or if it returns, 0N/A use the default handler, which will not return. */ 0N/A/* This function is called whenever there is a non-fatal error. This function 0N/A * should not be changed. If there is a need to handle warnings differently, 0N/A * you should supply a replacement warning function and use 0N/A * png_set_error_fn() to replace the warning function at run-time. 0N/A/* These utilities are used internally to build an error message that relates 0N/A * to the current chunk. The chunk name comes from png_ptr->chunk_name, 0N/A * this is used to prefix the message. The message is limited in length 0N/A * to 63 bytes, the name characters are output as hex digits wrapped in [] 0N/A * if the character is invalid. 0N/A#
define isnonalpha(c) ((c) <
65 || (c) >
122 || ((c) >
90 && (c) <
97))
0N/A '0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
0N/A 'A',
'B',
'C',
'D',
'E',
'F' 0N/Astatic void /* PRIVATE */ 0N/A/* This is the default error handling function. Note that replacements for 0N/A * this function MUST NOT RETURN, or the program will likely crash. This 0N/A * function is used by default, or if the program supplies NULL for the 0N/A * error function pointer in png_set_error_fn(). 0N/Astatic void /* PRIVATE */ 0N/A /* make compiler happy */ ;
0N/A/* This function is called when there is a warning, but the library thinks 0N/A * it can continue anyway. Replacement functions don't have to do anything 0N/A * here if you don't want them to. In the default configuration, png_ptr is 0N/A * not used, but it is passed in case it may be useful. 0N/Astatic void /* PRIVATE */ 0N/A /* make compiler happy */ ;
0N/A /* make compiler happy */ ;
0N/A/* This function is called when the application wants to use another method 0N/A * of handling errors and warnings. Note that the error function MUST NOT 0N/A * return to the calling routine or serious problems will occur. The return 0N/A * method used in the default routine calls longjmp(png_ptr->jmpbuf, 1) 0N/A/* This function returns a pointer to the error_ptr associated with the user 0N/A * functions. The application should free any memory associated with this 0N/A * pointer before png_write_destroy and png_read_destroy are called. 0N/A#
endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */