xref: /openbsd/lib/libc/locale/wctype.3 (revision 09467b48)
1.\" $OpenBSD: wctype.3,v 1.4 2017/09/05 03:16:13 schwarze Exp $
2.\" $NetBSD: wctype.3,v 1.4 2003/04/16 13:34:41 wiz Exp $
3.\"
4.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
5.\" Copyright (c) 2003 Citrus Project
6.\" All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE.
28.\"
29.Dd $Mdocdate: September 5 2017 $
30.Dt WCTYPE 3
31.Os
32.Sh NAME
33.Nm wctype ,
34.Nm wctype_l
35.Nd get a character class identifier by name
36.Sh SYNOPSIS
37.In wctype.h
38.Ft wctype_t
39.Fn wctype "const char *charclass"
40.Ft wctype_t
41.Fn wctype_l "const char *charclass" "locale_t locale"
42.Sh DESCRIPTION
43These functions return a character class identifier
44corresponding to the locale-specific character class name
45.Fa charclass .
46This identifier can be used in subsequent calls of
47.Fn iswctype
48or
49.Fn iswctype_l ,
50respectively.
51.Pp
52The following names are defined in all locales:
53.Bd -literal -offset indent
54alnum alpha blank cntrl digit graph
55lower print punct space upper xdigit
56.Ed
57.Pp
58The function
59.Fn wctype_l
60uses the specified
61.Fa locale ,
62whereas
63.Fn wctype
64uses the thread-specific locale set with
65.Xr uselocale 3 ,
66falling back to the global locale set with
67.Xr setlocale 3 .
68.Sh RETURN VALUES
69These functions return the character class identifier, or
70.Po Vt wctype_t Pc Ns 0
71if
72.Fa charclass
73does not correspond to a valid character class name.
74.Sh SEE ALSO
75.Xr iswctype 3 ,
76.Xr newlocale 3 ,
77.Xr setlocale 3 ,
78.Xr wctrans 3
79.Sh STANDARDS
80The
81.Fn wctype
82function conforms to
83.St -isoC-amd1 ,
84and
85.Fn wctype_l
86to
87.St -p1003.1-2008 .
88.Sh HISTORY
89The
90.Fn wctype
91function has been available since
92.Ox 3.8 ,
93and
94.Fn wctype_l
95since
96.Ox 6.2 .
97