1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libpng/pngdebug.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,154 @@ 1.4 + 1.5 +/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c 1.6 + * 1.7 + * Copyright (c) 1998-2013 Glenn Randers-Pehrson 1.8 + * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) 1.9 + * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) 1.10 + * 1.11 + * Last changed in libpng 1.6.8 [December 19, 2013] 1.12 + * 1.13 + * This code is released under the libpng license. 1.14 + * For conditions of distribution and use, see the disclaimer 1.15 + * and license in png.h 1.16 + */ 1.17 + 1.18 +/* Define PNG_DEBUG at compile time for debugging information. Higher 1.19 + * numbers for PNG_DEBUG mean more debugging information. This has 1.20 + * only been added since version 0.95 so it is not implemented throughout 1.21 + * libpng yet, but more support will be added as needed. 1.22 + * 1.23 + * png_debug[1-2]?(level, message ,arg{0-2}) 1.24 + * Expands to a statement (either a simple expression or a compound 1.25 + * do..while(0) statement) that outputs a message with parameter 1.26 + * substitution if PNG_DEBUG is defined to 2 or more. If PNG_DEBUG 1.27 + * is undefined, 0 or 1 every png_debug expands to a simple expression 1.28 + * (actually ((void)0)). 1.29 + * 1.30 + * level: level of detail of message, starting at 0. A level 'n' 1.31 + * message is preceded by 'n' 3-space indentations (not implemented 1.32 + * on Microsoft compilers unless PNG_DEBUG_FILE is also 1.33 + * defined, to allow debug DLL compilation with no standard IO). 1.34 + * message: a printf(3) style text string. A trailing '\n' is added 1.35 + * to the message. 1.36 + * arg: 0 to 2 arguments for printf(3) style substitution in message. 1.37 + */ 1.38 +#ifndef PNGDEBUG_H 1.39 +#define PNGDEBUG_H 1.40 +/* These settings control the formatting of messages in png.c and pngerror.c */ 1.41 +/* Moved to pngdebug.h at 1.5.0 */ 1.42 +# ifndef PNG_LITERAL_SHARP 1.43 +# define PNG_LITERAL_SHARP 0x23 1.44 +# endif 1.45 +# ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET 1.46 +# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b 1.47 +# endif 1.48 +# ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET 1.49 +# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d 1.50 +# endif 1.51 +# ifndef PNG_STRING_NEWLINE 1.52 +# define PNG_STRING_NEWLINE "\n" 1.53 +# endif 1.54 + 1.55 +#ifdef PNG_DEBUG 1.56 +# if (PNG_DEBUG > 0) 1.57 +# if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) 1.58 +# include <crtdbg.h> 1.59 +# if (PNG_DEBUG > 1) 1.60 +# ifndef _DEBUG 1.61 +# define _DEBUG 1.62 +# endif 1.63 +# ifndef png_debug 1.64 +# define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE) 1.65 +# endif 1.66 +# ifndef png_debug1 1.67 +# define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1) 1.68 +# endif 1.69 +# ifndef png_debug2 1.70 +# define png_debug2(l,m,p1,p2) \ 1.71 + _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2) 1.72 +# endif 1.73 +# endif 1.74 +# else /* PNG_DEBUG_FILE || !_MSC_VER */ 1.75 +# ifndef PNG_STDIO_SUPPORTED 1.76 +# include <stdio.h> /* not included yet */ 1.77 +# endif 1.78 +# ifndef PNG_DEBUG_FILE 1.79 +# define PNG_DEBUG_FILE stderr 1.80 +# endif /* PNG_DEBUG_FILE */ 1.81 + 1.82 +# if (PNG_DEBUG > 1) 1.83 +# ifdef __STDC__ 1.84 +# ifndef png_debug 1.85 +# define png_debug(l,m) \ 1.86 + do { \ 1.87 + int num_tabs=l; \ 1.88 + fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ 1.89 + (num_tabs==2 ? " " : (num_tabs>2 ? " " : "")))); \ 1.90 + } while (0) 1.91 +# endif 1.92 +# ifndef png_debug1 1.93 +# define png_debug1(l,m,p1) \ 1.94 + do { \ 1.95 + int num_tabs=l; \ 1.96 + fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ 1.97 + (num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1); \ 1.98 + } while (0) 1.99 +# endif 1.100 +# ifndef png_debug2 1.101 +# define png_debug2(l,m,p1,p2) \ 1.102 + do { \ 1.103 + int num_tabs=l; \ 1.104 + fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ 1.105 + (num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1,p2);\ 1.106 + } while (0) 1.107 +# endif 1.108 +# else /* __STDC __ */ 1.109 +# ifndef png_debug 1.110 +# define png_debug(l,m) \ 1.111 + do { \ 1.112 + int num_tabs=l; \ 1.113 + char format[256]; \ 1.114 + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ 1.115 + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ 1.116 + m,PNG_STRING_NEWLINE); \ 1.117 + fprintf(PNG_DEBUG_FILE,format); \ 1.118 + } while (0) 1.119 +# endif 1.120 +# ifndef png_debug1 1.121 +# define png_debug1(l,m,p1) \ 1.122 + do { \ 1.123 + int num_tabs=l; \ 1.124 + char format[256]; \ 1.125 + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ 1.126 + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ 1.127 + m,PNG_STRING_NEWLINE); \ 1.128 + fprintf(PNG_DEBUG_FILE,format,p1); \ 1.129 + } while (0) 1.130 +# endif 1.131 +# ifndef png_debug2 1.132 +# define png_debug2(l,m,p1,p2) \ 1.133 + do { \ 1.134 + int num_tabs=l; \ 1.135 + char format[256]; \ 1.136 + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ 1.137 + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ 1.138 + m,PNG_STRING_NEWLINE); \ 1.139 + fprintf(PNG_DEBUG_FILE,format,p1,p2); \ 1.140 + } while (0) 1.141 +# endif 1.142 +# endif /* __STDC __ */ 1.143 +# endif /* (PNG_DEBUG > 1) */ 1.144 + 1.145 +# endif /* _MSC_VER */ 1.146 +# endif /* (PNG_DEBUG > 0) */ 1.147 +#endif /* PNG_DEBUG */ 1.148 +#ifndef png_debug 1.149 +# define png_debug(l, m) ((void)0) 1.150 +#endif 1.151 +#ifndef png_debug1 1.152 +# define png_debug1(l, m, p1) ((void)0) 1.153 +#endif 1.154 +#ifndef png_debug2 1.155 +# define png_debug2(l, m, p1, p2) ((void)0) 1.156 +#endif 1.157 +#endif /* PNGDEBUG_H */