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