#include "ldif.h"
 #include "ldap_defaults.h"
 #include "ldap_log.h"
-/* needed for ldap_control_dup(); we should declare it somewhere else ... */
-#include "../../libraries/libldap/ldap-int.h"
+#include "ldap_pvt.h"
 
 static char    *prog;
 static char    *binddn = NULL;
 
 #define LDAP_HEX(c)                    (LDAP_DIGIT(c) || \
                                                                LDAP_HEXLOWER(c) || LDAP_HEXUPPER(c))
 
+/* controls.c */
+struct ldapcontrol;
+LDAP_F (struct ldapcontrol *) ldap_control_dup LDAP_P((
+       const struct ldapcontrol *ctrl ));
+
+LDAP_F (struct ldapcontrol **) ldap_controls_dup LDAP_P((
+       struct ldapcontrol *const *ctrls ));
+
+
 #ifdef HAVE_CYRUS_SASL
 /* cyrus.c */
 struct sasl_security_properties; /* avoid pulling in <sasl.h> */
 
 /*
  * in controls.c
  */
-LDAP_F (LDAPControl *) ldap_control_dup LDAP_P((
-       const LDAPControl *ctrl ));
-
-LDAP_F (LDAPControl **) ldap_controls_dup LDAP_P((
-       LDAPControl *const *ctrls ));
-
 LDAP_F (int) ldap_int_get_controls LDAP_P((
        BerElement *be,
        LDAPControl ***ctrlsp));