modules/freetype2/include/ftmoderr.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/modules/freetype2/include/ftmoderr.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,194 @@
     1.4 +/***************************************************************************/
     1.5 +/*                                                                         */
     1.6 +/*  ftmoderr.h                                                             */
     1.7 +/*                                                                         */
     1.8 +/*    FreeType module error offsets (specification).                       */
     1.9 +/*                                                                         */
    1.10 +/*  Copyright 2001-2005, 2010, 2013 by                                     */
    1.11 +/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
    1.12 +/*                                                                         */
    1.13 +/*  This file is part of the FreeType project, and may only be used,       */
    1.14 +/*  modified, and distributed under the terms of the FreeType project      */
    1.15 +/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
    1.16 +/*  this file you indicate that you have read the license and              */
    1.17 +/*  understand and accept it fully.                                        */
    1.18 +/*                                                                         */
    1.19 +/***************************************************************************/
    1.20 +
    1.21 +
    1.22 +  /*************************************************************************/
    1.23 +  /*                                                                       */
    1.24 +  /* This file is used to define the FreeType module error codes.          */
    1.25 +  /*                                                                       */
    1.26 +  /* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is    */
    1.27 +  /* set, the lower byte of an error value identifies the error code as    */
    1.28 +  /* usual.  In addition, the higher byte identifies the module.  For      */
    1.29 +  /* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */
    1.30 +  /* error `TT_Err_Invalid_File_Format' has value 0x1303, the error        */
    1.31 +  /* `T1_Err_Invalid_File_Format' has value 0x1403, etc.                   */
    1.32 +  /*                                                                       */
    1.33 +  /* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero,    */
    1.34 +  /* including the high byte.                                              */
    1.35 +  /*                                                                       */
    1.36 +  /* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of   */
    1.37 +  /* an error value is set to zero.                                        */
    1.38 +  /*                                                                       */
    1.39 +  /* To hide the various `XXX_Err_' prefixes in the source code, FreeType  */
    1.40 +  /* provides some macros in `fttypes.h'.                                  */
    1.41 +  /*                                                                       */
    1.42 +  /*   FT_ERR( err )                                                       */
    1.43 +  /*     Add current error module prefix (as defined with the              */
    1.44 +  /*     `FT_ERR_PREFIX' macro) to `err'.  For example, in the BDF module  */
    1.45 +  /*     the line                                                          */
    1.46 +  /*                                                                       */
    1.47 +  /*       error = FT_ERR( Invalid_Outline );                              */
    1.48 +  /*                                                                       */
    1.49 +  /*     expands to                                                        */
    1.50 +  /*                                                                       */
    1.51 +  /*       error = BDF_Err_Invalid_Outline;                                */
    1.52 +  /*                                                                       */
    1.53 +  /*     For simplicity, you can always use `FT_Err_Ok' directly instead   */
    1.54 +  /*     of `FT_ERR( Ok )'.                                                */
    1.55 +  /*                                                                       */
    1.56 +  /*   FT_ERR_EQ( errcode, err )                                           */
    1.57 +  /*   FT_ERR_NEQ( errcode, err )                                          */
    1.58 +  /*     Compare error code `errcode' with the error `err' for equality    */
    1.59 +  /*     and inequality, respectively.  Example:                           */
    1.60 +  /*                                                                       */
    1.61 +  /*       if ( FT_ERR_EQ( error, Invalid_Outline ) )                      */
    1.62 +  /*         ...                                                           */
    1.63 +  /*                                                                       */
    1.64 +  /*     Using this macro you don't have to think about error prefixes.    */
    1.65 +  /*     Of course, if module errors are not active, the above example is  */
    1.66 +  /*     the same as                                                       */
    1.67 +  /*                                                                       */
    1.68 +  /*       if ( error == FT_Err_Invalid_Outline )                          */
    1.69 +  /*         ...                                                           */
    1.70 +  /*                                                                       */
    1.71 +  /*   FT_ERROR_BASE( errcode )                                            */
    1.72 +  /*   FT_ERROR_MODULE( errcode )                                          */
    1.73 +  /*     Get base error and module error code, respectively.               */
    1.74 +  /*                                                                       */
    1.75 +  /*                                                                       */
    1.76 +  /* It can also be used to create a module error message table easily     */
    1.77 +  /* with something like                                                   */
    1.78 +  /*                                                                       */
    1.79 +  /*   {                                                                   */
    1.80 +  /*     #undef __FTMODERR_H__                                             */
    1.81 +  /*     #define FT_MODERRDEF( e, v, s )  { FT_Mod_Err_ ## e, s },         */
    1.82 +  /*     #define FT_MODERR_START_LIST     {                                */
    1.83 +  /*     #define FT_MODERR_END_LIST       { 0, 0 } };                      */
    1.84 +  /*                                                                       */
    1.85 +  /*     const struct                                                      */
    1.86 +  /*     {                                                                 */
    1.87 +  /*       int          mod_err_offset;                                    */
    1.88 +  /*       const char*  mod_err_msg                                        */
    1.89 +  /*     } ft_mod_errors[] =                                               */
    1.90 +  /*                                                                       */
    1.91 +  /*     #include FT_MODULE_ERRORS_H                                       */
    1.92 +  /*   }                                                                   */
    1.93 +  /*                                                                       */
    1.94 +  /*************************************************************************/
    1.95 +
    1.96 +
    1.97 +#ifndef __FTMODERR_H__
    1.98 +#define __FTMODERR_H__
    1.99 +
   1.100 +
   1.101 +  /*******************************************************************/
   1.102 +  /*******************************************************************/
   1.103 +  /*****                                                         *****/
   1.104 +  /*****                       SETUP MACROS                      *****/
   1.105 +  /*****                                                         *****/
   1.106 +  /*******************************************************************/
   1.107 +  /*******************************************************************/
   1.108 +
   1.109 +
   1.110 +#undef  FT_NEED_EXTERN_C
   1.111 +
   1.112 +#ifndef FT_MODERRDEF
   1.113 +
   1.114 +#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
   1.115 +#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = v,
   1.116 +#else
   1.117 +#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = 0,
   1.118 +#endif
   1.119 +
   1.120 +#define FT_MODERR_START_LIST  enum {
   1.121 +#define FT_MODERR_END_LIST    FT_Mod_Err_Max };
   1.122 +
   1.123 +#ifdef __cplusplus
   1.124 +#define FT_NEED_EXTERN_C
   1.125 +  extern "C" {
   1.126 +#endif
   1.127 +
   1.128 +#endif /* !FT_MODERRDEF */
   1.129 +
   1.130 +
   1.131 +  /*******************************************************************/
   1.132 +  /*******************************************************************/
   1.133 +  /*****                                                         *****/
   1.134 +  /*****               LIST MODULE ERROR BASES                   *****/
   1.135 +  /*****                                                         *****/
   1.136 +  /*******************************************************************/
   1.137 +  /*******************************************************************/
   1.138 +
   1.139 +
   1.140 +#ifdef FT_MODERR_START_LIST
   1.141 +  FT_MODERR_START_LIST
   1.142 +#endif
   1.143 +
   1.144 +
   1.145 +  FT_MODERRDEF( Base,      0x000, "base module" )
   1.146 +  FT_MODERRDEF( Autofit,   0x100, "autofitter module" )
   1.147 +  FT_MODERRDEF( BDF,       0x200, "BDF module" )
   1.148 +  FT_MODERRDEF( Bzip2,     0x300, "Bzip2 module" )
   1.149 +  FT_MODERRDEF( Cache,     0x400, "cache module" )
   1.150 +  FT_MODERRDEF( CFF,       0x500, "CFF module" )
   1.151 +  FT_MODERRDEF( CID,       0x600, "CID module" )
   1.152 +  FT_MODERRDEF( Gzip,      0x700, "Gzip module" )
   1.153 +  FT_MODERRDEF( LZW,       0x800, "LZW module" )
   1.154 +  FT_MODERRDEF( OTvalid,   0x900, "OpenType validation module" )
   1.155 +  FT_MODERRDEF( PCF,       0xA00, "PCF module" )
   1.156 +  FT_MODERRDEF( PFR,       0xB00, "PFR module" )
   1.157 +  FT_MODERRDEF( PSaux,     0xC00, "PS auxiliary module" )
   1.158 +  FT_MODERRDEF( PShinter,  0xD00, "PS hinter module" )
   1.159 +  FT_MODERRDEF( PSnames,   0xE00, "PS names module" )
   1.160 +  FT_MODERRDEF( Raster,    0xF00, "raster module" )
   1.161 +  FT_MODERRDEF( SFNT,     0x1000, "SFNT module" )
   1.162 +  FT_MODERRDEF( Smooth,   0x1100, "smooth raster module" )
   1.163 +  FT_MODERRDEF( TrueType, 0x1200, "TrueType module" )
   1.164 +  FT_MODERRDEF( Type1,    0x1300, "Type 1 module" )
   1.165 +  FT_MODERRDEF( Type42,   0x1400, "Type 42 module" )
   1.166 +  FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
   1.167 +  FT_MODERRDEF( GXvalid,  0x1600, "GX validation module" )
   1.168 +
   1.169 +
   1.170 +#ifdef FT_MODERR_END_LIST
   1.171 +  FT_MODERR_END_LIST
   1.172 +#endif
   1.173 +
   1.174 +
   1.175 +  /*******************************************************************/
   1.176 +  /*******************************************************************/
   1.177 +  /*****                                                         *****/
   1.178 +  /*****                      CLEANUP                            *****/
   1.179 +  /*****                                                         *****/
   1.180 +  /*******************************************************************/
   1.181 +  /*******************************************************************/
   1.182 +
   1.183 +
   1.184 +#ifdef FT_NEED_EXTERN_C
   1.185 +  }
   1.186 +#endif
   1.187 +
   1.188 +#undef FT_MODERR_START_LIST
   1.189 +#undef FT_MODERR_END_LIST
   1.190 +#undef FT_MODERRDEF
   1.191 +#undef FT_NEED_EXTERN_C
   1.192 +
   1.193 +
   1.194 +#endif /* __FTMODERR_H__ */
   1.195 +
   1.196 +
   1.197 +/* END */

mercurial