security/nss/lib/softoken/legacydb/keydbi.h

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     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/. */
     8 #ifndef _KEYDBI_H_
     9 #define _KEYDBI_H_
    11 #include "nspr.h"
    12 #include "seccomon.h"
    13 #include "mcom_db.h"
    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 };
    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);
    39 SEC_BEGIN_PROTOS
    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);
    51 SEC_END_PROTOS
    53 #endif /* _KEYDBI_H_ */

mercurial