utils/db1-ast/db/db.c File Reference

#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdio.h>
#include "../include/db.h"

Include dependency graph for utils/db1-ast/db/db.c:

Go to the source code of this file.

Defines

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

Functions

void __dbpanic (DB *dbp)
static int __dberr __P ((void))
DBdbopen (char *fname, int flags, int mode, DBTYPE type, const void *openinfo) const


Define Documentation

#define DB_FLAGS   (DB_LOCK | DB_SHMEM | DB_TXN)

Referenced by dbopen().

#define USE_OPEN_FLAGS

Value:

(O_CREAT | O_EXCL | O_EXLOCK | O_NONBLOCK | O_RDONLY |      \
    O_RDWR | O_SHLOCK | O_TRUNC)

Referenced by dbopen().


Function Documentation

void __dbpanic ( DB dbp  ) 

Definition at line 89 of file utils/db1-ast/db/db.c.

References __P.

Referenced by __bt_split().

00091 {
00092    /* The only thing that can succeed is a close. */
00093    dbp->del = (int (*)__P((const struct __db *,
00094             const DBT *, u_int))) __dberr;
00095    dbp->get = (int (*)__P((const struct __db *,
00096             const DBT *, DBT *, u_int))) __dberr;
00097    dbp->put = (int (*)__P((const struct __db *,
00098             DBT *, const DBT *, u_int))) __dberr;
00099    dbp->seq = (int (*)__P((const struct __db *,
00100             DBT *, DBT *, u_int))) __dberr;
00101    dbp->sync = (int (*)__P((const struct __db *, u_int))) __dberr;
00102    dbp->fd = (int (*)__P((const struct __db *))) __dberr;
00103 }

static int __dberr __P ( (void)   )  [static]

Definition at line 77 of file utils/db1-ast/db/db.c.

References RET_ERROR.

00078 {
00079    return (RET_ERROR);
00080 }

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

Definition at line 48 of file utils/db1-ast/db/db.c.

References __bt_open(), __hash_open(), __rec_open(), DB_BTREE, DB_FLAGS, DB_HASH, DB_RECNO, errno, NULL, and USE_OPEN_FLAGS.

Referenced by convert_bdb_to_sqlite3(), create_bdb_astdb(), and mssql_connect().

00053 {
00054 
00055 #define  DB_FLAGS (DB_LOCK | DB_SHMEM | DB_TXN)
00056 #define  USE_OPEN_FLAGS                   \
00057    (O_CREAT | O_EXCL | O_EXLOCK | O_NONBLOCK | O_RDONLY |      \
00058     O_RDWR | O_SHLOCK | O_TRUNC)
00059 
00060    if ((flags & ~(USE_OPEN_FLAGS | DB_FLAGS)) == 0)
00061       switch (type) {
00062       case DB_BTREE:
00063          return (__bt_open(fname, flags & USE_OPEN_FLAGS,
00064              mode, openinfo, flags & DB_FLAGS));
00065       case DB_HASH:
00066          return (__hash_open(fname, flags & USE_OPEN_FLAGS,
00067              mode, openinfo, flags & DB_FLAGS));
00068       case DB_RECNO:
00069          return (__rec_open(fname, flags & USE_OPEN_FLAGS,
00070              mode, openinfo, flags & DB_FLAGS));
00071       }
00072    errno = EINVAL;
00073    return (NULL);
00074 }


Generated on Thu Apr 16 06:30:36 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6