00001 /***************************************************************************/ 00002 /* */ 00003 /* ftmoderr.h */ 00004 /* */ 00005 /* FreeType module error offsets (specification). */ 00006 /* */ 00007 /* Copyright 2001, 2002, 2003, 2004, 2005 by */ 00008 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ 00009 /* */ 00010 /* This file is part of the FreeType project, and may only be used, */ 00011 /* modified, and distributed under the terms of the FreeType project */ 00012 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 00013 /* this file you indicate that you have read the license and */ 00014 /* understand and accept it fully. */ 00015 /* */ 00016 /***************************************************************************/ 00017 00018 00019 /*************************************************************************/ 00020 /* */ 00021 /* This file is used to define the FreeType module error offsets. */ 00022 /* */ 00023 /* The lower byte gives the error code, the higher byte gives the */ 00024 /* module. The base module has error offset 0. For example, the error */ 00025 /* `FT_Err_Invalid_File_Format' has value 0x003, the error */ 00026 /* `TT_Err_Invalid_File_Format' has value 0x1103, the error */ 00027 /* `T1_Err_Invalid_File_Format' has value 0x1203, etc. */ 00028 /* */ 00029 /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */ 00030 /* to make the higher byte always zero (disabling the module error */ 00031 /* mechanism). */ 00032 /* */ 00033 /* It can also be used to create a module error message table easily */ 00034 /* with something like */ 00035 /* */ 00036 /* { */ 00037 /* #undef __FTMODERR_H__ */ 00038 /* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */ 00039 /* #define FT_MODERR_START_LIST { */ 00040 /* #define FT_MODERR_END_LIST { 0, 0 } }; */ 00041 /* */ 00042 /* const struct */ 00043 /* { */ 00044 /* int mod_err_offset; */ 00045 /* const char* mod_err_msg */ 00046 /* } ft_mod_errors[] = */ 00047 /* */ 00048 /* #include FT_MODULE_ERRORS_H */ 00049 /* } */ 00050 /* */ 00051 /* To use such a table, all errors must be ANDed with 0xFF00 to remove */ 00052 /* the error code. */ 00053 /* */ 00054 /*************************************************************************/ 00055 00056 00057 #ifndef __FTMODERR_H__ 00058 #define __FTMODERR_H__ 00059 00060 00061 /*******************************************************************/ 00062 /*******************************************************************/ 00063 /***** *****/ 00064 /***** SETUP MACROS *****/ 00065 /***** *****/ 00066 /*******************************************************************/ 00067 /*******************************************************************/ 00068 00069 00070 #undef FT_NEED_EXTERN_C 00071 00072 #ifndef FT_MODERRDEF 00073 00074 #ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS 00075 #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v, 00076 #else 00077 #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0, 00078 #endif 00079 00080 #define FT_MODERR_START_LIST enum { 00081 #define FT_MODERR_END_LIST FT_Mod_Err_Max }; 00082 00083 #ifdef __cplusplus 00084 #define FT_NEED_EXTERN_C 00085 extern "C" { 00086 #endif 00087 00088 #endif /* !FT_MODERRDEF */ 00089 00090 00091 /*******************************************************************/ 00092 /*******************************************************************/ 00093 /***** *****/ 00094 /***** LIST MODULE ERROR BASES *****/ 00095 /***** *****/ 00096 /*******************************************************************/ 00097 /*******************************************************************/ 00098 00099 00100 #ifdef FT_MODERR_START_LIST 00101 FT_MODERR_START_LIST 00102 #endif 00103 00104 00105 FT_MODERRDEF( Base, 0x000, "base module" ) 00106 FT_MODERRDEF( Autofit, 0x100, "autofitter module" ) 00107 FT_MODERRDEF( BDF, 0x200, "BDF module" ) 00108 FT_MODERRDEF( Cache, 0x300, "cache module" ) 00109 FT_MODERRDEF( CFF, 0x400, "CFF module" ) 00110 FT_MODERRDEF( CID, 0x500, "CID module" ) 00111 FT_MODERRDEF( Gzip, 0x600, "Gzip module" ) 00112 FT_MODERRDEF( LZW, 0x700, "LZW module" ) 00113 FT_MODERRDEF( OTvalid, 0x800, "OpenType validation module" ) 00114 FT_MODERRDEF( PCF, 0x900, "PCF module" ) 00115 FT_MODERRDEF( PFR, 0xA00, "PFR module" ) 00116 FT_MODERRDEF( PSaux, 0xB00, "PS auxiliary module" ) 00117 FT_MODERRDEF( PShinter, 0xC00, "PS hinter module" ) 00118 FT_MODERRDEF( PSnames, 0xD00, "PS names module" ) 00119 FT_MODERRDEF( Raster, 0xE00, "raster module" ) 00120 FT_MODERRDEF( SFNT, 0xF00, "SFNT module" ) 00121 FT_MODERRDEF( Smooth, 0x1000, "smooth raster module" ) 00122 FT_MODERRDEF( TrueType, 0x1100, "TrueType module" ) 00123 FT_MODERRDEF( Type1, 0x1200, "Type 1 module" ) 00124 FT_MODERRDEF( Type42, 0x1300, "Type 42 module" ) 00125 FT_MODERRDEF( Winfonts, 0x1400, "Windows FON/FNT module" ) 00126 00127 00128 #ifdef FT_MODERR_END_LIST 00129 FT_MODERR_END_LIST 00130 #endif 00131 00132 00133 /*******************************************************************/ 00134 /*******************************************************************/ 00135 /***** *****/ 00136 /***** CLEANUP *****/ 00137 /***** *****/ 00138 /*******************************************************************/ 00139 /*******************************************************************/ 00140 00141 00142 #ifdef FT_NEED_EXTERN_C 00143 } 00144 #endif 00145 00146 #undef FT_MODERR_START_LIST 00147 #undef FT_MODERR_END_LIST 00148 #undef FT_MODERRDEF 00149 #undef FT_NEED_EXTERN_C 00150 00151 00152 #endif /* __FTMODERR_H__ */ 00153 00154 00155 /* END */