APBCDB

A constant key-value database library
Download

APBCDB Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Asher
  • Publisher web site:
  • http://www.wildsparx.com/

APBCDB Tags


APBCDB Description

A constant key-value database library Apbcdb is a library for C programmers and it cannot be used directly by users.PerformanceBenchmarked as follows: * 1.8 GHz machine; 1GB RAM * Lookup keys were randomly distributed. * 50% of lookup keys were present in the database.How to use APBCDBGeneral * Include apbcdb.h * All functions return a result code. o Always check it. o If it's nonzero, it's one of the errors listed in the header file. o Don't proceed past an error result. * Add the apbcdb directory to your project and link with: o apbcdb_writer.o o apbcdb_reader.o o apbindex/apbindex.oCreating a DBapbcdb_writer w;int rc;rc = apbcdb_begin_write(&w, "phonebook.dat");rc = apbcdb_add_entry(&w, strlen("Bob Smith"), "Bob Smith", strlen("408.921.9191"), "408.921.9191");rc = apbcdb_add_entry(&w, strlen("Jen Rapp"), "Jen Rapp", strlen("714.334.5543"), "714.334.5543");rc = apbcdb_end_write(&w);/* this creates phonebook.dat.idx; both files must be present to read */Reading a DBapbcdb_reader r;int rc;char val;uint vallen;rc = apbcdb_ropen(&r, "phonebook.dat");vallen = sizeof(val);rc = apbcdb_get(&r, "Bob Smith", strlen("Bob Smith"), val, &vallen);/* now val contains Bob's phone number, and vallen contains the * phone number's length */rc = apbcdb_rclose(&r); Here are some key features of "APBCDB": · Fast lookups. · Multiple readers can share the db efficiently. · UTF-8 safe and binary-safe. Merely stores byte sequences. · C API for DB creation. · Clear, maintainable code. · Permissive license.


APBCDB Related Software