Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / ctype / iscntrl.c
blobebbdd7371d7303996d00ca3e1110abd9e080ed5d
1 /*
2 FUNCTION
3 <<iscntrl>>, <<iscntrl_l>>---control character predicate
5 INDEX
6 iscntrl
8 INDEX
9 iscntrl_l
11 SYNOPSIS
12 #include <ctype.h>
13 int iscntrl(int <[c]>);
15 #include <ctype.h>
16 int iscntrl_l(int <[c]>, locale_t <[locale]>);
18 DESCRIPTION
19 <<iscntrl>> is a macro which classifies singlebyte charset values by table
20 lookup. It is a predicate returning non-zero for control characters, and 0
21 for other characters. It is defined only if <[c]> is representable as an
22 unsigned char or if <[c]> is EOF.
24 <<iscntrl_l>> is like <<iscntrl>> but performs the check based on the
25 locale specified by the locale object locale. If <[locale]> is
26 LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined.
28 You can use a compiled subroutine instead of the macro definition by
29 undefining the macro using `<<#undef iscntrl>>' or `<<#undef iscntrl_l>>'.
31 RETURNS
32 <<iscntrl>>, <<iscntrl_l>> return non-zero if <[c]> is a delete character
33 or ordinary control character.
35 PORTABILITY
36 <<iscntrl>> is ANSI C.
37 <<iscntrl_l>> is POSIX-1.2008.
39 No supporting OS subroutines are required.
42 #include <_ansi.h>
43 #include <ctype.h>
47 #undef iscntrl
48 int
49 iscntrl (int c)
51 return(__CTYPE_PTR[c+1] & _C);