summaryrefslogtreecommitdiff
path: root/src/character.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/character.h')
-rw-r--r--src/character.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/character.h b/src/character.h
index 62d252e91ba..b073a0dd1e4 100644
--- a/src/character.h
+++ b/src/character.h
@@ -700,6 +700,24 @@ char_table_translate (Lisp_Object obj, int ch)
return CHARACTERP (obj) ? XINT (obj) : ch;
}
+#if defined __GNUC__ && !defined __STRICT_ANSI__
+# define HEXDIGIT_CONST const
+# define HEXDIGIT_IS_CONST true
+#else
+# define HEXDIGIT_CONST
+# define HEXDIGIT_IS_CONST false
+#endif
+extern signed char HEXDIGIT_CONST hexdigit[];
+
+/* If C is a hexadecimal digit ('0'-'9', 'a'-'f', 'A'-'F'), return its
+ value (0-15). Otherwise return -1. */
+
+INLINE int
+char_hexdigit (int c)
+{
+ return 0 <= c && c <= UCHAR_MAX ? hexdigit[c] : -1;
+}
+
INLINE_HEADER_END
#endif /* EMACS_CHARACTER_H */