ccn_btree_store.c File Reference

Go to the source code of this file.

Functions

static int bts_open (struct ccn_btree_io *, struct ccn_btree_node *)
 File-based btree index storage.
static int bts_read (struct ccn_btree_io *, struct ccn_btree_node *, unsigned)
static int bts_write (struct ccn_btree_io *, struct ccn_btree_node *)
static int bts_close (struct ccn_btree_io *, struct ccn_btree_node *)
static int bts_destroy (struct ccn_btree_io **pio)
 Remove the lock file and free up resources.
struct ccn_btree_ioccn_btree_io_from_directory (const char *path, struct ccn_charbuf *msgs)
 Create a btree storage layer from a directory.
static int bts_remove_lockfile (struct ccn_btree_io *io)
 Remove the lock file, trusting that it is ours.


Function Documentation

static int bts_close ( struct ccn_btree_io io,
struct ccn_btree_node node 
) [static]

Definition at line 309 of file ccn_btree_store.c.

Referenced by ccn_btree_io_from_directory().

static int bts_destroy ( struct ccn_btree_io **  pio  )  [static]

Remove the lock file and free up resources.

Returns:
-1 if there were errors (but it cleans up what it can).

Definition at line 357 of file ccn_btree_store.c.

Referenced by ccn_btree_io_from_directory().

static int bts_open ( struct ccn_btree_io io,
struct ccn_btree_node node 
) [static]

File-based btree index storage.

Definition at line 198 of file ccn_btree_store.c.

Referenced by ccn_btree_io_from_directory().

static int bts_read ( struct ccn_btree_io io,
struct ccn_btree_node node,
unsigned  limit 
) [static]

Definition at line 250 of file ccn_btree_store.c.

Referenced by ccn_btree_io_from_directory().

static int bts_remove_lockfile ( struct ccn_btree_io io  )  [static]

Remove the lock file, trusting that it is ours.

Returns:
-1 if there were errors (but it cleans up what it can).

Definition at line 331 of file ccn_btree_store.c.

Referenced by bts_destroy().

static int bts_write ( struct ccn_btree_io io,
struct ccn_btree_node node 
) [static]

Definition at line 285 of file ccn_btree_store.c.

Referenced by ccn_btree_io_from_directory().

struct ccn_btree_io* ccn_btree_io_from_directory ( const char *  path,
struct ccn_charbuf msgs 
) [read]

Create a btree storage layer from a directory.

In this implementation of the storage layer, each btree block is stored as a separate file. The files are named using the decimal representation of the nodeid.

If msgs is not NULL, diagnostics may be recorded there.

Parameters:
path is the name of the directory, which must exist.
Returns:
the new ccn_btree_io handle, or sets errno and returns NULL.

Definition at line 57 of file ccn_btree_store.c.

Referenced by r_store_init(), test_btree_io(), and test_btree_lockfile().


Generated on Thu Feb 16 00:44:21 2012 for Content-Centric Networking in C by  doxygen 1.5.6