#include <ac/string.h>
#include "slap.h"
+#include "ldif.h"
static unsigned char *ebuf; /* buf returned by entry2str */
static unsigned char *ecur; /* pointer to end of currently used ebuf */
if ( e->e_dn != NULL ) {
#ifdef NEW_LOGGING
- LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
- "str2entry: entry %ld has multiple dns \"%s\" and \"%s\" (second ignored)\n",
- e->e_id, e->e_dn, value.bv_val != NULL ? value.bv_val : "" ));
+ LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1, "str2entry: "
+ "entry %ld has multiple dns \"%s\" and \"%s\" "
+ "(second ignored)\n",
+ (long) e->e_id, e->e_dn, value.bv_val != NULL ? value.bv_val : "" ));
#else
- Debug( LDAP_DEBUG_ANY,
- "str2entry: entry %ld has multiple dns \"%s\" and \"%s\" (second ignored)\n",
- e->e_id, e->e_dn,
+ Debug( LDAP_DEBUG_ANY, "str2entry: "
+ "entry %ld has multiple dns \"%s\" and \"%s\" "
+ "(second ignored)\n",
+ (long) e->e_id, e->e_dn,
value.bv_val != NULL ? value.bv_val : "" );
#endif
if( value.bv_val != NULL ) free( value.bv_val );
if ( e->e_dn == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
- "str2entry: entry %ld has no dn.\n", e->e_id ));
+ "str2entry: entry %ld has no dn.\n",
+ (long) e->e_id ));
#else
Debug( LDAP_DEBUG_ANY, "str2entry: entry %ld has no dn\n",
- e->e_id, 0, 0 );
+ (long) e->e_id, 0, 0 );
#endif
entry_free( e );
return( NULL );
return( e1->e_id < e2->e_id ? -1 : (e1->e_id > e2->e_id ? 1 : 0) );
}
-#define SLAPD_SLEEPY 1
-#ifdef SLAPD_SLEEPY
+#ifdef SLAPD_BDB
-/* a DER encoded entry looks like:
+/* a LBER encoded entry looks like:
*
- * entry :== SEQUENCE {
- * dn DistinguishedName,
- * ndn NormalizedDistinguishedName,
- * attrs SEQUENCE OF SEQUENCE {
- * type AttributeType,
- * values SET OF AttributeValue
- * }
- * }
+ * entry :== SEQUENCE {
+ * dn DistinguishedName,
+ * ndn NormalizedDistinguishedName,
+ * attrs SEQUENCE OF SEQUENCE {
+ * type AttributeType,
+ * values SET OF AttributeValue
+ * }
+ * }
*
- * Encoding/Decoding of DER should be much faster than LDIF
+ * Encoding/Decoding of LBER should be much faster than LDIF
*/
int entry_decode( struct berval *bv, Entry **entry )
ber_len_t len;
char *last;
+ assert( bv != NULL );
+ assert( entry != NULL );
+
ber = ber_init( bv );
if( ber == NULL ) {
+ assert( 0 ); /* XXYYZ: Temporary assert */
+
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"entry_decode: ber_init failed\n" ));
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_DETAIL1,
- "entry_encode: id: 0x%08lx \"%s\"\n",
- e->e_id, e->e_dn ));
+ "entry_encode: id: 0x%08lx \"%s\"\n",
+ (long) e->e_id, e->e_dn ));
#else
Debug( LDAP_DEBUG_TRACE, "=> entry_encode(0x%08lx): %s\n",
- e->e_id, e->e_dn, 0 );
+ (long) e->e_id, e->e_dn, 0 );
#endif
ber = ber_alloc_t( LBER_USE_DER );
if( ber == NULL ) {
if( rc ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
- "entry_encode: id=0x%08lx failed (%d)\n", e->e_id, rc ));
+ "entry_encode: id=0x%08lx failed (%d)\n",
+ (long) e->e_id, rc ));
#else
Debug( LDAP_DEBUG_ANY, "=> entry_encode(0x%08lx): failed (%d)\n",
- e->e_id, rc, 0 );
+ (long) e->e_id, rc, 0 );
#endif
}
return rc;