/*- * Copyright (c) 1991 The Regents of the University of California. * All rights reserved. * * %sccs.include.redist.c% */ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)db.c 5.5 (Berkeley) 05/16/93"; #endif /* LIBC_SCCS and not lint */ #include #include #include #include #define __DBINTERFACE_PRIVATE #include DB * dbopen(fname, flags, mode, type, openinfo) const char *fname; int flags, mode; DBTYPE type; const void *openinfo; { switch (type) { case DB_BTREE: return (__bt_open(fname, flags, mode, openinfo)); case DB_HASH: return (__hash_open(fname, flags, mode, openinfo)); case DB_RECNO: return (__rec_open(fname, flags, mode, openinfo)); } errno = EINVAL; return (NULL); } static int __dberr() { return (RET_ERROR); } /* * __DBPANIC -- Stop. * * Parameters: * dbp: pointer to the DB structure. */ void __dbpanic(dbp) DB *dbp; { /* The only thing that can succeed is a close. */ dbp->del = (int (*)())__dberr; dbp->get = (int (*)())__dberr; dbp->put = (int (*)())__dberr; dbp->seq = (int (*)())__dberr; dbp->sync = (int (*)())__dberr; }