summaryrefslogtreecommitdiff
path: root/chardefs.h
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-11-23 18:47:16 -0500
committerChet Ramey <chet.ramey@case.edu>2011-11-23 18:47:16 -0500
commitdb4c00d880b67af735af9b18835ae900f5be9e53 (patch)
tree8dfe99254425c933b2b9024e06faa506f3640359 /chardefs.h
parentfe34a312c8be645944828402351bd1192972586b (diff)
downloadreadline-db4c00d880b67af735af9b18835ae900f5be9e53.tar.gz
Readline-2.2 import
Diffstat (limited to 'chardefs.h')
-rw-r--r--chardefs.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/chardefs.h b/chardefs.h
index 8e6f0ef..3e9e273 100644
--- a/chardefs.h
+++ b/chardefs.h
@@ -121,7 +121,20 @@
#ifdef ESC
#undef ESC
#endif
-
#define ESC CTRL('[')
+#ifndef ISOCTAL
+#define ISOCTAL(c) ((c) >= '0' && (c) <= '7')
+#endif
+#define OCTVALUE(c) ((c) - '0')
+
+#ifndef isxdigit
+# define isxdigit(c) (isdigit((c)) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
+#endif
+
+#define HEXVALUE(c) \
+ (((c) >= 'a' && (c) <= 'f') \
+ ? (c)-'a'+10 \
+ : (c) >= 'A' && (c) <= 'F' ? (c)-'A'+10 : (c)-'0')
+
#endif /* _CHARDEFS_H_ */