xref: /illumos-gate/usr/src/man/man3c/wctrans.3c (revision 1ed6b69a5ca1ca3ee5e9a4931f74e2237c7e1c9f)
te

This file and its contents are supplied under the terms of the
Common Development and Distribution License ("CDDL"), version 1.0.
You may only use this file in accordance with the terms of version
1.0 of the CDDL.

A full copy of the text of the CDDL should have accompanied this
source. A copy of the CDDL is also available via the Internet at
http://www.illumos.org/license/CDDL.


Copyright (c) 2014 Joyent, Inc. All rights reserved.
Copyright 2014 Garrett D'Amore <garrett@damore.org>

WCTRANS 3C "Jun 25, 2014"
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 (5), locale (5)