Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Database > Database APIs

    APBCDB 0.2

    Download button

    No screenshots available
    Downloads: 402  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Asher | More programs
    MIT/X Consortium Lic... / FREE
    December 8th, 2008, 03:54 GMT
    ROOT / Database / Database APIs

     Read user reviews (0)  Refer to a friend  Subscribe

    APBCDB description

    A constant key-value database library

    Apbcdb is a library for C programmers and it cannot be used directly by users.

    Performance

    Benchmarked 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 APBCDB

    General


     * 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.o

    Creating a DB

    apbcdb_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 DB

    apbcdb_reader r;
    int rc;
    char val[0x400];
    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);



    Product's homepage

    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.

      


    TAGS:

    constant key-value | database API | C library | constant | key-value | database

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM