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 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2004
National Institute of Advanced Industrial Science and Technology (AIST)
This file is part of the m17n library documentation.
See the end for copying conditions.
-->
<html><head><meta http-equiv="Content-Type" content="text/html;charset="UTF-8">
<title>The m17n Library</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff">
<a name="top-of-page"></a>
<hr><center>
<a class="qindex" href="index.html">Main Page</a>
<a class="qindex" href="modules.html">Modules</a>
<!-- <a class="qindex" href="classes.html">Alphabetical List</a> -->
<a class="qindex" href="annotated.html">Data Structures</a>
<!-- <a class="qindex" href="files.html">File List</a> -->
<!-- <a class="qindex" href="functions.html">Data Fields</a> -->
<a class="qindex" href="globals.html">Globals</a>
<a class="qindex" href="pages.html">Appendix</a>
</center>
<hr>
<!-- Generated by Doxygen 1.3.9.1 -->
<h1>Locale<br>
<small>
[<a class="el" href="group__m17nShell.html">SHELL API</a>]</small>
</h1>Locale objects and API for them.
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="group__m17nLocale.html#ga0">MLocale</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nLocale.html#ga0">MLocale</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight"><code>struct</code> <code>MLocale</code>. <a href="#ga0"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__m17nLocale.html#ga0">MLocale</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nLocale.html#ga5">mlocale_set</a> (int category, const char *name)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the current locale. <a href="#ga5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nLocale.html#ga6">mlocale_get_prop</a> (<a class="el" href="group__m17nLocale.html#ga0">MLocale</a> *locale, <a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> key)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get the value of a locale property. <a href="#ga6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nLocale.html#ga7">mtext_ftime</a> (<a class="el" href="group__m17nMtext.html#ga0">MText</a> *mt, const char *format, const struct tm *tm, <a class="el" href="group__m17nLocale.html#ga0">MLocale</a> *locale)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Format date and time. <a href="#ga7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__m17nMtext.html#ga0">MText</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nLocale.html#ga8">mtext_getenv</a> (const char *name)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get an environment variable. <a href="#ga8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nLocale.html#ga9">mtext_putenv</a> (<a class="el" href="group__m17nMtext.html#ga0">MText</a> *mt)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Change or add an environment variable. <a href="#ga9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nLocale.html#ga10">mtext_coll</a> (<a class="el" href="group__m17nMtext.html#ga0">MText</a> *mt1, <a class="el" href="group__m17nMtext.html#ga0">MText</a> *mt2)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare two M-texts using the current locale. <a href="#ga10"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nLocale.html#ga1">Mlanguage</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nLocale.html#ga2">Mterritory</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nLocale.html#ga3">Mmodifier</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nLocale.html#ga4">Mcodeset</a></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The m17n library represents locale related information as objects of type <a class="el" href="group__m17nLocale.html#ga0">MLocale</a>. <hr><h2>Typedef Documentation</h2>
<a class="anchor" name="ga0" doxytag="m17n.h::MLocale"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">typedef struct <a class="el" href="group__m17nLocale.html#ga0">MLocale</a> <a class="el" href="group__m17nLocale.html#ga0">MLocale</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The structure <code>MLocale</code> is used to hold information about name, language, territory, modifier, codeset, and the corresponding coding system of locales.<p>
The contents of this structure are implementation dependent. Its internal structure is concealed from application programs.<p>
<dl compact><dt><b>See Also:</b></dt><dd><a class="el" href="group__m17nLocale.html#ga6">mlocale_get_prop()</a> </dd></dl>
</td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ga5" doxytag="locale.c::mlocale_set"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="group__m17nLocale.html#ga0">MLocale</a>* mlocale_set </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname" nowrap> <em>category</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>name</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The <a class="el" href="group__m17nLocale.html#ga5">mlocale_set()</a> function sets or query a part of the current locale. The part is specified by <b>category</b> which must be a valid first argument to <code>setlocale()</code>.<p>
If <b>locale</b> is not NULL, the locale of the specified part is set to <b>locale</b>. If <b>locale</b> is not supported by the system, the current locale is not changed.<p>
If <b>locale</b> is NULL, the current locale of the specified part is queried.<p>
<dl compact><dt><b>Return value:</b></dt><dd>If the call is successful, <a class="el" href="group__m17nLocale.html#ga5">mlocale_set()</a> returns an opaque locale object that corresponds to the locale. The name of the locale can be acquired by the function <a class="el" href="group__m17nLocale.html#ga6">mlocale_get_prop()</a>.</dd></dl>
Otherwise, it returns NULL.<p>
<dl compact><dt><b>Errors:</b></dt><dd><code>MERROR_LOCALE</code> </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga6" doxytag="locale.c::mlocale_get_prop"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> mlocale_get_prop </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="group__m17nLocale.html#ga0">MLocale</a> * </td>
<td class="mdname" nowrap> <em>locale</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> </td>
<td class="mdname" nowrap> <em>key</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The <a class="el" href="group__m17nLocale.html#ga6">mlocale_get_prop()</a> function returns the value of a property <b>key</b> of local <b>locale</b>. <b>key</b> must be <a class="el" href="group__m17nCharacter.html#ga1">Mname</a>, <a class="el" href="group__m17nLocale.html#ga1">Mlanguage</a>, <a class="el" href="group__m17nLocale.html#ga2">Mterritory</a>, <a class="el" href="group__m17nLocale.html#ga4">Mcodeset</a>, <a class="el" href="group__m17nLocale.html#ga3">Mmodifier</a>, or <a class="el" href="group__m17nConv.html#ga37">Mcoding</a>. </td>
</tr>
</table>
<a class="anchor" name="ga7" doxytag="locale.c::mtext_ftime"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int mtext_ftime </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="group__m17nMtext.html#ga0">MText</a> * </td>
<td class="mdname" nowrap> <em>mt</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const char * </td>
<td class="mdname" nowrap> <em>format</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>const struct tm * </td>
<td class="mdname" nowrap> <em>tm</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="group__m17nLocale.html#ga0">MLocale</a> * </td>
<td class="mdname" nowrap> <em>locale</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The <a class="el" href="group__m17nLocale.html#ga7">mtext_ftime()</a> function formats the broken-down time <b>tm</b> according to the format specification <b>format</b> and append the result to the M-text <b>mt</b>. The formating is done according to the locale <b>locale</b> (if not NULL) or the current locale (LC_TIME).<p>
The meaning of the arguments <b>tm</b> and <b>format</b> are the same as those of strftime().<p>
<dl compact><dt><b>See Also:</b></dt><dd>strftime() </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga8" doxytag="locale.c::mtext_getenv"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="group__m17nMtext.html#ga0">MText</a>* mtext_getenv </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const char * </td>
<td class="mdname1" valign="top" nowrap> <em>name</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The <a class="el" href="group__m17nLocale.html#ga8">mtext_getenv()</a> function searches the environment variable list for a string that matches the string pointed to by <b>name</b>.<p>
If there is a match, the function decodes the value according to the current locale (LC_CTYPE) into an M-text, and return that M-text.<p>
If there is no match, the function returns NULL. </td>
</tr>
</table>
<a class="anchor" name="ga9" doxytag="locale.c::mtext_putenv"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int mtext_putenv </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="group__m17nMtext.html#ga0">MText</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>mt</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The <a class="el" href="group__m17nLocale.html#ga9">mtext_putenv()</a> function changes or adds the value of environment variables according to M-text <b>mt</b>. It calls the function <code>putenv</code> with an argument generated by encoding <b>mt</b> according to the current locale (LC_CTYPE).<p>
<dl compact><dt><b>Return value:</b></dt><dd>This function returns zero on success, or -1 if an error occurs. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="ga10" doxytag="locale.c::mtext_coll"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int mtext_coll </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="group__m17nMtext.html#ga0">MText</a> * </td>
<td class="mdname" nowrap> <em>mt1</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="group__m17nMtext.html#ga0">MText</a> * </td>
<td class="mdname" nowrap> <em>mt2</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The <a class="el" href="group__m17nLocale.html#ga10">mtext_coll()</a> function compares the two M-texts <b>mt1</b> and <b>mt2</b>. It returns an integer less than, equal to, or greater than zero if <b>mt1</b> is found, respectively, to be less than, to match, or to be greater than <b>mt2</b>. The comparison is based on texts as appropriate for the current locale (LC_COLLATE).<p>
This function makes use of information that is automatically cached in the M-texts as a text property. So, the second call of this function with <b>mt1</b> or <b>mt2</b> finishes faster than the first call. </td>
</tr>
</table>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="ga1" doxytag="locale.c::Mlanguage"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> <a class="el" href="group__m17nLocale.html#ga1">Mlanguage</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The symbol whose name is "language". </td>
</tr>
</table>
<a class="anchor" name="ga2" doxytag="locale.c::Mterritory"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> <a class="el" href="group__m17nLocale.html#ga2">Mterritory</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The symbol whose name is "territory". </td>
</tr>
</table>
<a class="anchor" name="ga3" doxytag="locale.c::Mmodifier"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> <a class="el" href="group__m17nLocale.html#ga3">Mmodifier</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The symbol whose name is "modifier". </td>
</tr>
</table>
<a class="anchor" name="ga4" doxytag="locale.c::Mcodeset"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="group__m17nSymbol.html#ga0">MSymbol</a> <a class="el" href="group__m17nLocale.html#ga4">Mcodeset</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The symbol whose name is "codeset". </td>
</tr>
</table>
<hr>
<center>
<a href="#top-of-page">Top of this page</a><br><br>
<a class="qindex" href="index.html">Main Page</a>
<a class="qindex" href="modules.html">Modules</a>
<!-- <a class="qindex" href="classes.html">Alphabetical List</a> -->
<a class="qindex" href="annotated.html">Data Structures</a>
<!-- <a class="qindex" href="files.html">File List</a> -->
<!-- <a class="qindex" href="functions.html">Data Fields</a> -->
<a class="qindex" href="globals.html">Globals</a>
<a class="qindex" href="pages.html">Appendix</a>
</center>
<hr>
<ADDRESS>
<a href="http://www.m17n.org/m17n-lib/index.html" target="mulewindow"><img src="parrot.png" align=bottom alt="mulemark" border=0></a>
<A HREF="mailto:mule-aist@m17n.org">mule-aist@m17n.org</a>
</ADDRESS>
</body>
</HTML>
<!-- Copyright information
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2004
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, Front-Cover Texts "The m17n library documentation",
and no Back-Cover Texts. A copy of the license is included in the
appendix entitled "GNU Free Documentation License".
-->
|