---
name: "m17nError"
section: "3m17n"
platform: "linux"
package: "m17n-docs"
version: "1.8.4-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/m17nError"
---

# m17nError(3m17n)

\- Error handling of the m17n library.

## NAME

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.

## 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

### enum MErrorCode

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. \

**Enumerator**

- *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*

  ## Variable Documentation

### int merror\_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) (enum MErrorCode err) (enum MErrorCode err)

*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.* \

## Author

*Generated automatically by Doxygen for The m17n Library from the source code.*

## 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\>.*
