ACC SHELL
<!-- Creator : groff version 1.18.1 -->
<!-- CreationDate: Thu Jul 1 22:29:35 2010 -->
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta name="Content-Style" content="text/css">
<title>X11R6 Sample Implementation Frame Work</title>
</head>
<body>
<h1 align=center>X11R6 Sample Implementation Frame Work</h1>
<a href="#1. Preface">1. Preface</a><br>
<a href="#2. Objective">2. Objective</a><br>
<a href="#3. Locale Object Binding Functions">3. Locale Object Binding Functions</a><br>
<a href="#4. Locale Method Interface">4. Locale Method Interface</a><br>
<a href="#5. Locale Method Functions">5. Locale Method Functions</a><br>
<a href="#6. Charset functions">6. Charset functions</a><br>
<a href="#7. Converter Functions">7. Converter Functions</a><br>
<a href="#8. X Locale Database functions">8. X Locale Database functions</a><br>
<a href="#9. Utility Functions">9. Utility Functions</a><br>
<hr>
<p><small>Copyright © 1994 by TOSHIBA Corporation<br>
Copyright © 1994 by IBM Corporation</small></p>
<p><small>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.</small></p>
<p><small>Copyright © 1994 X Consortium</small></p>
<p><small>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:</small></p>
<p><small>The above copyright notice and this permission
notice shall be included in all copies or substantial
portions of the Software.</small></p>
<p><small>THE SOFTWARE IS PROVIDED ‘‘AS
IS’’, 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.</small></p>
<p><small>Except as contained in this notice, the name of
the X Consortium shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this
Software without prior written authorization from the X
Consortium.</small></p>
<p><small><i>X Window System</i> is a trademark of The Open
Group.</small></p>
<a name="1. Preface"></a>
<h2>1. Preface</h2>
<p><small>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) is
proposed to outline the separating of the components within
the sample implementation.</small></p>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="7%"></td>
<td width="92%">
<p><small>... 0.237 5.796 5.24 10.14 ... 0.000i 4.344i
5.003i 0.000i</small></p>
<!-- INDENTATION -->
<p align=center><img src="grohtml-151681.png"></p></td>
</table>
<p align=center><small>Fig.1 : Frame Work of Locale Service
API Proposal</small></p>
<p><small>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.</small></p>
<p><small>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.</small></p>
<p><small>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.</small></p>
<a name="2. Objective"></a>
<h2>2. Objective</h2>
<!-- TABS -->
<table width="100%" border=0 rules="none" frame="void"
cols="3" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="2%">
<p><small>•</small></p>
</td>
<td width="8%"></td>
<td width="90%">
<p><small>Explain the current X11R6 sample
implementation</small></p>
</td>
</table>
<!-- TABS -->
<table width="100%" border=0 rules="none" frame="void"
cols="3" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="2%">
<p><small>•</small></p>
</td>
<td width="8%"></td>
<td width="90%">
<p><small>Document the common set of locale dependent
interfaces</small></p>
</td>
</table>
<!-- TABS -->
<table width="100%" border=0 rules="none" frame="void"
cols="4" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="2%">
<p><small>•</small></p>
</td>
<td width="8%"></td>
<td width="74%">
<p><small>Provide more flexible pluggable layer</small></p>
</td>
<td width="15%">
</td>
</table>
<a name="3. Locale Object Binding Functions"></a>
<h2>3. Locale Object Binding Functions</h2>
<p><small>This chapter describes functions related locale
object binding for implementing the pluggable
layer.</small></p>
<p><small>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.</small></p>
<p><small>The loader is called in <i>_XOpenLC,</i> but
caller of <i>_XOpenLC</i> 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.</small></p>
<p><small><b>Initializing a locale loader
list</b></small></p>
<pre><small>void _XlcInitLoader()
</small></pre>
<p><small>The <i>_XlcInitLoader</i> function initializes
the locale loader list with vendor specific manner. Each
loader is registered with calling <i>_XlcAddLoader.</i> The
number of loaders and their order in the loader list is
implementation dependent.</small></p>
<p><small><b>Add a loader</b></small></p>
<pre><small>typedef XLCd (*XLCdLoadProc)(<i>name</i>);
char <i>*name</i>;
typedef int XlcPosition;
</small></pre>
<p align=center><small><img src="grohtml-151682.png"></small></p>
<pre><small>Bool _XlcAddLoader(<i>proc, position</i>)
XLCdLoadProc <i>proc</i>;
XlcPosition <i>position</i>;
</small></pre>
<p><small>The <i>_XlcAddLoader</i> function registers the
specified locale loader
‘‘<i>proc</i>’’ to the internal
loader list. The position specifies that the loader
‘‘<i>proc</i>’’ should be placed in
the top of the loader list(XlcHead) or
last(XlcTail).</small></p>
<p><small>The object loader is called from the top of the
loader list in order, when calling time.</small></p>
<p><small><b>Remove a loader</b></small></p>
<pre><small>void _XlcRemoveLoader(<i>proc</i>)
XLCdLoadProc <i>proc</i>;
</small></pre>
<p><small>The <i>_XlcRemoveLoader</i> function removes the
locale loader specified by
‘‘<i>proc</i>’’ from the loader
list.</small></p>
<p><small>Current implementation provides following locale
loaders;</small></p>
<pre><small><i> _XlcDefaultLoader
_XlcGenericLoader
_XlcEucLoader
_XlcSjisLoader
_XlcUtfLoader
_XaixOsDynamicLoad
</i></small></pre>
<a name="4. Locale Method Interface"></a>
<h2>4. Locale Method Interface</h2>
<p><small>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.</small></p>
<p><small>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.</small></p>
<a name="5. Locale Method Functions"></a>
<h2>5. Locale Method Functions</h2>
<p><small><b>Open a Locale Method</b></small></p>
<pre><small>XLCd _XOpenLC(<i>name</i>)
char <i>*name</i>;
</small></pre>
<p><small>The <i>_XOpenLC</i> function opens a locale
method which corresponds to the specified locale name.
<i>_XOpenLC</i> calls a locale object loader, which is
registered via <i>_XlcAddLoader</i>into is valid and
successfully opens a locale, <i>_XOpenLC</i> returns the
XLCd. If the loader is invalid or failed to open a locale,
<i>_XOpenLC</i> calls the next loader. If all registered
loaders cannot open a locale, <i>_XOpenLC</i> returns
NULL.</small></p>
<pre><small>XLCd _XlcCurrentLC()
</small></pre>
<p><small>The <i>_XlcCurrentLC</i> function returns an XLCd
that are bound to current locale.</small></p>
<p><small><b>Close a Locale Method</b></small></p>
<pre><small>void _XCloseLC(<i>lcd</i>)
XLCd <i>lcd</i>;
</small></pre>
<p><small>The <i>_XCloseLC</i> function close a locale
method the specified lcd.</small></p>
<p><small><b>Obtain Locale Method values</b></small></p>
<pre><small>char * _XGetLCValues(<i>lcd</i>, ...)
XLCd <i>lcd</i>;
</small></pre>
<p><small>The <i>_XGetLCValues</i> 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.</small></p>
<p align=center><small><img src="grohtml-151683.png"></small></p>
<a name="6. Charset functions"></a>
<h2>6. Charset functions</h2>
<p><small>The XlcCharSet is an identifier which represents
a subset of characters (character set) in the locale
object.</small></p>
<pre><small>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)(<i>charset</i>, <i>args</i>, <i>num_args</i>);
XlcCharSet <i>charset</i>;
XlcArgList <i>args</i>;
int <i>num_args</i>;
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;
</small></pre>
<p><small><b>Get an XlcCharSet</b></small></p>
<pre><small>XlcCharSet _XlcGetCharSet(<i>name</i>)
char <i>*name</i>;
</small></pre>
<p><small>The <i>_XlcGetCharSet</i> function gets an
XlcCharSet which corresponds to the charset name specified
by ‘‘<i>name</i>’’.
<i>_XlcGetCharSet</i> returns NULL, if no XlcCharSet bound
to specified
‘‘<i>name</i>’’.</small></p>
<p><small>The following character sets are
pre-registered.</small></p>
<p align=center><small><img src="grohtml-151684.png"></small></p>
<p><small><b>Add an XlcCharSet</b></small></p>
<pre><small>Bool _XlcAddCharSet(<i>charset</i>)
XlcCharSet <i>charset</i>;
</small></pre>
<p><small>The <i>_XlcAddCharSet</i> function registers
XlcCharSet specified by
‘‘<i>charset</i>’’.</small></p>
<p><small><b>Obtain Character Set values</b></small></p>
<pre><small>char * _XlcGetCSValues(<i>charset</i>, ...)
XlcCharSet <i>charset</i>;
</small></pre>
<p><small>The <i>_XlcGetCSValues</i> 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.</small></p>
<p align=center><small><img src="grohtml-151685.png"></small></p>
<a name="7. Converter Functions"></a>
<h2>7. Converter Functions</h2>
<p><small>We provide a set of the common converter APIs,
that are independent from both of source and destination
text type.</small></p>
<pre><small>typedef struct _XlcConvRec *XlcConv;
typedef void (*XlcCloseConverterProc)(<i>conv</i>);
XlcConv <i>conv</i>;
typedef int (*XlcConvertProc)(<i>conv</i>, <i>from</i>, <i>from_left</i>, <i>to</i>, <i>to_left</i>, <i>args</i>, <i>num_args</i>);
XlcConv <i>conv</i>;
XPointer <i>*from</i>;
int <i>*from_left</i>;
XPointer <i>*to</i>;
int <i>*to_left</i>;
XPointer <i>*args</i>;
int <i>num_args</i>;
typedef void (*XlcResetConverterProc)(<i>conv</i>);
XlcConv <i>conv</i>;
typedef struct _XlcConvMethodsRec {
XlcCloseConverterProc close;
XlcConvertProc convert;
XlcResetConverterProc reset;
} XlcConvMethodsRec, *XlcConvMethods;
typedef struct _XlcConvRec {
XlcConvMethods methods;
XPointer state;
} XlcConvRec;
</small></pre>
<p><small><b>Open a converter</b></small></p>
<pre><small>XlcConv _XlcOpenConverter(<i>from_lcd</i>, <i>from_type</i>, <i>to_lcd</i>, <i>to_type</i>)
XLCd <i>from_lcd</i>;
char <i>*from_type</i>;
XLCd <i>to_lcd</i>;
char <i>*to_type</i>;
</small></pre>
<p><small><i>_XlcOpenConverter</i> function opens the
converter which converts a text from specified
‘‘<i>from_type</i>’’ to specified
‘‘<i>to_type</i>’’ encoding. If the
function cannot find proper converter or cannot open a
corresponding converter, it returns NULL. Otherwise, it
returns the conversion descriptor.</small></p>
<p><small>The following types are pre-defined. Other types
are implementation dependent.</small></p>
<p align=center><small><img src="grohtml-151686.png"></small></p>
<p><small><b>Close a converter</b></small></p>
<pre><small>void _XlcCloseConverter(<i>conv</i>)
XlcConv <i>conv</i>;
</small></pre>
<p><small>The <i>_XlcCloseConverter</i> function closes the
specified converter
‘‘<i>conv</i>’’.</small></p>
<p><small><b>Code conversion</b></small></p>
<pre><small>int _XlcConvert(<i>conv</i>, <i>from</i>, <i>from_left</i>, <i>to</i>, <i>to_left</i>, <i>args</i>, <i>num_args</i>)
XlcConv <i>conv</i>;
XPointer <i>*from</i>;
int <i>*from_left</i>;
XPointer <i>*to</i>;
int <i>*to_left</i>;
XPointer <i>*args</i>;
int <i>num_args</i>;
</small></pre>
<p><small>The <i>_XlcConvert</i> function converts a
sequence of characters from one type, in the array specified
by ‘‘<i>from</i>’’, into a sequence
of corresponding characters in another type, in the array
specified by ‘‘<i>to</i>’’. The
types are those specified in the <i>_XlcOpenConverter()</i>
call that returned the conversion descriptor,
‘‘<i>conv</i>’’. The arguments
‘‘<i>from</i>’’,
‘‘<i>from_left</i>’’,
‘‘<i>to</i>’’ and
‘‘<i>to_left</i>’’ have the same
specification of XPG4 iconv function.</small></p>
<p><small>For state-dependent encodings, the conversion
descriptor ‘‘<i>conv</i>’’ is placed
into its initial shift state by a call for which
‘‘<i>from</i>’’ is a NULL pointer,
or for which ‘‘<i>from</i>’’ points
to a null pointer.</small></p>
<p><small>The following 2 converters prepared by locale
returns appropriate charset (XlcCharSet) in an area pointed
by args[0].</small></p>
<p align=center><small><img src="grohtml-151687.png"></small></p>
<p><small>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.</small></p>
<p><small><b>Reset a converter</b></small></p>
<pre><small>void _XlcResetConverter(<i>conv</i>)
XlcConv <i>conv</i>;
</small></pre>
<p><small>The <i>_XlcResetConverter</i> function reset the
specified converter
‘‘<i>conv</i>’’.</small></p>
<p><small><b>Register a converter</b></small></p>
<pre><small>typedef XlcConv (*XlcOpenConverterProc)(<i>from_lcd</i>, <i>from_type</i>, <i>to_lcd</i>, <i>to_type</i>);
XLCd <i>from_lcd</i>;
char <i>*from_type</i>;
XLCd <i>to_lcd</i>;
char <i>*to_type</i>;
</small></pre>
<pre><small>Bool _XlcSetConverter(<i>from_lcd</i>, <i>from</i>, <i>to_lcd</i>, <i>to</i>, <i>converter</i>)
XLCd <i>from_lcd</i>;
char <i>*from</i>;
XLCd <i>to_lcd</i>;
char <i>*to</i>;
XlcOpenConverterProc <i>converter</i>;
</small></pre>
<p><small>The <b>XlcSetConverter</b> function registers a
converter which convert from
‘‘<i>from_type</i>’’ to
‘‘<i>to_type</i>’’ into the
converter list (in the specified XLCd).</small></p>
<a name="8. X Locale Database functions"></a>
<h2>8. X Locale Database functions</h2>
<p><small>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.</small></p>
<p><small>For more detail about X Locale Database, please
refer X Locale Database Definition document.</small></p>
<p><small><b>Get a resource from database</b></small></p>
<pre><small>void _XlcGetResource(<i>lcd</i>, <i>category</i>, <i>class</i>, <i>value</i>, <i>count</i>)
XLCd <i>lcd</i>;
char <i>*category</i>;
char <i>*class</i>;
char <i>***value</i>;
int <i>*count</i>;
</small></pre>
<p><small>The <i>_XlcGetResource</i> function obtains a
locale dependent data which is associated with the locale of
specified ‘‘<i>lcd</i>’’. The locale
data is provided by system locale or by X Locale Database
file, and what kind of data is available is implementation
dependent.</small></p>
<p><small>The specified
‘‘<i>category</i>’’ and
‘‘<i>class</i>’’ are used for
finding out the objective locale data.</small></p>
<p><small>The returned value is returned in value argument
in string list form, and the returned count shows the number
of strings in the value.</small></p>
<p><small>The returned value is owned by locale method, and
should not be modified or freed by caller.</small></p>
<p><small><b>Get a locale relative file
name</b></small></p>
<pre><small>char * _XlcFileName(<i>lcd</i>, <i>category</i>)
XLCd <i>lcd</i>;
char <i>*category</i>;
</small></pre>
<p><small>The <i>_XlcFileName</i> functions returns a file
name which is bound to the specified
‘‘<i>lcd</i>’’ and
‘‘<i>category</i>’’, as a
null-terminated string. If no file name can be found, or
there is no readable file for the found file name,
<i>_XlcFileName</i> returns NULL. The returned file name
should be freed by caller.</small></p>
<p><small>The rule for searching a file name is
implementation dependent. In current implementation,
<i>_XlcFileName</i> uses
‘‘{category}.dir’’ file as mapping
table, which has pairs of strings, a full locale name and a
corresponding file name.</small></p>
<a name="9. Utility Functions"></a>
<h2>9. Utility Functions</h2>
<p><small><b>Compare Latin-1 strings</b></small></p>
<pre><small>int _XlcCompareISOLatin1(<i>str1</i>, <i>str2</i>)
char <i>*str1</i>, <i>*str2</i>;
</small></pre>
<pre><small>int _XlcNCompareISOLatin1(<i>str1</i>, <i>str2</i>, <i>len</i>)
char <i>*str1</i>, <i>*str2</i>;
int <i>len</i>;
</small></pre>
<p><small>The <i>_XlcCompareIsoLatin1</i> 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
‘‘<i>str1</i>’’ is lexicographicly
less than, equal to, or greater than
‘‘<i>str2</i>’’.</small></p>
<p><small>The <i>_XlcNCompareIsoLatin1</i> function is
identical to <i>_XlcCompareISOLatin1,</i> except that at
most ‘‘<i>len</i>’’ bytes are
compared.</small></p>
<p><small><b>Resource Utility</b></small></p>
<pre><small>int XlcNumber(<i>array</i>)
ArrayType <i>array</i>;
</small></pre>
<p><small>Similar to XtNumber.</small></p>
<pre><small>void _XlcCopyFromArg(<i>src</i>, <i>dst</i>, <i>size</i>)
char <i>*src</i>;
char <i>*dst</i>;
int <i>size</i>;
</small></pre>
<pre><small>void _XlcCopyToArg(<i>src</i>, <i>dst</i>, <i>size</i>)
char <i>*src</i>;
char <i>**dst</i>;
int <i>size</i>;
</small></pre>
<p><small>Similar to <i>_XtCopyFromArg</i> and
<i>_XtCopyToArg.</i></small></p>
<pre><small>void _XlcCountVaList(<i>var</i>, <i>count_ret</i>)
va_list <i>var</i>;
int <i>*count_ret</i>;
</small></pre>
<p><small>Similar to <i>_XtCountVaList.</i></small></p>
<pre><small>void _XlcVaToArgList(<i>var</i>, <i>count</i>, <i>args_ret</i>)
va_list <i>var</i>;
int <i>count</i>;
XlcArgList <i>*args_ret</i>;
</small></pre>
<p><small>Similar to <i>_XtVaToArgList.</i></small></p>
<pre><small>typedef struct _XlcResource {
char *name;
XrmQuark xrm_name;
int size;
int offset;
unsigned long mask;
} XlcResource, *XlcResourceList;
</small></pre>
<p align=center><small><img src="grohtml-151688.png"></small></p>
<pre><small>void _XlcCompileResourceList(<i>resources</i>, <i>num_resources</i>)
XlcResourceList <i>resources</i>;
int <i>num_resources</i>;
</small></pre>
<p><small>Similar to
<i>_XtCompileResourceList.</i></small></p>
<pre><small>char * _XlcGetValues(<i>base</i>, <i>resources</i>, <i>num_resources</i>, <i>args</i>, <i>num_args</i>, <i>mask</i>)
XPointer <i>base</i>;
XlcResourceList <i>resources</i>;
int <i>num_resources</i>;
XlcArgList <i>args</i>;
int <i>num_args</i>;
unsigned long <i>mask</i>;
</small></pre>
<p><small>Similar to XtGetSubvalues.</small></p>
<pre><small>char * _XlcSetValues(<i>base</i>, <i>resources</i>, <i>num_resources</i>, <i>args</i>, <i>num_args</i>, <i>mask</i>)
XPointer <i>base</i>;
XlcResourceList <i>resources</i>;
int <i>num_resources</i>;
XlcArgList <i>args</i>;
int <i>num_args</i>;
unsigned long <i>mask</i>;
</small></pre>
<p><small>Similar to XtSetSubvalues.</small></p>
<p><small><b>ANSI C Compatible Functions</b></small></p>
<p><small>The following are ANSI C/MSE Compatible Functions
for non-ANSI C environment.</small></p>
<pre><small>int _Xmblen(<i>str</i>, <i>len</i>)
char <i>*str</i>;
int <i>len</i>;
</small></pre>
<p><small>The <i>_Xmblen</i> function returns the number of
characters pointed to by
‘‘<i>str</i>’’. Only
‘‘<i>len</i>’’ bytes in
‘‘<i>str</i>’’ are used in
determining the character count returned.
‘‘<i>Str</i>’’ may point at
characters from any valid codeset in the current
locale.</small></p>
<p><small>The call <i>_Xmblen</i> is equivalent
to</small></p>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="9%"></td>
<td width="90%">
<p><small>_Xmbtowc(_Xmbtowc((<i>wchar_t*</i>)NULL,
<i>str</i>, <i>len</i>))</small></p>
</td>
</table>
<pre><small>int _Xmbtowc(<i>wstr</i>, <i>str</i>, <i>len</i>)
wchar_t <i>*wstr</i>;
char <i>*str</i>;
int <i>len</i>;
</small></pre>
<p><small>The <i>_Xmbtowc</i> function converts the
character(s) pointed to by
‘‘<i>str</i>’’ to their wide
character representation(s) pointed to by
‘‘<i>wstr</i>’’.
‘‘<i>Len</i>’’ is the number of
bytes in ‘‘<i>str</i>’’ to be
converted. The return value is the number of characters
converted.</small></p>
<p><small>The call <i>_Xmbtowc</i> is equivalent
to</small></p>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="9%"></td>
<td width="90%">
<p><small>_Xlcmbtowc((XLCd)NULL, <i>wstr</i>, <i>str</i>,
<i>len</i>)</small></p>
</td>
</table>
<pre><small>int _Xlcmbtowc(<i>lcd</i>, <i>wstr</i>, <i>str</i>, <i>len</i>)
XLCd <i>lcd</i>;
wchar_t <i>*wstr</i>;
char <i>*str</i>;
int <i>len</i>;
</small></pre>
<p><small>The <i>_Xlcmbtowc</i> function is identical to
<i>_Xmbtowc,</i> except that it requires the
‘‘<i>lcd</i>’’ argument. If
‘‘<i>lcd</i>’’ is (XLCd) NULL,
<i>_Xlcmbtowc,</i> calls <i>_XlcCurrentLC</i> to determine
the current locale.</small></p>
<pre><small>int _Xwctomb(<i>str</i>, <i>wc</i>)
char <i>*str</i>;
wchar_t <i>wc</i>;
</small></pre>
<p><small>The <i>_Xwctomb</i> function converts a single
wide character pointed to by
‘‘<i>wc</i>’’ to its multibyte
representation pointed to by
‘‘<i>str</i>’’. On success, the
return value is 1.</small></p>
<p><small>The call <i>_Xwctomb</i> is equivalent
to</small></p>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="9%"></td>
<td width="90%">
<p><small>_Xlcwctomb((XLCd)NULL, <i>str</i>,
<i>wstr</i>)</small></p>
</td>
</table>
<pre><small>int _Xlcwctomb(<i>lcd</i>, <i>str</i>, <i>wc</i>)
XLCd <i>lcd</i>;
char <i>*str</i>;
wchar_t <i>wc</i>;
</small></pre>
<p><small>The <i>_Xlcwctomb</i> function is identical to
_Xwctomb, except that it requires the
‘‘<i>lcd</i>’’ argument. If
‘‘<i>lcd</i>’’ is (XLCd) NULL,
<i>_Xlcwctomb,</i> calls <i>_XlcCurrentLC</i> to determine
the current locale.</small></p>
<pre><small>int _Xmbstowcs(<i>wstr</i>, <i>str</i>, <i>len</i>)
wchar_t <i>*wstr</i>;
char <i>*str</i>;
int <i>len</i>;
</small></pre>
<p><small>The <i>_Xmbstowcs</i> function converts the
NULL-terminated string pointed to by
‘‘<i>str</i>’’ to its wide character
string representation pointed to by
‘‘<i>wstr</i>’’.
‘‘<i>Len</i>’’ is the number of
characters in ‘‘<i>str</i>’’ to be
converted.</small></p>
<p><small>The call <i>_Xmbstowcs</i> is equivalent
to</small></p>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="9%"></td>
<td width="90%">
<p><small>_Xlcmbstowcs((XLCd)NULL, <i>wstr</i>, <i>str</i>,
<i>len</i>)</small></p>
</td>
</table>
<pre><small>int _Xlcmbstowcs(<i>lcd</i>, <i>wstr</i>, <i>str</i>, <i>len</i>)
XLCd <i>lcd</i>;
wchar_t <i>*wstr</i>;
char <i>*str</i>;
int <i>len</i>;
</small></pre>
<p><small>The <i>_Xlcmbstowcs</i> function is identical to
_Xmbstowcs, except that it requires the
‘‘<i>lcd</i>’’ argument. If
‘‘<i>lcd</i>’’ is (XLCd) NULL,
<i>_Xlcmbstowcs,</i> calls <i>_XlcCurrentLC</i> to determine
the current locale.</small></p>
<pre><small>int _Xwcstombs(<i>str</i>, <i>wstr</i>, <i>len</i>)
char <i>*str</i>;
wchar_t <i>*wstr</i>;
int <i>len</i>;
</small></pre>
<p><small>The <i>_Xwcstombs</i> function converts the
(wchar_t) NULL terminated wide character string pointed to
by ‘‘<i>wstr</i>’’ to the NULL
terminated multibyte string pointed to by
‘‘<i>str</i>’’.</small></p>
<p><small>The call <i>_Xwcstombs</i> is equivalent
to</small></p>
<!-- INDENTATION -->
<table width="100%" border=0 rules="none" frame="void"
cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="9%"></td>
<td width="90%">
<p><small>_Xlcwcstombs((XLCd)NULL, <i>str</i>, <i>wstr</i>,
<i>len</i>)</small></p>
</td>
</table>
<pre><small>int _Xlcwcstombs(<i>lcd</i>, <i>str</i>, <i>wstr</i>, <i>len</i>)
XLCd <i>lcd</i>;
char <i>*str</i>;
wchar_t <i>*wstr</i>;
int <i>len</i>;
</small></pre>
<p><small>The <i>_Xlcwcstombs</i> function is identical to
_Xwcstombs, except that it requires the
‘‘<i>lcd</i>’’ argument. If
‘‘<i>lcd</i>’’ is (XLCd) NULL,
<i>_Xlcwcstombs,</i> calls <i>_XlcCurrentLC</i> to determine
the current locale.</small></p>
<pre><small>int _Xwcslen(<i>wstr</i>)
wchar_t <i>*wstr</i>;
</small></pre>
<p><small>The <i>_Xwcslen</i> function returns the count of
wide characters in the (wchar_t) NULL terminated wide
character string pointed to by
‘‘<i>wstr</i>’’.</small></p>
<pre><small>wchar_t * _Xwcscpy(<i>wstr1</i>, <i>wstr2</i>)
wchar_t <i>*wstr1</i>, <i>*wstr2</i>;
</small></pre>
<pre><small>wchar_t * _Xwcsncpy(<i>wstr1</i>, <i>wstr2</i>, <i>len</i>)
wchar_t <i>*wstr1</i>, <i>*wstr2</i>;
int <i>len</i>;
</small></pre>
<p><small>The <i>_Xwcscpy</i> function copies the (wchar_t)
NULL terminated wide character string pointed to by
‘‘<i>wstr2</i>’’ to the object
pointed at by ‘‘<i>wstr1</i>’’.
‘‘<i>Wstr1</i>’’ is (wchar_t) NULL
terminated. The return value is a pointer to
‘‘<i>wstr1</i>’’.</small></p>
<p><small>The <i>_Xwcsncpy</i> function is identical to
<i>_Xwcscpy,</i> except that it copies
‘‘<i>len</i>’’ wide characters from
the object pointed to by
‘‘<i>wstr2</i>’’ to the object
pointed to
‘‘<i>wstr1</i>’’.</small></p>
<pre><small>int _Xwcscmp(<i>wstr1</i>, <i>wstr2</i>)
wchar_t <i>*wstr1</i>, <i>*wstr2</i>;
</small></pre>
<pre><small>int _Xwcsncmp(<i>wstr1</i>, <i>wstr2</i>, <i>len</i>)
wchar_t <i>*wstr1</i>, <i>*wstr2</i>;
int <i>len</i>;
</small></pre>
<p><small>The <i>_Xwcscmp</i> 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
‘‘<i>wstr1</i>’’ is lexicographicly
less then, equal to, or greater than
‘‘<i>str2</i>’’.</small></p>
<p><small>The <i>_Xwcsncmp</i> function is identical to
<i>_XlcCompareISOLatin1,</i> except that at most
‘‘<i>len</i>’’ wide characters are
compared.</small></p>
<p><small><b>1</b></small></p>
<hr>
</body>
</html>
ACC SHELL 2018