Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* |
michael@0 | 2 | * private.h - Private data structures for the software token library |
michael@0 | 3 | * |
michael@0 | 4 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef _KEYDBI_H_ |
michael@0 | 9 | #define _KEYDBI_H_ |
michael@0 | 10 | |
michael@0 | 11 | #include "nspr.h" |
michael@0 | 12 | #include "seccomon.h" |
michael@0 | 13 | #include "mcom_db.h" |
michael@0 | 14 | |
michael@0 | 15 | /* |
michael@0 | 16 | * Handle structure for open key databases |
michael@0 | 17 | */ |
michael@0 | 18 | struct NSSLOWKEYDBHandleStr { |
michael@0 | 19 | DB *db; |
michael@0 | 20 | DB *updatedb; /* used when updating an old version */ |
michael@0 | 21 | SECItem *global_salt; /* password hashing salt for this db */ |
michael@0 | 22 | int version; /* version of the database */ |
michael@0 | 23 | char *appname; /* multiaccess app name */ |
michael@0 | 24 | char *dbname; /* name of the openned DB */ |
michael@0 | 25 | PRBool readOnly; /* is the DB read only */ |
michael@0 | 26 | PRLock *lock; |
michael@0 | 27 | PRInt32 ref; /* reference count */ |
michael@0 | 28 | }; |
michael@0 | 29 | |
michael@0 | 30 | /* |
michael@0 | 31 | ** Typedef for callback for traversing key database. |
michael@0 | 32 | ** "key" is the key used to index the data in the database (nickname) |
michael@0 | 33 | ** "data" is the key data |
michael@0 | 34 | ** "pdata" is the user's data |
michael@0 | 35 | */ |
michael@0 | 36 | typedef SECStatus (* NSSLOWKEYTraverseKeysFunc)(DBT *key, DBT *data, void *pdata); |
michael@0 | 37 | |
michael@0 | 38 | |
michael@0 | 39 | SEC_BEGIN_PROTOS |
michael@0 | 40 | |
michael@0 | 41 | /* |
michael@0 | 42 | ** Traverse the entire key database, and pass the nicknames and keys to a |
michael@0 | 43 | ** user supplied function. |
michael@0 | 44 | ** "f" is the user function to call for each key |
michael@0 | 45 | ** "udata" is the user's data, which is passed through to "f" |
michael@0 | 46 | */ |
michael@0 | 47 | extern SECStatus nsslowkey_TraverseKeys(NSSLOWKEYDBHandle *handle, |
michael@0 | 48 | NSSLOWKEYTraverseKeysFunc f, |
michael@0 | 49 | void *udata); |
michael@0 | 50 | |
michael@0 | 51 | SEC_END_PROTOS |
michael@0 | 52 | |
michael@0 | 53 | #endif /* _KEYDBI_H_ */ |