]> git.ipfire.org Git - thirdparty/cups.git/blob - pstoraster/sjpegerr.c
Import cups.org releases
[thirdparty/cups.git] / pstoraster / sjpegerr.c
1 /*
2 Copyright 1993-2001 by Easy Software Products
3 Copyright (C) 1994, 1995, 1998 Aladdin Enterprises. All rights reserved.
4
5 This file is part of GNU Ghostscript.
6
7 GNU Ghostscript is distributed in the hope that it will be useful, but
8 WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
9 to anyone for the consequences of using it or for whether it serves any
10 particular purpose or works at all, unless he says so in writing. Refer
11 to the GNU General Public License for full details.
12
13 Everyone is granted permission to copy, modify and redistribute GNU
14 Ghostscript, but only under the conditions described in the GNU General
15 Public License. A copy of this license is supposed to have been given
16 to you along with GNU Ghostscript so you can know your rights and
17 responsibilities. It should be in a file named COPYING. Among other
18 things, the copyright notice and this notice must be preserved on all
19 copies.
20
21 Aladdin Enterprises supports the work of the GNU Project, but is not
22 affiliated with the Free Software Foundation or the GNU Project. GNU
23 Ghostscript, as distributed by Aladdin Enterprises, does not require any
24 GNU software to build or run it.
25 */
26
27 #include <config.h>
28 #ifdef HAVE_LIBJPEG
29 /*$Id$ */
30 /* IJG error message table for Ghostscript. */
31 #include "stdio_.h"
32 #include "jpeglib.h"
33
34 /*
35 * MRS - these are normally found in jversion.h, however it seems that
36 * many vendors (Red Hat, SGI, etc.) do not distribute it...
37 *
38 * The following definitions come from the 6B distribution...
39 */
40
41 #define JVERSION "6b 27-Mar-1998"
42 #define JCOPYRIGHT "Copyright (C) 1998, Thomas G. Lane"
43
44 /*
45 * This file exists solely to hold the rather large IJG error message string
46 * table (now about 4K, and likely to grow in future releases). The table
47 * is large enough that we don't want it to be in the default data segment
48 * in a 16-bit executable.
49 *
50 * In IJG version 5 and earlier, under Borland C, this is accomplished simply
51 * by compiling this one file in "huge" memory model rather than "large".
52 * The string constants will then go into a private far data segment.
53 * In less brain-damaged architectures, this file is simply compiled normally,
54 * and we pay only the price of one extra function call.
55 *
56 * In IJG version 5a and later, under Borland C, this is accomplished by making
57 * each string be a separate variable that's explicitly declared "far".
58 * (What a crock...)
59 *
60 * This must be a separate file to avoid duplicate-symbol errors, since we
61 * use the IJG message code names as variables rather than as enum constants.
62 */
63
64 #if JPEG_LIB_VERSION <= 50 /**************** *************** */
65
66 #include "jerror.h" /* get error codes */
67 #define JMAKE_MSG_TABLE
68 #include "jerror.h" /* create message string table */
69
70 #define jpeg_std_message_table jpeg_message_table
71
72 #else /* JPEG_LIB_VERSION >= 51 */ /**************** *************** */
73
74 /* Create a static const char[] variable for each message string. */
75
76 #define JMESSAGE(code,string) static const char code[] = string;
77
78 #include "jerror.h"
79
80 /* Now build an array of pointers to same. */
81
82 #define JMESSAGE(code,string) code ,
83
84 static const char *const jpeg_std_message_table[] =
85 {
86 #include "jerror.h"
87 NULL
88 };
89
90 #endif /* JPEG_LIB_VERSION */ /**************** *************** */
91
92 /*
93 * Return a pointer to the message table.
94 * It is unsafe to do much more than this within the "huge" environment.
95 */
96
97 const char *const *
98 gs_jpeg_message_table(void)
99 {
100 return jpeg_std_message_table;
101 }
102 #endif /* HAVE_LIBJPEG */