]> git.sur5r.net Git - openldap/commitdiff
ITS#5421 export ldap_debug define in <ldap_log.h>
authorHoward Chu <hyc@openldap.org>
Wed, 19 Jan 2011 21:20:10 +0000 (21:20 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 19 Jan 2011 21:20:10 +0000 (21:20 +0000)
include/ldap_log.h
libraries/librewrite/rewrite-int.h

index a29241fd59b3b3bc5f6e6c9f6db414711057912d..3e7b21b892e88dd17e4322fe7400e18475913fe5 100644 (file)
@@ -196,12 +196,27 @@ extern void eb_syslog(int pri, const char *fmt, ...);
        LogExpand((level), ldap_syslog_level, (fmt) \
                LogArg(a1) LogArg(a2) LogArg(a3))
 
+/* Actually now in liblber/debug.c */
 LDAP_LUTIL_F(int) lutil_debug_file LDAP_P(( FILE *file ));
 
 LDAP_LUTIL_F(void) lutil_debug LDAP_P((
        int debug, int level,
        const char* fmt, ... )) LDAP_GCCATTR((format(printf, 3, 4)));
 
+#ifdef LDAP_DEFINE_LDAP_DEBUG
+/* This struct matches the head of ldapoptions in <ldap-int.h> */
+struct ldapoptions_prefix {
+       short   ldo_valid;
+       int             ldo_debug;
+};
+#define ldap_debug \
+       (*(int *) ((char *)&ldap_int_global_options \
+                + offsetof(struct ldapoptions_prefix, ldo_debug)))
+
+struct ldapoptions;
+LDAP_V ( struct ldapoptions ) ldap_int_global_options;
+#endif /* LDAP_DEFINE_LDAP_DEBUG */
+
 LDAP_END_DECL
 
 #endif /* LDAP_LOG_H */
index 72ad664f95eee7fe598b26c44b073c6d260a3a42..0f4d4c054fd1133bc842692751ca7057fca8dcfb 100644 (file)
@@ -33,7 +33,8 @@
 
 #include <lber.h>
 #include <ldap.h>
-#include "../libldap/ldap-int.h"
+#define LDAP_DEFINE_LDAP_DEBUG
+#include <ldap_log.h>
 #include <lutil.h>
 #include <avl.h>