1 /* Copyright (C) 1996-2018 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
19 * ISO C99 Standard: 7.25
20 * Wide character classification and mapping utilities <wctype.h>
27 #include <bits/types.h>
28 #include <bits/types/wint_t.h>
30 /* Constant expression of type `wint_t' whose value does not correspond
31 to any member of the extended character set. */
33 # define WEOF (0xffffffffu)
36 /* Some definitions from this header also appear in <wchar.h> in
38 #include <bits/wctype-wchar.h>
41 * Extensible wide-character mapping functions: 7.15.3.2.
46 /* Scalar type that can hold values which represent locale-specific
47 character mappings. */
48 typedef const __int32_t
*wctrans_t;
50 /* Construct value that describes a mapping between wide characters
51 identified by the string argument PROPERTY. */
52 extern wctrans_t wctrans (const char *__property
) __THROW
;
54 /* Map the wide character WC using the mapping described by DESC. */
55 extern wint_t towctrans (wint_t __wc
, wctrans_t __desc
) __THROW
;
57 # ifdef __USE_XOPEN2K8
58 /* POSIX.1-2008 extended locale interface (see locale.h). */
59 # include <bits/types/locale_t.h>
61 /* Test for any wide character for which `iswalpha' or `iswdigit' is
63 extern int iswalnum_l (wint_t __wc
, locale_t __locale
) __THROW
;
65 /* Test for any wide character for which `iswupper' or 'iswlower' is
66 true, or any wide character that is one of a locale-specific set of
67 wide-characters for which none of `iswcntrl', `iswdigit',
68 `iswpunct', or `iswspace' is true. */
69 extern int iswalpha_l (wint_t __wc
, locale_t __locale
) __THROW
;
71 /* Test for any control wide character. */
72 extern int iswcntrl_l (wint_t __wc
, locale_t __locale
) __THROW
;
74 /* Test for any wide character that corresponds to a decimal-digit
76 extern int iswdigit_l (wint_t __wc
, locale_t __locale
) __THROW
;
78 /* Test for any wide character for which `iswprint' is true and
79 `iswspace' is false. */
80 extern int iswgraph_l (wint_t __wc
, locale_t __locale
) __THROW
;
82 /* Test for any wide character that corresponds to a lowercase letter
83 or is one of a locale-specific set of wide characters for which
84 none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */
85 extern int iswlower_l (wint_t __wc
, locale_t __locale
) __THROW
;
87 /* Test for any printing wide character. */
88 extern int iswprint_l (wint_t __wc
, locale_t __locale
) __THROW
;
90 /* Test for any printing wide character that is one of a
91 locale-specific et of wide characters for which neither `iswspace'
92 nor `iswalnum' is true. */
93 extern int iswpunct_l (wint_t __wc
, locale_t __locale
) __THROW
;
95 /* Test for any wide character that corresponds to a locale-specific
96 set of wide characters for which none of `iswalnum', `iswgraph', or
97 `iswpunct' is true. */
98 extern int iswspace_l (wint_t __wc
, locale_t __locale
) __THROW
;
100 /* Test for any wide character that corresponds to an uppercase letter
101 or is one of a locale-specific set of wide character for which none
102 of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true. */
103 extern int iswupper_l (wint_t __wc
, locale_t __locale
) __THROW
;
105 /* Test for any wide character that corresponds to a hexadecimal-digit
106 character equivalent to that performed be the functions described
107 in the previous subclause. */
108 extern int iswxdigit_l (wint_t __wc
, locale_t __locale
) __THROW
;
110 /* Test for any wide character that corresponds to a standard blank
111 wide character or a locale-specific set of wide characters for
112 which `iswalnum' is false. */
113 extern int iswblank_l (wint_t __wc
, locale_t __locale
) __THROW
;
115 /* Construct value that describes a class of wide characters identified
116 by the string argument PROPERTY. */
117 extern wctype_t wctype_l (const char *__property
, locale_t __locale
)
120 /* Determine whether the wide-character WC has the property described by
122 extern int iswctype_l (wint_t __wc
, wctype_t __desc
, locale_t __locale
)
126 * Wide-character case-mapping functions.
129 /* Converts an uppercase letter to the corresponding lowercase letter. */
130 extern wint_t towlower_l (wint_t __wc
, locale_t __locale
) __THROW
;
132 /* Converts an lowercase letter to the corresponding uppercase letter. */
133 extern wint_t towupper_l (wint_t __wc
, locale_t __locale
) __THROW
;
135 /* Construct value that describes a mapping between wide characters
136 identified by the string argument PROPERTY. */
137 extern wctrans_t wctrans_l (const char *__property
, locale_t __locale
)
140 /* Map the wide character WC using the mapping described by DESC. */
141 extern wint_t towctrans_l (wint_t __wc
, wctrans_t __desc
,
142 locale_t __locale
) __THROW
;
144 # endif /* Use POSIX 2008. */
148 #endif /* wctype.h */