source: trunk/libs/newlib/src/newlib/libc/ctype/toascii.c @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 1.0 KB
Line 
1/*
2FUNCTION
3        <<toascii>>, <<toascii_l>>---force integers to ASCII range
4
5INDEX
6        toascii
7
8INDEX
9        toascii_l
10
11SYNOPSIS
12        #include <ctype.h>
13        int toascii(int <[c]>);
14
15        #include <ctype.h>
16        int toascii_l(int <[c]>, locale_t <[locale]>);
17
18DESCRIPTION
19<<toascii>> is a macro which coerces integers to the ASCII range (0--127) by zeroing any higher-order bits.
20
21<<toascii_l>> is like <<toascii>> but performs the function based on the
22locale specified by the locale object locale.  If <[locale]> is
23LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined.
24
25You can use a compiled subroutine instead of the macro definition by
26undefining this macro using `<<#undef toascii>>' or `<<#undef toascii_l>>'.
27
28RETURNS
29<<toascii>>, <<toascii_l>> return integers between 0 and 127.
30
31PORTABILITY
32<<toascii>> is X/Open, BSD and POSIX-1.2001, but marked obsolete in
33POSIX-1.2008.
34<<toascii_l>> is a GNU extension.
35
36No supporting OS subroutines are required.
37*/
38
39#include <_ansi.h>
40#include <ctype.h>
41#undef toascii
42
43int
44toascii (int c)
45{
46  return (c)&0177;
47}
48
Note: See TracBrowser for help on using the repository browser.