diff options
author | Michael Widenius <monty@askmonty.org> | 2009-12-01 18:09:02 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2009-12-01 18:09:02 +0200 |
commit | 27f4f67bd2f35bf710f1a4e4ddde0e42738a195d (patch) | |
tree | 4d1dca11a3163a8f4fee516cd45895ef117255e0 /strings | |
parent | 55d0b6cc6fa4216192f29a55a93188bd0fbb2e02 (diff) | |
download | mariadb-git-27f4f67bd2f35bf710f1a4e4ddde0e42738a195d.tar.gz |
Fixed link problem when compiling without uca
cmd-line-utils/readline/config_readline.h:
Add back defines needed for linux to get rid of compiler warnings, but hide them for now until we have a solution for compile failure on MacOSX
strings/ctype-uca.c:
Always define UCA contraction functions used by ctype-mb.c
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-uca.c | 170 |
1 files changed, 81 insertions, 89 deletions
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 7b162618ed1..b2a60265a0a 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -36,6 +36,12 @@ #include "m_string.h" #include "m_ctype.h" + +#define MY_UCA_CNT_FLAG_SIZE 4096 +#define MY_UCA_CNT_FLAG_MASK 4095 +#define MY_UCA_CNT_HEAD 1 +#define MY_UCA_CNT_TAIL 2 + #ifdef HAVE_UCA_COLLATIONS #define MY_UCA_NPAGES 256 @@ -6756,16 +6762,6 @@ typedef struct my_uca_scanner_handler_st static uint16 nochar[]= {0,0}; - -#define MY_UCA_CNT_FLAG_SIZE 4096 -#define MY_UCA_CNT_FLAG_MASK 4095 - -#define MY_UCA_CNT_HEAD 1 -#define MY_UCA_CNT_TAIL 2 - - - - /********** Helper functions to handle contraction ************/ @@ -6836,85 +6832,6 @@ my_uca_alloc_contractions(CHARSET_INFO *cs, void *(*alloc)(size_t), size_t n) return 0; } - -/** - Check if UCA data has contractions (public version) - - @cs Pointer to CHARSET_INFO data - @retval 0 - no contraction, 1 - have contractions. -*/ - -my_bool -my_uca_have_contractions(CHARSET_INFO *cs) -{ - return cs->contractions != NULL; -} - - -/** - Check if a character can be contraction head - - @cs Pointer to CHARSET_INFO data - @wc Code point - - @retval 0 - cannot be contraction head - @retval 1 - can be contraction head -*/ - -my_bool -my_uca_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc) -{ - return cs->contractions->flags[wc & MY_UCA_CNT_FLAG_MASK] & MY_UCA_CNT_HEAD; -} - - -/** - Check if a character can be contraction tail - - @cs Pointer to CHARSET_INFO data - @wc Code point - - @retval 0 - cannot be contraction tail - @retval 1 - can be contraction tail -*/ - -my_bool -my_uca_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc) -{ - return cs->contractions->flags[wc & MY_UCA_CNT_FLAG_MASK] & MY_UCA_CNT_TAIL; -} - - -/** - Find a contraction and return its weight array - - @cs Pointer to CHARSET data - @wc1 First character - @wc2 Second character - - @return Weight array - @retval NULL - no contraction found - @retval ptr - contraction weight array -*/ - -uint16 * -my_uca_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) -{ - MY_CONTRACTIONS *list= cs->contractions; - MY_CONTRACTION *c, *last; - for (c= list->item, last= &list->item[list->nitems]; c < last; c++) - { - if (c->ch[0] == wc1 && c->ch[1] == wc2) - { - return c->weight; - } - } - return NULL; -} - - - - #ifdef HAVE_CHARSET_ucs2 /* Initialize collation weight scanner @@ -9607,3 +9524,78 @@ CHARSET_INFO my_charset_utf8_croatian_uca_ci= #endif /* HAVE_CHARSET_utf8 */ #endif /* HAVE_UCA_COLLATIONS */ + +/** + Check if UCA data has contractions (public version) + + @cs Pointer to CHARSET_INFO data + @retval 0 - no contraction, 1 - have contractions. +*/ + +my_bool +my_uca_have_contractions(CHARSET_INFO *cs) +{ + return cs->contractions != NULL; +} + +/** + Check if a character can be contraction head + + @cs Pointer to CHARSET_INFO data + @wc Code point + + @retval 0 - cannot be contraction head + @retval 1 - can be contraction head +*/ + +my_bool +my_uca_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc) +{ + return cs->contractions->flags[wc & MY_UCA_CNT_FLAG_MASK] & MY_UCA_CNT_HEAD; +} + + +/** + Check if a character can be contraction tail + + @cs Pointer to CHARSET_INFO data + @wc Code point + + @retval 0 - cannot be contraction tail + @retval 1 - can be contraction tail +*/ + +my_bool +my_uca_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc) +{ + return cs->contractions->flags[wc & MY_UCA_CNT_FLAG_MASK] & MY_UCA_CNT_TAIL; +} + + +/** + Find a contraction and return its weight array + + @cs Pointer to CHARSET data + @wc1 First character + @wc2 Second character + + @return Weight array + @retval NULL - no contraction found + @retval ptr - contraction weight array +*/ + +uint16 * +my_uca_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) +{ + MY_CONTRACTIONS *list= cs->contractions; + MY_CONTRACTION *c, *last; + for (c= list->item, last= &list->item[list->nitems]; c < last; c++) + { + if (c->ch[0] == wc1 && c->ch[1] == wc2) + { + return c->weight; + } + } + return NULL; +} + |