Back to index

openldap  2.4.31
Functions
key.c File Reference
#include "portable.h"
#include <stdio.h>
#include <ac/string.h>
#include <ac/socket.h>
#include "slap.h"
#include "back-mdb.h"
#include "idl.h"

Go to the source code of this file.

Functions

int mdb_key_read (Backend *be, MDB_txn *txn, MDB_dbi dbi, struct berval *k, ID *ids, MDB_cursor **saved_cursor, int get_flag)

Function Documentation

int mdb_key_read ( Backend be,
MDB_txn txn,
MDB_dbi  dbi,
struct berval k,
ID ids,
MDB_cursor **  saved_cursor,
int  get_flag 
)

Definition at line 30 of file key.c.

{
       int rc;
       MDB_val key;
#ifndef MISALIGNED_OK
       int kbuf[2];
#endif

       Debug( LDAP_DEBUG_TRACE, "=> key_read\n", 0, 0, 0 );

#ifndef MISALIGNED_OK
       if (k->bv_len & ALIGNER) {
              key.mv_size = sizeof(kbuf);
              key.mv_data = kbuf;
              kbuf[1] = 0;
              memcpy(kbuf, k->bv_val, k->bv_len);
       } else
#endif
       {
              key.mv_size = k->bv_len;
              key.mv_data = k->bv_val;
       }

       rc = mdb_idl_fetch_key( be, txn, dbi, &key, ids, saved_cursor, get_flag );

       if( rc != LDAP_SUCCESS ) {
              Debug( LDAP_DEBUG_TRACE, "<= mdb_index_read: failed (%d)\n",
                     rc, 0, 0 );
       } else {
              Debug( LDAP_DEBUG_TRACE, "<= mdb_index_read %ld candidates\n",
                     (long) MDB_IDL_N(ids), 0, 0 );
       }

       return rc;
}

Here is the call graph for this function:

Here is the caller graph for this function: