HP-UX Reference (11i v1 05/09) - 3 Library Functions N-Z (vol 7)
w
wcstring(3C) wcstring(3C)
Obsolescent Interface
wcstok_r() performs wide character string operations.
EXTERNAL INFLUENCES
Locale
The LC_COLLATE category determines the collation ordering used by the
wcscoll() function.
The
LC_CTYPE category determines how widths are calculated by the
wcwidth() and wcswidth()
functions.
ERRORS
wcswidth() fails if the following condition is encountered:
[EINVAL] ws is NULL or if ws contains an unprintable wide character.
wcsxfrm() fails under the following conditions:
[EINVAL] ws2 points to a string containing wide character codes outside the domain of the col-
lating sequence.
[ENOSYS] if the function
wcsxfrm() is not supported.
EXAMPLE
The following sample piece of code finds the tokens, separated by blanks, that are in the string s (assuming
that there are at most
MAXTOK tokens):
int i = 0;
wchar_t *ws, *wlast, *wtok[MAXTOK];
wtok[0] = wcstok_r(ws, L" ", &wlast);
while (wtok[++i] = wcstok_r(NULL, L" ", &wlast));
APPLICATION USAGE
To use the _INCLUDE__STDC_A1_SOURCE
prototype, pass the _INCLUDE__STDC_A1_SOURCE
flag as a compiler option.
WARNINGS
The functions wcscat(), wcsncat() , wcscpy(), wcsncpy(), wcstok(), wcsstr(), and
wcstok_r() alter the contents of the array to which ws1 points. They do not check for overflow of the
array.
Null pointers for destination wide strings cause undefined behavior.
Wide character movement is performed differently in different implementations, so copying that involves
overlapping source and destination wide strings may yield unexpected results.
For the wcscoll() function, the results are undefined if the languages specified by the
LC_COLLATE
and LC_CTYPE categories use different code sets.
wcstok_r() is an obsolescent interface supported only for compatibility with existing DCE applications.
New multithreaded applications should use
wcstok().
wcswidth() will return an incorrect negative value if the number of column positions required for n
wide characters in the wide string pointed to by ws exceeds INT_MAX.
AUTHOR
wcstring functions were developed by OSF and HP.
SEE ALSO
wconv(3C), memory(3C), multibyte(3C), setlocale(3C), string(3C), thread_safety(5).
STANDARDS CONFORMANCE
wcscat(): XPG4
wcschr(): XPG4
wcscmp(): XPG4
Section 3−−1048 Hewlett-Packard Company − 3 − HP-UX 11i Version 1: September 2005