man m17nIntro () - Introduction to the m17n library.

NAME

Introduction - Introduction to the m17n library.

Defines

#define M17NLIB_MAJOR_VERSION

#define M17NLIB_MINOR_VERSION

#define M17NLIB_PATCH_LEVEL

#define M17NLIB_VERSION_NAME

#define M17N_INIT()

Initialize the m17n library. #define M17N_FINI()

Finalize the m17n library.

Enumerations

enum M17NStatus { M17N_NOT_INITIALIZED, M17N_CORE_INITIALIZED, M17N_SHELL_INITIALIZED, M17N_GUI_INITIALIZED }

Enumeration for the status of the m17n library.

Functions

enum M17NStatus m17n_status (void)

Report which part of the m17n library is initialized.

Detailed Description

API LEVELS

The API of the m17n library is divided into these four.

CORE API

It provides basic modules to handle M-texts. They do not require the m17n database. To use this API, an application program must include <m17n-core.h> and be linked by -lm17n-core.

SHELL API

It provides modules that utilize the m17n database (code conversion, character property, etc). They load various kinds of data from the database on demand. To use this API, an application program must include <m17n.h> and be linked by -lm17n-core -lm17n.

When you use this API, CORE API is also available.

GUI API

It provides GUI modules such as drawing and inputting M-texts on a graphic device. The API itself is independent on a graphic device but most functions require an argument MFrame which is created for a specific type of graphic device. Currently, a null device, X Window System, and an image date (gdImagePtr) of GD library are supported as a graphic device.

On a frame of the null device, you can't draw text nor use an input method (but, for instance, the funciton mdraw_glyph_list() is available).

On a frame of the X Window System, you can use the whole GUI API.

On a frame of GD library, you can use all drawing API but can't use input method.

To use this device, an application program must include <m17n-gui.h> and be linked by -lm17n-core -lm17n -lm17n-gui.

When you use this API, CORE and SHELL API are also available.

MISC API

It provides miscellaneous functions to support error handling and debugging. This API cannot be used by itself, but with one or more APIs listed above. To use the API, an application program must include <m17n-misc.h> in addition to one of a header file described above.

See also the section m17n-config(1).

ENVIRONMENT VARIABLE

The m17n library pays attention to these environment variables.

M17NDIR

Name of a directory that contains data of the m17n database. See Database for more details.

MDEBUG_XXXX

Environment variables whose name start by 'MDEBUG_' controls printing of debug information. See Debugging for more details.

API NAMING CONVENTION

The library exports functions, variables, macros, and types. All of them start by the letter 'm' or 'M' followed by an object name (e.g. 'symbol' and 'plist', but 'mtext' object is given the name 'text' to avoid double 'm' at the head) or a module name (e.g. draw, input).

functions -- mobject() or mobject_xxx()

They start with 'm' followed by lower case object name. For example, msymbol(), mtext_ref_char(), mdraw_text().

non-symbol variables -- mobject, or mobject_xxx

The naming convention is the same as functions (e.g. mface_large).

symbol variables -- Mname

Variables of type MSymbol start with 'M' followed by their names (e.g. Mlanguage (name is 'language'), Miso_2022 (name is 'iso-2022').

macros -- MOBJECT_XXX

They start by 'M' followed by upper case object names.

types -- MObject or MObjectXxx

They start by 'M' followed by capitalized object names (e.g. MConverter, MInputDriver).

Define Documentation

#define M17NLIB_MAJOR_VERSION

The M17NLIB_MAJOR_VERSION macro gives the major version number of the m17n library.

#define M17NLIB_MINOR_VERSION

The M17NLIB_MINOR_VERSION macro gives the minor version number of the m17n library.

#define M17NLIB_PATCH_LEVEL

The M17NLIB_PATCH_LEVEL macro gives the patch level number of the m17n library.

#define M17NLIB_VERSION_NAME

The M17NLIB_VERSION_NAME macro gives the version name of the m17n library as a string.

#define M17N_INIT()

The macro M17N_INIT() initializes the m17n library. This macro must be called before any m17n functions are used.

It is safe to call this macro multiple times, but in that case, the macro M17N_FINI() must be called the same times to free the memory.

If the initialization was successful, the external variable merror_code is set to 0. Otherwise it is set to -1.

See Also:.RS 4 M17N_FINI(), m17n_status()

#define M17N_FINI()

The macro M17N_FINI() finalizes the m17n library. It frees all the memory area used by the m17n library. Once this macro is called, no m17n functions should be used until the macro M17N_INIT() is called again.

If the macro M17N_INIT() was called N times, the Nth call of this macro actually free the memory.

See Also:.RS 4 M17N_INIT(), m17n_status()

Enumeration Type Documentation

enum M17NStatus

The enum M17NStatus is used as a return value of the function m17n_status().

Enumeration values:

M17N_NOT_INITIALIZED
M17N_CORE_INITIALIZED
M17N_SHELL_INITIALIZED
M17N_GUI_INITIALIZED