]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/id2entry.c
Notices and acknowledgements
[openldap] / servers / slapd / back-ldbm / id2entry.c
index 6f3ea988446a7c4c60b74e80ec2da7dccff3957f..00b3a9977408484437ac4ef4de13844e2d5e1f2f 100644 (file)
@@ -1,7 +1,7 @@
 /* id2entry.c - routines to deal with the id2entry index */
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -33,8 +33,7 @@ id2entry_add( Backend *be, Entry *e )
        ldbm_datum_init( data );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "id2entry_add: (%s)%ld\n", e->e_dn, e->e_id ));
+       LDAP_LOG( INDEX, ENTRY, "id2entry_add: (%s)%ld\n", e->e_dn, e->e_id, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> id2entry_add( %ld, \"%s\" )\n", e->e_id,
            e->e_dn, 0 );
@@ -44,9 +43,9 @@ id2entry_add( Backend *be, Entry *e )
        if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT ))
            == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "id2entry_add: could not open/create id2entry%s\n",
-                          LDBM_SUFFIX ));
+               LDAP_LOG( INDEX, ERR, 
+                  "id2entry_add: could not open/create id2entry%s\n", 
+                  LDBM_SUFFIX, 0,0 );
 #else
                Debug( LDAP_DEBUG_ANY, "Could not open/create id2entry%s\n",
                    LDBM_SUFFIX, 0, 0 );
@@ -76,8 +75,7 @@ id2entry_add( Backend *be, Entry *e )
        ldbm_cache_close( be, db );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "id2entry_add: return %d\n", rc ));
+       LDAP_LOG( INDEX, ENTRY, "id2entry_add: return %d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= id2entry_add %d\n", rc, 0, 0 );
 #endif
@@ -98,8 +96,7 @@ id2entry_delete( Backend *be, Entry *e )
 #endif
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "id2entry_delete: (%s)%ld\n", e->e_dn, e->e_id ));
+       LDAP_LOG( INDEX, ENTRY, "id2entry_delete: (%s)%ld\n", e->e_dn, e->e_id, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "=> id2entry_delete( %ld, \"%s\" )\n", e->e_id,
            e->e_dn, 0 );
@@ -118,9 +115,9 @@ id2entry_delete( Backend *be, Entry *e )
        if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT ))
                == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
+               LDAP_LOG( INDEX, ERR, 
                           "id2entry_delete: could not open/create id2entry%s\n",
-                          LDBM_SUFFIX ));
+                          LDBM_SUFFIX, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "Could not open/create id2entry%s\n",
                    LDBM_SUFFIX, 0, 0 );
@@ -131,9 +128,9 @@ id2entry_delete( Backend *be, Entry *e )
 
        if ( cache_delete_entry( &li->li_cache, e ) != 0 ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
+               LDAP_LOG( INDEX, ERR, 
                           "id2entry_delete: Could not delete (%s)%ld from cache\n",
-                          e->e_dn, e->e_id ));
+                          e->e_dn, e->e_id, 0 );
 #else
                Debug(LDAP_DEBUG_ANY, "could not delete %ld (%s) from cache\n",
                    e->e_id, e->e_dn, 0 );
@@ -154,8 +151,7 @@ id2entry_delete( Backend *be, Entry *e )
        ldbm_cache_close( be, db );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "id2entry_delete: return %d\n", rc ));
+       LDAP_LOG( INDEX, ENTRY, "id2entry_delete: return %d\n", rc, 0, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= id2entry_delete %d\n", rc, 0, 0 );
 #endif
@@ -179,9 +175,8 @@ id2entry_rw( Backend *be, ID id, int rw )
        ldbm_datum_init( data );
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "id2entry_rw: %s (%ld)\n",
-                  rw ? "write" : "read", id ));
+       LDAP_LOG( INDEX, ENTRY, 
+                  "id2entry_rw: %s (%ld)\n", rw ? "write" : "read", id, 0 );
 #else
        Debug( LDAP_DEBUG_TRACE, "=> id2entry_%s( %ld )\n",
                rw ? "w" : "r", id, 0 );
@@ -190,9 +185,9 @@ id2entry_rw( Backend *be, ID id, int rw )
 
        if ( (e = cache_find_entry_id( &li->li_cache, id, rw )) != NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+               LDAP_LOG( INDEX, DETAIL1, 
                           "id2entry_rw: %s (%ld) 0x%lx (cache).\n",
-                          rw ? "write" : "read", id, (unsigned long)e ));
+                          rw ? "write" : "read", id, (unsigned long)e  );
 #else
                Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) 0x%lx (cache)\n",
                        rw ? "w" : "r", id, (unsigned long) e );
@@ -204,8 +199,8 @@ id2entry_rw( Backend *be, ID id, int rw )
        if ( (db = ldbm_cache_open( be, "id2entry", LDBM_SUFFIX, LDBM_WRCREAT ))
                == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "id2entry_rw: could not open id2entry%s\n", LDBM_SUFFIX ));
+               LDAP_LOG( INDEX, ERR, 
+                          "id2entry_rw: could not open id2entry%s\n", LDBM_SUFFIX, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "Could not open id2entry%s\n",
                    LDBM_SUFFIX, 0, 0 );
@@ -226,8 +221,8 @@ id2entry_rw( Backend *be, ID id, int rw )
 
        if ( data.dptr == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "id2entry_rw: (%ld) not found\n", id ));
+               LDAP_LOG( INDEX, ERR, 
+                          "id2entry_rw: (%ld) not found\n", id, 0, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) not found\n",
                        rw ? "w" : "r", id, 0 );
@@ -243,9 +238,8 @@ id2entry_rw( Backend *be, ID id, int rw )
 
        if ( e == NULL ) {
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
-                          "id2entry_rw: %s of %ld failed\n",
-                          rw ? "write" : "read", id ));
+               LDAP_LOG( INDEX, ERR, 
+                          "id2entry_rw: %s of %ld failed\n", rw ? "write" : "read", id, 0);
 #else
                Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) (failed)\n",
                        rw ? "w" : "r", id, 0 );
@@ -265,9 +259,9 @@ id2entry_rw( Backend *be, ID id, int rw )
                 */
                if ( (e = cache_find_entry_id( &li->li_cache, id, rw )) != NULL ) {
 #ifdef NEW_LOGGING
-                       LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
+                       LDAP_LOG( INDEX, DETAIL1, 
                                   "id2entry_rw: %s of %ld 0x%lx (cache)\n",
-                                  rw ? "write" : "read", id, (unsigned long)e ));
+                                  rw ? "write" : "read", id, (unsigned long)e  );
 #else
                        Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) 0x%lx (cache)\n",
                                rw ? "w" : "r", id, (unsigned long) e );
@@ -277,9 +271,9 @@ id2entry_rw( Backend *be, ID id, int rw )
                }
 
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "backend", LDAP_LEVEL_ERR,
+               LDAP_LOG( INDEX, ERR, 
                           "id2entry_rw: %s of %ld (cache add failed)\n",
-                          rw ? "write" : "read", id ));
+                          rw ? "write" : "read", id, 0 );
 #else
                Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) (cache add failed)\n",
                        rw ? "w" : "r", id, 0 );
@@ -289,9 +283,9 @@ id2entry_rw( Backend *be, ID id, int rw )
        }
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
+       LDAP_LOG( INDEX, ENTRY, 
                   "id2entry_rw: %s of %ld 0x%lx (disk)\n",
-                  rw ? "write" : "read", id, (unsigned long)e ));
+                  rw ? "write" : "read", id, (unsigned long)e  );
 #else
        Debug( LDAP_DEBUG_TRACE, "<= id2entry_%s( %ld ) 0x%lx (disk)\n",
                rw ? "w" : "r", id, (unsigned long) e );