/*
* Next, read the length. The first byte contains the length of
- * the length. If bit 8 is set, the length is the long form,
+ * the length. If bit 8 is set, the length is the long form,
* otherwise it's the short form. We don't allow a length that's
* greater than what we can hold in a ber_len_t.
*/
LDAP_CONST char *fmt_reset;
char *last;
char *s, **ss, ***sss;
- struct berval ***bv, **bvp, *bval;
+ struct berval ***bv, **bvp, *bval;
ber_int_t *i;
int j;
ber_len_t *l;
fmt_reset = fmt;
#ifdef NEW_LOGGING
- LDAP_LOG(( "LIBLBER", LDAP_LEVEL_ENTRY, "ber_scanf fmt (%s) ber:\n", fmt ));
- BER_DUMP(( "LIBLBER", LDAP_LEVEL_DETAIL2, ber, 1 ));
+ LDAP_LOG(( "liblber", LDAP_LEVEL_ENTRY, "ber_scanf fmt (%s) ber:\n", fmt ));
+ BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 ));
#else
ber_log_printf( LDAP_DEBUG_TRACE, ber->ber_debug,
"ber_scanf fmt (%s) ber:\n", fmt );
default:
if( ber->ber_debug ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "liblber", LDAP_LEVEL_ERR,
+ "ber_scanf: unknown fmt %c\n", *fmt ));
+#else
ber_log_printf( LDAP_DEBUG_ANY, ber->ber_debug,
"ber_scanf: unknown fmt %c\n", *fmt );
+#endif
}
rc = LBER_DEFAULT;
break;
case 'v': /* sequence of strings */
sss = va_arg( ap, char *** );
if ( *sss ) {
- for (j = 0; (*sss)[j]; j++) {
+ for (j = 0; (*sss)[j]; j++) {
LBER_FREE( (*sss)[j] );
(*sss)[j] = NULL;
}
-/* encode.c - ber output encoding routines */
+/* Encode.c - ber output encoding routines */
/* $OpenLDAP$ */
/*
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
assert( BER_VALID( ber ) );
sign = (num < 0);
- unum = num; /* Bit fiddling should be done with unsigned values */
+ unum = num; /* Bit fiddling should be done with unsigned values */
/*
* high bit is set - look for first non-all-one byte
/*
* If this is the toplevel sequence or set, we need to actually
- * write the stuff out. Otherwise, it's already been put in
+ * write the stuff out. Otherwise, it's already been put in
* the appropriate buffer and will be written when the toplevel
* one is written. In this case all we need to do is update the
* length and tag.
/* The sos_ptr exceeds the end of the BerElement
* this can happen, for example, when the sos_ptr
* is near the end and no data was written for the
- * 'V'. We must realloc the BerElement to ensure
+ * 'V'. We must realloc the BerElement to ensure
* we don't overwrite the buffer when writing
* the tag and length fields.
*/
default:
if( ber->ber_debug ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "liblber", LDAP_LEVEL_ERR,
+ "ber_printf: unknown fmt %c\n", *fmt ));
+#else
ber_log_printf( LDAP_DEBUG_ANY, ber->ber_debug,
"ber_printf: unknown fmt %c\n", *fmt );
+#endif
}
rc = -1;
break;
/*
* If the stinking thing was moved, we need to go through and
- * reset all the sos and ber pointers. Offsets would've been
+ * reset all the sos and ber pointers. Offsets would've been
* a better idea... oh well.
*/
towrite = ber->ber_ptr - ber->ber_rwptr;
if ( sb->sb_debug ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "liblber", LDAP_LEVEL_DETAIL1,
+ "ber_flush: %ld bytes to sd %ld%s\n",
+ towrite, (long)sb->sb_fd,
+ ber->ber_rwptr != ber->ber_buf ? " (re-flush)" : "" ));
+ BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 ));
+#else
ber_log_printf( LDAP_DEBUG_ANY, sb->sb_debug,
"ber_flush: %ld bytes to sd %ld%s\n",
towrite, (long) sb->sb_fd,
ber->ber_rwptr != ber->ber_buf ? " (re-flush)" : "" );
ber_log_bprint( LDAP_DEBUG_PACKETS, sb->sb_debug,
ber->ber_rwptr, towrite );
+#endif
}
nwritten = 0;
assert( SOCKBUF_VALID( sb ) );
assert( BER_VALID( ber ) );
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "liblber", LDAP_LEVEL_ENTRY, "ber_get_next: enter\n" ));
+#else
ber_log_printf( LDAP_DEBUG_TRACE, ber->ber_debug,
"ber_get_next\n" );
+#endif
/*
* Any ber element looks like this: tag length contents.
ber->ber_rwptr = NULL;
*len = ber->ber_len;
if ( ber->ber_debug ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "liblber", LDAP_LEVEL_DETAIL1,
+ "ber_get_next: tag 0x%lx len %ld\n",
+ ber->ber_tag, ber->ber_len ));
+ BER_DUMP(( "liblber", LDAP_LEVEL_DETAIL2, ber, 1 ));
+#else
ber_log_printf( LDAP_DEBUG_TRACE, ber->ber_debug,
"ber_get_next: tag 0x%lx len %ld contents:\n",
ber->ber_tag, ber->ber_len );
ber_log_dump( LDAP_DEBUG_BER, ber->ber_debug, ber, 1 );
+#endif
}
return (ber->ber_tag);
}