man m17nError () - Error handling of the m17n library.
NAME
Error Handling - Error handling of the m17n library.
Enumerations
enum MErrorCode { MERROR_NONE, MERROR_OBJECT, MERROR_SYMBOL, MERROR_MTEXT, MERROR_TEXTPROP, MERROR_CHAR, MERROR_CHARTABLE, MERROR_CHARSET, MERROR_CODING, MERROR_RANGE, MERROR_LANGUAGE, MERROR_LOCALE, MERROR_PLIST, MERROR_MISC, MERROR_WIN, MERROR_X, MERROR_FRAME, MERROR_FACE, MERROR_DRAW, MERROR_FONT, MERROR_FONTSET, MERROR_FONT_OTF, MERROR_FONT_FT, MERROR_IM, MERROR_DB, MERROR_IO, MERROR_DEBUG, MERROR_MEMORY, MERROR_GD, MERROR_MAX }
Enumeration for error code of the m17n library.
Variables
int merror_code
External variable to hold error code of the m17n library.
void(* m17n_memory_full_handler )(enum MErrorCode err)
Memory allocation error handler.
Detailed Description
There are two types of errors that may happen in a function of the m17n library.
The first type is argument errors. When a library function is called with invalid arguments, it returns a value that indicates error and at the same time sets the external variable merror_code to a non-zero integer.
The second type is memory allocation errors. When the required amount of memory is not available on the system, m17n library functions call a function pointed to by the external variable m17n_memory_full_handler. The default value of the variable is a pointer to the default_error_handle() function, which just calls exit().
Enumeration Type Documentation
enum MErrorCode
Enumeration for error code of the m17n library.
When a library function is called with an invalid argument, it sets the external variable merror_code to one of these values. All the error codes are positive integers.
When a memory allocation error happens, the function pointed to by the external variable m17n_memory_full_handler is called with one of these values as an argument.
Enumeration values:
- MERROR_NONE
MERROR_OBJECT
- MERROR_SYMBOL
MERROR_MTEXT
- MERROR_TEXTPROP
MERROR_CHAR
- MERROR_CHARTABLE
MERROR_CHARSET
- MERROR_CODING
MERROR_RANGE
- MERROR_LANGUAGE
MERROR_LOCALE
- MERROR_PLIST
MERROR_MISC
- MERROR_WIN
MERROR_X
- MERROR_FRAME
MERROR_FACE
- MERROR_DRAW
MERROR_FONT
- MERROR_FONTSET
MERROR_FONT_OTF
- MERROR_FONT_FT
MERROR_IM
- MERROR_DB
MERROR_IO
- MERROR_DEBUG
MERROR_MEMORY
- MERROR_GD
MERROR_MAX
Variable Documentation
int merror_code
The external variable merror_code holds an error code of the m17n library. When a library function is called with an invalid argument, it sets this variable to one of enum MErrorCode.
This variable initially has the value 0.
void(* m17n_memory_full_handler)(enum MErrorCode err)
The external variable m17n_memory_full_handler holds a pointer to the function to call when a library function failed to allocate memory. err is one of enum MErrorCode indicating in which function the error occurred.
This variable initially points a function that simply calls the exit () function with err as an argument.
An application program that needs a different error handling can change this variable to point a proper function.