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

# m17nDatabase(3m17n)

\- The m17n database and API for it.

## NAME

m17nDatabase\_-\_Data -  - The m17n database and API for it.

## SYNOPSIS

### Typedefs

typedef struct **MDatabase** **MDatabase**\
 Type of database.

### Functions

**MDatabase** \* **mdatabase\_find** (MSymbol tag0, MSymbol tag1, MSymbol tag2, MSymbol tag3)\
 Look for a data in the database.  **MPlist** \* **mdatabase\_list** (MSymbol tag0, MSymbol tag1, MSymbol tag2, MSymbol tag3)\
 Return a data list of the m17n database.  **MDatabase** \* **mdatabase\_define** (MSymbol tag0, MSymbol tag1, MSymbol tag2, MSymbol tag3, void \*(\*loader)(MSymbol \*, void \*), void \*extra\_info)\
 Define a data of the m17n database.  void \* **mdatabase\_load** (**MDatabase** \*mdb)\
 Load a data from the database.  MSymbol \* **mdatabase\_tag** (**MDatabase** \*mdb)\
 Get tags of a data.

### Variables

char \* **mdatabase\_dir**\

## Detailed Description

The m17n database and API for it.

Directory for application specific data.

The m17n library acquires various kinds of information from data in the  *m17n database* on demand. Application programs can also add/load their original data to/from the m17n database by setting the variable **mdatabase\_dir** to an application-specific directory and storing data in it. Users can overwrite those data by storing preferable data in the directory specified by the environment variable 'M17NDIR', or if it is not set, in the directory '~/.m17n.d'.

The m17n database contains multiple heterogeneous data, and each data is identified by four tags; TAG0, TAG1, TAG2, TAG3. Each tag must be a symbol.

TAG0 specifies the type of data stored in the database as below.

- •

  If TAG0 is **Mchar\_table**, the data is of the *chartable* *type* and provides information about each character. In this case, TAG1 specifies the type of the information and must be **Msymbol**, **Minteger**, **Mstring**, **Mtext**, or **Mplist**. TAG2 and TAG3 can be any symbols.

- •

  If TAG0 is **Mcharset**, the data is of the *charset* *type* and provides a decode/encode mapping table for a charset. In this case, TAG1 must be a symbol representing a charset. TAG2 and TAG3 can be any symbols.

- •

  If TAG0 is neither **Mchar\_table** nor **Mcharset**, the data is of the *plist* *type*. See the documentation of the **mdatabase\_load()** function for the details. \
  \
    In this case, TAG1, TAG2, and TAG3 can be any symbols.

The notation \<TAG0, TAG1, TAG2, TAG3\> means a data with those tags.

Application programs first calls the **mdatabase\_find()** function to get a pointer to an object of the type **MDatabase**. That object holds information about the specified data. When it is successfully returned, the **mdatabase\_load()** function loads the data. The implementation of the structure **MDatabase** is concealed from application programs.

If an application program wants to provide a data specific to the program or a data overriding what supplied by the m17n database, it must set this variable to a name of directory that contains the data files before it calls the macro **M17N\_INIT()**. The directory may contain a file 'mdb.dir' which contains a list of data definitions in the format described in **[mdbDir(5)](/mdbDir/5.md)**.

The default value is NULL. \

## Typedef Documentation

### typedef struct MDatabase MDatabase

Type of database. \<\>

The type **MDatabase** is for a database object. Its internal structure is concealed from an application program. \

## Variable Documentation

### char\* mdatabase\_dir

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