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

char * Villa::curval ( int *  sp = 0  )  throw (Villa_error) [virtual]

Get the value of the record where the cursor is.

sp the pointer to a variable to which the size of the region of the return value is assigned. If it is 0, it is not used.
the pointer to the region of the value of the corresponding record.
Villa_error if an error occurs or no record corresponds to the cursor.
Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. Because the region of the return value is allocated with the `stdmalloc' call, it should be released with the `stdfree' call if it is no longer in use.

Definition at line 335 of file xvilla.cc.

References qdbm::mutex, and villa.

  char* vbuf;
  if(!villa) throw Villa_error();
  if(pthread_mutex_lock(&mutex) != 0) throw Villa_error();
  if(!(vbuf = vlcurval(villa, sp))){
    throw Villa_error(dpecode);
  return vbuf;

Generated by  Doxygen 1.6.0   Back to index