Path: blob/master/src/java.desktop/share/native/libsplashscreen/libpng/pngdebug.h
41154 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c25*26* This file is available under and governed by the GNU General Public27* License version 2 only, as published by the Free Software Foundation.28* However, the following notice accompanied the original version of this29* file and, per its terms, should not be removed:30*31* Copyright (c) 2018 Cosmin Truta32* Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson33* Copyright (c) 1996-1997 Andreas Dilger34* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.35*36* This code is released under the libpng license.37* For conditions of distribution and use, see the disclaimer38* and license in png.h39*/4041/* Define PNG_DEBUG at compile time for debugging information. Higher42* numbers for PNG_DEBUG mean more debugging information. This has43* only been added since version 0.95 so it is not implemented throughout44* libpng yet, but more support will be added as needed.45*46* png_debug[1-2]?(level, message ,arg{0-2})47* Expands to a statement (either a simple expression or a compound48* do..while(0) statement) that outputs a message with parameter49* substitution if PNG_DEBUG is defined to 2 or more. If PNG_DEBUG50* is undefined, 0 or 1 every png_debug expands to a simple expression51* (actually ((void)0)).52*53* level: level of detail of message, starting at 0. A level 'n'54* message is preceded by 'n' 3-space indentations (not implemented55* on Microsoft compilers unless PNG_DEBUG_FILE is also56* defined, to allow debug DLL compilation with no standard IO).57* message: a printf(3) style text string. A trailing '\n' is added58* to the message.59* arg: 0 to 2 arguments for printf(3) style substitution in message.60*/61#ifndef PNGDEBUG_H62#define PNGDEBUG_H63/* These settings control the formatting of messages in png.c and pngerror.c */64/* Moved to pngdebug.h at 1.5.0 */65# ifndef PNG_LITERAL_SHARP66# define PNG_LITERAL_SHARP 0x2367# endif68# ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET69# define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b70# endif71# ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET72# define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d73# endif74# ifndef PNG_STRING_NEWLINE75# define PNG_STRING_NEWLINE "\n"76# endif7778#ifdef PNG_DEBUG79# if (PNG_DEBUG > 0)80# if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER)81# include <crtdbg.h>82# if (PNG_DEBUG > 1)83# ifndef _DEBUG84# define _DEBUG85# endif86# ifndef png_debug87# define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE)88# endif89# ifndef png_debug190# define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1)91# endif92# ifndef png_debug293# define png_debug2(l,m,p1,p2) \94_RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2)95# endif96# endif97# else /* PNG_DEBUG_FILE || !_MSC_VER */98# ifndef PNG_STDIO_SUPPORTED99# include <stdio.h> /* not included yet */100# endif101# ifndef PNG_DEBUG_FILE102# define PNG_DEBUG_FILE stderr103# endif /* PNG_DEBUG_FILE */104105# if (PNG_DEBUG > 1)106# ifdef __STDC__107# ifndef png_debug108# define png_debug(l,m) \109do { \110int num_tabs=l; \111fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \112(num_tabs==2 ? " " : (num_tabs>2 ? " " : "")))); \113} while (0)114# endif115# ifndef png_debug1116# define png_debug1(l,m,p1) \117do { \118int num_tabs=l; \119fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \120(num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1); \121} while (0)122# endif123# ifndef png_debug2124# define png_debug2(l,m,p1,p2) \125do { \126int num_tabs=l; \127fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \128(num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1,p2);\129} while (0)130# endif131# else /* __STDC __ */132# ifndef png_debug133# define png_debug(l,m) \134do { \135int num_tabs=l; \136char format[256]; \137snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \138(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \139m,PNG_STRING_NEWLINE); \140fprintf(PNG_DEBUG_FILE,format); \141} while (0)142# endif143# ifndef png_debug1144# define png_debug1(l,m,p1) \145do { \146int num_tabs=l; \147char format[256]; \148snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \149(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \150m,PNG_STRING_NEWLINE); \151fprintf(PNG_DEBUG_FILE,format,p1); \152} while (0)153# endif154# ifndef png_debug2155# define png_debug2(l,m,p1,p2) \156do { \157int num_tabs=l; \158char format[256]; \159snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \160(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \161m,PNG_STRING_NEWLINE); \162fprintf(PNG_DEBUG_FILE,format,p1,p2); \163} while (0)164# endif165# endif /* __STDC __ */166# endif /* (PNG_DEBUG > 1) */167168# endif /* _MSC_VER */169# endif /* (PNG_DEBUG > 0) */170#endif /* PNG_DEBUG */171#ifndef png_debug172# define png_debug(l, m) ((void)0)173#endif174#ifndef png_debug1175# define png_debug1(l, m, p1) ((void)0)176#endif177#ifndef png_debug2178# define png_debug2(l, m, p1, p2) ((void)0)179#endif180#endif /* PNGDEBUG_H */181182183