.\" Copyright (C) 2001 Information-technology Promotion Agency (IPA) .\" Copyright (C) 2001-2011 .\" National Institute of Advanced Industrial Science and Technology (AIST) .\" This file is part of the m17n library documentation. .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Section, no Front-Cover Texts, .\" and no Back-Cover Texts. A copy of the license is included in the .\" appendix entitled "GNU Free Documentation License". .TH "m17nDatabase" 3m17n "Mon Sep 25 2023" "Version 1.8.4" "The m17n Library" \" -*- nroff -*- .ad l .nh .SH NAME m17nDatabase_\-_Data \- \- The m17n database and API for it\&. .SH SYNOPSIS .br .PP .SS "Typedefs" .in +1c .ti -1c .RI "typedef struct \fBMDatabase\fP \fBMDatabase\fP" .br .RI "Type of database\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "\fBMDatabase\fP * \fBmdatabase_find\fP (MSymbol tag0, MSymbol tag1, MSymbol tag2, MSymbol tag3)" .br .RI "Look for a data in the database\&. " .ti -1c .RI "\fBMPlist\fP * \fBmdatabase_list\fP (MSymbol tag0, MSymbol tag1, MSymbol tag2, MSymbol tag3)" .br .RI "Return a data list of the m17n database\&. " .ti -1c .RI "\fBMDatabase\fP * \fBmdatabase_define\fP (MSymbol tag0, MSymbol tag1, MSymbol tag2, MSymbol tag3, void *(*loader)(MSymbol *, void *), void *extra_info)" .br .RI "Define a data of the m17n database\&. " .ti -1c .RI "void * \fBmdatabase_load\fP (\fBMDatabase\fP *mdb)" .br .RI "Load a data from the database\&. " .ti -1c .RI "MSymbol * \fBmdatabase_tag\fP (\fBMDatabase\fP *mdb)" .br .RI "Get tags of a data\&. " .in -1c .SS "Variables" .in +1c .ti -1c .RI "char * \fBmdatabase_dir\fP" .br .in -1c .SH "Detailed Description" .PP The m17n database and API for it\&. Directory for application specific data\&. .PP The m17n library acquires various kinds of information from data in the \fI m17n database\fP on demand\&. Application programs can also add/load their original data to/from the m17n database by setting the variable \fBmdatabase_dir\fP 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'\&. .PP 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\&. .PP TAG0 specifies the type of data stored in the database as below\&. .PP .PD 0 .IP "\(bu" 2 If TAG0 is \fBMchar_table\fP, the data is of the \fIchartable\fP \fItype\fP and provides information about each character\&. In this case, TAG1 specifies the type of the information and must be \fBMsymbol\fP, \fBMinteger\fP, \fBMstring\fP, \fBMtext\fP, or \fBMplist\fP\&. TAG2 and TAG3 can be any symbols\&. .PP .PD 0 .IP "\(bu" 2 If TAG0 is \fBMcharset\fP, the data is of the \fIcharset\fP \fItype\fP 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\&. .PP .PD 0 .IP "\(bu" 2 If TAG0 is neither \fBMchar_table\fP nor \fBMcharset\fP, the data is of the \fIplist\fP \fItype\fP\&. See the documentation of the \fBmdatabase_load()\fP function for the details\&. .br In this case, TAG1, TAG2, and TAG3 can be any symbols\&. .PP The notation means a data with those tags\&. .PP Application programs first calls the \fBmdatabase_find()\fP function to get a pointer to an object of the type \fBMDatabase\fP\&. That object holds information about the specified data\&. When it is successfully returned, the \fBmdatabase_load()\fP function loads the data\&. The implementation of the structure \fBMDatabase\fP is concealed from application programs\&. .PP .br .PP 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 \fBM17N_INIT()\fP\&. The directory may contain a file 'mdb\&.dir' which contains a list of data definitions in the format described in \fBmdbDir(5)\fP\&. .PP The default value is NULL\&. .br .SH "Typedef Documentation" .PP .SS "typedef struct \fBMDatabase\fP \fBMDatabase\fP" .PP Type of database\&. <> .PP The type \fBMDatabase\fP is for a database object\&. Its internal structure is concealed from an application program\&. .br .SH "Variable Documentation" .PP .SS "char* mdatabase_dir" .SH "Author" .PP Generated automatically by Doxygen for The m17n Library from the source code\&. .SH COPYRIGHT Copyright (C) 2001 Information\-technology Promotion Agency (IPA) .br Copyright (C) 2001\-2011 National Institute of Advanced Industrial Science and Technology (AIST) .br Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License .