File: group__m17nDatabase.html

package info (click to toggle)
m17n-docs 1.6.2-2.1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 22,492 kB
  • sloc: sh: 1,032; javascript: 635; makefile: 406; ansic: 206; perl: 108
file content (349 lines) | stat: -rw-r--r-- 27,647 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>The m17n Library: Database</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="Search" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Database<br/>
<small>
[<a class="el" href="group__m17nCore.html">CORE API</a>]</small>
</h1>
<p>The m17n database and API for it.  
<a href="#_details">More...</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e">MDatabase</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e">MDatabase</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Type of database.  <a href="#ga185385212a1dcd2bbb8ec94ba31caf0e"></a><br/></td></tr>
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e">MDatabase</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDatabase.html#gaf0b925b48cf03873cf8cdb7b81a3c37d">mdatabase_find</a> (<a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> tag0, <a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> tag1, <a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> tag2, <a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> tag3)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Look for a data in the database.  <a href="#gaf0b925b48cf03873cf8cdb7b81a3c37d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__m17nPlist.html#gac8b2ac3c9a8f0a6afb7f189b694035e2">MPlist</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDatabase.html#gaf3db907393a30e6c1ea062691cb8a2b0">mdatabase_list</a> (<a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> tag0, <a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> tag1, <a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> tag2, <a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> tag3)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return a data list of the m17n database.  <a href="#gaf3db907393a30e6c1ea062691cb8a2b0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e">MDatabase</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDatabase.html#ga265cfa2587dfda9bdc84f7afd1aabb1d">mdatabase_define</a> (<a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> tag0, <a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> tag1, <a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> tag2, <a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> tag3, void *(*loader)(<a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> *, void *), void *extra_info)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Define a data of the m17n database.  <a href="#ga265cfa2587dfda9bdc84f7afd1aabb1d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDatabase.html#ga62e5cf92d1b2836a9f6a988bcc20c26e">mdatabase_load</a> (<a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e">MDatabase</a> *mdb)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Load a data from the database.  <a href="#ga62e5cf92d1b2836a9f6a988bcc20c26e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDatabase.html#ga5362edb0cb91ff9c90d569d7aca58b39">mdatabase_tag</a> (<a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e">MDatabase</a> *mdb)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get tags of a data.  <a href="#ga5362edb0cb91ff9c90d569d7aca58b39"></a><br/></td></tr>
<tr><td colspan="2"><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nDatabase.html#ga29022d6905ce43de1ac69cd1f88b36f7">mdatabase_dir</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Directory for application specific data.  <a href="#ga29022d6905ce43de1ac69cd1f88b36f7"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>The m17n database and API for it. </p>
<p>The m17n library acquires various kinds of information from data in the <em> m17n database</em> on demand. Application programs can also add/load their original data to/from the m17n database by setting the variable <a class="el" href="group__m17nDatabase.html#ga29022d6905ce43de1ac69cd1f88b36f7" title="Directory for application specific data.">mdatabase_dir</a> 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".</p>
<p>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.</p>
<p>TAG0 specifies the type of data stored in the database as below.</p>
<ul>
<li>If TAG0 is <a class="el" href="group__m17nChartable.html#ga91e88555aace667aa53a16e5fbb4226c" title="Symbol whose name is &quot;char-table&quot;.">Mchar_table</a>, the data is of the <em>chartable</em> <em>type</em> and provides information about each character. In this case, TAG1 specifies the type of the information and must be <a class="el" href="group__m17nSymbol.html#ga6592d4eb3c46fe7fb8993c252b8fedeb" title="Symbol whose name is &quot;symbol&quot;.">Msymbol</a>, <a class="el" href="group__m17nPlist.html#ga0ce08eb57aa339db4d4745e75e80fdd8" title="Symbol whose name is &quot;integer&quot;.">Minteger</a>, <a class="el" href="group__m17nSymbol.html#ga60daf7d600a1f487862366a37c171ce5" title="Symbol whose name is &quot;string&quot;.">Mstring</a>, <a class="el" href="group__m17nPlist.html#ga1a22859374071a0ca66f12452afee8bd" title="Symbol whose name is &quot;mtext&quot;.">Mtext</a>, or <a class="el" href="group__m17nPlist.html#ga933000e154873f9bfcaa56d976bd259b" title="Symbol whose name is &quot;plist&quot;.">Mplist</a>. TAG2 and TAG3 can be any symbols.</li>
</ul>
<ul>
<li>If TAG0 is <a class="el" href="group__m17nCharset.html#ga45426542709f174689a06ce7c34a37de" title="The symbol Mcharset.">Mcharset</a>, the data is of the <em>charset</em> <em>type</em> 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.</li>
</ul>
<ul>
<li>If TAG0 is neither <a class="el" href="group__m17nChartable.html#ga91e88555aace667aa53a16e5fbb4226c" title="Symbol whose name is &quot;char-table&quot;.">Mchar_table</a> nor <a class="el" href="group__m17nCharset.html#ga45426542709f174689a06ce7c34a37de" title="The symbol Mcharset.">Mcharset</a>, the data is of the <em>plist</em> <em>type</em>. See the documentation of the <a class="el" href="group__m17nDatabase.html#ga62e5cf92d1b2836a9f6a988bcc20c26e" title="Load a data from the database.">mdatabase_load()</a> function for the details. In this case, TAG1, TAG2, and TAG3 can be any symbols.</li>
</ul>
<p>The notation &lt;TAG0, TAG1, TAG2, TAG3&gt; means a data with those tags.</p>
<p>Application programs first calls the <a class="el" href="group__m17nDatabase.html#gaf0b925b48cf03873cf8cdb7b81a3c37d" title="Look for a data in the database.">mdatabase_find()</a> function to get a pointer to an object of the type <a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e" title="Type of database.">MDatabase</a>. That object holds information about the specified data. When it is successfully returned, the <a class="el" href="group__m17nDatabase.html#ga62e5cf92d1b2836a9f6a988bcc20c26e" title="Load a data from the database.">mdatabase_load()</a> function loads the data. The implementation of the structure <a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e" title="Type of database.">MDatabase</a> is concealed from application programs. </p>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="ga185385212a1dcd2bbb8ec94ba31caf0e"></a><!-- doxytag: member="m17n&#45;core.h::MDatabase" ref="ga185385212a1dcd2bbb8ec94ba31caf0e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef struct <a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e">MDatabase</a> <a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e">MDatabase</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Type of database. </p>
<p>The type <a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e" title="Type of database.">MDatabase</a> is for a database object. Its internal structure is concealed from an application program. </p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gaf0b925b48cf03873cf8cdb7b81a3c37d"></a><!-- doxytag: member="database.c::mdatabase_find" ref="gaf0b925b48cf03873cf8cdb7b81a3c37d" args="(MSymbol tag0, MSymbol tag1, MSymbol tag2, MSymbol tag3)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e">MDatabase</a>* mdatabase_find </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a>&nbsp;</td>
          <td class="paramname"> <em>tag0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a>&nbsp;</td>
          <td class="paramname"> <em>tag1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a>&nbsp;</td>
          <td class="paramname"> <em>tag2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a>&nbsp;</td>
          <td class="paramname"> <em>tag3</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Look for a data in the database. </p>
<p>The <a class="el" href="group__m17nDatabase.html#gaf0b925b48cf03873cf8cdb7b81a3c37d" title="Look for a data in the database.">mdatabase_find()</a> function searches the m17n database for a data who has tags <b>tag0</b> through <b>tag3</b>, and returns a pointer to the data. If such a data is not found, it returns <code>NULL</code>. </p>

</div>
</div>
<a class="anchor" id="gaf3db907393a30e6c1ea062691cb8a2b0"></a><!-- doxytag: member="database.c::mdatabase_list" ref="gaf3db907393a30e6c1ea062691cb8a2b0" args="(MSymbol tag0, MSymbol tag1, MSymbol tag2, MSymbol tag3)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__m17nPlist.html#gac8b2ac3c9a8f0a6afb7f189b694035e2">MPlist</a>* mdatabase_list </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a>&nbsp;</td>
          <td class="paramname"> <em>tag0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a>&nbsp;</td>
          <td class="paramname"> <em>tag1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a>&nbsp;</td>
          <td class="paramname"> <em>tag2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a>&nbsp;</td>
          <td class="paramname"> <em>tag3</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return a data list of the m17n database. </p>
<p>The <a class="el" href="group__m17nDatabase.html#gaf3db907393a30e6c1ea062691cb8a2b0" title="Return a data list of the m17n database.">mdatabase_list()</a> function searches the m17n database for data who have tags <b>tag0</b> through <b>tag3</b>, and returns their list by a plist. The value <a class="el" href="group__m17nSymbol.html#ga0346fc05efcccc8f11271b51c0fe3eeb" title="Symbol whose name is &quot;nil&quot;.">Mnil</a> in <b>tagn</b> means a wild card that matches any tag. Each element of the plist has key <a class="el" href="group__m17nSymbol.html#ga8769a573efbb023b4d77f9d03babc09f" title="Symbol whose name is &quot;t&quot;.">Mt</a> and value a pointer to type <a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e" title="Type of database.">MDatabase</a>. </p>

</div>
</div>
<a class="anchor" id="ga265cfa2587dfda9bdc84f7afd1aabb1d"></a><!-- doxytag: member="database.c::mdatabase_define" ref="ga265cfa2587dfda9bdc84f7afd1aabb1d" args="(MSymbol tag0, MSymbol tag1, MSymbol tag2, MSymbol tag3, void *(*loader)(MSymbol *, void *), void *extra_info)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e">MDatabase</a>* mdatabase_define </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a>&nbsp;</td>
          <td class="paramname"> <em>tag0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a>&nbsp;</td>
          <td class="paramname"> <em>tag1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a>&nbsp;</td>
          <td class="paramname"> <em>tag2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a>&nbsp;</td>
          <td class="paramname"> <em>tag3</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *(*)(<a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> *, void *)&nbsp;</td>
          <td class="paramname"> <em>loader</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>extra_info</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Define a data of the m17n database. </p>
<p>The <a class="el" href="group__m17nDatabase.html#ga265cfa2587dfda9bdc84f7afd1aabb1d" title="Define a data of the m17n database.">mdatabase_define()</a> function defines a data that has tags <b>tag0</b> through <b>tag3</b> and additional information <b>extra_info</b>.</p>
<p><b>loader</b> is a pointer to a function that loads the data from the database. This function is called from the <a class="el" href="group__m17nDatabase.html#ga62e5cf92d1b2836a9f6a988bcc20c26e" title="Load a data from the database.">mdatabase_load()</a> function with the two arguments <b>tags</b> and <b>extra_info</b>. Here, <b>tags</b> is the array of <b>tag0</b> through <b>tag3</b>.</p>
<p>If <b>loader</b> is <code>NULL</code>, the default loader of the m17n library is used. In this case, <b>extra_info</b> must be a string specifying a filename that contains the data.</p>
<dl class="user"><dt><b>Return value:</b></dt><dd>If the operation was successful, <a class="el" href="group__m17nDatabase.html#ga265cfa2587dfda9bdc84f7afd1aabb1d" title="Define a data of the m17n database.">mdatabase_define()</a> returns a pointer to the defined data, which can be used as an argument to <a class="el" href="group__m17nDatabase.html#ga62e5cf92d1b2836a9f6a988bcc20c26e" title="Load a data from the database.">mdatabase_load()</a>. Otherwise, it returns <code>NULL</code>.</dd></dl>
<dl class="user"><dt><b>See Also:</b></dt><dd><a class="el" href="group__m17nDatabase.html#ga62e5cf92d1b2836a9f6a988bcc20c26e" title="Load a data from the database.">mdatabase_load()</a>, <a class="el" href="group__m17nDatabase.html#ga265cfa2587dfda9bdc84f7afd1aabb1d" title="Define a data of the m17n database.">mdatabase_define()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga62e5cf92d1b2836a9f6a988bcc20c26e"></a><!-- doxytag: member="database.c::mdatabase_load" ref="ga62e5cf92d1b2836a9f6a988bcc20c26e" args="(MDatabase *mdb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* mdatabase_load </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e">MDatabase</a> *&nbsp;</td>
          <td class="paramname"> <em>mdb</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Load a data from the database. </p>
<p>The <a class="el" href="group__m17nDatabase.html#ga62e5cf92d1b2836a9f6a988bcc20c26e" title="Load a data from the database.">mdatabase_load()</a> function loads a data specified in <b>mdb</b> and returns the contents. The type of contents depends on the type of the data.</p>
<p>If the data is of the <em>plist</em> <em>type</em>, this function returns a pointer to <em>plist</em>.</p>
<p>If the database is of the <em>chartable</em> <em>type</em>, it returns a chartable. The default value of the chartable is set according to the second tag of the data as below:</p>
<ul>
<li>If the tag is <a class="el" href="group__m17nSymbol.html#ga6592d4eb3c46fe7fb8993c252b8fedeb" title="Symbol whose name is &quot;symbol&quot;.">Msymbol</a>, the default value is <a class="el" href="group__m17nSymbol.html#ga0346fc05efcccc8f11271b51c0fe3eeb" title="Symbol whose name is &quot;nil&quot;.">Mnil</a>. </li>
<li>If the tag is <a class="el" href="group__m17nPlist.html#ga0ce08eb57aa339db4d4745e75e80fdd8" title="Symbol whose name is &quot;integer&quot;.">Minteger</a>, the default value is -1. </li>
<li>Otherwise, the default value is <code>NULL</code>.</li>
</ul>
<p>If the data is of the <em>charset</em> <em>type</em>, it returns a plist of length 2 (keys are both <a class="el" href="group__m17nSymbol.html#ga8769a573efbb023b4d77f9d03babc09f" title="Symbol whose name is &quot;t&quot;.">Mt</a>). The value of the first element is an array of integers that maps code points to the corresponding character codes. The value of the second element is a chartable of integers that does the reverse mapping. The charset must be defined in advance.</p>
<dl class="user"><dt><b>See Also:</b></dt><dd><a class="el" href="group__m17nDatabase.html#ga62e5cf92d1b2836a9f6a988bcc20c26e" title="Load a data from the database.">mdatabase_load()</a>, <a class="el" href="group__m17nDatabase.html#ga265cfa2587dfda9bdc84f7afd1aabb1d" title="Define a data of the m17n database.">mdatabase_define()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga5362edb0cb91ff9c90d569d7aca58b39"></a><!-- doxytag: member="database.c::mdatabase_tag" ref="ga5362edb0cb91ff9c90d569d7aca58b39" args="(MDatabase *mdb)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a>* mdatabase_tag </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__m17nDatabase.html#ga185385212a1dcd2bbb8ec94ba31caf0e">MDatabase</a> *&nbsp;</td>
          <td class="paramname"> <em>mdb</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get tags of a data. </p>
<p>The <a class="el" href="group__m17nDatabase.html#ga5362edb0cb91ff9c90d569d7aca58b39" title="Get tags of a data.">mdatabase_tag()</a> function returns an array of tags (symbols) that identify the data in <b>mdb</b>. The length of the array is four. </p>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="ga29022d6905ce43de1ac69cd1f88b36f7"></a><!-- doxytag: member="database.c::mdatabase_dir" ref="ga29022d6905ce43de1ac69cd1f88b36f7" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* <a class="el" href="group__m17nDatabase.html#ga29022d6905ce43de1ac69cd1f88b36f7">mdatabase_dir</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Directory for application specific data. </p>
<p>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 <a class="el" href="group__m17nIntro.html#ga66879b35a1fee08b3e5966f6650c39f9" title="Initialize the m17n library.">M17N_INIT()</a>. The directory may contain a file "mdb.dir" which contains a list of data definitions in the format described in <a class="el" href="m17nDBFormat.html#mdbDir">mdbDir(5)</a>.</p>
<p>The default value is NULL. </p>

</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr>

<ADDRESS>
<a href="http://www.m17n.org/m17n-lib-en/index.html" target="mulewindow"><img src="parrot.png" align=bottom alt="m17n-lib Home" border=0></a>
</ADDRESS>
</body>
</HTML>

<!-- Copyright information

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