+/*
+ * Default sizes of AVA and RDN static working arrays; if required
+ * the are dynamically resized. The values can be tuned in case
+ * of special requirements (e.g. very deep DN trees or high number
+ * of AVAs per RDN).
+ */
+#define TMP_AVA_SLOTS 8
+#define TMP_RDN_SLOTS 32
+
+int
+ldap_bv2dn( struct berval *bv, LDAPDN **dn, unsigned flags )
+{
+ assert( bv );
+ assert( dn );
+
+ /*
+ * FIXME: ldap_bv2dn() and ldap_str2dn() will be swapped,
+ * i.e. ldap_str2dn() will become a wrapper for ldap_bv2dn()
+ */
+ if ( bv->bv_len != strlen( bv->bv_val ) ) {
+ return LDAP_INVALID_DN_SYNTAX;
+ }
+
+ return ldap_str2dn( bv->bv_val, dn, flags );
+}