summaryrefslogtreecommitdiff
path: root/rlmbutil.h
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2019-01-07 09:30:21 -0500
committerChet Ramey <chet.ramey@case.edu>2019-01-07 09:30:21 -0500
commit8e6ccd0373d77b86ed37a9a7d232ccfea3d6670c (patch)
tree58bce2928cd55511defa0029ba70b884053c3fdb /rlmbutil.h
parent57ea39840aebbb34571df1586acc66783b3368d0 (diff)
downloadreadline-8e6ccd0373d77b86ed37a9a7d232ccfea3d6670c.tar.gz
readline-8.0 distribution sources and documentationreadline-8.0
Diffstat (limited to 'rlmbutil.h')
-rw-r--r--rlmbutil.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/rlmbutil.h b/rlmbutil.h
index 4748a61..6fd03f6 100644
--- a/rlmbutil.h
+++ b/rlmbutil.h
@@ -172,6 +172,10 @@ _rl_wcwidth (wc)
# define IS_COMBINING_CHAR(x) (WCWIDTH(x) == 0)
#endif
+#define UTF8_SINGLEBYTE(c) (((c) & 0x80) == 0)
+#define UTF8_MBFIRSTCHAR(c) (((c) & 0xc0) == 0xc0)
+#define UTF8_MBCHAR(c) (((c) & 0xc0) == 0x80)
+
#else /* !HANDLE_MULTIBYTE */
#undef MB_LEN_MAX
@@ -196,6 +200,12 @@ _rl_wcwidth (wc)
#define MB_INVALIDCH(x) (0)
#define MB_NULLWCH(x) (0)
+#define UTF8_SINGLEBYTE(c) (1)
+
+#if !defined (HAVE_WCHAR_T) && !defined (wchar_t)
+# define wchar_t int
+#endif
+
#endif /* !HANDLE_MULTIBYTE */
extern int rl_byte_oriented;