]> git.sur5r.net Git - openldap/commitdiff
Using UTF8normcmp() from lunicode, removing our own UTF8casecmp()
authorStig Venaas <venaas@openldap.org>
Wed, 31 Jan 2001 15:58:00 +0000 (15:58 +0000)
committerStig Venaas <venaas@openldap.org>
Wed, 31 Jan 2001 15:58:00 +0000 (15:58 +0000)
servers/slapd/schema_init.c

index 921cab74c38fe558488296fc597ce1c0f876b3f0..518e46290f54760a5b870f11a4217d9344b08124 100644 (file)
@@ -496,60 +496,6 @@ booleanMatch(
 }
 
 #if UTF8MATCH
-static int
-UTF8casecmp(
-       struct berval *right,
-       struct berval *left )
-{
-       ber_len_t r, l;
-       int rlen, llen;
-       ldap_unicode_t ru, lu;
-       ldap_unicode_t ruu, luu;
-
-       for( r=0, l=0;
-               r < right->bv_len && l < left->bv_len;
-               r+=rlen, l+=llen )
-       {
-               /*
-                * XXYYZ: we convert to ucs4 even though -llunicode
-                * expects ucs2 in an unsigned long
-                */
-               ru = ldap_utf8_to_ucs4( &right->bv_val[r] );
-               if( ru == LDAP_UCS4_INVALID ) {
-                       return 1;
-               }
-
-               lu = ldap_utf8_to_ucs4( &left->bv_val[l] );
-               if( lu == LDAP_UCS4_INVALID ) {
-                       return -1;
-               }
-
-               ruu = uctoupper( ru );
-               luu = uctoupper( lu );
-
-               if( ruu > luu ) {
-                       return 1;
-               } else if( luu > ruu ) {
-                       return -1;
-               }
-
-               rlen = LDAP_UTF8_CHARLEN( &right->bv_val[r] );
-               llen = LDAP_UTF8_CHARLEN( &left->bv_val[l] );
-       }
-
-       if( r < right->bv_len ) {
-               /* less left */
-               return -1;
-       }
-
-       if( l < left->bv_len ) {
-               /* less right */
-               return 1;
-       }
-
-       return 0;
-}
-
 /* case insensitive UTF8 strncmp with offset for second string */
 static int
 UTF8oncasecmp(
@@ -1664,7 +1610,9 @@ caseIgnoreMatch(
        void *assertedValue )
 {
 #if UTF8MATCH
-       *matchp = UTF8casecmp( value, (struct berval *) assertedValue );
+       *matchp = UTF8normcmp( value->bv_val,
+                              ((struct berval *) assertedValue)->bv_val,
+                              UTF8_CASEFOLD );
 #else
        int match = value->bv_len - ((struct berval *) assertedValue)->bv_len;