Home | Info | Community | Development | myReactOS | Contact Us
[inline, static]
Definition at line 158 of file sortkey.c.
Referenced by wine_compare_string().
{ unsigned int ce1, ce2; int ret; /* 32-bit collation element table format: * unicode weight - high 16 bit, diacritic weight - high 8 bit of low 16 bit, * case weight - high 4 bit of low 8 bit. */ while (len1 > 0 && len2 > 0) { if (flags & NORM_IGNORESYMBOLS) { int skip = 0; /* FIXME: not tested */ if (get_char_typeW(*str1) & (C1_PUNCT | C1_SPACE)) { str1++; len1--; skip = 1; } if (get_char_typeW(*str2) & (C1_PUNCT | C1_SPACE)) { str2++; len2--; skip = 1; } if (skip) continue; } /* hyphen and apostrophe are treated differently depending on * whether SORT_STRINGSORT specified or not */ if (!(flags & SORT_STRINGSORT)) { if (*str1 == '-' || *str1 == '\'') { if (*str2 != '-' && *str2 != '\'') { str1++; len1--; continue; } } else if (*str2 == '-' || *str2 == '\'') { str2++; len2--; continue; } } ce1 = collation_table[collation_table[*str1 >> 8] + (*str1 & 0xff)]; ce2 = collation_table[collation_table[*str2 >> 8] + (*str2 & 0xff)]; if (ce1 != (unsigned int)-1 && ce2 != (unsigned int)-1) ret = (ce1 >> 16) - (ce2 >> 16); else ret = *str1 - *str2; if (ret) return ret; str1++; str2++; len1--; len2--; } return len1 - len2; }