misc/libfreetype/builds/amiga/src/base/ftdebug.c
author koda
Mon, 25 Apr 2011 01:46:54 +0200
changeset 5172 88f2e05288ba
permissions -rw-r--r--
aaand let's add freetype as well while we are at it other smaller changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5172
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     1
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     2
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     3
/*  ftdebug.c                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     4
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     5
/*    Debugging and logging component (body).                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     6
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     7
/*  Copyright 1996-2001, 2002, 2004, 2005 by                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*  David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner.       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     9
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    10
/*  This file is part of the FreeType project, and may only be used,       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    11
/*  modified, and distributed under the terms of the FreeType project      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    12
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    13
/*  this file you indicate that you have read the license and              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    14
/*  understand and accept it fully.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    15
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    16
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    17
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    18
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    19
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
  /* This component contains various macros and functions used to ease the */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
  /* debugging of the FreeType engine.  Its main purpose is in assertion   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
  /* checking, tracing, and error detection.                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
  /* There are now three debugging modes:                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
  /* - trace mode                                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    29
  /*   Error and trace messages are sent to the log file (which can be the */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
  /*   standard error output).                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
  /* - error mode                                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
  /*   Only error messages are generated.                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
  /* - release mode:                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
  /*   No error message is sent or generated.  The code is free from any   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
  /*   debugging parts.                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
/*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
 * Based on the default ftdebug.c,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
 * replaced vprintf() with KVPrintF(),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
 * commented out exit(),
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
 * replaced getenv() with GetVar().
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
#include <exec/types.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
#include <utility/tagitem.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
#include <dos/exall.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
#include <dos/var.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
#define __NOLIBBASE__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
#define __NOLOBALIFACE__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
#define __USE_INLINE__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
#include <proto/dos.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
#include <clib/debug_protos.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
#ifndef __amigaos4__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
extern struct Library *DOSBase;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
extern struct DOSIFace *IDOS;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
#include <ft2build.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
#include FT_FREETYPE_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
#include FT_INTERNAL_DEBUG_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
#if defined( FT_DEBUG_LEVEL_ERROR )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
  /* documentation is in ftdebug.h */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
  FT_BASE_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
  FT_Message( const char*  fmt, ... )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
    va_list  ap;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
    va_start( ap, fmt );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
/*  vprintf( fmt, ap ); */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
    KVPrintF( fmt, ap );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
    va_end( ap );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
  /* documentation is in ftdebug.h */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
  FT_BASE_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
  FT_Panic( const char*  fmt, ... )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
    va_list  ap;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
    va_start( ap, fmt );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
/*  vprintf( fmt, ap ); */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
    KVPrintF( fmt, ap );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
    va_end( ap );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
/*  exit( EXIT_FAILURE ); */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
#endif /* FT_DEBUG_LEVEL_ERROR */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
#ifdef FT_DEBUG_LEVEL_TRACE
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
  /* array of trace levels, initialized to 0 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
  int  ft_trace_levels[trace_count];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
  /* define array of trace toggle names */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
#define FT_TRACE_DEF( x )  #x ,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
  static const char*  ft_trace_toggles[trace_count + 1] =
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
#include FT_INTERNAL_TRACE_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
    NULL
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
#undef FT_TRACE_DEF
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   128
  /* documentation is in ftdebug.h */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   129
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
  FT_BASE_DEF( FT_Int )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
  FT_Trace_Get_Count( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   133
    return trace_count;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   134
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   135
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   136
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   137
  /* documentation is in ftdebug.h */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   138
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   139
  FT_BASE_DEF( const char * )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   140
  FT_Trace_Get_Name( FT_Int  idx )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   141
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   142
    int  max = FT_Trace_Get_Count();
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   143
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   144
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   145
    if ( idx < max )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   146
      return ft_trace_toggles[idx];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   148
      return NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   149
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   151
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   152
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   154
  /* Initialize the tracing sub-system.  This is done by retrieving the    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   155
  /* value of the `FT2_DEBUG' environment variable.  It must be a list of  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
  /* toggles, separated by spaces, `;', or `,'.  Example:                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   157
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   158
  /*    export FT2_DEBUG="any:3 memory:7 stream:5"                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
  /* This requests that all levels be set to 3, except the trace level for */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
  /* the memory and stream components which are set to 7 and 5,            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   162
  /* respectively.                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   163
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
  /* See the file <include/freetype/internal/fttrace.h> for details of the */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
  /* available toggle names.                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   167
  /* The level must be between 0 and 7; 0 means quiet (except for serious  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
  /* runtime errors), and 7 means _very_ verbose.                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   169
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   170
  FT_BASE_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   171
  ft_debug_init( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   172
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   173
/*  const char*  ft2_debug = getenv( "FT2_DEBUG" ); */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   174
    char         buf[256];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   175
    const char*  ft2_debug = &buf[0];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   178
/*  if ( ft2_debug ) */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   179
    if ( GetVar( "FT2_DEBUG", (STRPTR)ft2_debug, 256, LV_VAR ) > 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
      const char*  p = ft2_debug;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
      const char*  q;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   183
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   184
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
      for ( ; *p; p++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   186
      {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   187
        /* skip leading whitespace and separators */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   188
        if ( *p == ' ' || *p == '\t' || *p == ',' || *p == ';' || *p == '=' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   189
          continue;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   190
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   191
        /* read toggle name, followed by ':' */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   192
        q = p;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   193
        while ( *p && *p != ':' )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   194
          p++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   195
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   196
        if ( *p == ':' && p > q )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   197
        {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   198
          FT_Int  n, i, len = (FT_Int)( p - q );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   199
          FT_Int  level = -1, found = -1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   200
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   201
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   202
          for ( n = 0; n < trace_count; n++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   203
          {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   204
            const char*  toggle = ft_trace_toggles[n];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   207
            for ( i = 0; i < len; i++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   208
            {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   209
              if ( toggle[i] != q[i] )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   210
                break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   211
            }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   212
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   213
            if ( i == len && toggle[i] == 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   214
            {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   215
              found = n;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   216
              break;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   217
            }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   218
          }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   219
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   220
          /* read level */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   221
          p++;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   222
          if ( *p )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   223
          {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   224
            level = *p++ - '0';
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   225
            if ( level < 0 || level > 7 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   226
              level = -1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   227
          }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   228
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   229
          if ( found >= 0 && level >= 0 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   230
          {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   231
            if ( found == trace_any )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   232
            {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   233
              /* special case for `any' */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   234
              for ( n = 0; n < trace_count; n++ )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   235
                ft_trace_levels[n] = level;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   236
            }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   237
            else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   238
              ft_trace_levels[found] = level;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   239
          }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   240
        }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   241
      }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   242
    }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   243
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   244
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   245
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   246
#else  /* !FT_DEBUG_LEVEL_TRACE */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   247
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   248
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   249
  FT_BASE_DEF( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   250
  ft_debug_init( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   251
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   252
    /* nothing */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   253
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   254
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   255
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   256
  FT_BASE_DEF( FT_Int )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   257
  FT_Trace_Get_Count( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   258
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   259
    return 0;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   260
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   261
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   262
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   263
  FT_BASE_DEF( const char * )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   264
  FT_Trace_Get_Name( FT_Int  idx )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   265
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   266
    FT_UNUSED( idx );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   267
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   268
    return NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   269
  }
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   270
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   271
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   272
#endif /* !FT_DEBUG_LEVEL_TRACE */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   273
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   274
/*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   275
Local Variables:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   276
coding: latin-1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   277
End:
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   278
*/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   279
/* END */