Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
db.c File Reference
#include "watcomfx.h"
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdio.h>
#include "mcom_db.h"

Go to the source code of this file.

Defines

#define __DBINTERFACE_PRIVATE
#define DB_FLAGS   (DB_LOCK | DB_SHMEM | DB_TXN)
#define USE_OPEN_FLAGS

Functions

void dbSetOrClearDBLock (DBLockFlagEnum type)
 dbopen (const char *fname, int flags, int mode, DBTYPE type, const void *openinfo)
static int __dberr ()
void __dbpanic (DB *dbp)

Variables

int all_databases_locked_closed = 0

Define Documentation

Definition at line 39 of file db.c.

Value:
(O_CREAT | O_EXCL  | O_RDONLY |           \
        O_RDWR | O_TRUNC)

Function Documentation

static int __dberr ( ) [static]

Definition at line 121 of file db.c.

{
       return (RET_ERROR);
}

Here is the caller graph for this function:

void __dbpanic ( DB dbp)

Definition at line 133 of file db.c.

{
       /* The only thing that can succeed is a close. */
       dbp->del = (int (*)(const struct __db *, const DBT *, uint))__dberr;
       dbp->fd = (int (*)(const struct __db *))__dberr;
       dbp->get = (int (*)(const struct __db *, const DBT *, DBT *, uint))__dberr;
       dbp->put = (int (*)(const struct __db *, DBT *, const DBT *, uint))__dberr;
       dbp->seq = (int (*)(const struct __db *, DBT *, DBT *, uint))__dberr;
       dbp->sync = (int (*)(const struct __db *, uint))__dberr;
}

Here is the call graph for this function:

dbopen ( const char *  fname,
int  flags,
int  mode,
DBTYPE  type,
const void openinfo 
)

Definition at line 74 of file db.c.

{

       /* lock out all file databases.  Let in-memory databases through
        */
       if(all_databases_locked_closed && fname)
         {
              errno = EINVAL;
              return(NULL);
         }

#define       DB_FLAGS      (DB_LOCK | DB_SHMEM | DB_TXN)


#if 0  /* most systems dont have EXLOCK and SHLOCK */
#define       USE_OPEN_FLAGS                                                 \
       (O_CREAT | O_EXCL | O_EXLOCK | O_NONBLOCK | O_RDONLY |         \
        O_RDWR | O_SHLOCK | O_TRUNC)
#else
#define       USE_OPEN_FLAGS                                                 \
       (O_CREAT | O_EXCL  | O_RDONLY |           \
        O_RDWR | O_TRUNC)
#endif

       if ((flags & ~(USE_OPEN_FLAGS | DB_FLAGS)) == 0)
              switch (type) {
/* we don't need btree and recno right now */    
#if 0
              case DB_BTREE:
                     return (__bt_open(fname, flags & USE_OPEN_FLAGS,
                         mode, openinfo, flags & DB_FLAGS));
              case DB_RECNO:
                     return (__rec_open(fname, flags & USE_OPEN_FLAGS,
                         mode, openinfo, flags & DB_FLAGS));
#endif

              case DB_HASH:
                     return (__hash_open(fname, flags & USE_OPEN_FLAGS,
                         mode, (const HASHINFO *)openinfo, flags & DB_FLAGS));
              default:
                     break;
              }
       errno = EINVAL;
       return (NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 61 of file db.c.


Variable Documentation

Definition at line 55 of file db.c.