- return p - dn_in->bv_val;
-}
-
-/*
- * FIXME: should be replaced by dnExtractRdn() (together with dn_rdnlen)
- */
-char * dn_rdn(
- Backend *be,
- struct berval *dn_in )
-{
- struct berval rdn;
-
- assert( dn_in );
-
- if ( dn_in == NULL ) {
- return NULL;
- }
-
- if ( !dn_in->bv_len ) {
- return NULL;
- }
-
- if ( be != NULL && be_issuffix( be, dn_in->bv_val ) ) {
- return NULL;
- }
-
- if ( dnExtractRdn( dn_in, &rdn ) != LDAP_SUCCESS ) {
- return NULL;
- }
-
- return rdn.bv_val;
-}
-
-/*
- * dn_issuffix - tells whether suffix is a suffix of dn.
- * Both dn and suffix must be normalized.
- * deprecated in favor of dnIsSuffix()
- */
-int
-dn_issuffix(
- const char *dn,
- const char *suffix
-)
-{
- struct berval bvdn, bvsuffix;
-
- assert( dn );
- assert( suffix );
-
- bvdn.bv_val = (char *) dn;
- bvdn.bv_len = strlen( dn );
- bvsuffix.bv_val = (char *) suffix;
- bvsuffix.bv_len = strlen( suffix );
-
- return dnIsSuffix( &bvdn, &bvsuffix );
-}
-
-/* rdn_attr_type:
- *
- * Given a string (i.e. an rdn) of the form:
- * "attribute_type = attribute_value"
- * this function returns the type of an attribute, that is the
- * string "attribute_type" which is placed in newly allocated
- * memory. The returned string will be null-terminated.
- *
- * Deprecated
- */
-
-char * rdn_attr_type( const char * s )
-{
- char **attrs, **values, *retval;
-
- if ( rdn_attrs( s, &attrs, &values ) != LDAP_SUCCESS ) {
- return NULL;
- }
-
- retval = ch_strdup( attrs[ 0 ] );
-
- charray_free( attrs );
- charray_free( values );
-
- return retval;
-}
-
-
-/* rdn_attr_value:
- *
- * Given a string (i.e. an rdn) of the form:
- * "attribute_type = attribute_value"
- * this function returns "attribute_type" which is placed in newly allocated
- * memory. The returned string will be null-terminated and may contain
- * spaces (i.e. "John Doe\0").
- *
- * Deprecated
- */
-
-char *
-rdn_attr_value( const char * rdn )
-{
- char **attrs, **values, *retval;
-
- if ( rdn_attrs( rdn, &attrs, &values ) != LDAP_SUCCESS ) {
- return NULL;
- }
-
- retval = ch_strdup( values[ 0 ] );
-
- charray_free( attrs );
- charray_free( values );