unicode: optional table for better handling of neutral bidi chars

Off:
function                                             old     new   delta
unicode_bidi_isrtl                                     -      55     +55
isrtl_str                                             51      65     +14
unicode_isrtl                                         55       -     -55
read_line_input                                     5003    4937     -66
------------------------------------------------------------------------------
(add/remove: 1/4 grow/shrink: 1/1 up/down: 69/-121)           Total: -52 bytes

On:
function                                             old     new   delta
static.neutral_b                                       -     320    +320
static.neutral_p                                       -     142    +142
unicode_bidi_isrtl                                     -      55     +55
unicode_bidi_is_neutral_wchar                          -      55     +55
isrtl_str                                             51      59      +8
unicode_isrtl                                         55       -     -55
read_line_input                                     5003    4937     -66
------------------------------------------------------------------------------
(add/remove: 4/4 grow/shrink: 1/1 up/down: 580/-121)          Total: 459 bytes

Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Tomas Heinrich
2010-03-26 13:13:24 +01:00
committed by Denys Vlasenko
parent 385b4562e3
commit aa167556cd
5 changed files with 284 additions and 106 deletions

@@ -18,7 +18,8 @@ enum {
UNICODE_ON = 2,
};
#define unicode_isrtl(wc) 0
#define unicode_bidi_isrtl(wc) 0
#define unicode_bidi_is_neutral_wchar(wc) (wc <= 126 && !isalpha(wc))
#if !ENABLE_FEATURE_ASSUME_UNICODE
@@ -92,8 +93,12 @@ 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;
# undef unicode_bidi_isrtl
int unicode_bidi_isrtl(wint_t wc) FAST_FUNC;
# if ENABLE_UNICODE_NEUTRAL_TABLE
# undef unicode_bidi_is_neutral_wchar
int unicode_bidi_is_neutral_wchar(wint_t wc) FAST_FUNC;
# endif
# endif