Browse Source Download (without any required ccan dependencies)

Module:

ntdb

Summary:

Next Generation Trivial Database

Maintainer:

Rusty Russell <rusty@rustcorp.com.au>

Dependencies:

Description:

This package provides an experimental persistent keyword/data store. Its main advantage over tdb is that it's 64-bit.

Example:

#include <stdio.h>
#include <err.h>
#include <unistd.h>
#include <ccan/ntdb/ntdb.h>

int main(int argc, char *argv[])
{
        NTDB_DATA key = ntdb_mkdata("key", 3);
        NTDB_DATA val = ntdb_mkdata("val", 3);
        struct ntdb_context *ntdb;

        ntdb = ntdb_open("example.ntdb", NTDB_DEFAULT,
                         O_RDWR | O_CREAT | O_TRUNC, 0600, NULL);
        if (ntdb == NULL)
                errx(1, "failed to open database file");

        ntdb_store(ntdb, key, val, NTDB_INSERT);

        ntdb_close(ntdb);

        return 0;
}

License:

LGPL (v3 or any later version)