|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 /* |
|
5 * cdbhdl.h - certificate database handle |
|
6 * private to the certdb module |
|
7 */ |
|
8 #ifndef _CDBHDL_H_ |
|
9 #define _CDBHDL_H_ |
|
10 |
|
11 #include "nspr.h" |
|
12 #include "mcom_db.h" |
|
13 #include "pcertt.h" |
|
14 #include "prtypes.h" |
|
15 |
|
16 /* |
|
17 * Handle structure for open certificate databases |
|
18 */ |
|
19 struct NSSLOWCERTCertDBHandleStr { |
|
20 DB *permCertDB; |
|
21 PZMonitor *dbMon; |
|
22 PRBool dbVerify; |
|
23 PRInt32 ref; /* reference count */ |
|
24 }; |
|
25 |
|
26 #ifdef DBM_USING_NSPR |
|
27 #define NO_RDONLY PR_RDONLY |
|
28 #define NO_RDWR PR_RDWR |
|
29 #define NO_CREATE (PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE) |
|
30 #else |
|
31 #define NO_RDONLY O_RDONLY |
|
32 #define NO_RDWR O_RDWR |
|
33 #define NO_CREATE (O_RDWR | O_CREAT | O_TRUNC) |
|
34 #endif |
|
35 |
|
36 typedef DB * (*rdbfunc)(const char *appName, const char *prefix, |
|
37 const char *type, int flags); |
|
38 typedef int (*rdbstatusfunc)(void); |
|
39 |
|
40 #define RDB_FAIL 1 |
|
41 #define RDB_RETRY 2 |
|
42 |
|
43 DB * rdbopen(const char *appName, const char *prefix, |
|
44 const char *type, int flags, int *status); |
|
45 |
|
46 DB *dbsopen (const char *dbname , int flags, int mode, DBTYPE type, |
|
47 const void * appData); |
|
48 SECStatus db_Copy(DB *dest,DB *src); |
|
49 int db_InitComplete(DB *db); |
|
50 |
|
51 #endif |