comparison nss/lib/softoken/legacydb/keydbi.h @ 3:150b72113545

Add DBM and legacydb support
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 05 Aug 2014 18:32:02 +0200
parents
children
comparison
equal deleted inserted replaced
2:a945361df361 3:150b72113545
1 /*
2 * private.h - Private data structures for the software token library
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7
8 #ifndef _KEYDBI_H_
9 #define _KEYDBI_H_
10
11 #include "nspr.h"
12 #include "seccomon.h"
13 #include "mcom_db.h"
14
15 /*
16 * Handle structure for open key databases
17 */
18 struct NSSLOWKEYDBHandleStr {
19 DB *db;
20 DB *updatedb; /* used when updating an old version */
21 SECItem *global_salt; /* password hashing salt for this db */
22 int version; /* version of the database */
23 char *appname; /* multiaccess app name */
24 char *dbname; /* name of the openned DB */
25 PRBool readOnly; /* is the DB read only */
26 PRLock *lock;
27 PRInt32 ref; /* reference count */
28 };
29
30 /*
31 ** Typedef for callback for traversing key database.
32 ** "key" is the key used to index the data in the database (nickname)
33 ** "data" is the key data
34 ** "pdata" is the user's data
35 */
36 typedef SECStatus (* NSSLOWKEYTraverseKeysFunc)(DBT *key, DBT *data, void *pdata);
37
38
39 SEC_BEGIN_PROTOS
40
41 /*
42 ** Traverse the entire key database, and pass the nicknames and keys to a
43 ** user supplied function.
44 ** "f" is the user function to call for each key
45 ** "udata" is the user's data, which is passed through to "f"
46 */
47 extern SECStatus nsslowkey_TraverseKeys(NSSLOWKEYDBHandle *handle,
48 NSSLOWKEYTraverseKeysFunc f,
49 void *udata);
50
51 SEC_END_PROTOS
52
53 #endif /* _KEYDBI_H_ */
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)