Back to index

courier  0.68.2
Functions
gdbmobj2.c File Reference
#include "gdbmobj.h"

Go to the source code of this file.

Functions

static char * fetchkeyval (struct gdbmobj *obj, size_t *, char **, size_t *)
char * gdbm_dofetch (struct gdbmobj *, const char *, size_t, size_t *)
char * gdbmobj_firstkey (struct gdbmobj *obj, size_t *keylen, char **val, size_t *vallen)
char * gdbmobj_nextkey (struct gdbmobj *obj, size_t *keylen, char **val, size_t *vallen)

Function Documentation

static char * fetchkeyval ( struct gdbmobj obj,
size_t *  keylen,
char **  val,
size_t *  vallen 
) [static]

Definition at line 31 of file gdbmobj2.c.

{
       if (!obj->prev_key)  return (0);
       *val=gdbm_dofetch(obj, obj->prev_key, obj->prev_key_len, vallen);
       *keylen=obj->prev_key_len;
       return (obj->prev_key);
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* gdbm_dofetch ( struct gdbmobj ,
const char *  ,
size_t  ,
size_t *   
)

Definition at line 162 of file gdbmobj.c.

{
datum  dkey, val;

       if (!obj->has_dbf)   return (0);

       dkey.dptr=(char *)key;
       dkey.dsize=keylen;

       val=gdbm_fetch(obj->dbf, dkey);

       if (!val.dptr)       return (0);
       *datalen=val.dsize;
       return (val.dptr);
}

Here is the caller graph for this function:

char* gdbmobj_firstkey ( struct gdbmobj obj,
size_t *  keylen,
char **  val,
size_t *  vallen 
)

Definition at line 11 of file gdbmobj2.c.

{
datum  key;

       if (!obj->has_dbf)   return (0);

       if (obj->prev_key)   free(obj->prev_key);
       obj->prev_key=0;

       key=gdbm_firstkey(obj->dbf);

       if (!key.dptr)       return (0);

       obj->prev_key=key.dptr;
       obj->prev_key_len=key.dsize;
       return (fetchkeyval(obj, keylen, val, vallen));
}

Here is the call graph for this function:

char* gdbmobj_nextkey ( struct gdbmobj obj,
size_t *  keylen,
char **  val,
size_t *  vallen 
)

Definition at line 40 of file gdbmobj2.c.

{
datum  dkey, key;

       if (!obj->has_dbf || !obj->prev_key)      return (0);

       dkey.dptr=(char *)obj->prev_key;
       dkey.dsize=obj->prev_key_len;

       key=gdbm_nextkey(obj->dbf, dkey);

       free(obj->prev_key);
       obj->prev_key=key.dptr;
       obj->prev_key_len=key.dsize;
       return (fetchkeyval(obj, keylen, val, vallen));
}

Here is the call graph for this function: