summaryrefslogtreecommitdiff
path: root/chardefs.h
diff options
context:
space:
mode:
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_ */