Logo Search packages:      
Sourcecode: qdbm version File versions  Download package

void Villa::curjump ( const char *  kbuf,
int  ksiz,
int  jmode = Villa::JFORWARD 
) throw (Villa_error) [virtual]

Move the cursor to positon around a record.

Parameters:
kbuf the pointer to the region of a key.
ksiz the size of the region of the key. If it is negative, the size is assigned with `stdstrlen(kbuf)'.
jmode detail adjustment: `VillaJFORWARD', which means that the cursor is set to the first record of the same key and that the cursor is set to the next substitute if completely matching record does not exist, `VillaJBACKWARD', which means that the cursor is set to the last record of the same key and that the cursor is set to the previous substitute if completely matching record does not exist.
Exceptions:
Villa_error if an error occurs or there is no record corresponding the condition.

Definition at line 311 of file xvilla.cc.

References qdbm::mutex, and villa.

                                                                           {
  if(!villa) throw Villa_error();
  if(pthread_mutex_lock(&mutex) != 0) throw Villa_error();
  if(!vlcurjump(villa, kbuf, ksiz, jmode)){
    pthread_mutex_unlock(&mutex);
    throw Villa_error(dpecode);
  }
  pthread_mutex_unlock(&mutex);
}


Generated by  Doxygen 1.6.0   Back to index