1 /***************************************************************************/
5 /* Debugging and logging component (body). */
7 /* Copyright 1996-2001 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* This file is part of the FreeType project, and may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
16 /***************************************************************************/
19 /*************************************************************************/
21 /* This component contains various macros and functions used to ease the */
22 /* debugging of the FreeType engine. Its main purpose is in assertion */
23 /* checking, tracing, and error detection. */
25 /* There are now three debugging modes: */
29 /* Error and trace messages are sent to the log file (which can be the */
30 /* standard error output). */
34 /* Only error messages are generated. */
38 /* No error message is sent or generated. The code is free from any */
39 /* debugging parts. */
41 /*************************************************************************/
45 #include FT_INTERNAL_DEBUG_H
48 #ifdef FT_DEBUG_LEVEL_TRACE
49 char ft_trace_levels[trace_max];
53 #if defined( FT_DEBUG_LEVEL_ERROR ) || defined( FT_DEBUG_LEVEL_TRACE )
62 FT_Message( const char* fmt, ... )
74 FT_Panic( const char* fmt, ... )
87 #ifdef FT_DEBUG_LEVEL_TRACE
90 FT_SetTraceLevel( FT_Trace component,
93 if ( component >= trace_max )
96 /* if component is `trace_any', change _all_ levels at once */
97 if ( component == trace_any )
102 for ( n = trace_any; n < trace_max; n++ )
103 ft_trace_levels[n] = level;
105 else /* otherwise, only change individual component */
106 ft_trace_levels[component] = level;
109 #endif /* FT_DEBUG_LEVEL_TRACE */
111 #endif /* FT_DEBUG_LEVEL_TRACE || FT_DEBUG_LEVEL_ERROR */
114 /* ANSI C doesn't allow empty files, so we insert a dummy symbol */
115 extern const int ft_debug_dummy;