From d00b99fd378ba6d1e9220ed05436b6e3b0613a56 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Wed, 3 Mar 1999 15:25:44 +0000 Subject: [PATCH] Declare lber_pvt_sb_* functions from io.c in lber-int.h --- libraries/liblber/decode.c | 6 +++--- libraries/liblber/dtest.c | 4 ++-- libraries/liblber/encode.c | 2 +- libraries/liblber/io.c | 2 +- libraries/liblber/lber-int.h | 8 ++++++++ libraries/liblber/sockbuf.c | 4 ++-- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index b94c5cf926..a96b1946c2 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -198,7 +198,7 @@ ber_get_stringb( BerElement *ber, char *buf, unsigned long *len ) #ifdef STR_TRANSLATION if ( datalen > 0 && ( ber->ber_options & LBER_TRANSLATE_STRINGS ) != 0 - && ber->ber_decode_translate_proc != NULL ) { + && ber->ber_decode_translate_proc != 0 ) { transbuf = buf; ++datalen; if ( (*(ber->ber_decode_translate_proc))( &transbuf, &datalen, @@ -241,7 +241,7 @@ ber_get_stringa( BerElement *ber, char **buf ) #ifdef STR_TRANSLATION if ( datalen > 0 && ( ber->ber_options & LBER_TRANSLATE_STRINGS ) != 0 - && ber->ber_decode_translate_proc != NULL ) { + && ber->ber_decode_translate_proc != 0 ) { ++datalen; if ( (*(ber->ber_decode_translate_proc))( buf, &datalen, 1 ) != 0 ) { @@ -284,7 +284,7 @@ ber_get_stringal( BerElement *ber, struct berval **bv ) #ifdef STR_TRANSLATION if ( len > 0 && ( ber->ber_options & LBER_TRANSLATE_STRINGS ) != 0 - && ber->ber_decode_translate_proc != NULL ) { + && ber->ber_decode_translate_proc != 0 ) { ++len; if ( (*(ber->ber_decode_translate_proc))( &((*bv)->bv_val), &len, 1 ) != 0 ) { diff --git a/libraries/liblber/dtest.c b/libraries/liblber/dtest.c index df683a0ec7..beeac06718 100644 --- a/libraries/liblber/dtest.c +++ b/libraries/liblber/dtest.c @@ -28,7 +28,7 @@ #include #endif /* MACOS */ -#include +#include "lber-int.h" static void usage( char *name ) { @@ -62,7 +62,7 @@ main( int argc, char **argv ) } printf( "message has tag 0x%x and length %ld\n", tag, len ); - if ( ber_scanf( ber, "i", &i ) == -1 ) { + if ( ber_scanf( ber, "i", &i ) == LBER_ERROR ) { fprintf( stderr, "ber_scanf returns -1\n" ); exit( 1 ); } diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index 55cde46cc5..913c0d23a2 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -231,7 +231,7 @@ ber_put_ostring( BerElement *ber, char *str, unsigned long len, #ifdef STR_TRANSLATION if ( len > 0 && ( ber->ber_options & LBER_TRANSLATE_STRINGS ) != 0 && - ber->ber_encode_translate_proc != NULL ) { + ber->ber_encode_translate_proc != 0 ) { if ( (*(ber->ber_encode_translate_proc))( &str, &len, 0 ) != 0 ) { return( -1 ); diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index dd8bc5f14f..8032c7ce91 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -237,7 +237,7 @@ ber_dup( BerElement *ber ) void ber_init_w_nullc( BerElement *ber, int options ) { - (void) memset( (char *)ber, '\0', sizeof( BerElement )); + (void) memset( (char *)ber, '\0', sizeof( BerElement )); /* ### Bug: Expects pointers to have 00000 bit pattern */ ber->ber_tag = LBER_DEFAULT; ber->ber_options = (char) options; } diff --git a/libraries/liblber/lber-int.h b/libraries/liblber/lber-int.h index aeab66b2ba..719f329da4 100644 --- a/libraries/liblber/lber-int.h +++ b/libraries/liblber/lber-int.h @@ -166,6 +166,14 @@ LDAP_F int lber_log_sos_dump LDAP_P(( int loglvl, Seqorset *sos )); +/* io.c */ +LDAP_F Sockbuf *lber_pvt_sb_alloc LDAP_P(( void )); +LDAP_F Sockbuf *lber_pvt_sb_alloc_fd LDAP_P(( int )); +LDAP_F Sockbuf *lber_pvt_sb_alloc_fd LDAP_P(( int )); +LDAP_F void lber_pvt_sb_free LDAP_P(( Sockbuf * )); +LDAP_F int lber_pvt_sb_get_option LDAP_P(( Sockbuf *, int, void * )); +LDAP_F int lber_pvt_sb_set_option LDAP_P(( Sockbuf *, int, void * )); + /* sockbuf.c */ LDAP_F int lber_pvt_sb_init LDAP_P(( Sockbuf *sb )); diff --git a/libraries/liblber/sockbuf.c b/libraries/liblber/sockbuf.c index 8902af162d..28f28b979c 100644 --- a/libraries/liblber/sockbuf.c +++ b/libraries/liblber/sockbuf.c @@ -486,8 +486,8 @@ long lber_pvt_sb_write( Sockbuf *sb, void *buf, long len_arg ) int lber_pvt_sb_close( Sockbuf *sb ) { int ret; - assert( sb->sb_io ); - assert( sb->sb_io->sbi_close ); + assert( sb->sb_io != NULL ); + assert( sb->sb_io->sbi_close != NULL ); assert( status_is_ok(sb) ); assert( lber_pvt_sb_in_use( sb ) ); -- 2.39.5