Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / ctype / iswctype.c
blob027cb8ae314af619bca0d5866ff570c6bc2ff4ac
1 /*
2 FUNCTION
3 <<iswctype>>, <<iswctype_l>>---extensible wide-character test
5 INDEX
6 iswctype
8 INDEX
9 iswctype_l
11 SYNOPSIS
12 #include <wctype.h>
13 int iswctype(wint_t <[c]>, wctype_t <[desc]>);
15 #include <wctype.h>
16 int iswctype_l(wint_t <[c]>, wctype_t <[desc]>, locale_t <[locale]>);
18 DESCRIPTION
19 <<iswctype>> is a function which classifies wide-character values using the
20 wide-character test specified by <[desc]>.
22 <<iswctype_l>> is like <<iswctype>> but performs the check based on the
23 locale specified by the locale object locale. If <[locale]> is
24 LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined.
26 RETURNS
27 <<iswctype>>, <<iswctype_l>> return non-zero if and only if <[c]> matches
28 the test specified by <[desc]>. If <[desc]> is unknown, zero is returned.
30 PORTABILITY
31 <<iswctype>> is C99.
32 <<iswctype_l>> is POSIX-1.2008.
34 No supporting OS subroutines are required.
36 #include <_ansi.h>
37 #include <wctype.h>
38 #include "local.h"
40 int
41 iswctype (wint_t c, wctype_t desc)
43 switch (desc)
45 case WC_ALNUM:
46 return iswalnum (c);
47 case WC_ALPHA:
48 return iswalpha (c);
49 case WC_BLANK:
50 return iswblank (c);
51 case WC_CNTRL:
52 return iswcntrl (c);
53 case WC_DIGIT:
54 return iswdigit (c);
55 case WC_GRAPH:
56 return iswgraph (c);
57 case WC_LOWER:
58 return iswlower (c);
59 case WC_PRINT:
60 return iswprint (c);
61 case WC_PUNCT:
62 return iswpunct (c);
63 case WC_SPACE:
64 return iswspace (c);
65 case WC_UPPER:
66 return iswupper (c);
67 case WC_XDIGIT:
68 return iswxdigit (c);
69 default:
70 return 0; /* eliminate warning */
73 /* otherwise unknown */
74 return 0;