Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ctype.h « include « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c1ace5077a11e9506a5597a2734d24da8b54f91b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef _CTYPE_H_
#define _CTYPE_H_

#include "_ansi.h"

_BEGIN_STD_C

int _EXFUN(isalnum, (int __c));
int _EXFUN(isalpha, (int __c));
int _EXFUN(iscntrl, (int __c));
int _EXFUN(isdigit, (int __c));
int _EXFUN(isgraph, (int __c));
int _EXFUN(islower, (int __c));
int _EXFUN(isprint, (int __c));
int _EXFUN(ispunct, (int __c));
int _EXFUN(isspace, (int __c));
int _EXFUN(isupper, (int __c));
int _EXFUN(isxdigit,(int __c));
int _EXFUN(tolower, (int __c));
int _EXFUN(toupper, (int __c));

#ifndef __STRICT_ANSI__
int _EXFUN(isblank, (int __c));
int _EXFUN(isascii, (int __c));
int _EXFUN(toascii, (int __c));
int _EXFUN(_tolower, (int __c));
int _EXFUN(_toupper, (int __c));
#endif

#define	_U	01
#define	_L	02
#define	_N	04
#define	_S	010
#define _P	020
#define _C	040
#define _X	0100
#define	_B	0200

extern	__IMPORT _CONST char	*__ctype_ptr;
extern	__IMPORT _CONST char	_ctype_[];  /* For backward compatibility.  */

#ifndef __cplusplus
#define	isalpha(c)	((__ctype_ptr)[(unsigned)(c)]&(_U|_L))
#define	isupper(c)	((__ctype_ptr)[(unsigned)(c)]&_U)
#define	islower(c)	((__ctype_ptr)[(unsigned)(c)]&_L)
#define	isdigit(c)	((__ctype_ptr)[(unsigned)(c)]&_N)
#define	isxdigit(c)	((__ctype_ptr)[(unsigned)(c)]&(_X|_N))
#define	isspace(c)	((__ctype_ptr)[(unsigned)(c)]&_S)
#define ispunct(c)	((__ctype_ptr)[(unsigned)(c)]&_P)
#define isalnum(c)	((__ctype_ptr)[(unsigned)(c)]&(_U|_L|_N))
#define isprint(c)	((__ctype_ptr)[(unsigned)(c)]&(_P|_U|_L|_N|_B))
#define	isgraph(c)	((__ctype_ptr)[(unsigned)(c)]&(_P|_U|_L|_N))
#define iscntrl(c)	((__ctype_ptr)[(unsigned)(c)]&_C)


/* Non-gcc versions will get the library versions, and will be
   slightly slower */
#ifdef __GNUC__
# define toupper(c) \
	__extension__ ({ int __x = (c); islower(__x) ? (__x - 'a' + 'A') : __x;})
# define tolower(c) \
	__extension__ ({ int __x = (c); isupper(__x) ? (__x - 'A' + 'a') : __x;})
#endif
#endif /* !__cplusplus */

#ifndef __STRICT_ANSI__
#define isascii(c)	((unsigned)(c)<=0177)
#define toascii(c)	((c)&0177)
#endif

_END_STD_C

#endif /* _CTYPE_H_ */