]> git.sur5r.net Git - openldap/blobdiff - libraries/liblber/lber-int.h
Fix ITS#2142
[openldap] / libraries / liblber / lber-int.h
index 37bd015c678a859d90a9e456c47a44ba1483f1ac..1d6ad83ba3a2bb841539d4910cd1f5c9b08a2ecb 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 /* Portions
 #include "lber.h"
 #include "ldap_log.h"
 #include "lber_pvt.h"
+#include "ldap_queue.h"
 
 LDAP_BEGIN_DECL
 
 typedef void (*BER_LOG_FN)(FILE *file,
-       const char *subsys, int level, const char *fmt, va_list vl );
+       const char *subsys, int level, const char *fmt, ... );
 
 LBER_V (BER_ERRNO_FN) ber_int_errno_fn;
 
@@ -37,16 +38,20 @@ struct lber_options {
 };
 
 #ifdef NEW_LOGGING
+/*
 #    ifdef LDAP_DEBUG
 #        ifdef LDAP_LOG
 #            undef LDAP_LOG
 #        endif
 #        define LDAP_LOG(a) ber_pvt_log_output a
+ */
 #        define BER_DUMP(a) ber_output_dump a
+/*
 #    else
 #        define LDAP_LOG(a)
 #        define BER_DUMP(a)
 #    endif
+ */
 #endif
 
 LBER_F( int ) ber_pvt_log_output(
@@ -68,10 +73,10 @@ struct berelement {
 #define ber_options            ber_opts.lbo_options
 #define ber_debug              ber_opts.lbo_debug
 
-       ber_tag_t       ber_usertag;
-
+       /* Do not change the order of these 3 fields! see ber_get_next */
        ber_tag_t       ber_tag;
        ber_len_t       ber_len;
+       ber_tag_t       ber_usertag;
 
        char            *ber_buf;
        char            *ber_ptr;
@@ -152,6 +157,8 @@ ber_log_sos_dump LDAP_P((
        int loglvl,
        Seqorset *sos ));
 
+LBER_V (BER_LOG_FN) ber_int_log_proc;
+LBER_V (FILE *) ber_pvt_err_file;
 
 /* memory.c */
        /* simple macros to realloc for now */
@@ -160,29 +167,15 @@ LBER_F (char *)   ber_strndup( LDAP_CONST char *, ber_len_t );
 LBER_F (char *)        ber_strndup__( LDAP_CONST char *, size_t );
 
 #ifdef CSRIMALLOC
-#define LBER_INT_MALLOC                malloc
-#define LBER_INT_CALLOC                calloc
-#define LBER_INT_REALLOC       realloc
-#define LBER_INT_FREE          free
-#define LBER_INT_VFREE         ber_memvfree
-#define LBER_INT_STRDUP                strdup
-
 #define LBER_MALLOC                    malloc
 #define LBER_CALLOC                    calloc
 #define LBER_REALLOC           realloc
 #define LBER_FREE                      free
 #define LBER_VFREE                     ber_memvfree
 #define LBER_STRDUP                    strdup
-#define LBER_STRNDUP                   ber_strndup__
+#define LBER_STRNDUP           ber_strndup__
 
 #else
-#define LBER_INT_MALLOC(s)             ber_memalloc((s))
-#define LBER_INT_CALLOC(n,s)   ber_memcalloc((n),(s))
-#define LBER_INT_REALLOC(p,s)  ber_memrealloc((p),(s))
-#define LBER_INT_FREE(p)               ber_memfree((p))
-#define LBER_INT_VFREE(v)              ber_memvfree((void**)(v))
-#define LBER_INT_STRDUP(s)             ber_strdup((s))
-
 #define LBER_MALLOC(s)         ber_memalloc((s))
 #define LBER_CALLOC(n,s)       ber_memcalloc((n),(s))
 #define LBER_REALLOC(p,s)      ber_memrealloc((p),(s))