Release Notes
Open Source Used In AsyncOS 8.8 for Cisco Web Security Appliances
75
format_message (j_common_ptr cinfo, char * buffer)
Constructs a readable error message string based on the error info
stored in cinfo->err. This method is called by output_message. Few
applications should need to override this method. One possible
reason for doing so is to implement dynamic switching of error message
language.
emit_message (j_common_ptr cinfo, int msg_level)
Decide whether or not to emit a warning or trace message; if so,
calls output_message. The main reason for overriding this method
would be to abort on warnings. msg_level is -1 for warnings,
0 and up for trace messages.
Only error_exit() and emit_message() are called from the rest of the JPEG
library; the other two are internal to the error handler.
The actual message texts are stored in an array of strings which is pointed to
by the field err->jpeg_message_table. The messages are numbered from 0 to
err->last_jpeg_message, and it is these code numbers that are used in the
JPEG library code. You could replace the message texts (for instance, with
messages in French or German) by changing the message table pointer. See
jerror.h for the default texts. CAUTION: this table will almost certainly
change or grow from one library version to the next.
It may be useful for an application to add its own message texts that are
handled by the same mechanism. The error handler supports a second "add-on"
message table for this purpose. To define an addon table, set the pointer
err->addon_message_table and the message numbers err->first_addon_message and
err->last_addon_message. If you number the addon messages beginning at 1000
or so, you won't have to worry about conflicts with the library's built-in
messages. See the sample applications cjpeg/djpeg for an example of using
addon messages (the addon messages are defined in cderror.h).
Actual invocation of the error handler is done via macros defined in jerror.h:
ERREXITn(...)for fatal errors
WARNMSn(...)for corrupt-data warnings
TRACEMSn(...)for trace and informational messages.
These macros store the message code and any additional parameters into the
error handler struct, then invoke the error_exit() or emit_message() method.
The variants of each macro are for varying numbers of additional parameters.
The additional parameters are inserted into the generated message using
standard printf() format codes.
See jerror.h and jerror.c for further details.
Compressed data handling (source and destination managers)
----------------------------------------------------------