1 /* Copyright (c) 2016 Corinna Vinschen <corinna@vinschen.de> */
2 /* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
3 #define _DEFAULT_SOURCE
4 #include <wctype.h>
5 #include "local.h"
6 
7 int
iswctype_l(wint_t c,wctype_t desc,struct __locale_t * locale)8 iswctype_l (wint_t c, wctype_t desc, struct __locale_t *locale)
9 {
10   switch (desc)
11     {
12     case WC_ALNUM:
13       return iswalnum_l (c, locale);
14     case WC_ALPHA:
15       return iswalpha_l (c, locale);
16     case WC_BLANK:
17       return iswblank_l (c, locale);
18     case WC_CNTRL:
19       return iswcntrl_l (c, locale);
20     case WC_DIGIT:
21       return iswdigit_l (c, locale);
22     case WC_GRAPH:
23       return iswgraph_l (c, locale);
24     case WC_LOWER:
25       return iswlower_l (c, locale);
26     case WC_PRINT:
27       return iswprint_l (c, locale);
28     case WC_PUNCT:
29       return iswpunct_l (c, locale);
30     case WC_SPACE:
31       return iswspace_l (c, locale);
32     case WC_UPPER:
33       return iswupper_l (c, locale);
34     case WC_XDIGIT:
35       return iswxdigit_l (c, locale);
36     default:
37       return 0; /* eliminate warning */
38     }
39 
40   /* otherwise unknown */
41   return 0;
42 }
43