WCTRANS(3C) Standard C Library Functions WCTRANS(3C)


NAME


towctrans, towctrans_l, wctrans, wctrans_l - define and perform
transliteration mappings

SYNOPSIS


#include <wctype.h>

wint_t towctrans(wint_t wc, wctrans_t desc);

wint_t towctrans_l(wint_t wc, wctrans_t desc, locale_t loc);

wctrans_t wctrans(const char * tranclass);

wctrans_t wctrans_l(const char * tranclass, locale_t loc);

DESCRIPTION


The functions wctrans() and wctrans_l() are used to obtain a handle
to a table that maps one set of wide characters to another. They
return an object of type wctrans_t which can be used with the
functions towctrans() and towctrans_l(). The valid set of classes
that are available depends on the locale. The following names are
valid in all locales:

"tolower"
Conversion from upper case to lower case characters.

"toupper"
Conversion from lower case to upper case characters.

The towctrans() and towctrans_l() functions convert the wide
character wc based on the conversion table specified by desc.

The functions towctrans_l() and wctrans_l() are equivalent to the
functions towctrans() and wctrans(), but instead of operating in the
current locale, they operate on the locale specified by loc.

RETURN VALUES


On successful completion, towctrans() and towctrans_l() functions
return the character that corresponds to the argument passed through
the mapping table described by desc. Otherwise, they return the
character unchanged and set errno. On successful completion,
wctrans() and wctrans_l() functions return a non-zero identifier for
tranclass. On failure, they return zero and set errno.

ERRORS


The wctrans() and wctrans_l() functions will fail if:

EINVAL The mapping class specified by tranclass does not exist or is
invalid.

The towctrans() and towctrans_l() functions will fail if:

EINVAL The mapping class specified by desc is invalid.

ATTRIBUTES



+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Interface Stability | Standard |
+--------------------+-----------------+
|MT-Level | MT-Safe |
+--------------------+-----------------+

SEE ALSO


newlocale(3C), setlocale(3C), towlower(3C), towupper(3C), environ(7),
locale(7)

June 25, 2014 WCTRANS(3C)

tribblix@gmail.com :: GitHub :: Privacy