Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions
ndbm.h File Reference
#include "mcom_db.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  datum

Defines

#define DBM_RDONLY   O_RDONLY
#define DBM_INSERT   0
#define DBM_REPLACE   1
#define DBM_SUFFIX   ".db"
#define dbm_pagfno(a)   DBM_PAGFNO_NOT_AVAILABLE

Typedefs

typedef DB DBM

Functions

__BEGIN_DECLS void dbm_close (DBM *)
int dbm_delete (DBM *, datum)
datum dbm_fetch (DBM *, datum)
datum dbm_firstkey (DBM *)
long dbm_forder (DBM *, datum)
datum dbm_nextkey (DBM *)
DBMdbm_open (const char *, int, int)
int dbm_store (DBM *, datum, datum, int)
int dbm_dirfno (DBM *)

Class Documentation

struct datum

Definition at line 55 of file ndbm.h.

Collaboration diagram for datum:
Class Members
char * dptr
int dsize

Define Documentation

#define DBM_INSERT   0

Definition at line 46 of file ndbm.h.

#define dbm_pagfno (   a)    DBM_PAGFNO_NOT_AVAILABLE

Definition at line 61 of file ndbm.h.

Definition at line 43 of file ndbm.h.

Definition at line 47 of file ndbm.h.

#define DBM_SUFFIX   ".db"

Definition at line 53 of file ndbm.h.


Typedef Documentation

typedef DB DBM

Definition at line 60 of file ndbm.h.


Function Documentation

Definition at line 82 of file ndbm.c.

{
       (void)(db->close)(db);
}
int dbm_delete ( DBM ,
datum   
)

Definition at line 145 of file ndbm.c.

{
       int status;

       status = (db->del)(db, (DBT *)&key, 0);
       if (status)
              return (-1);
       else
              return (0);
}
int dbm_dirfno ( DBM )

Definition at line 190 of file ndbm.c.

{
       return(((HTAB *)db->internal)->fp);
}
datum dbm_fetch ( DBM ,
datum   
)

Definition at line 93 of file ndbm.c.

{
       datum retval;
       int status;

       status = (db->get)(db, (DBT *)&key, (DBT *)&retval, 0);
       if (status) {
              retval.dptr = NULL;
              retval.dsize = 0;
       }
       return (retval);
}

Definition at line 112 of file ndbm.c.

{
       int status;
       datum retdata, retkey;

       status = (db->seq)(db, (DBT *)&retkey, (DBT *)&retdata, R_FIRST);
       if (status)
              retkey.dptr = NULL;
       return (retkey);
}
long dbm_forder ( DBM ,
datum   
)

Definition at line 129 of file ndbm.c.

{
       int status;
       datum retdata, retkey;

       status = (db->seq)(db, (DBT *)&retkey, (DBT *)&retdata, R_NEXT);
       if (status)
              retkey.dptr = NULL;
       return (retkey);
}
DBM* dbm_open ( const char *  ,
int  ,
int   
)

Definition at line 65 of file ndbm.c.

{
       HASHINFO info;
       char path[MAXPATHLEN];

       info.bsize = 4096;
       info.ffactor = 40;
       info.nelem = 1;
       info.cachesize = 0;
       info.hash = NULL;
       info.lorder = 0;
       (void)strcpy(path, file);
       (void)strcat(path, DBM_SUFFIX);
       return ((DBM *)__hash_open(path, flags, mode, &info, 0));
}

Here is the call graph for this function:

int dbm_store ( DBM ,
datum  ,
datum  ,
int   
)

Definition at line 163 of file ndbm.c.

{
       return ((db->put)(db, (DBT *)&key, (DBT *)&content,
           (flags == DBM_INSERT) ? R_NOOVERWRITE : 0));
}