1 /* Get descriptor for a wide character property.
2 Copyright (C) 2011-2024 Free Software Foundation, Inc.
3 Written by Bruno Haible <bruno@clisp.org>, 2011.
5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 This file is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
19 wctype (const char* name
)
30 if (strcmp (name
+ 3, "um") == 0)
31 return (wctype_t) iswalnum
;
34 if (strcmp (name
+ 3, "ha") == 0)
35 return (wctype_t) iswalpha
;
46 if (strcmp (name
+ 1, "lank") == 0)
47 return (wctype_t) iswblank
;
50 if (strcmp (name
+ 1, "ntrl") == 0)
51 return (wctype_t) iswcntrl
;
54 if (strcmp (name
+ 1, "igit") == 0)
55 return (wctype_t) iswdigit
;
58 if (strcmp (name
+ 1, "raph") == 0)
59 return (wctype_t) iswgraph
;
62 if (strcmp (name
+ 1, "ower") == 0)
63 return (wctype_t) iswlower
;
69 if (strcmp (name
+ 2, "int") == 0)
70 return (wctype_t) iswprint
;
73 if (strcmp (name
+ 2, "nct") == 0)
74 return (wctype_t) iswpunct
;
81 if (strcmp (name
+ 1, "pace") == 0)
82 return (wctype_t) iswspace
;
85 if (strcmp (name
+ 1, "pper") == 0)
86 return (wctype_t) iswupper
;
89 if (strcmp (name
+ 1, "digit") == 0)
90 return (wctype_t) iswxdigit
;