ftmoderr.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /***************************************************************************/
  2. /* */
  3. /* ftmoderr.h */
  4. /* */
  5. /* FreeType module error offsets (specification). */
  6. /* */
  7. /* Copyright 2001, 2002 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. /* This file is used to define the FreeType module error offsets. */
  20. /* */
  21. /* The lower byte gives the error code, the higher byte gives the */
  22. /* module. The base module has error offset 0. For example, the error */
  23. /* `FT_Err_Invalid_File_Format' has value 0x003, the error */
  24. /* `TT_Err_Invalid_File_Format' has value 0xB03, the error */
  25. /* `T1_Err_Invalid_File_Format' has value 0xC03, etc. */
  26. /* */
  27. /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */
  28. /* to make the higher byte always zero (disabling the module error */
  29. /* mechanism). */
  30. /* */
  31. /* It can also be used to create a module error message table easily */
  32. /* with something like */
  33. /* */
  34. /* { */
  35. /* #undef __FTMODERR_H__ */
  36. /* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
  37. /* #define FT_MODERR_START_LIST { */
  38. /* #define FT_MODERR_END_LIST { 0, 0 } }; */
  39. /* */
  40. /* const struct */
  41. /* { */
  42. /* int mod_err_offset; */
  43. /* const char* mod_err_msg */
  44. /* } ft_mod_errors[] = */
  45. /* */
  46. /* #include FT_MODULE_ERRORS_H */
  47. /* } */
  48. /* */
  49. /* To use such a table, all errors must be ANDed with 0xFF00 to remove */
  50. /* the error code. */
  51. /* */
  52. /*************************************************************************/
  53. #ifndef __FTMODERR_H__
  54. #define __FTMODERR_H__
  55. /*******************************************************************/
  56. /*******************************************************************/
  57. /***** *****/
  58. /***** SETUP MACROS *****/
  59. /***** *****/
  60. /*******************************************************************/
  61. /*******************************************************************/
  62. #undef FT_NEED_EXTERN_C
  63. #ifndef FT_MODERRDEF
  64. #ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
  65. #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v,
  66. #else
  67. #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0,
  68. #endif
  69. #define FT_MODERR_START_LIST enum {
  70. #define FT_MODERR_END_LIST FT_Mod_Err_Max };
  71. #ifdef __cplusplus
  72. #define FT_NEED_EXTERN_C
  73. extern "C" {
  74. #endif
  75. #endif /* !FT_MODERRDEF */
  76. /*******************************************************************/
  77. /*******************************************************************/
  78. /***** *****/
  79. /***** LIST MODULE ERROR BASES *****/
  80. /***** *****/
  81. /*******************************************************************/
  82. /*******************************************************************/
  83. #ifdef FT_MODERR_START_LIST
  84. FT_MODERR_START_LIST
  85. #endif
  86. FT_MODERRDEF( Base, 0x000, "base module" )
  87. FT_MODERRDEF( Autohint, 0x100, "autohinter module" )
  88. FT_MODERRDEF( Cache, 0x200, "cache module" )
  89. FT_MODERRDEF( CFF, 0x300, "CFF module" )
  90. FT_MODERRDEF( CID, 0x400, "CID module" )
  91. FT_MODERRDEF( PCF, 0x500, "PCF module" )
  92. FT_MODERRDEF( PSaux, 0x600, "PS auxiliary module" )
  93. FT_MODERRDEF( PSnames, 0x700, "PS names module" )
  94. FT_MODERRDEF( Raster, 0x800, "raster module" )
  95. FT_MODERRDEF( SFNT, 0x900, "SFNT module" )
  96. FT_MODERRDEF( Smooth, 0xA00, "smooth raster module" )
  97. FT_MODERRDEF( TrueType, 0xB00, "TrueType module" )
  98. FT_MODERRDEF( Type1, 0xC00, "Type 1 module" )
  99. FT_MODERRDEF( Winfonts, 0xD00, "Windows FON/FNT module" )
  100. FT_MODERRDEF( PFR, 0xE00, "PFR module" )
  101. #ifdef FT_MODERR_END_LIST
  102. FT_MODERR_END_LIST
  103. #endif
  104. /*******************************************************************/
  105. /*******************************************************************/
  106. /***** *****/
  107. /***** CLEANUP *****/
  108. /***** *****/
  109. /*******************************************************************/
  110. /*******************************************************************/
  111. #ifdef FT_NEED_EXTERN_C
  112. }
  113. #endif
  114. #undef FT_MODERR_START_LIST
  115. #undef FT_MODERR_END_LIST
  116. #undef FT_MODERRDEF
  117. #undef FT_NEED_EXTERN_C
  118. #endif /* __FTMODERR_H__ */
  119. /* END */