1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/lib/softoken/legacydb/cdbhdl.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,51 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 +/* 1.8 + * cdbhdl.h - certificate database handle 1.9 + * private to the certdb module 1.10 + */ 1.11 +#ifndef _CDBHDL_H_ 1.12 +#define _CDBHDL_H_ 1.13 + 1.14 +#include "nspr.h" 1.15 +#include "mcom_db.h" 1.16 +#include "pcertt.h" 1.17 +#include "prtypes.h" 1.18 + 1.19 +/* 1.20 + * Handle structure for open certificate databases 1.21 + */ 1.22 +struct NSSLOWCERTCertDBHandleStr { 1.23 + DB *permCertDB; 1.24 + PZMonitor *dbMon; 1.25 + PRBool dbVerify; 1.26 + PRInt32 ref; /* reference count */ 1.27 +}; 1.28 + 1.29 +#ifdef DBM_USING_NSPR 1.30 +#define NO_RDONLY PR_RDONLY 1.31 +#define NO_RDWR PR_RDWR 1.32 +#define NO_CREATE (PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE) 1.33 +#else 1.34 +#define NO_RDONLY O_RDONLY 1.35 +#define NO_RDWR O_RDWR 1.36 +#define NO_CREATE (O_RDWR | O_CREAT | O_TRUNC) 1.37 +#endif 1.38 + 1.39 +typedef DB * (*rdbfunc)(const char *appName, const char *prefix, 1.40 + const char *type, int flags); 1.41 +typedef int (*rdbstatusfunc)(void); 1.42 + 1.43 +#define RDB_FAIL 1 1.44 +#define RDB_RETRY 2 1.45 + 1.46 +DB * rdbopen(const char *appName, const char *prefix, 1.47 + const char *type, int flags, int *status); 1.48 + 1.49 +DB *dbsopen (const char *dbname , int flags, int mode, DBTYPE type, 1.50 + const void * appData); 1.51 +SECStatus db_Copy(DB *dest,DB *src); 1.52 +int db_InitComplete(DB *db); 1.53 + 1.54 +#endif