cderror.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. * cderror.h
  3. *
  4. * Copyright (C) 1994-1997, Thomas G. Lane.
  5. * This file is part of the Independent JPEG Group's software.
  6. * For conditions of distribution and use, see the accompanying README file.
  7. *
  8. * This file defines the error and message codes for the cjpeg/djpeg
  9. * applications. These strings are not needed as part of the JPEG library
  10. * proper.
  11. * Edit this file to add new codes, or to translate the message strings to
  12. * some other language.
  13. */
  14. /*
  15. * To define the enum list of message codes, include this file without
  16. * defining macro JMESSAGE. To create a message string table, include it
  17. * again with a suitable JMESSAGE definition (see jerror.c for an example).
  18. */
  19. #ifndef JMESSAGE
  20. #ifndef CDERROR_H
  21. #define CDERROR_H
  22. /* First time through, define the enum list */
  23. #define JMAKE_ENUM_LIST
  24. #else
  25. /* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
  26. #define JMESSAGE(code,string)
  27. #endif /* CDERROR_H */
  28. #endif /* JMESSAGE */
  29. #ifdef JMAKE_ENUM_LIST
  30. typedef enum {
  31. #define JMESSAGE(code,string) code ,
  32. #endif /* JMAKE_ENUM_LIST */
  33. JMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */
  34. #ifdef BMP_SUPPORTED
  35. JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format")
  36. JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported")
  37. JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length")
  38. JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1")
  39. JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB")
  40. JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported")
  41. JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM")
  42. JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image")
  43. JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image")
  44. JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image")
  45. JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image")
  46. #endif /* BMP_SUPPORTED */
  47. #ifdef GIF_SUPPORTED
  48. JMESSAGE(JERR_GIF_BUG, "GIF output got confused")
  49. JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d")
  50. JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB")
  51. JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file")
  52. JMESSAGE(JERR_GIF_NOT, "Not a GIF file")
  53. JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image")
  54. JMESSAGE(JTRC_GIF_BADVERSION,
  55. "Warning: unexpected GIF version number '%c%c%c'")
  56. JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x")
  57. JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input")
  58. JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file")
  59. JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring")
  60. JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image")
  61. JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits")
  62. #endif /* GIF_SUPPORTED */
  63. #ifdef PPM_SUPPORTED
  64. JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
  65. JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
  66. JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file")
  67. JMESSAGE(JTRC_PGM, "%ux%u PGM image")
  68. JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image")
  69. JMESSAGE(JTRC_PPM, "%ux%u PPM image")
  70. JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image")
  71. #endif /* PPM_SUPPORTED */
  72. #ifdef RLE_SUPPORTED
  73. JMESSAGE(JERR_RLE_BADERROR, "Bogus error code from RLE library")
  74. JMESSAGE(JERR_RLE_COLORSPACE, "RLE output must be grayscale or RGB")
  75. JMESSAGE(JERR_RLE_DIMENSIONS, "Image dimensions (%ux%u) too large for RLE")
  76. JMESSAGE(JERR_RLE_EMPTY, "Empty RLE file")
  77. JMESSAGE(JERR_RLE_EOF, "Premature EOF in RLE header")
  78. JMESSAGE(JERR_RLE_MEM, "Insufficient memory for RLE header")
  79. JMESSAGE(JERR_RLE_NOT, "Not an RLE file")
  80. JMESSAGE(JERR_RLE_TOOMANYCHANNELS, "Cannot handle %d output channels for RLE")
  81. JMESSAGE(JERR_RLE_UNSUPPORTED, "Cannot handle this RLE setup")
  82. JMESSAGE(JTRC_RLE, "%ux%u full-color RLE file")
  83. JMESSAGE(JTRC_RLE_FULLMAP, "%ux%u full-color RLE file with map of length %d")
  84. JMESSAGE(JTRC_RLE_GRAY, "%ux%u grayscale RLE file")
  85. JMESSAGE(JTRC_RLE_MAPGRAY, "%ux%u grayscale RLE file with map of length %d")
  86. JMESSAGE(JTRC_RLE_MAPPED, "%ux%u colormapped RLE file with map of length %d")
  87. #endif /* RLE_SUPPORTED */
  88. #ifdef TARGA_SUPPORTED
  89. JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format")
  90. JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file")
  91. JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB")
  92. JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image")
  93. JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image")
  94. JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image")
  95. #else
  96. JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled")
  97. #endif /* TARGA_SUPPORTED */
  98. JMESSAGE(JERR_BAD_CMAP_FILE,
  99. "Color map file is invalid or of unsupported format")
  100. JMESSAGE(JERR_TOO_MANY_COLORS,
  101. "Output file format cannot handle %d colormap entries")
  102. JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed")
  103. #ifdef TARGA_SUPPORTED
  104. JMESSAGE(JERR_UNKNOWN_FORMAT,
  105. "Unrecognized input file format --- perhaps you need -targa")
  106. #else
  107. JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format")
  108. #endif
  109. JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format")
  110. #ifdef JMAKE_ENUM_LIST
  111. JMSG_LASTADDONCODE
  112. } ADDON_MESSAGE_CODE;
  113. #undef JMAKE_ENUM_LIST
  114. #endif /* JMAKE_ENUM_LIST */
  115. /* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
  116. #undef JMESSAGE