]> git.sur5r.net Git - cc65/blob - include/ctype.h
This commit was generated by cvs2svn to compensate for changes in r2,
[cc65] / include / ctype.h
1 /*
2  * ctype.h
3  *
4  * Ullrich von Bassewitz, 03.06.1998
5  *
6  */
7
8
9
10 #ifndef _CTYPE_H
11 #define _CTYPE_H
12
13
14
15 int __fastcall__ isalnum (int c);
16 int __fastcall__ isalpha (int c);
17 int __fastcall__ iscntrl (int c);
18 int __fastcall__ isdigit (int c);
19 int __fastcall__ isgraph (int c);
20 int __fastcall__ islower (int c);
21 int __fastcall__ isprint (int c);
22 int __fastcall__ ispunct (int c);
23 int __fastcall__ isspace (int c);
24 int __fastcall__ isupper (int c);
25 int __fastcall__ isxdigit (int c);
26 #ifndef __STRICT_ANSI__
27 int __fastcall__ isblank (int c);       /* cc65 (and GNU) extension */
28 #endif
29
30 int __fastcall__ toupper (int c);       /* Always external */
31 int __fastcall__ tolower (int c);       /* Always external */
32
33
34
35 /* When inlining of known function is enabled, overload most of the above
36  * functions by macros. The function prototypes are again available after
37  * #undef'ing the macros.
38 */
39 #ifdef __OPT_s__
40
41
42 extern unsigned char _ctype[256];
43
44 #define isalnum(c)  (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$07"), __AX__)
45 #define isalpha(c)  (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$03"), __AX__)
46 #define iscntrl(c)  (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$10"), __AX__)
47 #define isdigit(c)  (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$04"), __AX__)
48 #define isgraph(c)  (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\teor\t#$30\n\tand\t#$30"), __AX__)
49 #define islower(c)  (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$01"), __AX__)
50 #define isprint(c)  (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\teor\t#$10\n\tand\t#$10"), __AX__)
51 #define ispunct(c)  (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\teor\t#$37\n\tand\t#$37"), __AX__)
52 #define isspace(c)  (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$60"), __AX__)
53 #define isupper(c)  (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$02"), __AX__)
54 #define isxdigit(c) (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$08"), __AX__)
55
56 #ifndef __STRICT_ANSI__
57 /* cc65 and GNU extension */
58 #define isblank(c)  (__AX__ = (c), __asm__ ("\ttay\n\tlda\t__ctype,y\n\tand\t#$80"), __AX__)
59 #endif
60
61
62 #endif
63
64
65
66 /* End of ctype.h */
67 #endif
68
69
70