2000-02-17 20:39:52 +01:00
|
|
|
#ifndef _CTYPE_H_
|
|
|
|
#define _CTYPE_H_
|
|
|
|
|
|
|
|
#include "_ansi.h"
|
|
|
|
|
2002-06-28 01:58:38 +02:00
|
|
|
_BEGIN_STD_C
|
|
|
|
|
2000-02-17 20:39:52 +01:00
|
|
|
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__
|
2002-06-18 20:49:17 +02:00
|
|
|
int _EXFUN(isblank, (int __c));
|
2000-02-17 20:39:52 +01:00
|
|
|
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
|
|
|
|
|
2000-08-01 22:51:51 +02:00
|
|
|
extern __IMPORT _CONST char _ctype_[];
|
2000-02-17 20:39:52 +01:00
|
|
|
|
2001-06-11 23:51:41 +02:00
|
|
|
#ifndef __cplusplus
|
2000-02-17 20:39:52 +01:00
|
|
|
#define isalpha(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L))
|
|
|
|
#define isupper(c) ((_ctype_+1)[(unsigned)(c)]&_U)
|
|
|
|
#define islower(c) ((_ctype_+1)[(unsigned)(c)]&_L)
|
|
|
|
#define isdigit(c) ((_ctype_+1)[(unsigned)(c)]&_N)
|
|
|
|
#define isxdigit(c) ((_ctype_+1)[(unsigned)(c)]&(_X|_N))
|
|
|
|
#define isspace(c) ((_ctype_+1)[(unsigned)(c)]&_S)
|
|
|
|
#define ispunct(c) ((_ctype_+1)[(unsigned)(c)]&_P)
|
|
|
|
#define isalnum(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L|_N))
|
|
|
|
#define isprint(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B))
|
|
|
|
#define isgraph(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N))
|
|
|
|
#define iscntrl(c) ((_ctype_+1)[(unsigned)(c)]&_C)
|
|
|
|
/* Non-gcc versions will get the library versions, and will be
|
|
|
|
slightly slower */
|
|
|
|
#ifdef __GNUC__
|
|
|
|
# define toupper(c) \
|
2000-05-16 01:00:24 +02:00
|
|
|
__extension__ ({ int __x = (c); islower(__x) ? (__x - 'a' + 'A') : __x;})
|
2000-02-17 20:39:52 +01:00
|
|
|
# define tolower(c) \
|
2000-05-16 01:00:24 +02:00
|
|
|
__extension__ ({ int __x = (c); isupper(__x) ? (__x - 'A' + 'a') : __x;})
|
2000-02-17 20:39:52 +01:00
|
|
|
#endif
|
2001-06-11 23:51:41 +02:00
|
|
|
#endif /* !__cplusplus */
|
2000-02-17 20:39:52 +01:00
|
|
|
|
|
|
|
#ifndef __STRICT_ANSI__
|
|
|
|
#define isascii(c) ((unsigned)(c)<=0177)
|
|
|
|
#define toascii(c) ((c)&0177)
|
|
|
|
#endif
|
|
|
|
|
2002-06-28 01:58:38 +02:00
|
|
|
_END_STD_C
|
|
|
|
|
2000-02-17 20:39:52 +01:00
|
|
|
#endif /* _CTYPE_H_ */
|