OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [include/] [ctype.h] - Blame information for rev 1773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1005 ivang
#ifndef _CTYPE_H_
2
#ifdef __cplusplus
3
extern "C" {
4
#endif
5
#define _CTYPE_H_
6
 
7
#include "_ansi.h"
8
 
9
int _EXFUN(isalnum, (int __c));
10
int _EXFUN(isalpha, (int __c));
11
int _EXFUN(iscntrl, (int __c));
12
int _EXFUN(isdigit, (int __c));
13
int _EXFUN(isgraph, (int __c));
14
int _EXFUN(islower, (int __c));
15
int _EXFUN(isprint, (int __c));
16
int _EXFUN(ispunct, (int __c));
17
int _EXFUN(isspace, (int __c));
18
int _EXFUN(isupper, (int __c));
19
int _EXFUN(isxdigit,(int __c));
20
int _EXFUN(tolower, (int __c));
21
int _EXFUN(toupper, (int __c));
22
 
23
#ifndef __STRICT_ANSI__
24
int _EXFUN(isascii, (int __c));
25
int _EXFUN(toascii, (int __c));
26
int _EXFUN(_tolower, (int __c));
27
int _EXFUN(_toupper, (int __c));
28
#endif
29
 
30
#define _U      01
31
#define _L      02
32
#define _N      04
33
#define _S      010
34
#define _P      020
35
#define _C      040
36
#define _X      0100
37
#define _B      0200
38
 
39
extern  __IMPORT _CONST char    _ctype_[];
40
 
41
#ifndef __cplusplus
42
#define isalpha(c)      ((_ctype_+1)[(unsigned)(c)]&(_U|_L))
43
#define isupper(c)      ((_ctype_+1)[(unsigned)(c)]&_U)
44
#define islower(c)      ((_ctype_+1)[(unsigned)(c)]&_L)
45
#define isdigit(c)      ((_ctype_+1)[(unsigned)(c)]&_N)
46
#define isxdigit(c)     ((_ctype_+1)[(unsigned)(c)]&(_X|_N))
47
#define isspace(c)      ((_ctype_+1)[(unsigned)(c)]&_S)
48
#define ispunct(c)      ((_ctype_+1)[(unsigned)(c)]&_P)
49
#define isalnum(c)      ((_ctype_+1)[(unsigned)(c)]&(_U|_L|_N))
50
#define isprint(c)      ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B))
51
#define isgraph(c)      ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N))
52
#define iscntrl(c)      ((_ctype_+1)[(unsigned)(c)]&_C)
53
/* Non-gcc versions will get the library versions, and will be
54
   slightly slower */
55
#ifdef __GNUC__
56
# define toupper(c) \
57
        __extension__ ({ int __x = (c); islower(__x) ? (__x - 'a' + 'A') : __x;})
58
# define tolower(c) \
59
        __extension__ ({ int __x = (c); isupper(__x) ? (__x - 'A' + 'a') : __x;})
60
#endif
61
#endif /* !__cplusplus */
62
 
63
#ifndef __STRICT_ANSI__
64
#define isascii(c)      ((unsigned)(c)<=0177)
65
#define toascii(c)      ((c)&0177)
66
#endif
67
 
68
#ifdef __cplusplus
69
}
70
#endif
71
#endif /* _CTYPE_H_ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.