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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libc/] [include/] [ctype.h] - Blame information for rev 816

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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