OLD | NEW |
1 #if !defined(_FX_JPEG_TURBO_) | 1 #if !defined(_FX_JPEG_TURBO_) |
2 /* | 2 /* |
3 * jerror.c | 3 * jerror.c |
4 * | 4 * |
5 * Copyright (C) 1991-1998, Thomas G. Lane. | 5 * Copyright (C) 1991-1998, Thomas G. Lane. |
6 * This file is part of the Independent JPEG Group's software. | 6 * This file is part of the Independent JPEG Group's software. |
7 * For conditions of distribution and use, see the accompanying README file. | 7 * For conditions of distribution and use, see the accompanying README file. |
8 * | 8 * |
9 * This file contains simple error-reporting and trace-message routines. | 9 * This file contains simple error-reporting and trace-message routines. |
10 * These are suitable for Unix-like systems and others where writing to | 10 * These are suitable for Unix-like systems and others where writing to |
11 * stderr is the right thing to do. Many applications will want to replace | 11 * stderr is the right thing to do. Many applications will want to replace |
12 * some or all of these routines. | 12 * some or all of these routines. |
13 * | 13 * |
14 * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile, | |
15 * you get a Windows-specific hack to display error messages in a dialog box. | |
16 * It ain't much, but it beats dropping error messages into the bit bucket, | |
17 * which is what happens to output to stderr under most Windows C compilers. | |
18 * | |
19 * These routines are used by both the compression and decompression code. | 14 * These routines are used by both the compression and decompression code. |
20 */ | 15 */ |
21 | 16 |
22 /* this is not a core library module, so it doesn't define JPEG_INTERNALS */ | 17 /* this is not a core library module, so it doesn't define JPEG_INTERNALS */ |
23 #include "jinclude.h" | 18 #include "jinclude.h" |
24 #include "jpeglib.h" | 19 #include "jpeglib.h" |
25 #include "jversion.h" | 20 #include "jversion.h" |
26 #include "jerror.h" | 21 #include "jerror.h" |
27 | 22 |
28 #ifndef EXIT_FAILURE /* define exit() codes if not provided */ | 23 #ifndef EXIT_FAILURE /* define exit() codes if not provided */ |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 */ | 87 */ |
93 | 88 |
94 METHODDEF(void) | 89 METHODDEF(void) |
95 output_message (j_common_ptr cinfo) | 90 output_message (j_common_ptr cinfo) |
96 { | 91 { |
97 char buffer[JMSG_LENGTH_MAX]; | 92 char buffer[JMSG_LENGTH_MAX]; |
98 | 93 |
99 /* Create the message */ | 94 /* Create the message */ |
100 (*cinfo->err->format_message) (cinfo, buffer); | 95 (*cinfo->err->format_message) (cinfo, buffer); |
101 | 96 |
102 #ifdef USE_WINDOWS_MESSAGEBOX | |
103 /* Display it in a message dialog box */ | |
104 MessageBox(GetActiveWindow(), buffer, "JPEG Library Error", | |
105 MB_OK | MB_ICONERROR); | |
106 #else | |
107 /* Send it to stderr, adding a newline */ | 97 /* Send it to stderr, adding a newline */ |
108 #ifndef _FPDFAPI_MINI_ | |
109 FXSYS_fprintf(stderr, "%s\n", buffer); | 98 FXSYS_fprintf(stderr, "%s\n", buffer); |
110 #endif | |
111 #endif | |
112 } | 99 } |
113 | 100 |
114 | 101 |
115 /* | 102 /* |
116 * Decide whether to emit a trace or warning message. | 103 * Decide whether to emit a trace or warning message. |
117 * msg_level is one of: | 104 * msg_level is one of: |
118 * -1: recoverable corrupt-data warning, may want to abort. | 105 * -1: recoverable corrupt-data warning, may want to abort. |
119 * 0: important advisory messages (always display to user). | 106 * 0: important advisory messages (always display to user). |
120 * 1: first level of tracing detail. | 107 * 1: first level of tracing detail. |
121 * 2,3,...: successively more detailed tracing messages. | 108 * 2,3,...: successively more detailed tracing messages. |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1; | 233 err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1; |
247 | 234 |
248 err->addon_message_table = NULL; | 235 err->addon_message_table = NULL; |
249 err->first_addon_message = 0; /* for safety */ | 236 err->first_addon_message = 0; /* for safety */ |
250 err->last_addon_message = 0; | 237 err->last_addon_message = 0; |
251 | 238 |
252 return err; | 239 return err; |
253 } | 240 } |
254 | 241 |
255 #endif //_FX_JPEG_TURBO_ | 242 #endif //_FX_JPEG_TURBO_ |
OLD | NEW |