]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/proto-slap.h
Modify ad_cmp() macro to support use as an ordering function.
[openldap] / servers / slapd / proto-slap.h
index e28c953560121bf1edc39b5375dc92e6bf50ec9a..41594bb3678b73ccd2982f33cdb64d611e66e5fc 100644 (file)
@@ -57,8 +57,9 @@ LDAP_SLAPD_F (AttributeDescription *) ad_dup LDAP_P((
 
 LDAP_SLAPD_F (void) ad_destroy LDAP_P(( AttributeDescription * ));
 
-#define ad_cmp(l,r)    (((l)->ad_cname.bv_len == (r)->ad_cname.bv_len) \
-       ? strcasecmp((l)->ad_cname.bv_val, (r)->ad_cname.bv_val ) : 1 )
+#define ad_cmp(l,r)    (((l)->ad_cname.bv_len < (r)->ad_cname.bv_len) \
+       ? -1 : (((l)->ad_cname.bv_len > (r)->ad_cname.bv_len) \
+               ? strcasecmp((l)->ad_cname.bv_val, (r)->ad_cname.bv_val ) : 1 ))
 
 LDAP_SLAPD_F (int) is_ad_subtype LDAP_P((
        AttributeDescription *sub,
@@ -521,25 +522,13 @@ LDAP_SLAPD_F (int) lock_fclose LDAP_P(( FILE *fp, FILE *lfp ));
 
 /*
  * modify.c
- *     should be relocated to separate file
  */
-LDAP_SLAPD_F( void ) slap_mod_free( Modification *mod, int freeit );
-LDAP_SLAPD_F( void ) slap_mods_free( Modifications *mods );
-LDAP_SLAPD_F( void ) slap_modlist_free( LDAPModList *ml );
-
 LDAP_SLAPD_F( int ) slap_mods_check(
        Modifications *ml,
        int update,
        const char **text,
        char *textbuf, size_t textlen );
 
-LDAP_SLAPD_F( int ) slap_modlist2mods(
-       LDAPModList *ml,
-       int update,
-       Modifications **mods,
-       const char **text,
-       char *textbuf, size_t textlen );
-
 LDAP_SLAPD_F( int ) slap_mods_opattrs(
        Operation *op,
        Modifications *mods,
@@ -547,6 +536,13 @@ LDAP_SLAPD_F( int ) slap_mods_opattrs(
        const char **text,
        char *textbuf, size_t textlen );
 
+/*
+ * mods.c
+ */
+LDAP_SLAPD_F( void ) slap_mod_free( Modification *mod, int freeit );
+LDAP_SLAPD_F( void ) slap_mods_free( Modifications *mods );
+LDAP_SLAPD_F( void ) slap_modlist_free( LDAPModList *ml );
+
 /*
  * module.c
  */