summaryrefslogtreecommitdiff
path: root/setup_once.h
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2006-10-18 03:41:19 +0000
committerYang Tse <yangsita@gmail.com>2006-10-18 03:41:19 +0000
commit2a7b004e49fb7c355dec0d299f9cd5c63c119ccd (patch)
treefcd8019cac358d2da767f0eb631d2da7e3eafb55 /setup_once.h
parent69dcc701cfed2561f39a34e7ffa171b355281b88 (diff)
downloadc-ares-2a7b004e49fb7c355dec0d299f9cd5c63c119ccd.tar.gz
c-ares-2a7b004e49fb7c355dec0d299f9cd5c63c119ccd.tar.bz2
c-ares-2a7b004e49fb7c355dec0d299f9cd5c63c119ccd.zip
Move definition of IS*() macros to setup_once.h
Diffstat (limited to 'setup_once.h')
-rw-r--r--setup_once.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/setup_once.h b/setup_once.h
index 0ca6863..15ad563 100644
--- a/setup_once.h
+++ b/setup_once.h
@@ -17,6 +17,16 @@
*/
+/********************************************************************
+ * 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
@@ -94,7 +104,7 @@
(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
@@ -105,5 +115,18 @@
#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 */