#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,
#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 ) {
#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 ) {
#include <console.h>
#endif /* MACOS */
-#include <lber.h>
+#include "lber-int.h"
static void usage( char *name )
{
}
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 );
}
#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 );
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;
}
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 ));
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 ) );