kusano 7d535a
/*
kusano 7d535a
 * cderror.h
kusano 7d535a
 *
kusano 7d535a
 * Copyright (C) 1994-1997, Thomas G. Lane.
shun-iwasawa 82a8f5
 * Modified 2009-2017 by Guido Vollbeding.
kusano 7d535a
 * This file is part of the Independent JPEG Group's software.
shun-iwasawa 82a8f5
 * For conditions of distribution and use, see the accompanying README.ijg
shun-iwasawa 82a8f5
 * file.
kusano 7d535a
 *
kusano 7d535a
 * This file defines the error and message codes for the cjpeg/djpeg
kusano 7d535a
 * applications.  These strings are not needed as part of the JPEG library
kusano 7d535a
 * proper.
kusano 7d535a
 * Edit this file to add new codes, or to translate the message strings to
kusano 7d535a
 * some other language.
kusano 7d535a
 */
kusano 7d535a
kusano 7d535a
/*
kusano 7d535a
 * To define the enum list of message codes, include this file without
kusano 7d535a
 * defining macro JMESSAGE.  To create a message string table, include it
kusano 7d535a
 * again with a suitable JMESSAGE definition (see jerror.c for an example).
kusano 7d535a
 */
kusano 7d535a
#ifndef JMESSAGE
kusano 7d535a
#ifndef CDERROR_H
kusano 7d535a
#define CDERROR_H
kusano 7d535a
/* First time through, define the enum list */
kusano 7d535a
#define JMAKE_ENUM_LIST
kusano 7d535a
#else
kusano 7d535a
/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */
shun-iwasawa 82a8f5
#define JMESSAGE(code, string)
kusano 7d535a
#endif /* CDERROR_H */
kusano 7d535a
#endif /* JMESSAGE */
kusano 7d535a
kusano 7d535a
#ifdef JMAKE_ENUM_LIST
kusano 7d535a
kusano 7d535a
typedef enum {
kusano 7d535a
shun-iwasawa 82a8f5
#define JMESSAGE(code, string)  code,
kusano 7d535a
kusano 7d535a
#endif /* JMAKE_ENUM_LIST */
kusano 7d535a
shun-iwasawa 82a8f5
JMESSAGE(JMSG_FIRSTADDONCODE = 1000, NULL) /* Must be first entry! */
kusano 7d535a
kusano 7d535a
#ifdef BMP_SUPPORTED
kusano 7d535a
JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format")
kusano 7d535a
JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported")
kusano 7d535a
JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length")
kusano 7d535a
JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1")
kusano 7d535a
JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB")
kusano 7d535a
JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported")
kusano 7d535a
JMESSAGE(JERR_BMP_EMPTY, "Empty BMP image")
kusano 7d535a
JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM")
shun-iwasawa 82a8f5
JMESSAGE(JERR_BMP_OUTOFRANGE, "Numeric value out of range in BMP file")
kusano 7d535a
JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image")
kusano 7d535a
JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image")
kusano 7d535a
JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image")
kusano 7d535a
JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image")
kusano 7d535a
#endif /* BMP_SUPPORTED */
kusano 7d535a
kusano 7d535a
#ifdef GIF_SUPPORTED
kusano 7d535a
JMESSAGE(JERR_GIF_BUG, "GIF output got confused")
kusano 7d535a
JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d")
kusano 7d535a
JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB")
kusano 7d535a
JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file")
kusano 7d535a
JMESSAGE(JERR_GIF_NOT, "Not a GIF file")
kusano 7d535a
JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image")
kusano 7d535a
JMESSAGE(JTRC_GIF_BADVERSION,
shun-iwasawa 82a8f5
         "Warning: unexpected GIF version number '%c%c%c'")
kusano 7d535a
JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x")
kusano 7d535a
JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input")
kusano 7d535a
JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file")
kusano 7d535a
JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring")
kusano 7d535a
JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image")
kusano 7d535a
JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits")
kusano 7d535a
#endif /* GIF_SUPPORTED */
kusano 7d535a
kusano 7d535a
#ifdef PPM_SUPPORTED
kusano 7d535a
JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB")
kusano 7d535a
JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file")
kusano 7d535a
JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file")
shun-iwasawa 82a8f5
JMESSAGE(JERR_PPM_OUTOFRANGE, "Numeric value out of range in PPM file")
kusano 7d535a
JMESSAGE(JTRC_PGM, "%ux%u PGM image")
kusano 7d535a
JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image")
kusano 7d535a
JMESSAGE(JTRC_PPM, "%ux%u PPM image")
kusano 7d535a
JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image")
kusano 7d535a
#endif /* PPM_SUPPORTED */
kusano 7d535a
kusano 7d535a
#ifdef RLE_SUPPORTED
kusano 7d535a
JMESSAGE(JERR_RLE_BADERROR, "Bogus error code from RLE library")
kusano 7d535a
JMESSAGE(JERR_RLE_COLORSPACE, "RLE output must be grayscale or RGB")
kusano 7d535a
JMESSAGE(JERR_RLE_DIMENSIONS, "Image dimensions (%ux%u) too large for RLE")
kusano 7d535a
JMESSAGE(JERR_RLE_EMPTY, "Empty RLE file")
kusano 7d535a
JMESSAGE(JERR_RLE_EOF, "Premature EOF in RLE header")
kusano 7d535a
JMESSAGE(JERR_RLE_MEM, "Insufficient memory for RLE header")
kusano 7d535a
JMESSAGE(JERR_RLE_NOT, "Not an RLE file")
kusano 7d535a
JMESSAGE(JERR_RLE_TOOMANYCHANNELS, "Cannot handle %d output channels for RLE")
kusano 7d535a
JMESSAGE(JERR_RLE_UNSUPPORTED, "Cannot handle this RLE setup")
kusano 7d535a
JMESSAGE(JTRC_RLE, "%ux%u full-color RLE file")
kusano 7d535a
JMESSAGE(JTRC_RLE_FULLMAP, "%ux%u full-color RLE file with map of length %d")
kusano 7d535a
JMESSAGE(JTRC_RLE_GRAY, "%ux%u grayscale RLE file")
kusano 7d535a
JMESSAGE(JTRC_RLE_MAPGRAY, "%ux%u grayscale RLE file with map of length %d")
kusano 7d535a
JMESSAGE(JTRC_RLE_MAPPED, "%ux%u colormapped RLE file with map of length %d")
kusano 7d535a
#endif /* RLE_SUPPORTED */
kusano 7d535a
kusano 7d535a
#ifdef TARGA_SUPPORTED
kusano 7d535a
JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format")
kusano 7d535a
JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file")
kusano 7d535a
JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB")
kusano 7d535a
JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image")
kusano 7d535a
JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image")
kusano 7d535a
JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image")
kusano 7d535a
#else
kusano 7d535a
JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled")
kusano 7d535a
#endif /* TARGA_SUPPORTED */
kusano 7d535a
kusano 7d535a
JMESSAGE(JERR_BAD_CMAP_FILE,
shun-iwasawa 82a8f5
         "Color map file is invalid or of unsupported format")
kusano 7d535a
JMESSAGE(JERR_TOO_MANY_COLORS,
shun-iwasawa 82a8f5
         "Output file format cannot handle %d colormap entries")
kusano 7d535a
JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed")
kusano 7d535a
#ifdef TARGA_SUPPORTED
kusano 7d535a
JMESSAGE(JERR_UNKNOWN_FORMAT,
shun-iwasawa 82a8f5
         "Unrecognized input file format --- perhaps you need -targa")
kusano 7d535a
#else
kusano 7d535a
JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format")
kusano 7d535a
#endif
kusano 7d535a
JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format")
kusano 7d535a
kusano 7d535a
#ifdef JMAKE_ENUM_LIST
kusano 7d535a
kusano 7d535a
  JMSG_LASTADDONCODE
kusano 7d535a
} ADDON_MESSAGE_CODE;
kusano 7d535a
kusano 7d535a
#undef JMAKE_ENUM_LIST
kusano 7d535a
#endif /* JMAKE_ENUM_LIST */
kusano 7d535a
kusano 7d535a
/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */
kusano 7d535a
#undef JMESSAGE