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