Coda Distributed File System
Classes | Macros | Functions
rwcdb.c File Reference
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include "rwcdb_pack.h"
#include "rwcdb.h"
Include dependency graph for rwcdb.c:

Classes

struct  wrentry
 

Macros

#define wbuf(w)   (((char *)w) + sizeof(struct wrentry) - 8)
 
#define wkey(w)   (wbuf(w) + 8)
 
#define wdata(w)   (wbuf(w) + 8 + (w)->klen)
 

Functions

int rwcdb_init (struct rwcdb *c, const char *file, const int mode)
 
int rwcdb_free (struct rwcdb *c)
 
int rwcdb_find (struct rwcdb *c, const char *k, const uint32_t klen)
 
int rwcdb_insert (struct rwcdb *c, const char *k, const uint32_t klen, const char *d, const uint32_t dlen)
 
int rwcdb_delete (struct rwcdb *c, const char *k, const uint32_t klen)
 
int rwcdb_next (struct rwcdb *c, int init)
 
int rwcdb_read (struct rwcdb *c, char *d, const uint32_t dlen, const uint32_t dpos)
 
int rwcdb_readkey (struct rwcdb *c, char *k, const uint32_t klen, const uint32_t dpos)
 
int rwcdb_sync (struct rwcdb *c)
 

Macro Definition Documentation

◆ wbuf

#define wbuf (   w)    (((char *)w) + sizeof(struct wrentry) - 8)

◆ wdata

#define wdata (   w)    (wbuf(w) + 8 + (w)->klen)

◆ wkey

#define wkey (   w)    (wbuf(w) + 8)

Function Documentation

◆ rwcdb_delete()

int rwcdb_delete ( struct rwcdb c,
const char *  k,
const uint32_t  klen 
)

◆ rwcdb_find()

int rwcdb_find ( struct rwcdb c,
const char *  k,
const uint32_t  klen 
)

◆ rwcdb_free()

int rwcdb_free ( struct rwcdb c)

◆ rwcdb_init()

int rwcdb_init ( struct rwcdb c,
const char *  file,
const int  mode 
)

◆ rwcdb_insert()

int rwcdb_insert ( struct rwcdb c,
const char *  k,
const uint32_t  klen,
const char *  d,
const uint32_t  dlen 
)

◆ rwcdb_next()

int rwcdb_next ( struct rwcdb c,
int  init 
)

◆ rwcdb_read()

int rwcdb_read ( struct rwcdb c,
char *  d,
const uint32_t  dlen,
const uint32_t  dpos 
)

◆ rwcdb_readkey()

int rwcdb_readkey ( struct rwcdb c,
char *  k,
const uint32_t  klen,
const uint32_t  dpos 
)

◆ rwcdb_sync()

int rwcdb_sync ( struct rwcdb c)