* Print stuff
*/
static void
-lber_print_error( char *data )
+lber_error_print( char *data )
{
fputs( data, stderr );
fflush( stderr );
}
+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_print_error( buf );
+ (*lber_pvt_log_print)( buf );
return 1;
}
return 0;
}
- lber_print_error( buf );
+ (*lber_pvt_log_print)( buf );
return 1;
}
void
ber_bprint(char *data, int len )
{
- static char hexdig[] = "0123456789abcdef";
+ static const char hexdig[] = "0123456789abcdef";
#define BPLEN 48
char out[ BPLEN ];
char buf[ BPLEN + sizeof("\t%s\n") ];
for ( ;; ) {
if ( len < 1 ) {
sprintf( buf, "\t%s\n", ( i == 0 ) ? "(end)" : out );
- lber_print_error( buf );
+ (*lber_pvt_log_print)( buf );
break;
}
if ( i > BPLEN - 2 ) {
char data[128 + BPLEN];
sprintf( data, "\t%s\n", out );
- lber_print_error(data);
+ (*lber_pvt_log_print)(data);
memset( out, 0, BPLEN );
i = 0;
continue;
(long) ber->ber_ptr,
(long) ber->ber_end );
- lber_print_error( buf );
+ (*lber_pvt_log_print)( buf );
if ( inout == 1 ) {
sprintf( buf, " current len %ld, contents:\n",
{
char buf[132];
- lber_print_error( "*** 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_print_error( buf );
+ (*lber_pvt_log_print)( buf );
sprintf( buf, " current len %ld contents:\n",
(long) (sos->sos_ptr - sos->sos_first) );
- lber_print_error( buf );
+ (*lber_pvt_log_print)( buf );
ber_bprint( sos->sos_first, sos->sos_ptr - sos->sos_first );
sos = sos->sos_next;
}
- lber_print_error( "*** end dump ***\n" );
+ (*lber_pvt_log_print)( "*** end dump ***\n" );
}