]>
git.saurik.com Git - wxWidgets.git/blob - src/freetype/base/ftdebug.c
1 /***************************************************************************/
5 /* Debugging and logging component (body). */
7 /* Copyright 1996-2000 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 /*************************************************************************/
44 #include <freetype/internal/ftdebug.h>
46 #ifdef FT_DEBUG_LEVEL_TRACE
47 char ft_trace_levels
[trace_max
];
51 #if defined( FT_DEBUG_LEVEL_ERROR ) || defined( FT_DEBUG_LEVEL_TRACE )
59 FT_EXPORT_FUNC( void ) FT_Message( const char* fmt
, ... )
70 FT_EXPORT_FUNC( void ) FT_Panic( const char* fmt
, ... )
83 #ifdef FT_DEBUG_LEVEL_TRACE
86 /*************************************************************************/
89 /* FT_SetTraceLevel */
92 /* Sets the trace level for debugging. */
95 /* component :: The component which should be traced. See ftdebug.h */
96 /* for a complete list. If set to `trace_any', all */
97 /* components will be traced. */
98 /* level :: The tracing level. */
100 FT_EXPORT_FUNC( void ) FT_SetTraceLevel( FT_Trace component
,
103 if ( component
>= trace_max
)
106 /* if component is `trace_any', change _all_ levels at once */
107 if ( component
== trace_any
)
112 for ( n
= trace_any
; n
< trace_max
; n
++ )
113 ft_trace_levels
[n
] = level
;
115 else /* otherwise, only change individual component */
116 ft_trace_levels
[component
] = level
;
119 #endif /* FT_DEBUG_LEVEL_TRACE */
121 #endif /* FT_DEBUG_LEVEL_TRACE || FT_DEBUG_LEVEL_ERROR */