| OLD | NEW |
| 1 | 1 |
| 2 /* pngerror.c - stub functions for i/o and memory allocation | 2 /* pngerror.c - stub functions for i/o and memory allocation |
| 3 * | 3 * |
| 4 * Last changed in libpng 1.2.36 [May 7, 2009] | 4 * Last changed in libpng 1.2.37 [June 4, 2009] |
| 5 * For conditions of distribution and use, see copyright notice in png.h | 5 * For conditions of distribution and use, see copyright notice in png.h |
| 6 * Copyright (c) 1998-2009 Glenn Randers-Pehrson | 6 * Copyright (c) 1998-2009 Glenn Randers-Pehrson |
| 7 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) | 7 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) |
| 8 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) | 8 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) |
| 9 * | 9 * |
| 10 * This file provides a location for all error handling. Users who | 10 * This file provides a location for all error handling. Users who |
| 11 * need special error handling are expected to write replacement functions | 11 * need special error handling are expected to write replacement functions |
| 12 * and use png_set_error_fn() to use those functions. See the instructions | 12 * and use png_set_error_fn() to use those functions. See the instructions |
| 13 * at each function. | 13 * at each function. |
| 14 */ | 14 */ |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 break; | 227 break; |
| 228 } | 228 } |
| 229 if ((offset > 1) && (offset < 15)) | 229 if ((offset > 1) && (offset < 15)) |
| 230 { | 230 { |
| 231 error_number[offset - 1] = '\0'; | 231 error_number[offset - 1] = '\0'; |
| 232 fprintf(stderr, "libpng error no. %s: %s", | 232 fprintf(stderr, "libpng error no. %s: %s", |
| 233 error_number, error_message + offset + 1); | 233 error_number, error_message + offset + 1); |
| 234 fprintf(stderr, PNG_STRING_NEWLINE); | 234 fprintf(stderr, PNG_STRING_NEWLINE); |
| 235 } | 235 } |
| 236 else | 236 else |
| 237 { |
| 237 fprintf(stderr, "libpng error: %s, offset=%d", | 238 fprintf(stderr, "libpng error: %s, offset=%d", |
| 238 error_message, offset); | 239 error_message, offset); |
| 239 fprintf(stderr, PNG_STRING_NEWLINE); | 240 fprintf(stderr, PNG_STRING_NEWLINE); |
| 241 } |
| 240 } | 242 } |
| 241 else | 243 else |
| 242 #endif | 244 #endif |
| 243 { | 245 { |
| 244 fprintf(stderr, "libpng error: %s", error_message); | 246 fprintf(stderr, "libpng error: %s", error_message); |
| 245 fprintf(stderr, PNG_STRING_NEWLINE); | 247 fprintf(stderr, PNG_STRING_NEWLINE); |
| 246 } | 248 } |
| 247 #endif | 249 #endif |
| 248 | 250 |
| 249 #ifdef PNG_SETJMP_SUPPORTED | 251 #ifdef PNG_SETJMP_SUPPORTED |
| 250 if (png_ptr) | 252 if (png_ptr) |
| 251 { | 253 { |
| 252 # ifdef USE_FAR_KEYWORD | 254 # ifdef USE_FAR_KEYWORD |
| 253 { | 255 { |
| 254 jmp_buf jmpbuf; | 256 jmp_buf jmpbuf; |
| 255 png_memcpy(jmpbuf, png_ptr->jmpbuf, png_sizeof(jmp_buf)); | 257 png_memcpy(jmpbuf, png_ptr->jmpbuf, png_sizeof(jmp_buf)); |
| 256 longjmp(jmpbuf, 1); | 258 longjmp(jmpbuf, 1); |
| 257 } | 259 } |
| 258 # else | 260 # else |
| 259 longjmp(png_ptr->jmpbuf, 1); | 261 longjmp(png_ptr->jmpbuf, 1); |
| 260 # endif | 262 # endif |
| 261 } | 263 } |
| 262 #else | 264 #else |
| 263 PNG_ABORT(); | 265 PNG_ABORT(); |
| 264 #endif | 266 #endif |
| 265 #ifdef PNG_NO_CONSOLE_IO | 267 #ifdef PNG_NO_CONSOLE_IO |
| 266 error_message = error_message; /* make compiler happy */ | 268 error_message = error_message; /* Make compiler happy */ |
| 267 #endif | 269 #endif |
| 268 } | 270 } |
| 269 | 271 |
| 270 #ifndef PNG_NO_WARNINGS | 272 #ifndef PNG_NO_WARNINGS |
| 271 /* This function is called when there is a warning, but the library thinks | 273 /* This function is called when there is a warning, but the library thinks |
| 272 * it can continue anyway. Replacement functions don't have to do anything | 274 * it can continue anyway. Replacement functions don't have to do anything |
| 273 * here if you don't want them to. In the default configuration, png_ptr is | 275 * here if you don't want them to. In the default configuration, png_ptr is |
| 274 * not used, but it is passed in case it may be useful. | 276 * not used, but it is passed in case it may be useful. |
| 275 */ | 277 */ |
| 276 static void /* PRIVATE */ | 278 static void /* PRIVATE */ |
| (...skipping 25 matching lines...) Expand all Loading... |
| 302 fprintf(stderr, PNG_STRING_NEWLINE); | 304 fprintf(stderr, PNG_STRING_NEWLINE); |
| 303 } | 305 } |
| 304 } | 306 } |
| 305 else | 307 else |
| 306 # endif | 308 # endif |
| 307 { | 309 { |
| 308 fprintf(stderr, "libpng warning: %s", warning_message); | 310 fprintf(stderr, "libpng warning: %s", warning_message); |
| 309 fprintf(stderr, PNG_STRING_NEWLINE); | 311 fprintf(stderr, PNG_STRING_NEWLINE); |
| 310 } | 312 } |
| 311 #else | 313 #else |
| 312 warning_message = warning_message; /* make compiler happy */ | 314 warning_message = warning_message; /* Make compiler happy */ |
| 313 #endif | 315 #endif |
| 314 png_ptr = png_ptr; /* make compiler happy */ | 316 png_ptr = png_ptr; /* Make compiler happy */ |
| 315 } | 317 } |
| 316 #endif /* PNG_NO_WARNINGS */ | 318 #endif /* PNG_NO_WARNINGS */ |
| 317 | 319 |
| 318 /* This function is called when the application wants to use another method | 320 /* This function is called when the application wants to use another method |
| 319 * of handling errors and warnings. Note that the error function MUST NOT | 321 * of handling errors and warnings. Note that the error function MUST NOT |
| 320 * return to the calling routine or serious problems will occur. The return | 322 * return to the calling routine or serious problems will occur. The return |
| 321 * method used in the default routine calls longjmp(png_ptr->jmpbuf, 1) | 323 * method used in the default routine calls longjmp(png_ptr->jmpbuf, 1) |
| 322 */ | 324 */ |
| 323 void PNGAPI | 325 void PNGAPI |
| 324 png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, | 326 png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 350 png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode) | 352 png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode) |
| 351 { | 353 { |
| 352 if (png_ptr != NULL) | 354 if (png_ptr != NULL) |
| 353 { | 355 { |
| 354 png_ptr->flags &= | 356 png_ptr->flags &= |
| 355 ((~(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode); | 357 ((~(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode); |
| 356 } | 358 } |
| 357 } | 359 } |
| 358 #endif | 360 #endif |
| 359 #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ | 361 #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ |
| OLD | NEW |