michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: /* michael@0: * cdbhdl.h - certificate database handle michael@0: * private to the certdb module michael@0: */ michael@0: #ifndef _CDBHDL_H_ michael@0: #define _CDBHDL_H_ michael@0: michael@0: #include "nspr.h" michael@0: #include "mcom_db.h" michael@0: #include "pcertt.h" michael@0: #include "prtypes.h" michael@0: michael@0: /* michael@0: * Handle structure for open certificate databases michael@0: */ michael@0: struct NSSLOWCERTCertDBHandleStr { michael@0: DB *permCertDB; michael@0: PZMonitor *dbMon; michael@0: PRBool dbVerify; michael@0: PRInt32 ref; /* reference count */ michael@0: }; michael@0: michael@0: #ifdef DBM_USING_NSPR michael@0: #define NO_RDONLY PR_RDONLY michael@0: #define NO_RDWR PR_RDWR michael@0: #define NO_CREATE (PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE) michael@0: #else michael@0: #define NO_RDONLY O_RDONLY michael@0: #define NO_RDWR O_RDWR michael@0: #define NO_CREATE (O_RDWR | O_CREAT | O_TRUNC) michael@0: #endif michael@0: michael@0: typedef DB * (*rdbfunc)(const char *appName, const char *prefix, michael@0: const char *type, int flags); michael@0: typedef int (*rdbstatusfunc)(void); michael@0: michael@0: #define RDB_FAIL 1 michael@0: #define RDB_RETRY 2 michael@0: michael@0: DB * rdbopen(const char *appName, const char *prefix, michael@0: const char *type, int flags, int *status); michael@0: michael@0: DB *dbsopen (const char *dbname , int flags, int mode, DBTYPE type, michael@0: const void * appData); michael@0: SECStatus db_Copy(DB *dest,DB *src); michael@0: int db_InitComplete(DB *db); michael@0: michael@0: #endif