CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/ext/libpng17/pngdebug.h
Views: 1401
1/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c2*3* Last changed in libpng 1.6.8 [December 19, 2013]4* Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson5* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)6* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)7*8* This code is released under the libpng license.9* For conditions of distribution and use, see the disclaimer10* and license in png.h11*/1213/* Define PNG_DEBUG at compile time for debugging information. Higher14* numbers for PNG_DEBUG mean more debugging information. This has15* only been added since version 0.95 so it is not implemented throughout16* libpng yet, but more support will be added as needed.17*18* png_debug[1-2]?(level, message ,arg{0-2})19* Expands to a statement (either a simple expression or a compound20* do..while(0) statement) that outputs a message with parameter21* substitution if PNG_DEBUG is defined to 2 or more. If PNG_DEBUG22* is undefined, 0 or 1 every png_debug expands to a simple expression23* (actually ((void)0)).24*25* level: level of detail of message, starting at 0. A level 'n'26* message is preceded by 'n' 3-space indentations (not implemented27* on Microsoft compilers unless PNG_DEBUG_FILE is also28* defined, to allow debug DLL compilation with no standard IO).29* message: a printf(3) style text string. A trailing '\n' is added30* to the message.31* arg: 0 to 2 arguments for printf(3) style substitution in message.32*/33#ifndef PNGDEBUG_H34#define PNGDEBUG_H35/* These settings control the formatting of messages in png.c and pngerror.c */36/* Moved to pngdebug.h at 1.5.0 */37# ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET38# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5bU39# endif40# ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET41# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5dU42# endif43# ifndef PNG_STRING_NEWLINE44# define PNG_STRING_NEWLINE "\n"45# endif4647#ifdef PNG_DEBUG48# if (PNG_DEBUG > 0)49# if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER)50# include <crtdbg.h>51# if (PNG_DEBUG > 1)52# ifndef _DEBUG53# define _DEBUG54# endif55# ifndef png_debug56# define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE)57# endif58# ifndef png_debug159# define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1)60# endif61# ifndef png_debug262# define png_debug2(l,m,p1,p2) \63_RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2)64# endif65# endif66# else /* PNG_DEBUG_FILE || !_MSC_VER */67# ifndef PNG_STDIO_SUPPORTED68# include <stdio.h> /* not included yet */69# endif70# ifndef PNG_DEBUG_FILE71# define PNG_DEBUG_FILE stderr72# endif /* PNG_DEBUG_FILE */7374# if (PNG_DEBUG > 1)75# ifdef __STDC__76# ifndef png_debug77# define png_debug(l,m) \78do { \79int num_tabs=l; \80fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \81(num_tabs==2 ? " " : (num_tabs>2 ? " " : "")))); \82} while (0)83# endif84# ifndef png_debug185# define png_debug1(l,m,p1) \86do { \87int num_tabs=l; \88fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \89(num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1); \90} while (0)91# endif92# ifndef png_debug293# define png_debug2(l,m,p1,p2) \94do { \95int num_tabs=l; \96fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \97(num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1,p2);\98} while (0)99# endif100# else /* __STDC __ */101# ifndef png_debug102# define png_debug(l,m) \103do { \104int num_tabs=l; \105char format[256]; \106snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \107(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \108m,PNG_STRING_NEWLINE); \109fprintf(PNG_DEBUG_FILE,format); \110} while (0)111# endif112# ifndef png_debug1113# define png_debug1(l,m,p1) \114do { \115int num_tabs=l; \116char format[256]; \117snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \118(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \119m,PNG_STRING_NEWLINE); \120fprintf(PNG_DEBUG_FILE,format,p1); \121} while (0)122# endif123# ifndef png_debug2124# define png_debug2(l,m,p1,p2) \125do { \126int num_tabs=l; \127char format[256]; \128snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \129(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \130m,PNG_STRING_NEWLINE); \131fprintf(PNG_DEBUG_FILE,format,p1,p2); \132} while (0)133# endif134# endif /* __STDC __ */135# endif /* (PNG_DEBUG > 1) */136137# endif /* _MSC_VER */138# endif /* (PNG_DEBUG > 0) */139#endif /* PNG_DEBUG */140#ifndef png_debug141# define png_debug(l, m) ((void)0)142#endif143#ifndef png_debug1144# define png_debug1(l, m, p1) ((void)0)145#endif146#ifndef png_debug2147# define png_debug2(l, m, p1, p2) ((void)0)148#endif149#endif /* PNGDEBUG_H */150151152