1 /***************************************************************************/
5 /* FreeType module error offsets (specification). */
7 /* Copyright 2001, 2002, 2003, 2004, 2005, 2010 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 file is used to define the FreeType module error offsets. */
23 /* The lower byte gives the error code, the higher byte gives the */
24 /* module. The base module has error offset 0. For example, the error */
25 /* `FT_Err_Invalid_File_Format' has value 0x003, the error */
26 /* `TT_Err_Invalid_File_Format' has value 0x1103, the error */
27 /* `T1_Err_Invalid_File_Format' has value 0x1203, etc. */
29 /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */
30 /* to make the higher byte always zero (disabling the module error */
33 /* It can also be used to create a module error message table easily */
34 /* with something like */
37 /* #undef __FTMODERR_H__ */
38 /* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
39 /* #define FT_MODERR_START_LIST { */
40 /* #define FT_MODERR_END_LIST { 0, 0 } }; */
44 /* int mod_err_offset; */
45 /* const char* mod_err_msg */
46 /* } ft_mod_errors[] = */
48 /* #include FT_MODULE_ERRORS_H */
51 /* To use such a table, all errors must be ANDed with 0xFF00 to remove */
54 /*************************************************************************/
57 #ifndef __FTMODERR_H__
58 #define __FTMODERR_H__
61 /*******************************************************************/
62 /*******************************************************************/
64 /***** SETUP MACROS *****/
66 /*******************************************************************/
67 /*******************************************************************/
70 #undef FT_NEED_EXTERN_C
74 #ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
75 #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v,
77 #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0,
80 #define FT_MODERR_START_LIST enum {
81 #define FT_MODERR_END_LIST FT_Mod_Err_Max };
84 #define FT_NEED_EXTERN_C
88 #endif /* !FT_MODERRDEF */
91 /*******************************************************************/
92 /*******************************************************************/
94 /***** LIST MODULE ERROR BASES *****/
96 /*******************************************************************/
97 /*******************************************************************/
100 #ifdef FT_MODERR_START_LIST
105 FT_MODERRDEF( Base, 0x000, "base module" )
106 FT_MODERRDEF( Autofit, 0x100, "autofitter module" )
107 FT_MODERRDEF( BDF, 0x200, "BDF module" )
108 FT_MODERRDEF( Bzip2, 0x300, "Bzip2 module" )
109 FT_MODERRDEF( Cache, 0x400, "cache module" )
110 FT_MODERRDEF( CFF, 0x500, "CFF module" )
111 FT_MODERRDEF( CID, 0x600, "CID module" )
112 FT_MODERRDEF( Gzip, 0x700, "Gzip module" )
113 FT_MODERRDEF( LZW, 0x800, "LZW module" )
114 FT_MODERRDEF( OTvalid, 0x900, "OpenType validation module" )
115 FT_MODERRDEF( PCF, 0xA00, "PCF module" )
116 FT_MODERRDEF( PFR, 0xB00, "PFR module" )
117 FT_MODERRDEF( PSaux, 0xC00, "PS auxiliary module" )
118 FT_MODERRDEF( PShinter, 0xD00, "PS hinter module" )
119 FT_MODERRDEF( PSnames, 0xE00, "PS names module" )
120 FT_MODERRDEF( Raster, 0xF00, "raster module" )
121 FT_MODERRDEF( SFNT, 0x1000, "SFNT module" )
122 FT_MODERRDEF( Smooth, 0x1100, "smooth raster module" )
123 FT_MODERRDEF( TrueType, 0x1200, "TrueType module" )
124 FT_MODERRDEF( Type1, 0x1300, "Type 1 module" )
125 FT_MODERRDEF( Type42, 0x1400, "Type 42 module" )
126 FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
129 #ifdef FT_MODERR_END_LIST
134 /*******************************************************************/
135 /*******************************************************************/
137 /***** CLEANUP *****/
139 /*******************************************************************/
140 /*******************************************************************/
143 #ifdef FT_NEED_EXTERN_C
147 #undef FT_MODERR_START_LIST
148 #undef FT_MODERR_END_LIST
150 #undef FT_NEED_EXTERN_C
153 #endif /* __FTMODERR_H__ */