added ber_print_error() and renamed lber_bprint into ber_ namespace.

This commit is contained in:
Kurt Zeilenga 1998-10-27 07:50:07 +00:00
parent 80cf83ace8
commit 34c945b86d
3 changed files with 19 additions and 6 deletions

View File

@ -164,7 +164,7 @@ base object for the search. The default is to never dereference aliases.
wait at most \fItimelimit\fP seconds for a search to complete.
.TP
.B \-z sizelimit
retrieve at most \fIsizelimit\fP seconds for a search to complete.
retrieve at most \fIsizelimit\fP entries for a search.
.SH OUTPUT FORMAT
If one or more entries are found, each entry is written to standard output
in the form:

View File

@ -97,7 +97,9 @@ extern int lber_debug;
/*
* in bprint.c:
*/
LDAP_F void lber_bprint LDAP_P(( char *data, int len ));
LDAP_F void ber_print_error LDAP_P(( char *data ));
LDAP_F void ber_bprint LDAP_P(( char *data, int len ));
#define lber_bprint(d,l) ber_bprint((d),(l))
/*
* in decode.c:

View File

@ -1,22 +1,31 @@
#include "portable.h"
#if defined( LDAP_DEBUG ) && defined( LDAP_LIBUI )
#include <stdio.h>
#if defined( LDAP_DEBUG ) && defined( LDAP_LIBUI )
#include <ac/ctype.h>
#include <ac/string.h>
#endif /* LDAP_DEBUG && LDAP_LIBUI */
#include "lber-int.h"
/*
* Print stuff
*/
void
ber_print_error( char *data)
{
fputs( data, stderr );
fflush( stderr );
}
/*
* Print arbitrary stuff, for debugging.
*/
void
lber_bprint( char *data, int len )
ber_bprint( char *data, int len )
{
#if defined( LDAP_DEBUG ) && defined( LDAP_LIBUI )
#define BPLEN 48
@ -48,7 +57,9 @@ lber_bprint( char *data, int len )
data++;
if ( i > BPLEN - 2 ) {
fprintf( stderr, "\t%s\n", out );
char data[128 + BPLEN];
sprintf( data, "\t%s\n", out );
ber_print_error(data);
memset( out, 0, BPLEN );
i = 0;
continue;