Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / ctype / toascii.c
blobde5b8e1c3ff0b9f456fcf3da18b6c0eea0090840
1 /*
2 FUNCTION
3 <<toascii>>, <<toascii_l>>---force integers to ASCII range
5 INDEX
6 toascii
8 INDEX
9 toascii_l
11 SYNOPSIS
12 #include <ctype.h>
13 int toascii(int <[c]>);
15 #include <ctype.h>
16 int toascii_l(int <[c]>, locale_t <[locale]>);
18 DESCRIPTION
19 <<toascii>> is a macro which coerces integers to the ASCII range (0--127) by zeroing any higher-order bits.
21 <<toascii_l>> is like <<toascii>> but performs the function based on the
22 locale specified by the locale object locale. If <[locale]> is
23 LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined.
25 You can use a compiled subroutine instead of the macro definition by
26 undefining this macro using `<<#undef toascii>>' or `<<#undef toascii_l>>'.
28 RETURNS
29 <<toascii>>, <<toascii_l>> return integers between 0 and 127.
31 PORTABILITY
32 <<toascii>> is X/Open, BSD and POSIX-1.2001, but marked obsolete in
33 POSIX-1.2008.
34 <<toascii_l>> is a GNU extension.
36 No supporting OS subroutines are required.
39 #include <_ansi.h>
40 #include <ctype.h>
41 #undef toascii
43 int
44 toascii (int c)
46 return (c)&0177;