From a83cc88edd325554f46d871e4e7f5badce3baa44 Mon Sep 17 00:00:00 2001
From: Kurt Zeilenga <kurt@openldap.org>
Date: Wed, 4 Sep 2002 02:14:12 +0000
Subject: [PATCH] Move ldap_control_dup() to ldap_pvt.h

---
 clients/tools/ldapmodify.c   | 3 +--
 include/ldap_pvt.h           | 9 +++++++++
 libraries/libldap/ldap-int.h | 6 ------
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/clients/tools/ldapmodify.c b/clients/tools/ldapmodify.c
index 839469f0ad..6eea5872ce 100644
--- a/clients/tools/ldapmodify.c
+++ b/clients/tools/ldapmodify.c
@@ -34,8 +34,7 @@
 #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;
diff --git a/include/ldap_pvt.h b/include/ldap_pvt.h
index 5100b14b77..4150e41700 100644
--- a/include/ldap_pvt.h
+++ b/include/ldap_pvt.h
@@ -121,6 +121,15 @@ LDAP_F (void) ldap_pvt_hex_unescape LDAP_P(( char *s ));
 #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> */
diff --git a/libraries/libldap/ldap-int.h b/libraries/libldap/ldap-int.h
index 5e44c3287d..01fe78bac1 100644
--- a/libraries/libldap/ldap-int.h
+++ b/libraries/libldap/ldap-int.h
@@ -370,12 +370,6 @@ LDAP_F (int) ldap_check_cache LDAP_P(( LDAP *ld, ber_tag_t msgtype, BerElement *
 /*
  * 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));
-- 
GitLab