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

Subversion Repositories or1k

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

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

Line No. Rev Author Line
1 39 lampret
#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  _CONST char     _ctype_[];
40
 
41
#define isalpha(c)      ((_ctype_+1)[c]&(_U|_L))
42
#define isupper(c)      ((_ctype_+1)[c]&_U)
43
#define islower(c)      ((_ctype_+1)[c]&_L)
44
#define isdigit(c)      ((_ctype_+1)[c]&_N)
45
#define isxdigit(c)     ((_ctype_+1)[c]&(_X|_N))
46
#define isspace(c)      ((_ctype_+1)[c]&_S)
47
#define ispunct(c)      ((_ctype_+1)[c]&_P)
48
#define isalnum(c)      ((_ctype_+1)[c]&(_U|_L|_N))
49
#define isprint(c)      ((_ctype_+1)[c]&(_P|_U|_L|_N|_B))
50
#define isgraph(c)      ((_ctype_+1)[c]&(_P|_U|_L|_N))
51
#define iscntrl(c)      ((_ctype_+1)[c]&_C)
52
/* Non-gcc versions will get the library versions, and will be
53
   slightly slower */
54
#ifdef __GNUC__
55
# define toupper(c) \
56
        ({ int __x = (c); islower(__x) ? (__x - 'a' + 'A') : __x;})
57
# define tolower(c) \
58
        ({ int __x = (c); isupper(__x) ? (__x - 'A' + 'a') : __x;})
59
#endif
60
 
61
#ifndef _STRICT_ANSI
62
#define isascii(c)      ((unsigned)(c)<=0177)
63
#define toascii(c)      ((c)&0177)
64
#endif
65
 
66
#ifdef __cplusplus
67
}
68
#endif
69
#endif /* _CTYPE_H_ */

powered by: WebSVN 2.1.0

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