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