Your Browser is not longer supported
Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...
{{viewport.spaceProperty.prod}}
wcsxfrm - Transform wide character string
&pagelevel(4)&pagelevel
Definition | #include <wchar.h> size_t wcsxfrm(wchar_t *ws1, const wchar_t *ws2, size_t n); wcsxfrm transforms the wide character string pointed to by ws2, and writes the result of the transformation to the field pointed to by ws1. The transformation is performed such that the wcscmp function returns the same return value (greater than, equal to or less than zero) for two transformed wide character strings as the wcscoll function does for the two original non-transformed wide character strings. A maximum of n wide character codes are written to the field (including the terminating null character). If n is 0, wc1 can be a NULL pointer.
If copying is between overlapping objects, the result is undefined. |
Return val. | Integer < n |
|
| indicating the number of wide character codes written to the field (without terminating null). |
| Integer >= n |
|
| In this case the content of the ws1 field is undefined. |
|
(size_t)-1
| if an error occurs. errno is set to indicate the error: EINVAL | The wide character string pointed to by ws2 contains wide character codes from outside the value range of the selected collation sequence. | ENOMEM | There is not enough memory available for the internal management data. |
|
Notes | This version of the C runtime system only supports one-byte characters as wide character codes. Transformation is such that two transformed wide character strings are arranged by wcscmp in accordance with the collation sequence defined in LC_COLLATE. The fact that ws1 can be a NULL pointer if n is 0, is useful if the size of the field is to be deter-mined before the transformation. Because there is no default value defined for if an error occurs, it is advisable to set errno to 0, then call wcscoll and after the call check errno . If errno is not 0, assume that an error has occurred. |
See also | strxfrm, wcscmp, wcscoll |