m17nError_-_Error_Hand - - Error handling of the m17n library.
Contents
Copyright
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free
Documentation License <http://www.gnu.org/licenses/fdl.html>.
Version 1.8.4 Mon Sep 25 2023 m17nError(3m17n)
Detailed Description
Error handling of the m17n library.
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
enumMErrorCode
Enumeration for error code of the m17n library. 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.
EnumeratorMERROR_NONEMERROR_OBJECTMERROR_SYMBOLMERROR_MTEXTMERROR_TEXTPROPMERROR_CHARMERROR_CHARTABLEMERROR_CHARSETMERROR_CODINGMERROR_RANGEMERROR_LANGUAGEMERROR_LOCALEMERROR_PLISTMERROR_MISCMERROR_WINMERROR_XMERROR_FRAMEMERROR_FACEMERROR_DRAWMERROR_FLTMERROR_FONTMERROR_FONTSETMERROR_FONT_OTFMERROR_FONT_XMERROR_FONT_FTMERROR_IMMERROR_DBMERROR_IOMERROR_DEBUGMERROR_MEMORYMERROR_GDMERROR_MAXName
m17nError_-_Error_Hand - - Error handling of the m17n library.
Synopsis
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_FLT,
MERROR_FONT, MERROR_FONTSET, MERROR_FONT_OTF, MERROR_FONT_X, 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.
Variable Documentation
intmerror_code
External variable to hold error code of the m17n library. 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)(enumMErrorCodeerr)(enumMErrorCodeerr)
Memory allocation error handler. 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.
