move fnmatch function declaration from unistd.h
[unix-history] / usr / src / include / ctype.h
index 31911f2..ca792e0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ctype.h     5.4 (Berkeley) %G%
+ *     @(#)ctype.h     5.7 (Berkeley) %G%
  */
 
 #ifndef _CTYPE_H_
  */
 
 #ifndef _CTYPE_H_
 #define        _X      0x40
 #define        _B      0x80
 
 #define        _X      0x40
 #define        _B      0x80
 
-extern char    _ctype_[];
+extern char __ctype[], __maplower[], __mapupper[];
 
 
-#define        isalnum(c)      ((_ctype_ + 1)[c] & (_U|_L|_N))
-#define        isalpha(c)      ((_ctype_ + 1)[c] & (_U|_L))
-#define        isascii(c)      ((unsigned)(c) <= 0177)
+#define        isalnum(c)      ((__ctype + 1)[c] & (_U|_L|_N))
+#define        isalpha(c)      ((__ctype + 1)[c] & (_U|_L))
+#define        iscntrl(c)      ((__ctype + 1)[c] & _C)
+#define        isdigit(c)      ((__ctype + 1)[c] & _N)
+#define        isgraph(c)      ((__ctype + 1)[c] & (_P|_U|_L|_N))
+#define        islower(c)      ((__ctype + 1)[c] & _L)
+#define        isprint(c)      ((__ctype + 1)[c] & (_P|_U|_L|_N|_B))
+#define        ispunct(c)      ((__ctype + 1)[c] & _P)
+#define        isspace(c)      ((__ctype + 1)[c] & _S)
+#define        isupper(c)      ((__ctype + 1)[c] & _U)
+#define        isxdigit(c)     ((__ctype + 1)[c] & (_N|_X))
+#define        tolower(c)      ((__maplower + 1)[c])
+#define        toupper(c)      ((__mapupper + 1)[c])
+
+#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
+#define        isascii(c)      ((unsigned int)(c) <= 0177)
 #define        isblank(c)      ((c) == '\t' || (c) == ' ')
 #define        isblank(c)      ((c) == '\t' || (c) == ' ')
-#define        iscntrl(c)      ((_ctype_ + 1)[c] & _C)
-#define        isdigit(c)      ((_ctype_ + 1)[c] & _N)
-#define        isgraph(c)      ((_ctype_ + 1)[c] & (_P|_U|_L|_N))
-#define        islower(c)      ((_ctype_ + 1)[c] & _L)
-#define        isprint(c)      ((_ctype_ + 1)[c] & (_P|_U|_L|_N|_B))
-#define        ispunct(c)      ((_ctype_ + 1)[c] & _P)
-#define        isspace(c)      ((_ctype_ + 1)[c] & _S)
-#define        isupper(c)      ((_ctype_ + 1)[c] & _U)
-#define        isxdigit(c)     ((_ctype_ + 1)[c] & (_N|_X))
 #define        toascii(c)      ((c) & 0177)
 #define        toascii(c)      ((c) & 0177)
-#define        tolower(c)      ((c) - 'A' + 'a')
-#define        toupper(c)      ((c) - 'a' + 'A')
+#endif
 
 #endif /* !_CTYPE_H_ */
 
 #endif /* !_CTYPE_H_ */