XenevaOS
Loading...
Searching...
No Matches
ctype.h
Go to the documentation of this file.
1
31#ifndef __CTYPE_H__
32#define __CTYPE_H__
33
34#include <aurora.h>
35
36#ifdef __cplusplus
38{
39#endif
40
41 AU_EXPORT int isspace(int c);
42 AU_EXPORT int isascii(int c);
43 AU_EXPORT int isupper(int c);
44 AU_EXPORT int islower(int c);
45 AU_EXPORT int isalpha(int c);
46 AU_EXPORT int isdigit(int c);
47 AU_EXPORT int isxdigit(int c);
48 AU_EXPORT int isprint(int c);
49 AU_EXPORT int toupper(int c);
50 AU_EXPORT int tolower(int c);
51 AU_EXPORT int toascii(int c);
52
53#if 0
54
55 extern char _ctype[257];
56
57 /* Constants */
58
59#define _LEADBYTE 0x8000 // Multibyte leadbyte
60#define _ALPHA (0x0100 | _UPPER| _LOWER) // Alphabetic character
61
62#define CT_UP 0x01 /* upper case */
63#define CT_LOW 0x02 /* lower case */
64#define CT_DIG 0x04 /* digit */
65#define CT_CTL 0x08 /* control */
66#define CT_PUN 0x10 /* punctuation */
67#define CT_WHT 0x20 /* white space (space/cr/lf/tab) */
68#define CT_HEX 0x40 /* hex digit */
69#define CT_SP 0x80 /* hard space (0x20) */
70
71 /* Basic macros */
72
73#define isalnum(c) ((_ctype + 1)[(unsigned)(c)] & (CT_UP | CT_LOW | CT_DIG))
74#define isalpha(c) ((_ctype + 1)[(unsigned)(c)] & (CT_UP | CT_LOW))
75#define iscntrl(c) ((_ctype + 1)[(unsigned)(c)] & (CT_CTL))
76#define isdigit(c) ((_ctype + 1)[(unsigned)(c)] & (CT_DIG))
77#define isgraph(c) ((_ctype + 1)[(unsigned)(c)] & (CT_PUN | CT_UP | CT_LOW | CT_DIG))
78#define islower(c) ((_ctype + 1)[(unsigned)(c)] & (CT_LOW))
79#define isprint(c) ((_ctype + 1)[(unsigned)(c)] & (CT_PUN | CT_UP | CT_LOW | CT_DIG | CT_SP))
80#define ispunct(c) ((_ctype + 1)[(unsigned)(c)] & (CT_PUN))
81#define isspace(c) ((_ctype + 1)[(unsigned)(c)] & (CT_WHT))
82#define isupper(c) ((_ctype + 1)[(unsigned)(c)] & (CT_UP))
83#define isxdigit(c) ((_ctype + 1)[(unsigned)(c)] & (CT_DIG | CT_HEX))
84
85
86#endif
87
88#ifdef __cplusplus
89}
90#endif
91
92#endif
#define AU_EXTERN
Definition aurora.h:50
#define AU_EXPORT
Definition aurora.h:38
AU_EXPORT int isascii(int c)
Definition ctype.cpp:36
AU_EXPORT int tolower(int c)
Definition utclib.c:1012
AU_EXPORT int toupper(int c)
Definition utclib.c:991
#define toascii(c)
Definition ctype.h:51
#define isspace(c)
Definition acclib.h:177
#define islower(c)
Definition acclib.h:180
#define isalpha(c)
Definition acclib.h:182
#define isdigit(c)
Definition acclib.h:176
#define isprint(c)
Definition acclib.h:181
#define isxdigit(c)
Definition acclib.h:178
#define isupper(c)
Definition acclib.h:179