73 lines
2.4 KiB
Plaintext
73 lines
2.4 KiB
Plaintext
'\"macro stdmacro
|
|
.if n .pH g3w.wstring @(#)wstring 41.4 of 5/26/91
|
|
.\" Copyright 1991 UNIX System Laboratories, Inc.
|
|
.\" Copyright 1990 AT&T
|
|
.nr X
|
|
.if \nX=0 .ds x} wstring 3W "" "\&"
|
|
.if \nX=1 .ds x} wstring 3W ""
|
|
.if \nX=2 .ds x} wstring 3W "" "\&"
|
|
.if \nX=3 .ds x} wstring "" "" "\&"
|
|
.if \nX=9 .ds x} wstring 3W "SVR4 MNLS" "\&"
|
|
.TH \*(x}
|
|
.SH NAME
|
|
\f4wstring: wssize, wstok, strtows\fP \- \f4wchar_t\fP
|
|
string operations and type transformation
|
|
.SH SYNOPSIS
|
|
.ft 4
|
|
#include <widec.h>
|
|
.sp .5
|
|
int wssize(wchar_t \(**\f2s\fP\^);
|
|
.sp .5
|
|
wchar_t \(**wstok(wchar_t \(**\f2s1\fP\^, wchar_t \(**\f2s2\fP\^);
|
|
.sp .5
|
|
wchar_t \(**strtows(wchar_t \(**\f2s1\fP\^, char \(**\f2s2\fP\^);
|
|
.ft 1
|
|
.SH DESCRIPTION (International Functions)
|
|
The arguments \f2s1\fP, \f2s2\fP, and \f2s\fP
|
|
point to \f4wchar_t\fP strings (that is, arrays of
|
|
\f4wchar_t\fP characters terminated by a \f4wchar_t\fP null character).
|
|
.P
|
|
\f4wssize\f1 returns the number of
|
|
\f4wchar_t\fP characters in \f2s\fP, not including
|
|
the terminating \f4wchar_t\fP null character.
|
|
.P
|
|
\f4wstok\f1 treats the \f4wchar_t\fP
|
|
string \f2s1\fP as a sequence of
|
|
zero or more text tokens,
|
|
separated by spans of one or more
|
|
\f4wchar_t\fP characters from the separator
|
|
\f4wchar_t\fP string \f2s2\fP.
|
|
The first call (with the pointer \f2s1\fP specified)
|
|
returns a pointer to the
|
|
first \f4wchar_t\fP character of the first token,
|
|
and writes a \f4wchar_t\fP null character into \f2s1\fP
|
|
immediately following the returned token.
|
|
The function keeps track of its position in the
|
|
\f4wchar_t\fP string between separate calls,
|
|
so that subsequent calls
|
|
(which must be made with the first argument a null pointer) will
|
|
progress through the \f4wchar_t\fP string \f2s1\fP immediately
|
|
following that token.
|
|
Similarly, subsequent calls will progress through the \f4wchar_t\fP
|
|
string \f2s1\fP until no tokens remain.
|
|
The \f4wchar_t\fP separator
|
|
string \f2s2\fP may be different from call to call.
|
|
A null pointer is returned
|
|
when no token remains in \f2s1\fP.
|
|
.P
|
|
\f4strtows\f1 transforms \s-1EUC\s+1
|
|
in character string \f2s2\fP into \f4wchar_t\fP
|
|
characters, and transfers those to \f4wchar_t\fP string \f2s1\fP,
|
|
stopping after the null character has been processed.
|
|
.SH SEE ALSO
|
|
.na
|
|
\f4malloc\fP(3C),
|
|
\f4widec\fP(3S),
|
|
\f4wcstring\fP(3S),
|
|
\f4malloc\fP(3X).
|
|
.ad
|
|
.SH DIAGNOSTICS
|
|
On success, \f4strtows\fP returns \f2s1\fP.
|
|
If an illegal byte sequence is detected, a null pointer is
|
|
returned and \f4errno\fP is set to \f4\s-1EILSEQ\s+1\f1.
|