]> granicus.if.org Git - curl/commitdiff
Move definition of IS*() macros to setup_once.h
authorYang Tse <yangsita@gmail.com>
Wed, 18 Oct 2006 03:41:19 +0000 (03:41 +0000)
committerYang Tse <yangsita@gmail.com>
Wed, 18 Oct 2006 03:41:19 +0000 (03:41 +0000)
ares/setup_once.h
lib/setup.h
lib/setup_once.h
src/setup.h

index 0ca6863e206f625a46a75644e4b43069b0e36edd..15ad563956a860919dfc57b489aa9cabf880807e 100644 (file)
  */
 
 
+/********************************************************************
+ *                              NOTICE                              *
+ *                             ========                             *
+ *                                                                  *
+ *  Content of header files lib/setup_once.h and ares/setup_once.h  *
+ *  must be kept in sync. Modify the other one if you change this.  *
+ *                                                                  *
+ ********************************************************************/
+
+
 /*
  * If we have the MSG_NOSIGNAL define, make sure we use
  * it as the fourth argument of send() and recv()
@@ -67,7 +77,7 @@
                                    (RECV_TYPE_ARG4)(SEND_4TH_ARG))
 #endif
 #else /* HAVE_RECV */
-#ifdef DJGPP
+#ifdef MSDOS
 #define sread(x,y,z) (ssize_t)read_s((int)(x), (char *)(y), (int)(z))
 #endif
 #ifndef sread
                                     (SEND_TYPE_ARG4)(SEND_4TH_ARG))
 #endif
 #else /* HAVE_SEND */
-#ifdef DJGPP
+#ifdef MSDOS
 #define swrite(x,y,z) (ssize_t)write_s((int)(x), (char *)(y), (int)(z))
 #endif
 #ifndef swrite
 #endif /* HAVE_SEND */
 
 
+/*
+ * Uppercase macro versions of ANSI/ISO is*() functions/macros which 
+ * avoid negative number inputs whith argument byte codes > 127.
+ */
+
+#define ISSPACE(x)  (isspace((int)  ((unsigned char)x)))
+#define ISDIGIT(x)  (isdigit((int)  ((unsigned char)x)))
+#define ISALNUM(x)  (isalnum((int)  ((unsigned char)x)))
+#define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x)))
+#define ISGRAPH(x)  (isgraph((int)  ((unsigned char)x)))
+#define ISALPHA(x)  (isalpha((int)  ((unsigned char)x)))
+
+
 #endif /* __SETUP_ONCE_H */
 
index 4f1a3c1cd091711b163b82de0c622133bb81ba67..a02834ecdc8470c5839306e7050db06401b1a5cd 100644 (file)
@@ -348,16 +348,6 @@ int fileno( FILE *stream);
 #define DEBUGF(x)
 #endif
 
-#ifndef ISSPACE
-/* typecasting craze to avoid negative number inputs to these macros */
-#define ISSPACE(x) (isspace((int)((unsigned char)x)))
-#define ISDIGIT(x) (isdigit((int)((unsigned char)x)))
-#define ISALNUM(x) (isalnum((int)((unsigned char)x)))
-#define ISXDIGIT(x) (isxdigit((int)((unsigned char)x)))
-#define ISGRAPH(x) (isgraph((int)((unsigned char)x)))
-#define ISALPHA(x) (isalpha((int)((unsigned char)x)))
-#endif
-
 /*
  * Include macros and defines that should only be processed once.
  */
index d3a4cc0a132c3e30b3649dfb32301cfcb4a05711..9c00fd6377305d4590440ddb594cdbc909a32646 100644 (file)
  ***************************************************************************/
 
 
+/********************************************************************
+ *                              NOTICE                              *
+ *                             ========                             *
+ *                                                                  *
+ *  Content of header files lib/setup_once.h and ares/setup_once.h  *
+ *  must be kept in sync. Modify the other one if you change this.  *
+ *                                                                  *
+ ********************************************************************/
+
+
 /*
  * If we have the MSG_NOSIGNAL define, make sure we use
  * it as the fourth argument of send() and recv()
 #endif /* HAVE_SEND */
 
 
+/*
+ * Uppercase macro versions of ANSI/ISO is*() functions/macros which 
+ * avoid negative number inputs whith argument byte codes > 127.
+ */
+
+#define ISSPACE(x)  (isspace((int)  ((unsigned char)x)))
+#define ISDIGIT(x)  (isdigit((int)  ((unsigned char)x)))
+#define ISALNUM(x)  (isalnum((int)  ((unsigned char)x)))
+#define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x)))
+#define ISGRAPH(x)  (isgraph((int)  ((unsigned char)x)))
+#define ISALPHA(x)  (isalpha((int)  ((unsigned char)x)))
+
+
 #endif /* __SETUP_ONCE_H */
 
index a8f636974ff12d59c1fa1a07ee5bb6651f26cff6..6e0f23a1535c58c33bd8cdecc7cc8a33c631c1ab 100644 (file)
@@ -184,16 +184,12 @@ int fileno( FILE *stream);
 #define strdup(ptr) curlx_strdup(ptr)
 #endif
 
-#ifndef ISSPACE
-/* typecasting craze to avoid negative number inputs to these macros */
-/* copied from lib/setup.h */
-#define ISSPACE(x) (isspace((int)((unsigned char)x)))
-#define ISDIGIT(x) (isdigit((int)((unsigned char)x)))
-#define ISALNUM(x) (isalnum((int)((unsigned char)x)))
-#define ISXDIGIT(x) (isxdigit((int)((unsigned char)x)))
-#define ISGRAPH(x) (isgraph((int)((unsigned char)x)))
-#define ISALPHA(x) (isalpha((int)((unsigned char)x)))
-#define ISPRINT(x) (isprint((int)((unsigned char)x)))
+/*
+ * Include macros and defines that should only be processed once.
+ */
+
+#ifndef __SETUP_ONCE_H
+#include "setup_once.h"
 #endif
 
 #endif /* __SRC_CURL_SETUP_H */