Ripple name change through -llber & -lldap.
Update -lldif to use lber_pvt_log_printf() instead of Debug.
--- /dev/null
+/*
+ * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted only
+ * as authorized by the OpenLDAP Public License. A copy of this
+ * license is available at http://www.OpenLDAP.org/license.html or
+ * in file LICENSE in the top-level directory of the distribution.
+ */
+/*
+ * lber_pvt.h - Header for lber_pvt_ functions. These are meant to be used
+ * by the OpenLDAP distribution only.
+ */
+
+#ifndef _LBER_PVT_H
+#define _LBER_PVT_H 1
+
+#include <lber.h>
+
+LDAP_BEGIN_DECL
+
+/*
+ * bprint.c
+ */
+extern BER_LOG_PRINT_FN lber_pvt_log_print;
+
+LDAP_F int lber_pvt_log_printf LDAP_P((
+ int errlvl,
+ int loglvl,
+ char *fmt,
+ ... ));
+
+LDAP_END_DECL
+
+#endif
+
fflush( stderr );
}
-BER_LOG_PRINT_FN lber_log_print = lber_error_print;
+BER_LOG_PRINT_FN lber_pvt_log_print = lber_error_print;
/*
* lber log
return errlvl & loglvl ? 1 : 0;
}
-int lber_log_printf
+int lber_pvt_log_printf
#ifdef HAVE_STDARG
(int errlvl, int loglvl, char *fmt, ...)
#else
va_end(ap);
- (*lber_log_print)( buf );
+ (*lber_pvt_log_print)( buf );
return 1;
}
return 0;
}
- (*lber_log_print)( buf );
+ (*lber_pvt_log_print)( buf );
return 1;
}
for ( ;; ) {
if ( len < 1 ) {
sprintf( buf, "\t%s\n", ( i == 0 ) ? "(end)" : out );
- (*lber_log_print)( buf );
+ (*lber_pvt_log_print)( buf );
break;
}
if ( i > BPLEN - 2 ) {
char data[128 + BPLEN];
sprintf( data, "\t%s\n", out );
- (*lber_log_print)(data);
+ (*lber_pvt_log_print)(data);
memset( out, 0, BPLEN );
i = 0;
continue;
(long) ber->ber_ptr,
(long) ber->ber_end );
- (*lber_log_print)( buf );
+ (*lber_pvt_log_print)( buf );
if ( inout == 1 ) {
sprintf( buf, " current len %ld, contents:\n",
{
char buf[132];
- (*lber_log_print)( "*** sos dump ***\n" );
+ (*lber_pvt_log_print)( "*** sos dump ***\n" );
while ( sos != NULLSEQORSET ) {
sprintf( buf, "ber_sos_dump: clen %ld first 0x%lx ptr 0x%lx\n",
(long) sos->sos_clen, (long) sos->sos_first, (long) sos->sos_ptr );
- (*lber_log_print)( buf );
+ (*lber_pvt_log_print)( buf );
sprintf( buf, " current len %ld contents:\n",
(long) (sos->sos_ptr - sos->sos_first) );
- (*lber_log_print)( buf );
+ (*lber_pvt_log_print)( buf );
ber_bprint( sos->sos_first, sos->sos_ptr - sos->sos_first );
sos = sos->sos_next;
}
- (*lber_log_print)( "*** end dump ***\n" );
+ (*lber_pvt_log_print)( "*** end dump ***\n" );
}
#include "lber.h"
#include "ldap_log.h"
+#include "lber_pvt.h"
LDAP_BEGIN_DECL
#define LBER_ITEM_SOCKBUF 2
extern int lber_int_debug;
+#define lber_log_printf lber_pvt_log_printf
struct berelement {
short ber_item_type; /* always LBER_ITEM_BERELEMENT */
/*
* bprint.c
*/
-LDAP_F int lber_log_printf LDAP_P((
- int errlvl,
- int loglvl,
- char *fmt,
- ... ));
-
LDAP_F int lber_log_bprint LDAP_P((
int errlvl,
int loglvl,
return LBER_OPT_SUCCESS;
} else if(option == LBER_OPT_LOG_PRINT_FN) {
- extern BER_LOG_PRINT_FN lber_log_print;
-
- lber_log_print = (BER_LOG_PRINT_FN) invalue;
+ lber_pvt_log_print = (BER_LOG_PRINT_FN) invalue;
return LBER_OPT_SUCCESS;
}
#include "ldap-int.h"
-extern BER_LOG_PRINT_FN lber_log_print;
-
/*
* ldap log
*/
va_end(ap);
- (*lber_log_print)( buf );
+ (*lber_pvt_log_print)( buf );
return 1;
}
return 0;
}
- (*lber_log_print)( buf );
+ (*lber_pvt_log_print)( buf );
return 1;
}
int ldif_debug = 0;
-#define ldap_debug ldif_debug
#include "ldap_log.h"
+#include "lber_pvt.h"
#include "ldif.h"
#define RIGHT2 0x03
for ( s = line; *s && *s != ':'; s++ )
; /* NULL */
if ( *s == '\0' ) {
- Debug( LDAP_DEBUG_PARSE, "parse_line missing ':'\n", 0, 0, 0 );
+ lber_pvt_log_printf( LDAP_DEBUG_PARSE, ldif_debug,
+ "ldif_parse_line missing ':'\n");
return( -1 );
}
/* if no value is present, error out */
if ( *s == '\0' ) {
- Debug( LDAP_DEBUG_PARSE, "parse_line missing value\n", 0,0,0 );
+ lber_pvt_log_printf( LDAP_DEBUG_PARSE, ldif_debug,
+ "ldif_parse_line missing value\n");
return( -1 );
}
for ( i = 0; i < 4; i++ ) {
if ( p[i] != '=' && (p[i] & 0x80 ||
b642nib[ p[i] & 0x7f ] > 0x3f) ) {
- Debug( LDAP_DEBUG_ANY,
- "invalid base 64 encoding char (%c) 0x%x\n",
- p[i], p[i], 0 );
+ lber_pvt_log_printf( LDAP_DEBUG_ANY, ldif_debug,
+"ldif_parse_line: invalid base 64 encoding char (%c) 0x%x\n",
+ p[i], p[i] );
return( -1 );
}
}
int tlen;
tlen = strlen( type );
- if (( buf = (char *)malloc( LDIF_SIZE_NEEDED( tlen, vlen ) + 1 )) !=
- NULL ) {
+ if (( buf = (char *) malloc( LDIF_SIZE_NEEDED( tlen, vlen ) + 1 ))
+ == NULL )
+ {
+ lber_pvt_log_printf( LDAP_DEBUG_ANY, ldif_debug,
+ "ldif_type_and_value: malloc failed!" );
+ return NULL;
}
p = buf;