HP-UX Reference (11i v1 00/12) - 3 Library Functions N-Z (vol 7)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/nan.3m
________________________________________________________________
___ ___
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 unprintablewide 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
The interfaces wcscat(), wcsncat(), wcscmp(), wcsncmp(), wcscpy(), wcsncpy(),
wcslen(), wcschr(), wcsrchr(), wcspbrk() , wcsspn(), wcscspn(), wcswcs(),
wcstok(), wcscoll(), wcwidth(), wcswidth() , wcsstr() and wcsxfrm() are thread-safe.
All these interfaces, with the exception of wcscoll() , wcwidth(), wcswidth() and wcsxfrm()
are async-cancel-safe.
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).
Section 31020 3 HP-UX Release 11i: December 2000
___
___