wctrans3
Wide character mapping functions
Usage
#include <wctype.h>
wint_t
towctrans(wint_t wc, wctrans_t desc);
wctrans_t
wctrans(const char *charclass);
Library
Standard C Library (libc, -lc)
Overview
The wctrans() function returns a value of type wctrans_t which represents the requested wide character mapping operation and may be used as the second argument for calls to towctrans().
The following character mapping names are recognised:
| tolower | toupper |
The towctrans() function transliterates the wide character wc according to the mapping described by desc.
Return values
The towctrans() function returns the transliterated character if successful, otherwise it returns the character unchanged and sets errno.
The wctrans() function returns non-zero if successful, otherwise it returns zero and sets errno.
Examples
Reimplement towupper() in terms of towctrans() and wctrans():
wint_t
mytowupper(wint_t wc)
{
return (towctrans(wc, wctrans("toupper")));
}
Errors
The towctrans() function will fail if:
- [EINVAL]
-
The supplied desc argument is invalid.
The wctrans() function will fail if:
- [EINVAL]
-
The requested mapping name is invalid.
Releases
56 releases since FreeBSD 5.0-RELEASE; the text changed 32 times.