sophia - an embeddable key-value database designed for a high load | documentation

GET DOCUMENTATION ARCHITECTURE BENCHMARKS sp_env sp_ctl sp_open sp_error sp_destroy sp_begin sp_commit sp_rollback sp_set sp_get sp_delete sp_cursor sp_fetch sp_key sp_keysize sp_value sp_valuesize NAME sp_get - find a key in a database SYNOPSIS #include <sophia.h> int sp_get( void *db, const void *k, size_t ksize, void **v, size_t *vsize); DESCRIPTION The sp_get(3) function is used to find keys in a database. If key is found, it's value and value size is copied and returned through supplied arguments. Value must be free'd after a use. If no value pointer is supplied, sp_get(3) is used only to check for a key existence. EXAMPLE int key = 1234; void *value; size_t vsize; int rc; rc = sp_get(db, &key;, sizeof(key), &value;, &vsize;); switch (rc) { case -1: printf("error: %s\n", sp_error(db)); break; case 0: printf("no key found\n");...

Linked on 2014-03-02 21:51:55 | Similar Links