summaryrefslogtreecommitdiff
path: root/include/unicode.h
diff options
context:
space:
mode:
authorTomas Heinrich2010-03-18 18:35:37 +0100
committerDenys Vlasenko2010-03-18 18:35:37 +0100
commitc5c006c10c060e7f1a97250d039051b93ed390b2 (patch)
treeb281136c99e6a27a530282a0b1b7eaf938704bb2 /include/unicode.h
parent98f1dc12f1554aca6c3743bec1c3d8982a077f7c (diff)
downloadbusybox-c5c006c10c060e7f1a97250d039051b93ed390b2.zip
busybox-c5c006c10c060e7f1a97250d039051b93ed390b2.tar.gz
lineedit: first shot at optional unicode bidi input support
function old new delta read_line_input 4886 5003 +117 in_uint16_table - 97 +97 in_interval_table - 78 +78 static.rtl_b - 68 +68 unicode_isrtl - 55 +55 isrtl_str - 51 +51 static.rtl_p - 42 +42 unicode_conv_to_printable2 633 477 -156 ------------------------------------------------------------------------------ (add/remove: 6/0 grow/shrink: 1/1 up/down: 508/-156) Total: 352 bytes Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include/unicode.h')
-rw-r--r--include/unicode.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/unicode.h b/include/unicode.h
index 857aab1..05bdbca 100644
--- a/include/unicode.h
+++ b/include/unicode.h
@@ -18,6 +18,8 @@ enum {
UNICODE_ON = 2,
};
+#define unicode_isrtl(wc) 0
+
#if !ENABLE_FEATURE_ASSUME_UNICODE
# define unicode_strlen(string) strlen(string)
@@ -26,6 +28,17 @@ enum {
#else
+# if CONFIG_LAST_SUPPORTED_WCHAR < 126 || CONFIG_LAST_SUPPORTED_WCHAR >= 0x30000
+# define LAST_SUPPORTED_WCHAR 0x2ffff
+# else
+# define LAST_SUPPORTED_WCHAR CONFIG_LAST_SUPPORTED_WCHAR
+# endif
+
+# if LAST_SUPPORTED_WCHAR < 0x590
+# undef ENABLE_UNICODE_BIDI_SUPPORT
+# define ENABLE_UNICODE_BIDI_SUPPORT 0
+# endif
+
size_t FAST_FUNC unicode_strlen(const char *string);
enum {
UNI_FLAG_PAD = (1 << 0),
@@ -78,6 +91,10 @@ size_t wcrtomb(char *s, wchar_t wc, mbstate_t *ps) FAST_FUNC;
int iswspace(wint_t wc) FAST_FUNC;
int iswalnum(wint_t wc) FAST_FUNC;
int iswpunct(wint_t wc) FAST_FUNC;
+# if ENABLE_UNICODE_BIDI_SUPPORT
+# undef unicode_isrtl
+int unicode_isrtl(wint_t wc) FAST_FUNC;
+# endif
# endif /* !LOCALE_SUPPORT */