aboutsummaryrefslogtreecommitdiff
path: root/libX11/specs/i18n/framework/framework.xml
blob: ab1dac6b69ccfbae7b3c3ab07d50e16864fb9321 (plain)
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
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">

<book id="framework">

<bookinfo>
   <title>X11R6 Sample Implementation Frame Work</title>
   <releaseinfo>X Version 11, Release 7</releaseinfo>
   <authorgroup>
      <othercredit>
         <firstname>Katsuhisa</firstname><surname>Yano</surname>
         <affiliation><orgname>TOSHIBA Corporation</orgname></affiliation>
      </othercredit>
      <othercredit>
         <firstname>Yoshio</firstname><surname>Horiuchi</surname>
         <affiliation><orgname>IBM Japan</orgname></affiliation>
      </othercredit>
   </authorgroup>
   <copyright><year>1994</year><holder>TOSHIBA Corporation</holder></copyright>
   <copyright><year>1994</year><holder>IBM Corporation</holder></copyright>

<legalnotice>

<para>
Permission to use, copy, modify, and distribute this documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice and this permission notice appear in all copies. TOSHIBA Corporation and
IBM Corporation make no representations about the suitability for any purpose of the information in this document.
This documentation is provided as is without express or implied warranty.
</para>

<para>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following
conditions:
</para>

<para>
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
</para>

<para>
THE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN
NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
</para>

<para>
Except as contained in this notice, the name of The Open Group shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from X Consortium.
</para>

<para>X Window System is a trademark of The Open Group.</para>

</legalnotice>
</bookinfo>

<chapter id="framework_">
<title>Framework</title>
<sect1 id="preface">
<title>Preface</title>
<para>
This document proposes to define the structures, methods and their
signatures that are expected to be common to all locale dependent
functions within the Xlib sample implementation.  The following
illustration (Fig.1) <!-- xref --> is proposed to outline the separating of
the components within the sample implementation.
</para>

<para>
Preface drawing.
</para>

<mediaobject  id="framework_locale_service_api_proposal">
  <imageobject>
    <imagedata   width="540px" depth="530px" contentwidth="560px" contentdepth="550px" format="SVG"  fileref="framework.svg"/>
  </imageobject>
  <caption>Frame work of Locale Service API Proposal</caption>
</mediaobject>

<para>
Generally speaking, the internationalized portion of Xlib (Locale
Dependent X, LDX) consists of three objects;
locale (LC) , input method (IM) and output method (OM).
The LC provides a set of information that depends on user's language
environment.  The IM manages text inputing, and the OM manages text
drawing.  Both IM and OM highly depend on LC data.
</para>

<para>
In X11R5, there are two sample implementations, Ximp and Xsi, for
Xlib internationalization.  But in both implementations, IM and OM
actually refer the private extension of LC.  It breaks coexistence
of these two sample implementations.  For example, if a user creates
a new OM for special purpose as a part of Ximp, it will not work with
Xsi.
</para>

<para>
As a solution of this problem, we propose to define the standard
APIs between these three objects, and define the structure that are
common to these objects.
</para>
</sect1>

<sect1 id="Objective">
<title>Objective</title>

<itemizedlist>
  <listitem>
    <para>
Explain the current X11R6 sample implementation
    </para>
  </listitem>
  <listitem>
    <para>
Document the common set of locale dependent interfaces
    </para>
  </listitem>
  <listitem>
    <para>
Provide more flexible pluggable layer
    </para>
  </listitem>
</itemizedlist>
</sect1>

<sect1 id="Locale_Object_Binding_Functions">
<title>Locale Object Binding Functions</title>
<!-- .XS (SN Locale Object Binding Functions -->
<!-- .XE  -->
<para>
This chapter describes functions related locale object binding for
implementing the pluggable layer.
</para>

<para>
A locale loader is an entry point for locale object, which
instantiates XLCd object and binds locale methods with specified
locale name. The behavior of loader is implementation dependent.
And, what kind of loaders are available is also implementation
dependent.
</para>

<para>
<!-- .LP -->
The loader is called in
<function>_XOpenLC, </function>
but caller of
<function>_XOpenLC </function>
does not need to care about its inside.  For example, if the loader is
implemented with dynamic load functions, and the dynamic module is
expected to be unloaded when the corresponding XLCd is freed,
close methods of XLCdMethods should handle unloading.
</para>

<para>
<emphasis role="bold">Initializing a locale loader list</emphasis>
</para>

<para>void _XlcInitLoader</para>


<para>
The
<function>_XlcInitLoader</function>
function initializes the locale loader list with vendor specific
manner.  Each loader is registered with calling
<function>_XlcAddLoader.</function>
The number of loaders and their order in the loader list is
implementation dependent.
</para>

<para>
<emphasis role="bold">Add a loader</emphasis>
</para>

<literallayout>
typedef XLCd (*XLCdLoadProc)(<emphasis remap='I'>name</emphasis>);
      char <emphasis remap='I'>*name</emphasis>;

typedef int XlcPosition;

#define   XlcHead
#define   XlcTail
</literallayout>

<funcsynopsis>
<funcprototype>
  <funcdef>Bool <function> _XlcAddLoader</function></funcdef>
  <paramdef>XLCdLoadProc<parameter> proc</parameter></paramdef>
  <paramdef>XlcPosition<parameter> position</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_XlcAddLoader</function>
function registers the specified locale loader "<emphasis remap='I'>proc</emphasis>" to the
internal loader list.  The position specifies that the loader
"<emphasis remap='I'>proc</emphasis>" should be placed in the top of the loader list(XlcHead)
or last(XlcTail).
</para>

<para>
The object loader is called from the top of the loader list in order,
when calling time.
</para>

<para>
<function>Remove a loader</function>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>void <function> _XlcRemoveLoader</function></funcdef>
  <paramdef>XLCdLoadProc<parameter> proc</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_XlcRemoveLoader</function>
function removes the locale loader specified by "<emphasis remap='I'>proc</emphasis>" from the
loader list.
</para>

<para>
Current implementation provides following locale loaders;
</para>

<literallayout>
<function>_XlcDefaultLoader</function>
<function>_XlcGenericLoader</function>
<function>_XlcEucLoader</function>
<function>_XlcSjisLoader</function>
<function>_XlcUtfLoader</function>
<function>_XaixOsDynamicLoad</function>
</literallayout>

</sect1>

<sect1 id="Locale_Method_Interface">
<title>Locale Method Interface</title>

<para>
This chapter describes the locale method API, which is a set of
accessible functions from both IM and OM parts.
The locale method API provides the functionalities;  obtaining locale
dependent information, handling charset, converting text, etc.
</para>

<para>
As a result of using these APIs instead of accessing vender private
extension of the locale object, we can keep locale, IM and OM
independently each other.
</para>

</sect1>

<sect1 id="Locale_Method_Functions">
<title>Locale Method Functions</title>
<para>
<function>Open a Locale Method</function>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>XLCd <function> _XOpenLC</function></funcdef>
  <paramdef>char<parameter> *name</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_XOpenLC</function>
function opens a locale method which corresponds to the
specified locale name.
<function>_XOpenLC</function>
calls a locale object loader, which is registered via
<function>_XlcAddLoader into the internal loader list.  If the called loader </function>
is valid and successfully opens a locale,
<function>_XOpenLC</function>
returns the XLCd.  If the loader is invalid or failed to open a locale,
<function>_XOpenLC</function>
calls the next loader.  If all registered loaders cannot open a locale,
<function>_XOpenLC</function>
returns NULL.
</para>

<para>XLCd _XlcCurrentLC</para>

<para>
The
<function>_XlcCurrentLC</function>
function returns an XLCd that are bound to current locale.
</para>

<para>
<emphasis role="bold">Close a Locale Method</emphasis>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>void <function> _XCloseLC</function></funcdef>
  <paramdef>XLCd<parameter> lcd</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
<!-- .LP -->
The
<function>_XCloseLC</function>
function close a locale method the specified lcd.
</para>

<para>
<emphasis role="bold">Obtain Locale Method values</emphasis>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>char *<function>_XGetLCValues</function></funcdef>
  <paramdef>XLCd<parameter> lcd</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_XGetLCValues</function>
function returns NULL if no error occurred; otherwise, it returns the
name of the first argument that could not be obtained.
The following values are defined as standard arguments. Other values
are implementation dependent.
</para>

<informaltable frame="none">
  <tgroup cols='3' align='left'>
  <colspec colname='c1' colwidth="3*" colsep="0"/>
  <colspec colname='c2' colwidth="1*" colsep="0"/>
  <colspec colname='c3' colwidth="3*" colsep="0"/>
  <thead>
    <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>Description</entry>
    </row>
  </thead>
  <tbody>
    <row rowsep="0">
      <entry>XlcNCodeset</entry>
      <entry>char*</entry>
      <entry>codeset part of locale name</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNDefaultString</entry>
      <entry>char*</entry>
      <entry>XDefaultString()</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNEncodingName</entry>
      <entry>char*</entry>
      <entry>encoding name</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNLanguage</entry>
      <entry>char*</entry>
      <entry>language part of locale name</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNMbCurMax</entry>
      <entry>int</entry>
      <entry>ANSI C MB_CUR_MAX</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNStateDependentEncoding</entry>
      <entry>Bool</entry>
      <entry>is state-dependent encoding or not</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNTerritory</entry>
      <entry>char*</entry>
      <entry>territory part of locale name</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

</sect1>

<sect1 id="Charset_functions">
<title>Charset functions</title>
<para>
The XlcCharSet is an identifier which represents a subset of characters
(character set) in the locale object.
</para>

<literallayout class="monospaced">
typedef enum {
      XlcUnknown, XlcC0, XlcGL, XlcC1, XlcGR, XlcGLGR, XlcOther
} XlcSide;

typedef struct _XlcCharSetRec *XlcCharSet;

typedef struct {
      char *name;
      XPointer value;
} XlcArg, *XlcArgList;

typedef char* (*XlcGetCSValuesProc)(<emphasis remap='I'>charset</emphasis>, <emphasis remap='I'>args</emphasis>, <emphasis remap='I'>num_args</emphasis>);
      XlcCharSet <emphasis remap='I'>charset</emphasis>;
      XlcArgList <emphasis remap='I'>args</emphasis>;
      int <emphasis remap='I'>num_args</emphasis>;

typedef struct _XlcCharSetRec {
      char *name;
      XrmQuark xrm_name;
      char *encoding_name;
      XrmQuark xrm_encoding_name;
      XlcSide side;
      int char_size;
      int set_size;
      char *ct_sequence;
      XlcGetCSValuesProc get_values;
} XlcCharSetRec;
</literallayout>

<para>
<emphasis role="bold">Get an XlcCharSet</emphasis>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>XlcCharSet <function> _XlcGetCharSet</function></funcdef>
  <paramdef>char<parameter> *name</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_XlcGetCharSet</function>
function gets an XlcCharSet which corresponds to the charset name
specified by "<emphasis remap='I'>name</emphasis>".
<function>_XlcGetCharSet </function>
returns NULL, if no XlcCharSet bound to specified "<emphasis remap='I'>name</emphasis>".
</para>

<para>
The following character sets are pre-registered.
</para>

<informaltable frame="none">
  <tgroup cols='2' align='left'>
  <colspec colname='c1' colwidth="1*" colsep="0"/>
  <colspec colname='c2' colwidth="2*" colsep="0"/>
  <thead>
    <row>
      <entry>Name</entry>
      <entry>Description</entry>
    </row>
  </thead>
  <tbody>
    <row rowsep="0">
      <entry>ISO8859-1:GL</entry>
      <entry>7-bit ASCII graphics (ANSI X3.4-1968),</entry>
    </row>
    <row rowsep="0">
      <entry></entry>
      <entry>Left half of ISO 8859 sets</entry>
    </row>
    <row rowsep="0">
      <entry>JISX0201.1976-0:GL</entry>
      <entry>Left half of JIS X0201-1976 (reaffirmed 1984),</entry>
    </row>
    <row rowsep="0">
      <entry></entry>
      <entry>8-Bit Alphanumeric-Katakana Code</entry>
    </row>
    <row rowsep="0">
      <entry>ISO8859-1:GR</entry>
      <entry>Right half of ISO 8859-1, Latin alphabet No. 1</entry>
    </row>
    <row rowsep="0">
      <entry>ISO8859-2:GR</entry>
      <entry>Right half of ISO 8859-2, Latin alphabet No. 2</entry>
    </row>
    <row rowsep="0">
      <entry>ISO8859-3:GR</entry>
      <entry>Right half of ISO 8859-3, Latin alphabet No. 3</entry>
    </row>
    <row rowsep="0">
      <entry>ISO8859-4:GR</entry>
      <entry>Right half of ISO 8859-4, Latin alphabet No. 4</entry>
    </row>
    <row rowsep="0">
      <entry>ISO8859-7:GR</entry>
      <entry>Right half of ISO 8859-7, Latin/Greek alphabet</entry>
    </row>
    <row rowsep="0">
      <entry>ISO8859-6:GR</entry>
      <entry>Right half of ISO 8859-6, Latin/Arabic alphabet</entry>
    </row>
    <row rowsep="0">
      <entry>ISO8859-8:GR</entry>
      <entry>Right half of ISO 8859-8, Latin/Hebrew alphabet</entry>
    </row>
    <row rowsep="0">
      <entry>ISO8859-5:GR</entry>
      <entry>Right half of ISO 8859-5, Latin/Cyrillic alphabet</entry>
    </row>
    <row rowsep="0">
      <entry>ISO8859-9:GR</entry>
      <entry>Right half of ISO 8859-9, Latin alphabet No. 5</entry>
    </row>
    <row rowsep="0">
      <entry>JISX0201.1976-0:GR</entry>
      <entry>Right half of JIS X0201-1976 (reaffirmed 1984),</entry>
    </row>
    <row rowsep="0">
      <entry></entry>
      <entry>8-Bit Alphanumeric-Katakana Code</entry>
    </row>
    <row rowsep="0">
      <entry>GB2312.1980-0:GL</entry>
      <entry>GB2312-1980, China (PRC) Hanzi defined as GL</entry>
    </row>
    <row rowsep="0">
      <entry>GB2312.1980-0:GR</entry>
      <entry>GB2312-1980, China (PRC) Hanzi defined as GR</entry>
    </row>
    <row rowsep="0">
      <entry>JISX0208.1983-0:GL</entry>
      <entry>JIS X0208-1983, Japanese Graphic Character Set</entry>
    </row>
    <row rowsep="0">
      <entry></entry>
      <entry>defined as GL</entry>
    </row>
    <row rowsep="0">
      <entry>JISX0208.1983-0:GR</entry>
      <entry>JIS X0208-1983, Japanese Graphic Character Set</entry>
    </row>
    <row rowsep="0">
      <entry></entry>
      <entry>defined as GR</entry>
    </row>
    <row rowsep="0">
      <entry>KSC5601.1987-0:GL</entry>
      <entry>KS C5601-1987, Korean Graphic Character Set</entry>
    </row>
    <row rowsep="0">
      <entry></entry>
      <entry>defined as GL</entry>
    </row>
    <row rowsep="0">
      <entry>KSC5601.1987-0:GR</entry>
      <entry>KS C5601-1987, Korean Graphic Character Set</entry>
    </row>
    <row rowsep="0">
      <entry></entry>
      <entry>defined as GR</entry>
    </row>
    <row rowsep="0">
      <entry>JISX0212.1990-0:GL</entry>
      <entry>JIS X0212-1990, Japanese Graphic Character Set</entry>
    </row>
    <row rowsep="0">
      <entry></entry>
      <entry>defined as GL</entry>
    </row>
    <row rowsep="0">
      <entry>JISX0212.1990-0:GR</entry>
      <entry>JIS X0212-1990, Japanese Graphic Character Set</entry>
    </row>
    <row rowsep="0">
      <entry></entry>
      <entry>defined as GR</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

<para>
<emphasis role="bold">Add an XlcCharSet</emphasis>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>Bool <function> _XlcAddCharSet</function></funcdef>
  <paramdef>XlcCharSet<parameter> charset</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_XlcAddCharSet</function>
function registers XlcCharSet specified by "<emphasis remap='I'>charset</emphasis>".
</para>

<para>
<!-- .LP -->
<!-- .sp -->
<function>Obtain Character Set values</function>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>char * <function> _XlcGetCSValues</function></funcdef>
  <paramdef>XlcCharSet<parameter> charset</parameter></paramdef>
  <paramdef><parameter> ...</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_XlcGetCSValues</function>
function returns NULL if no error occurred;
otherwise, it returns the name of the first argument that could not
be obtained.  The following values are defined as standard arguments.
Other values are implementation dependent.
</para>

<informaltable frame="none">
  <tgroup cols='3' align='left'>
  <colspec colname='c1' colwidth="3*" colsep="0"/>
  <colspec colname='c2' colwidth="1*" colsep="0"/>
  <colspec colname='c3' colwidth="3*" colsep="0"/>
  <thead>
    <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>Description</entry>
    </row>
  </thead>
  <tbody>
    <row rowsep="0">
      <entry>XlcNName</entry>
      <entry>char*</entry>
      <entry>charset name</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNEncodingName</entry>
      <entry>char*</entry>
      <entry>XLFD CharSet Registry and Encoding</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNSide</entry>
      <entry>XlcSide</entry>
      <entry>charset side (GL, GR, ...)</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNCharSize</entry>
      <entry>int</entry>
      <entry>number of octets per character</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNSetSize</entry>
      <entry>int</entry>
      <entry>number of character sets</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNControlSequence</entry>
      <entry>char*</entry>
      <entry>control sequence of Compound Text</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

</sect1>

<sect1 id="Converter_Functions">
<title>Converter Functions</title>
<para>
We provide a set of the common converter APIs, that are independent
from both of source and destination text type.
</para>

<literallayout class="monospaced">
typedef struct _XlcConvRec *XlcConv;

typedef void (*XlcCloseConverterProc)(<emphasis remap='I'>conv</emphasis>);
      XlcConv <emphasis remap='I'>conv</emphasis>;

typedef int (*XlcConvertProc)(<emphasis remap='I'>conv</emphasis>, <emphasis remap='I'>from</emphasis>, <emphasis remap='I'>from_left</emphasis>, <emphasis remap='I'>to</emphasis>, <emphasis remap='I'>to_left</emphasis>, <emphasis remap='I'>args</emphasis>, <emphasis remap='I'>num_args</emphasis>);
      XlcConv <emphasis remap='I'>conv</emphasis>;
      XPointer <emphasis remap='I'>*from</emphasis>;
      int <emphasis remap='I'>*from_left</emphasis>;
      XPointer <emphasis remap='I'>*to</emphasis>;
      int <emphasis remap='I'>*to_left</emphasis>;
      XPointer <emphasis remap='I'>*args</emphasis>;
      int <emphasis remap='I'>num_args</emphasis>;

typedef void (*XlcResetConverterProc)(<emphasis remap='I'>conv</emphasis>);
      XlcConv <emphasis remap='I'>conv</emphasis>;

typedef struct _XlcConvMethodsRec {
      XlcCloseConverterProc close;
      XlcConvertProc convert;
      XlcResetConverterProc reset;
} XlcConvMethodsRec, *XlcConvMethods;

typedef struct _XlcConvRec {
    XlcConvMethods methods;
    XPointer state;
} XlcConvRec;
</literallayout>

<para>
<function>Open a converter</function>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>XlcConv <function> _XlcOpenConverter</function></funcdef>
  <paramdef>XLCd<parameter> from_lcd</parameter></paramdef>
  <paramdef>char<parameter> *from_type</parameter></paramdef>
  <paramdef>XLCd<parameter> to_lcd</parameter></paramdef>
  <paramdef>char<parameter> *to_type</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
<function>_XlcOpenConverter </function>
function opens the converter which converts a text from specified
"<emphasis remap='I'>from_type</emphasis>" to specified "<emphasis remap='I'>to_type</emphasis>" encoding.  If the
function cannot find proper converter or cannot open a corresponding
converter, it returns NULL.  Otherwise, it returns the conversion
descriptor.
</para>

<para>
The following types are pre-defined. Other types are implementation
dependent.
</para>

<informaltable>
  <tgroup cols='4' align='left'>
  <colspec colname='c1' colwidth="3*" colsep="0"/>
  <colspec colname='c2' colwidth="1*" colsep="0"/>
  <colspec colname='c3' colwidth="3*" colsep="0"/>
  <colspec colname='c4' colwidth="2*" colsep="0"/>
  <thead>
    <row>
      <entry>Name</entry>
      <entry>Type</entry>
      <entry>Description</entry>
      <entry>Arguments</entry>
    </row>
  </thead>
  <tbody>
    <row rowsep="0">
      <entry>XlcNMultiByte</entry>
      <entry>char *</entry>
      <entry>multibyte</entry>
      <entry>-</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNWideChar</entry>
      <entry>wchar_t *</entry>
      <entry>wide character</entry>
      <entry>-</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNCompoundText</entry>
      <entry>char *</entry>
      <entry>COMPOUND_TEXT</entry>
      <entry>-</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNString</entry>
      <entry>char *</entry>
      <entry>STRING</entry>
      <entry>-</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNCharSet</entry>
      <entry>char *</entry>
      <entry>per charset</entry>
      <entry>XlcCharSet</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNChar</entry>
      <entry>char *</entry>
      <entry>per character</entry>
      <entry>XlcCharSet</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

<para>
<emphasis role="bold">Close a converter</emphasis>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>void <function> _XlcCloseConverter</function></funcdef>
  <paramdef>XlcConv<parameter> conv</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_XlcCloseConverter</function>
function closes the specified converter "<emphasis remap='I'>conv</emphasis>".
</para>

<para>
<emphasis role="bold">Code conversion</emphasis>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _XlcConvert</function></funcdef>
  <paramdef>XlcConv<parameter> conv</parameter></paramdef>
  <paramdef>XPointer<parameter> *from</parameter></paramdef>
  <paramdef>int<parameter> *from_left</parameter></paramdef>
  <paramdef>XPointer<parameter> *to</parameter></paramdef>
  <paramdef>int<parameter> *to_left</parameter></paramdef>
  <paramdef>XPointer<parameter> *args</parameter></paramdef>
  <paramdef>int<parameter> num_args</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_XlcConvert</function>
function converts a sequence of characters from one type, in the array
specified by "<emphasis remap='I'>from</emphasis>", into a sequence of corresponding characters
in another type, in the array specified by "<emphasis remap='I'>to</emphasis>".  The types are
those specified in the
<function>_XlcOpenConverter() </function>
call that returned the conversion descriptor, "<emphasis remap='I'>conv</emphasis>".
The arguments "<emphasis remap='I'>from</emphasis>", "<emphasis remap='I'>from_left</emphasis>", "<emphasis remap='I'>to</emphasis>" and
"<emphasis remap='I'>to_left</emphasis>" have the same specification of XPG4 iconv function.
</para>

<para>
For state-dependent encodings, the conversion descriptor "<emphasis remap='I'>conv</emphasis>"
is placed into its initial shift state by a call for which "<emphasis remap='I'>from</emphasis>"
is a NULL pointer, or for which "<emphasis remap='I'>from</emphasis>" points to a null pointer.
</para>

<para>
The following 2 converters prepared by locale returns appropriate
charset (XlcCharSet) in an area pointed by args[0].
</para>

<informaltable frame="none">
  <tgroup cols='3' align='left'>
  <colspec colname='c1' colwidth="1*" colsep="0"/>
  <colspec colname='c2' colwidth="1*" colsep="0"/>
  <colspec colname='c3' colwidth="2*" colsep="0"/>
  <thead>
    <row>
      <entry>From</entry>
      <entry>To</entry>
      <entry>Description</entry>
    </row>
  </thead>
  <tbody>
    <row rowsep="0">
      <entry>XlcNMultiByte</entry>
      <entry>XlcNCharSet</entry>
      <entry>Segmentation (Decomposing)</entry>
    </row>
    <row rowsep="0">
      <entry>XlcNWideChar</entry>
      <entry>XlcNCharSet</entry>
      <entry>Segmentation (Decomposing)</entry>
    </row>
  </tbody>
  </tgroup>
</informaltable>

<para>
The conversion, from XlcNMultiByte/XlcNWideChar to XlcNCharSet,
extracts a segment which has same charset encoding characters.
More than one segment cannot be converted in a call.
</para>

<para>
<emphasis role="bold">Reset a converter</emphasis>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>void <function> _XlcResetConverter</function></funcdef>
  <paramdef>XlcConv<parameter> conv</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_XlcResetConverter </function>
function reset the specified converter "<emphasis remap='I'>conv</emphasis>".
</para>

<para>
<emphasis role="bold">Register a converter</emphasis>
</para>

<literallayout class="monospaced">
typedef XlcConv (*XlcOpenConverterProc)(<emphasis remap='I'>from_lcd</emphasis>, <emphasis remap='I'>from_type</emphasis>, <emphasis remap='I'>to_lcd</emphasis>, <emphasis remap='I'>to_type</emphasis>);
      XLCd <emphasis remap='I'>from_lcd</emphasis>;
      char <emphasis remap='I'>*from_type</emphasis>;
      XLCd <emphasis remap='I'>to_lcd</emphasis>;
      char <emphasis remap='I'>*to_type</emphasis>;
</literallayout>

<funcsynopsis>
<funcprototype>
  <funcdef>Bool <function> _XlcSetConverter</function></funcdef>
  <paramdef>XLCd<parameter> from_lcd</parameter></paramdef>
  <paramdef>char<parameter> *from</parameter></paramdef>
  <paramdef>XLCd<parameter> to_lcd</parameter></paramdef>
  <paramdef>char<parameter> *to</parameter></paramdef>
  <paramdef>XlcOpenConverterProc<parameter> converter</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The <function>XlcSetConverter</function> function registers a converter which convert
from "<emphasis remap='I'>from_type</emphasis>" to "<emphasis remap='I'>to_type</emphasis>" into the converter list
(in the specified XLCd).
</para>
</sect1>

<sect1 id="X_Locale_Database_functions">
<title>X Locale Database functions</title>
<para>
X Locale Database contains the subset of user's environment that
depends on language.  The following APIs are provided for accessing
X Locale Database and other locale relative files.
</para>

<para>
For more detail about  X Locale Database, please refer
X Locale Database Definition document.
</para>

<para>
<emphasis role="bold">Get a resource from database</emphasis>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>void <function> _XlcGetResource</function></funcdef>
  <paramdef>XLCd<parameter> lcd</parameter></paramdef>
  <paramdef>char<parameter> *category</parameter></paramdef>
  <paramdef>char<parameter> *class</parameter></paramdef>
  <paramdef>char<parameter> ***value</parameter></paramdef>
  <paramdef>int<parameter> *count</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_XlcGetResource</function>
function obtains a locale dependent data which is associated with the
locale of specified "<emphasis remap='I'>lcd</emphasis>".
The locale data is provided by system locale or by X Locale Database
file, and what kind of data is available is implementation dependent.
</para>

<para>
The specified "<emphasis remap='I'>category</emphasis>" and "<emphasis remap='I'>class</emphasis>" are used for
finding out the objective locale data.
</para>

<para>
The returned  value is returned in value argument in string list form,
and the returned count shows the number of strings in the value.
</para>

<para>
The returned value is owned by locale method, and should not be modified
or freed by caller.
</para>

<para>
<emphasis role="bold">Get a locale relative file name</emphasis>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>char *<function>_XlcFileName</function></funcdef>
  <paramdef>XLCd<parameter> lcd</parameter></paramdef>
  <paramdef>char<parameter> *category</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_XlcFileName</function>
functions returns a file name which is bound to the specified "<emphasis remap='I'>lcd</emphasis>"
and "<emphasis remap='I'>category</emphasis>", as a null-terminated string.  If no file name can
be found, or there is no readable file for the found file name,
<function>_XlcFileName</function>
returns NULL.  The returned file name should be freed by caller.
</para>

<para>
The rule for searching a file name is implementation dependent.
In current implementation,
<function>_XlcFileName </function>
uses "{category}.dir" file as mapping table, which has pairs of
strings, a full locale name and a corresponding file name.
</para>

</sect1>

<sect1 id="Utility_Functions">
<title>Utility Functions</title>

<para>
<emphasis role="bold">Compare Latin-1 strings</emphasis>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _XlcCompareISOLatin1</function></funcdef>
  <paramdef>char*str1,<parameter> *str2</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _XlcNCompareISOLatin1</function></funcdef>
  <paramdef>char*str1,<parameter> *str2</parameter></paramdef>
  <paramdef>int<parameter> len</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_XlcCompareIsoLatin1 </function>
function to compares two ISO-8859-1 strings.  Bytes representing ASCII lower
case letters are converted to upper case before making the comparison.
The value returned is an integer less than, equal to, or greater than
zero, depending on whether "<emphasis remap='I'>str1</emphasis>" is lexicographicly less than,
equal to, or greater than "<emphasis remap='I'>str2</emphasis>".
</para>

<para>
The
<function>_XlcNCompareIsoLatin1</function>
function is identical to
<function>_XlcCompareISOLatin1,</function>
except that at most "<emphasis remap='I'>len</emphasis>" bytes are compared.
</para>

<para>
<emphasis role="bold">Resource Utility</emphasis>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> XlcNumber</function></funcdef>
  <paramdef>ArrayType<parameter> array</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
Similar to XtNumber.
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>void <function> _XlcCopyFromArg</function></funcdef>
  <paramdef>char<parameter> *src</parameter></paramdef>
  <paramdef>char<parameter> *dst</parameter></paramdef>
  <paramdef>int<parameter> size</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<funcsynopsis>
<funcprototype>
  <funcdef>void <function> _XlcCopyToArg</function></funcdef>
  <paramdef>char<parameter> *src</parameter></paramdef>
  <paramdef>char<parameter> **dst</parameter></paramdef>
  <paramdef>int<parameter> size</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
Similar to
<function>_XtCopyFromArg </function>
and
<function>_XtCopyToArg.</function>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>void <function> _XlcCountVaList</function></funcdef>
  <paramdef>va_list<parameter> var</parameter></paramdef>
  <paramdef>int<parameter> *count_ret</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
Similar to
<function>_XtCountVaList.</function>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>void <function> _XlcVaToArgList</function></funcdef>
  <paramdef>va_list<parameter> var</parameter></paramdef>
  <paramdef>int<parameter> count</parameter></paramdef>
  <paramdef>XlcArgList<parameter> *args_ret</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
Similar to
<function>_XtVaToArgList.</function>
</para>

<literallayout class="monospaced">
typedef struct _XlcResource {
      char *name;
      XrmQuark xrm_name;
      int size;
      int offset;
      unsigned long mask;
} XlcResource, *XlcResourceList;
</literallayout>

<literallayout class="monospaced">
#define    XlcCreateMask   (1L&lt;&lt;0)
#define    XlcDefaultMask  (1L&lt;&lt;1)
#define    XlcGetMask      (1L&lt;&lt;2)
#define    XlcSetMask      (1L&lt;&lt;3)
#define    XlcIgnoreMask   (1L&lt;&lt;4)
</literallayout>

<funcsynopsis>
<funcprototype>
  <funcdef>void <function> _XlcCompileResourceList</function></funcdef>
  <paramdef>XlcResourceList<parameter> resources</parameter></paramdef>
  <paramdef>int<parameter> num_resources</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
Similar to
<function>_XtCompileResourceList.</function>
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>char * <function> _XlcGetValues</function></funcdef>
  <paramdef>XPointer<parameter> base</parameter></paramdef>
  <paramdef>XlcResourceList<parameter> resources</parameter></paramdef>
  <paramdef>int<parameter> num_resources</parameter></paramdef>
  <paramdef>XlcArgList<parameter> args</parameter></paramdef>
  <paramdef>int<parameter> num_args</parameter></paramdef>
  <paramdef>unsignedlong<parameter> mask</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
Similar to XtGetSubvalues.
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>char * <function> _XlcSetValues</function></funcdef>
  <paramdef>XPointer<parameter> base</parameter></paramdef>
  <paramdef>XlcResourceList<parameter> resources</parameter></paramdef>
  <paramdef>int<parameter> num_resources</parameter></paramdef>
  <paramdef>XlcArgList<parameter> args</parameter></paramdef>
  <paramdef>int<parameter> num_args</parameter></paramdef>
  <paramdef>unsignedlong<parameter> mask</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
Similar to XtSetSubvalues.
</para>

<para>
<emphasis role="bold">ANSI C Compatible Functions</emphasis>
</para>

<para>
The following are ANSI C/MSE Compatible Functions for non-ANSI C environment.
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _Xmblen</function></funcdef>
  <paramdef>char<parameter> *str</parameter></paramdef>
  <paramdef>int<parameter> len</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_Xmblen </function>
function returns the number of characters pointed to by "<emphasis remap='I'>str</emphasis>".
Only "<emphasis remap='I'>len</emphasis>" bytes in "<emphasis remap='I'>str</emphasis>" are used in determining the
character count returned.  "<emphasis remap='I'>Str</emphasis>" may point at characters from
any valid codeset in the current locale.
</para>

<para>
The call
<function>_Xmblen</function>
is equivalent to
_Xmbtowc(_Xmbtowc((<emphasis remap='I'>wchar_t*</emphasis>)NULL, <emphasis remap='I'>str</emphasis>, <emphasis remap='I'>len</emphasis>))
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _Xmbtowc</function></funcdef>
  <paramdef>wchar_t<parameter> *wstr</parameter></paramdef>
  <paramdef>char<parameter> *str</parameter></paramdef>
  <paramdef>int<parameter> len</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_Xmbtowc</function>
function converts the character(s) pointed to by "<emphasis remap='I'>str</emphasis>"
to their wide character representation(s) pointed to by "<emphasis remap='I'>wstr</emphasis>".
"<emphasis remap='I'>Len</emphasis>" is the number of bytes in "<emphasis remap='I'>str</emphasis>" to be converted.
The return value is the number of characters converted.
</para>

<para>
The call
<function>_Xmbtowc</function>
is equivalent to
_Xlcmbtowc((XLCd)NULL, <emphasis remap='I'>wstr</emphasis>, <emphasis remap='I'>str</emphasis>, <emphasis remap='I'>len</emphasis>)
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _Xlcmbtowc</function></funcdef>
  <paramdef>XLCd<parameter> lcd</parameter></paramdef>
  <paramdef>wchar_t<parameter> *wstr</parameter></paramdef>
  <paramdef>char<parameter> *str</parameter></paramdef>
  <paramdef>int<parameter> len</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_Xlcmbtowc</function>
function is identical to
<function>_Xmbtowc, </function>
except that it requires the "<emphasis remap='I'>lcd</emphasis>" argument.  If "<emphasis remap='I'>lcd</emphasis>"
is (XLCd) NULL,
<function>_Xlcmbtowc, </function>
calls
<function>_XlcCurrentLC </function>
to determine the current locale.
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _Xwctomb</function></funcdef>
  <paramdef>char<parameter> *str</parameter></paramdef>
  <paramdef>wchar_t<parameter> wc</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_Xwctomb </function>
function converts a single wide character pointed to by "<emphasis remap='I'>wc</emphasis>" to
its multibyte representation pointed to by "<emphasis remap='I'>str</emphasis>".
On success, the return value is 1.
</para>

<para>
The call
<function>_Xwctomb</function>
is equivalent to
_Xlcwctomb((XLCd)NULL, <emphasis remap='I'>str</emphasis>, <emphasis remap='I'>wstr</emphasis>)
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _Xlcwctomb</function></funcdef>
  <paramdef>XLCd<parameter> lcd</parameter></paramdef>
  <paramdef>char<parameter> *str</parameter></paramdef>
  <paramdef>wchar_t<parameter> wc</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_Xlcwctomb</function>
function is identical to _Xwctomb, except that it requires the
"<emphasis remap='I'>lcd</emphasis>" argument.  If "<emphasis remap='I'>lcd</emphasis>" is (XLCd) NULL,
<function>_Xlcwctomb, </function>
calls
<function>_XlcCurrentLC </function>
to determine the current locale.
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _Xmbstowcs</function></funcdef>
  <paramdef>wchar_t<parameter> *wstr</parameter></paramdef>
  <paramdef>char<parameter> *str</parameter></paramdef>
  <paramdef>int<parameter> len</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_Xmbstowcs</function>
function converts the NULL-terminated string pointed to by "<emphasis remap='I'>str</emphasis>"
to its wide character string representation pointed to by "<emphasis remap='I'>wstr</emphasis>".
"<emphasis remap='I'>Len</emphasis>" is the number of characters in "<emphasis remap='I'>str</emphasis>" to be converted.
</para>

<para>
The call
<function>_Xmbstowcs</function>
is equivalent to
_Xlcmbstowcs((XLCd)NULL, <emphasis remap='I'>wstr</emphasis>, <emphasis remap='I'>str</emphasis>, <emphasis remap='I'>len</emphasis>)
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _Xlcmbstowcs</function></funcdef>
  <paramdef>XLCd<parameter> lcd</parameter></paramdef>
  <paramdef>wchar_t<parameter> *wstr</parameter></paramdef>
  <paramdef>char<parameter> *str</parameter></paramdef>
  <paramdef>int<parameter> len</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_Xlcmbstowcs </function>
function is identical to _Xmbstowcs, except that it requires the
"<emphasis remap='I'>lcd</emphasis>" argument.  If "<emphasis remap='I'>lcd</emphasis>" is (XLCd) NULL,
<function>_Xlcmbstowcs, </function>
calls
<function>_XlcCurrentLC</function>
to determine the current locale.
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _Xwcstombs</function></funcdef>
  <paramdef>char<parameter> *str</parameter></paramdef>
  <paramdef>wchar_t<parameter> *wstr</parameter></paramdef>
  <paramdef>int<parameter> len</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_Xwcstombs </function>
function converts the (wchar_t) NULL terminated wide character string
pointed to by "<emphasis remap='I'>wstr</emphasis>" to the NULL terminated multibyte string
pointed to by "<emphasis remap='I'>str</emphasis>".
</para>

<para>
The call
<function>_Xwcstombs </function>
is equivalent to
_Xlcwcstombs((XLCd)NULL, <emphasis remap='I'>str</emphasis>, <emphasis remap='I'>wstr</emphasis>, <emphasis remap='I'>len</emphasis>)
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _Xlcwcstombs</function></funcdef>
  <paramdef>XLCd<parameter> lcd</parameter></paramdef>
  <paramdef>char<parameter> *str</parameter></paramdef>
  <paramdef>wchar_t<parameter> *wstr</parameter></paramdef>
  <paramdef>int<parameter> len</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_Xlcwcstombs </function>
function is identical to _Xwcstombs, except that it requires the
"<emphasis remap='I'>lcd</emphasis>" argument.  If "<emphasis remap='I'>lcd</emphasis>" is (XLCd) NULL,
<function>_Xlcwcstombs, </function>
calls
<function>_XlcCurrentLC </function>
to determine the current locale.
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _Xwcslen</function></funcdef>
  <paramdef>wchar_t<parameter> *wstr</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_Xwcslen </function>
function returns the count of wide characters in the (wchar_t) NULL
terminated wide character string pointed to by "<emphasis remap='I'>wstr</emphasis>".
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>wchar_t *<function> _Xwcscpy</function></funcdef>
  <paramdef>wchar_t<parameter> *wstr1</parameter></paramdef>
  <paramdef>wchar_t<parameter> *wstr2</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<funcsynopsis>
<funcprototype>
  <funcdef>wchar_t * <function> _Xwcsncpy</function></funcdef>
  <paramdef>wchar_t<parameter> *wstr1</parameter></paramdef>
  <paramdef>wchar_t<parameter> *wstr2</parameter></paramdef>
  <paramdef>int<parameter> len</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_Xwcscpy </function>
function copies the (wchar_t) NULL terminated wide character string
pointed to by "<emphasis remap='I'>wstr2</emphasis>" to the object pointed at by "<emphasis remap='I'>wstr1</emphasis>".
"<emphasis remap='I'>Wstr1</emphasis>" is (wchar_t) NULL terminated.  The return value is a
pointer to "<emphasis remap='I'>wstr1</emphasis>".
</para>

<para>
The
<function>_Xwcsncpy</function>
function is identical to
<function>_Xwcscpy, </function>
except that it copies "<emphasis remap='I'>len</emphasis>" wide characters from the object
pointed to by "<emphasis remap='I'>wstr2</emphasis>" to the object pointed to "<emphasis remap='I'>wstr1</emphasis>".
</para>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _Xwcscmp</function></funcdef>
  <paramdef>wchar_t*wstr1,<parameter> *wstr2</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<funcsynopsis>
<funcprototype>
  <funcdef>int <function> _Xwcsncmp</function></funcdef>
  <paramdef>wchar_t*wstr1,<parameter> *wstr2</parameter></paramdef>
  <paramdef>int<parameter> len</parameter></paramdef>
</funcprototype>
</funcsynopsis>

<para>
The
<function>_Xwcscmp </function>
function  compares two (wchar_t) NULL terminated wide character strings.
The value returned is an integer less than, equal to, or greater than zero,
depending on whether "<emphasis remap='I'>wstr1</emphasis>" is lexicographicly less then, equal to,
or greater than "<emphasis remap='I'>str2</emphasis>".
</para>

<para>
The
<function>_Xwcsncmp </function>
function is identical to
<function>_XlcCompareISOLatin1, </function>
except that at most "<emphasis remap='I'>len</emphasis>" wide characters are compared.
</para>


<!-- .sp -->
<!-- .\" .LP -->
<!-- .\" <function>Locale Method Internal Functions</function> -->
<!-- .\" .LP -->
<!-- .\" .FD 0 -->
<!-- .\" XlcCharSet _XlcCreateDefaultCharSet(<emphasis remap='I'>name</emphasis>, <emphasis remap='I'>ct_sequence</emphasis>) -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>*name</emphasis>; -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>*ct_sequence</emphasis>; -->
<!-- .\" .FN -->
<!-- .\" .FD 0 -->
<!-- .\" Bool _XlcParseCharSet(<emphasis remap='I'>charset</emphasis>) -->
<!-- .\" .br -->
<!-- .\"       XlcCharSet <emphasis remap='I'>charset</emphasis>; -->
<!-- .\" .FN -->
<!-- .\" .FD 0 -->
<!-- .\" void _XlcGetLocaleDataBase(<emphasis remap='I'>lcd</emphasis>, <emphasis remap='I'>category</emphasis>, <emphasis remap='I'>name</emphasis>, <emphasis remap='I'>value</emphasis>, <emphasis remap='I'>count</emphasis>) -->
<!-- .\" .br -->
<!-- .\"       XLCd <emphasis remap='I'>lcd</emphasis>; -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>*category</emphasis>; -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>*name</emphasis>; -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>***value</emphasis>; -->
<!-- .\" .br -->
<!-- .\"       int <emphasis remap='I'>*count</emphasis>; -->
<!-- .\" .FN -->
<!-- .\" .FD 0 -->
<!-- .\" void _XlcDestroyLocaleDataBase(<emphasis remap='I'>lcd</emphasis>) -->
<!-- .\" .br -->
<!-- .\"       XLCd <emphasis remap='I'>lcd</emphasis>; -->
<!-- .\" .FN -->
<!-- .\" .FD 0 -->
<!-- .\" XPointer _XlcCreateLocaleDataBase(<emphasis remap='I'>lcd</emphasis>) -->
<!-- .\" .br -->
<!-- .\"       XLCd <emphasis remap='I'>lcd</emphasis>; -->
<!-- .\" .FN -->
<!-- .\" .LP -->
<!-- .\" .sp -->
<!-- .\" <function>Obtain an locale database path</function> -->
<!-- .\" .LP -->
<!-- .\" .FD 0 -->
<!-- .\" int _XlcResolveI18NPath(<emphasis remap='I'>dir</emphasis>) -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>*dir</emphasis>; -->
<!-- .\" .FN -->
<!-- .\" .LP -->
<!-- .\" The  -->
<!-- .\" .PN _XlcResolveI18NPath  -->
<!-- .\" function returns path name list that is related to X Locale Database. -->
<!-- .\" The obtained path is stored into the array which is pointed by -->
<!-- .\" specified "<emphasis remap='I'>dir</emphasis>".  The path consists of directory paths which  -->
<!-- .\" are separated with colon. -->
<!-- .\" If the environment variable XLOCALEDIR is specified, the path -->
<!-- .\" contains its contents. -->
<!-- .\" .LP -->
<!-- .\" The default path of X Locale Database is implementation dependent. -->
<!-- .\" In current implementation, it's determined in build time. -->
<!-- .\" .LP -->
<!-- .\" .PN _XlcResolveI18NPath  -->
<!-- .\" does not check overflow of the array to which the "<emphasis remap='I'>dir</emphasis>"  -->
<!-- .\" parameter points.  Caller should provide enough buffer to store this  -->
<!-- .\" string. -->
<!-- .\" .LP -->
<!-- .\" .sp -->
<!-- .\" <function>Obtain a full locale name</function> -->
<!-- .\" .LP -->
<!-- .\" .FD 0 -->
<!-- .\" int _XlcResolveLocaleName(<emphasis remap='I'>lc_name</emphasis>, <emphasis remap='I'>full_name</emphasis>, <emphasis remap='I'>language</emphasis>, <emphasis remap='I'>territory</emphasis>, <emphasis remap='I'>codeset</emphasis>) -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>*lc_name</emphasis>; -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>*full_name</emphasis>; -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>*language</emphasis>; -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>*territory</emphasis>; -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>*codeset</emphasis>; -->
<!-- .\" .FN -->
<!-- .\" .LP -->
<!-- .\" The  -->
<!-- .\" .PN _XlcResolveLocaleName  -->
<!-- .\" function returns a full locale name. -->
<!-- .\" The obtained full locale name is stored into the array which is -->
<!-- .\" pointed by specified "<emphasis remap='I'>full_name</emphasis>". -->
<!-- .\" The language, territory and codeset part of the full locale name -->
<!-- .\" are copied to the return arguments, "<emphasis remap='I'>language</emphasis>",  -->
<!-- .\" "<emphasis remap='I'>territory</emphasis>" and "<emphasis remap='I'>codeset</emphasis>", respectively. -->
<!-- .\" NULL can be specified for these arguments. -->
<!-- .\" .LP -->
<!-- .\" The rule for mapping from locale name to full locale name is -->
<!-- .\" implementation dependent. -->
<!-- .\" .LP -->
<!-- .\" .PN _XlcResolveLocaleName  -->
<!-- .\" does not check overflow of the array to which -->
<!-- .\" "<emphasis remap='I'>full_name</emphasis>", "<emphasis remap='I'>language</emphasis>", "<emphasis remap='I'>territory</emphasis>" and  -->
<!-- .\" "<emphasis remap='I'>codeset</emphasis>" parameter point. -->
<!-- .\" Caller should provide enough buffer to store those string. -->
<!-- .\" .LP -->
<!-- .\" In current implementation,  -->
<!-- .\" .PN _XlcResolveLocaleName  -->
<!-- .\" uses locale.alias file as mapping table, which has pairs of strings,  -->
<!-- .\" a locale name and a full locale name. -->
<!-- .\" .LP -->
<!-- .\" .FD 0 -->
<!-- .\" int _XlcResolveDBName(<emphasis remap='I'>lc_name</emphasis>, <emphasis remap='I'>file_name</emphasis>) -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>*lc_name</emphasis>; -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>*file_name</emphasis>; -->
<!-- .\" .FN -->
<!-- .\" .FD 0  -->
<!-- .\" XLCd _XlcCreateLC(<emphasis remap='I'>name</emphasis>, <emphasis remap='I'>methods</emphasis>) -->
<!-- .\" .br -->
<!-- .\"       char <emphasis remap='I'>*name</emphasis>; -->
<!-- .\" .br -->
<!-- .\"       XLCdMethods <emphasis remap='I'>methods</emphasis>; -->
<!-- .\" .FN -->
<!-- .\" .FD 0 -->
<!-- .\" void _XlcDestroyLC(<emphasis remap='I'>lcd</emphasis>) -->
<!-- .\" .br -->
<!-- .\"       XLCd <emphasis remap='I'>lcd</emphasis>; -->
<!-- .\" .FN -->
<!-- .\" .LP -->
<!-- .\"  -->

</sect1>
</chapter>
</book>