The BIG graph update
[rrdtool.git] / libraries / freetype-2.0.5 / include / freetype / fterrors.h
1 /***************************************************************************/
2 /*                                                                         */
3 /*  fterrors.h                                                             */
4 /*                                                                         */
5 /*    FreeType error codes (specification).                                */
6 /*                                                                         */
7 /*  Copyright 1996-2001 by                                                 */
8 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
9 /*                                                                         */
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.                                        */
15 /*                                                                         */
16 /***************************************************************************/
17
18
19   /*************************************************************************/
20   /*                                                                       */
21   /* This special header file is used to define the FT2 enumeration        */
22   /* constants.  It can also be used to generate error message strings     */
23   /* with a small macro trick explained below.                             */
24   /*                                                                       */
25   /* I - Error Formats                                                     */
26   /* -----------------                                                     */
27   /*                                                                       */
28   /*   Since release 2.1, the error constants have changed.  The lower     */
29   /*   byte of the error value gives the "generic" error code, while the   */
30   /*   higher byte indicates in which module the error occured.            */
31   /*                                                                       */
32   /*   You can use the macro FT_ERROR_BASE(x) macro to extract the generic */
33   /*   error code from an FT_Error value.                                  */
34   /*                                                                       */
35   /*   The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be   */
36   /*   undefined in ftoption.h in order to make the higher byte always     */
37   /*   zero, in case you need to be compatible with previous versions of   */
38   /*   FreeType 2.                                                         */
39   /*                                                                       */
40   /*                                                                       */
41   /* II - Error Message strings                                            */
42   /* --------------------------                                            */
43   /*                                                                       */
44   /*   The error definitions below are made through special macros that    */
45   /*   allow client applications to build a table of error message strings */
46   /*   if they need it.  The strings are not included in a normal build of */
47   /*   FreeType 2 to save space (most client applications do not use       */
48   /*   them).                                                              */
49   /*                                                                       */
50   /*   To do so, you have to define the following macros before including  */
51   /*   this file:                                                          */
52   /*                                                                       */
53   /*   FT_ERROR_START_LIST ::                                              */
54   /*     This macro is called before anything else to define the start of  */
55   /*     the error list.  It is followed by several FT_ERROR_DEF calls     */
56   /*     (see below).                                                      */
57   /*                                                                       */
58   /*   FT_ERROR_DEF( e, v, s ) ::                                          */
59   /*     This macro is called to define one single error.                  */
60   /*     `e' is the error code identifier (e.g. FT_Err_Invalid_Argument).  */
61   /*     `v' is the error numerical value.                                 */
62   /*     `s' is the corresponding error string.                            */
63   /*                                                                       */
64   /*   FT_ERROR_END_LIST ::                                                */
65   /*     This macro ends the list.                                         */
66   /*                                                                       */
67   /*   Additionally, you have to undefine __FTERRORS_H__ before #including */
68   /*   this file.                                                          */
69   /*                                                                       */
70   /*   Here is a simple example:                                           */
71   /*                                                                       */
72   /*     {                                                                 */
73   /*       #undef __FTERRORS_H__                                           */
74   /*       #define FT_ERRORDEF( e, v, s )   { e, s },                      */
75   /*       #define FT_ERROR_START_LIST      {                              */
76   /*       #define FT_ERROR_END_LIST        { 0, 0 } };                    */
77   /*                                                                       */
78   /*       const struct                                                    */
79   /*       {                                                               */
80   /*         int          err_code;                                        */
81   /*         const char*  err_msg                                          */
82   /*       } ft_errors[] =                                                 */
83   /*                                                                       */
84   /*       #include FT_ERRORS_H                                            */
85   /*     }                                                                 */
86   /*                                                                       */
87   /*************************************************************************/
88
89
90 #ifndef __FTERRORS_H__
91 #define __FTERRORS_H__
92
93
94   /* include module base error codes */
95 #include FT_MODULE_ERRORS_H
96
97
98   /*******************************************************************/
99   /*******************************************************************/
100   /*****                                                         *****/
101   /*****                       SETUP MACROS                      *****/
102   /*****                                                         *****/
103   /*******************************************************************/
104   /*******************************************************************/
105
106
107 #undef  FT_NEED_EXTERN_C
108 #define FT_ERR_XCAT( x, y )  x ## y
109 #define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )
110
111
112   /* FT_ERR_PREFIX is used as a prefix for error identifiers. */
113   /* By default, we use `FT_Err_'.                            */
114   /*                                                          */
115 #ifndef FT_ERR_PREFIX
116 #define FT_ERR_PREFIX  FT_Err_
117 #endif
118
119
120   /* FT_ERR_BASE is used as the base for module-specific errors. */
121   /*                                                             */
122 #ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
123
124 #ifndef FT_ERR_BASE
125 #define FT_ERR_BASE  FT_Mod_Err_Base
126 #endif
127
128 #else
129
130 #undef FT_ERR_BASE
131 #define FT_ERR_BASE  0
132
133 #endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */
134
135
136   /* If FT_ERRORDEF is not defined, we need to define a simple */
137   /* enumeration type.                                         */
138   /*                                                           */
139 #ifndef FT_ERRORDEF
140
141 #define FT_ERRORDEF( e, v, s )  e = v,
142 #define FT_ERROR_START_LIST     enum {
143 #define FT_ERROR_END_LIST       FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
144
145 #ifdef __cplusplus
146 #define FT_NEED_EXTERN_C
147   extern "C" {
148 #endif
149
150 #endif /* !FT_ERRORDEF */
151
152
153   /* this macro is used to define an error */
154 #define FT_ERRORDEF_( e, v, s )   \
155           FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
156
157   /* this is only used for FT_Err_Ok, which must be 0! */
158 #define FT_NOERRORDEF_( e, v, s ) \
159           FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
160
161
162   /*******************************************************************/
163   /*******************************************************************/
164   /*****                                                         *****/
165   /*****                LIST OF ERROR CODES/MESSAGES             *****/
166   /*****                                                         *****/
167   /*******************************************************************/
168   /*******************************************************************/
169
170
171 #ifdef FT_ERROR_START_LIST
172   FT_ERROR_START_LIST
173 #endif
174
175
176   /* generic errors */
177
178   FT_NOERRORDEF_( Ok,                                        0x00, \
179                   "no error" )
180
181   FT_ERRORDEF_( Cannot_Open_Resource,                        0x01, \
182                "cannot open resource" )
183   FT_ERRORDEF_( Unknown_File_Format,                         0x02, \
184                "unknown file format" )
185   FT_ERRORDEF_( Invalid_File_Format,                         0x03, \
186                "broken file" )
187   FT_ERRORDEF_( Invalid_Version,                             0x04, \
188                "invalid FreeType version" )
189   FT_ERRORDEF_( Lower_Module_Version,                        0x05, \
190                "module version is too low" )
191   FT_ERRORDEF_( Invalid_Argument,                            0x06, \
192                "invalid argument" )
193   FT_ERRORDEF_( Unimplemented_Feature,                       0x07, \
194                "unimplemented feature" )
195
196   /* glyph/character errors */
197
198   FT_ERRORDEF_( Invalid_Glyph_Index,                         0x10, \
199                "invalid glyph index" )
200   FT_ERRORDEF_( Invalid_Character_Code,                      0x11, \
201                "invalid character code" )
202   FT_ERRORDEF_( Invalid_Glyph_Format,                        0x12, \
203                "unsupported glyph image format" )
204   FT_ERRORDEF_( Cannot_Render_Glyph,                         0x13, \
205                "cannot render this glyph format" )
206   FT_ERRORDEF_( Invalid_Outline,                             0x14, \
207                "invalid outline" )
208   FT_ERRORDEF_( Invalid_Composite,                           0x15, \
209                "invalid composite glyph" )
210   FT_ERRORDEF_( Too_Many_Hints,                              0x16, \
211                "too many hints" )
212   FT_ERRORDEF_( Invalid_Pixel_Size,                          0x17, \
213                "invalid pixel size" )
214
215   /* handle errors */
216
217   FT_ERRORDEF_( Invalid_Handle,                              0x20, \
218                "invalid object handle" )
219   FT_ERRORDEF_( Invalid_Library_Handle,                      0x21, \
220                "invalid library handle" )
221   FT_ERRORDEF_( Invalid_Driver_Handle,                       0x22, \
222                "invalid module handle" )
223   FT_ERRORDEF_( Invalid_Face_Handle,                         0x23, \
224                "invalid face handle" )
225   FT_ERRORDEF_( Invalid_Size_Handle,                         0x24, \
226                "invalid size handle" )
227   FT_ERRORDEF_( Invalid_Slot_Handle,                         0x25, \
228                "invalid glyph slot handle" )
229   FT_ERRORDEF_( Invalid_CharMap_Handle,                      0x26, \
230                "invalid charmap handle" )
231   FT_ERRORDEF_( Invalid_Cache_Handle,                        0x27, \
232                "invalid cache manager handle" )
233   FT_ERRORDEF_( Invalid_Stream_Handle,                       0x28, \
234                "invalid stream handle" )
235
236   /* driver errors */
237
238   FT_ERRORDEF_( Too_Many_Drivers,                            0x30, \
239                "too many modules" )
240   FT_ERRORDEF_( Too_Many_Extensions,                         0x31, \
241                "too many extensions" )
242
243   /* memory errors */
244
245   FT_ERRORDEF_( Out_Of_Memory,                               0x40, \
246                "out of memory" )
247   FT_ERRORDEF_( Unlisted_Object,                             0x41, \
248                "unlisted object" )
249
250   /* stream errors */
251
252   FT_ERRORDEF_( Cannot_Open_Stream,                          0x51, \
253                "cannot open stream" )
254   FT_ERRORDEF_( Invalid_Stream_Seek,                         0x52, \
255                "invalid stream seek" )
256   FT_ERRORDEF_( Invalid_Stream_Skip,                         0x53, \
257                "invalid stream skip" )
258   FT_ERRORDEF_( Invalid_Stream_Read,                         0x54, \
259                "invalid stream read" )
260   FT_ERRORDEF_( Invalid_Stream_Operation,                    0x55, \
261                "invalid stream operation" )
262   FT_ERRORDEF_( Invalid_Frame_Operation,                     0x56, \
263                "invalid frame operation" )
264   FT_ERRORDEF_( Nested_Frame_Access,                         0x57, \
265                "nested frame access" )
266   FT_ERRORDEF_( Invalid_Frame_Read,                          0x58, \
267                "invalid frame read" )
268
269   /* raster errors */
270
271   FT_ERRORDEF_( Raster_Uninitialized,                        0x60, \
272                "raster uninitialized" )
273   FT_ERRORDEF_( Raster_Corrupted,                            0x61, \
274                "raster corrupted" )
275   FT_ERRORDEF_( Raster_Overflow,                             0x62, \
276                "raster overflow" )
277   FT_ERRORDEF_( Raster_Negative_Height,                      0x63, \
278                "negative height while rastering" )
279
280   /* cache errors */
281
282   FT_ERRORDEF_( Too_Many_Caches,                             0x70, \
283                "too many registered caches" )
284
285   /* TrueType and SFNT errors */
286
287   FT_ERRORDEF_( Invalid_Opcode,                              0x80, \
288                "invalid opcode" )
289   FT_ERRORDEF_( Too_Few_Arguments,                           0x81, \
290                "too few arguments" )
291   FT_ERRORDEF_( Stack_Overflow,                              0x82, \
292                "stack overflow" )
293   FT_ERRORDEF_( Code_Overflow,                               0x83, \
294                "code overflow" )
295   FT_ERRORDEF_( Bad_Argument,                                0x84, \
296                "bad argument" )
297   FT_ERRORDEF_( Divide_By_Zero,                              0x85, \
298                "division by zero" )
299   FT_ERRORDEF_( Invalid_Reference,                           0x86, \
300                "invalid reference" )
301   FT_ERRORDEF_( Debug_OpCode,                                0x87, \
302                "found debug opcode" )
303   FT_ERRORDEF_( ENDF_In_Exec_Stream,                         0x88, \
304                "found ENDF opcode in execution stream" )
305   FT_ERRORDEF_( Nested_DEFS,                                 0x89, \
306                "nested DEFS" )
307   FT_ERRORDEF_( Invalid_CodeRange,                           0x8A, \
308                "invalid code range" )
309   FT_ERRORDEF_( Execution_Too_Long,                          0x8B, \
310                "execution context too long" )
311   FT_ERRORDEF_( Too_Many_Function_Defs,                      0x8C, \
312                "too many function definitions" )
313   FT_ERRORDEF_( Too_Many_Instruction_Defs,                   0x8D, \
314                "too many instruction definitions" )
315   FT_ERRORDEF_( Table_Missing,                               0x8E, \
316                "SFNT font table missing" )
317   FT_ERRORDEF_( Horiz_Header_Missing,                        0x8F, \
318                "horizontal header (hhea) table missing" )
319   FT_ERRORDEF_( Locations_Missing,                           0x90, \
320                "locations (loca) table missing" )
321   FT_ERRORDEF_( Name_Table_Missing,                          0x91, \
322                "name table missing" )
323   FT_ERRORDEF_( CMap_Table_Missing,                          0x92, \
324                "character map (cmap) table missing" )
325   FT_ERRORDEF_( Hmtx_Table_Missing,                          0x93, \
326                "horizontal metrics (hmtx) table missing" )
327   FT_ERRORDEF_( Post_Table_Missing,                          0x94, \
328                "PostScript (post) table missing" )
329   FT_ERRORDEF_( Invalid_Horiz_Metrics,                       0x95, \
330                "invalid horizontal metrics" )
331   FT_ERRORDEF_( Invalid_CharMap_Format,                      0x96, \
332                "invalid character map (cmap) format" )
333   FT_ERRORDEF_( Invalid_PPem,                                0x97, \
334                "invalid ppem value" )
335   FT_ERRORDEF_( Invalid_Vert_Metrics,                        0x98, \
336                "invalid vertical metrics" )
337   FT_ERRORDEF_( Could_Not_Find_Context,                      0x99, \
338                "could not find context" )
339   FT_ERRORDEF_( Invalid_Post_Table_Format,                   0x9A, \
340                "invalid PostScript (post) table format" )
341   FT_ERRORDEF_( Invalid_Post_Table,                          0x9B, \
342                "invalid PostScript (post) table" )
343
344   /* CFF, CID, and Type 1 errors */
345
346   FT_ERRORDEF_( Syntax_Error,                                0xA0, \
347                "opcode syntax error" )
348   FT_ERRORDEF_( Stack_Underflow,                             0xA1, \
349                "argument stack underflow" )
350
351
352 #ifdef FT_ERROR_END_LIST
353   FT_ERROR_END_LIST
354 #endif
355
356
357   /*******************************************************************/
358   /*******************************************************************/
359   /*****                                                         *****/
360   /*****                      SIMPLE CLEANUP                     *****/
361   /*****                                                         *****/
362   /*******************************************************************/
363   /*******************************************************************/
364
365 #ifdef FT_NEED_EXTERN_C
366   }
367 #endif
368
369 #undef FT_ERROR_START_LIST
370 #undef FT_ERROR_END_LIST
371
372 #undef FT_ERRORDEF
373 #undef FT_ERRORDEF_
374 #undef FT_NOERRORDEF_
375
376 #undef FT_NEED_EXTERN_C
377 #undef FT_ERR_PREFIX
378 #undef FT_ERR_BASE
379 #undef FT_ERR_CONCAT
380
381 #endif /* __FTERRORS_H__ */
382
383 /* END */