Changed this file so that one could get function prototypes in effect

by #undef-ing the macros after inclusion of <ctype.h>.
This commit is contained in:
gdr 1997-09-24 06:39:23 +00:00
parent b00e9eb797
commit f8cc5f9ba2

View File

@ -29,35 +29,71 @@ extern char __ctype[],__ctype2[];
#define __octal 0x04 #define __octal 0x04
#define __blank 0x08 #define __blank 0x08
#define isalnum(c) ((__ctype)[(c)+1] & (__upper|__lower|__digit)) #define _isalnum(c) ((__ctype)[(c)+1] & (__upper|__lower|__digit))
#define isalpha(c) ((__ctype)[(c)+1] & (__upper|__lower)) #define _isalpha(c) ((__ctype)[(c)+1] & (__upper|__lower))
#define _isascii(c) ((unsigned)(c) < 0x0080)
#define _isblank(c) ((__ctype2)[(c)+1] & __blank)
#define _iscntrl(c) ((__ctype)[(c)+1] & __control)
#define _iscsym(c) ((__ctype2)[(c)+1] & __csym)
#define _iscsymf(c) ((__ctype2)[(c)+1] & __csymf)
#define _isdigit(c) ((__ctype)[(c)+1] & __digit)
#define _isgraph(c) ((__ctype)[(c)+1] & (__upper|__lower|__digit|__punctuation))
#define _islower(c) ((__ctype)[(c)+1] & __lower)
#define _isodigit(c) ((__ctype2)[(c)+1] & __octal)
#define _isprint(c) ((__ctype)[(c)+1] & __print)
#define _ispunct(c) ((__ctype)[(c)+1] & __punctuation)
#define _isspace(c) ((__ctype)[(c)+1] & __space)
#define _isupper(c) ((__ctype)[(c)+1] & __upper)
#define _isxdigit(c) ((__ctype)[(c)+1] & __hex)
#define _toascii(c) ((c) & 0x7F)
#define _tolower(c) ((c) | 0x20)
#define _toupper(c) ((c) & 0x5F)
/*
* If one #includes this file, the macro will be used. Otherwise, the
* function will be used.
*/
int isalnum(int);
int isalpha(int);
int iscntrl(int);
int isdigit(int);
int isgraph(int);
int islower(int);
int isprint(int);
int ispunct(int);
int isspace(int);
int isupper(int);
int isxdigit(int);
int tolower(int); /* no macro version (but see _tolower()) */
int toupper(int); /* no macro version (but see _toupper()) */
#ifndef __KeepNamespacePure__ #ifndef __KeepNamespacePure__
#define isascii(c) ((unsigned)(c) < 0x0080) int isascii(int);
#define isblank(c) ((__ctype2)[(c)+1] & __blank) int isblank(int);
int iscsym(int);
int iscsymf(int);
int isodigit(int);
int toascii(int);
int toint(char); /* No macro version */
#endif #endif
#define iscntrl(c) ((__ctype)[(c)+1] & __control)
#define isalnum(c) _isalnum(c)
#define isalpha(c) _isalpha(c)
#define iscntrl(c) _iscntrl(c)
#define isdigit(c) _isdigit(c)
#define isgraph(c) _isgraph(c)
#define islower(c) _islower(c)
#define isprint(c) _isprint(c)
#define ispunct(c) _ispunct(c)
#define isspace(c) _isspace(c)
#define isupper(c) _isupper(c)
#define isxdigit(c) _isxdigit(c)
#ifndef __KeepNamespacePure__ #ifndef __KeepNamespacePure__
#define iscsym(c) ((__ctype2)[(c)+1] & __csym) # define isascii(c) _isascii(c)
#define iscsymf(c) ((__ctype2)[(c)+1] & __csymf) # define isblank(c) _isblank(c)
# define iscsym(c) _iscsym(c)
# define iscsymf(c) _iscsymf(c)
# define isodigit(c) _isodigit(c)
# define toascii(c) _toascii(c)
#endif #endif
#define isdigit(c) ((__ctype)[(c)+1] & __digit)
#define isgraph(c) ((__ctype)[(c)+1] & (__upper|__lower|__digit|__punctuation))
#define islower(c) ((__ctype)[(c)+1] & __lower)
#ifndef __KeepNamespacePure__
#define isodigit(c) ((__ctype2)[(c)+1] & __octal)
#endif
#define isprint(c) ((__ctype)[(c)+1] & __print)
#define ispunct(c) ((__ctype)[(c)+1] & __punctuation)
#define isspace(c) ((__ctype)[(c)+1] & __space)
#define isupper(c) ((__ctype)[(c)+1] & __upper)
#define isxdigit(c) ((__ctype)[(c)+1] & __hex)
#ifndef __KeepNamespacePure__
#define toascii(c) ((c) & 0x7F)
#endif
int toint(char);
int tolower(int);
int toupper(int);
#define _tolower(c) ((c) | 0x20)
#define _toupper(c) ((c) & 0x5F)
#endif #endif