wcstring.3c (2010 09)
w
wcstring(3C) wcstring(3C)
NAME
wcscat(), wcsncat(), wcscmp(), wcsncmp(), wcscpy(), wcsncpy(), wcslen(), wcschr(), wcsrchr(), wcsstr(),
wcspbrk(), wcsspn(), wcscspn(), wcswcs(), wcstok(), wcscoll(), wcwidth(), wcswidth(), wcsxfrm() - wide
character string operations
SYNOPSIS
#include <wchar.h>
wchar_t *wcscat(wchar_t *__restrict ws1, const wchar_t *__restrict ws2);
wchar_t *wcsncat(wchar_t *__restrict ws1, const wchar_t *__restrict ws2,
size_t n);
int wcscmp(const wchar_t *ws1, const wchar_t *ws2);
int wcsncmp(const wchar_t *ws1, const wchar_t *ws2, size_t n);
wchar_t *wcscpy(wchar_t *__restrict ws1, const wchar_t *__restrict ws2);
wchar_t *wcsncpy(wchar_t *__restrict ws1, const wchar_t *__restrict ws2,
size_t n);
size_t wcslen(const wchar_t *ws);
wchar_t *wcschr(const wchar_t *ws, wchar_t wc);
wchar_t *wcsrchr(const wchar_t *ws, wchar_t wc);
wchar_t *wcspbrk(const wchar_t *ws1, const wchar_t *ws2);
size_t wcsspn(const wchar_t *ws1, const wchar_t *ws2);
size_t wcscspn(const wchar_t *ws1, const wchar_t *ws2);
wchar_t *wcswcs(const wchar_t *ws1, const wchar_t *ws2);
wchar_t *wcstok(wchar_t *ws1, const wchar_t *ws2);
int wcscoll(const wchar_t *ws1, const wchar_t *ws2);
int wcwidth(wint_t wc);
int wcswidth(const wchar_t *ws, size_t n);
size_t wcsxfrm(wchar_t *ws1, const wchar_t *ws2, size_t n);
Unix Standards Only
wchar_t *wcstok(wchar_t *ws1, const wchar_t *ws2, wchar_t **ptr);
Unix Standards Only
wchar_t *wcsstr(const wchar_t *__restrict ws1, const wchar_t *__restrict
ws2);
Obsolescent Interface
wchar_t *wcstok_r(wchar_t *ws1, const wchar_t *ws2, wchar_t **wlast);
Remarks
These functions are compliant with the XPG4 Worldwide Portability Interface wide-character string han-
dling functions. They parallel the 8 bit string functions defined in string (3C).
DESCRIPTION
The arguments ws1 , ws2, and ws point to wide character strings (arrays of type
wchar_t terminated by
a null value).
wcscat() appends a copy of wide string ws2 to the end of wide string ws1. wcsncat() appends a
maximum of n characters; fewer if ws2 is shorter than n characters. Each returns a pointer to the null-
terminated result (the value of ws1).
wcscmp() compares its arguments and returns an integer less than, equal to, or greater than zero,
depending on whether ws1 is lexicographically less than, equal to, or greater than ws2. The comparison
of corresponding wide characters is done by comparing numeric values of the wide character codes. Null
pointer values for ws1 and ws2 are treated the same as pointers to empty wide strings. wcsncmp()
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1