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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/lib/softoken/legacydb/keydbi.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,53 @@
     1.4 +/*
     1.5 + * private.h - Private data structures for the software token library
     1.6 + *
     1.7 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    1.10 +
    1.11 +#ifndef _KEYDBI_H_
    1.12 +#define _KEYDBI_H_
    1.13 +
    1.14 +#include "nspr.h"
    1.15 +#include "seccomon.h"
    1.16 +#include "mcom_db.h"
    1.17 +
    1.18 +/*
    1.19 + * Handle structure for open key databases
    1.20 + */
    1.21 +struct NSSLOWKEYDBHandleStr {
    1.22 +    DB *db;
    1.23 +    DB *updatedb;		/* used when updating an old version */
    1.24 +    SECItem *global_salt;	/* password hashing salt for this db */
    1.25 +    int version;		/* version of the database */
    1.26 +    char *appname;		/* multiaccess app name */
    1.27 +    char *dbname;		/* name of the openned DB */
    1.28 +    PRBool readOnly;		/* is the DB read only */
    1.29 +    PRLock *lock;
    1.30 +    PRInt32 ref;		/* reference count */
    1.31 +};
    1.32 +
    1.33 +/*
    1.34 +** Typedef for callback for traversing key database.
    1.35 +**      "key" is the key used to index the data in the database (nickname)
    1.36 +**      "data" is the key data
    1.37 +**      "pdata" is the user's data 
    1.38 +*/
    1.39 +typedef SECStatus (* NSSLOWKEYTraverseKeysFunc)(DBT *key, DBT *data, void *pdata);
    1.40 +
    1.41 +
    1.42 +SEC_BEGIN_PROTOS
    1.43 +
    1.44 +/*
    1.45 +** Traverse the entire key database, and pass the nicknames and keys to a 
    1.46 +** user supplied function.
    1.47 +**      "f" is the user function to call for each key
    1.48 +**      "udata" is the user's data, which is passed through to "f"
    1.49 +*/
    1.50 +extern SECStatus nsslowkey_TraverseKeys(NSSLOWKEYDBHandle *handle, 
    1.51 +				NSSLOWKEYTraverseKeysFunc f,
    1.52 +				void *udata);
    1.53 +
    1.54 +SEC_END_PROTOS
    1.55 +
    1.56 +#endif /* _KEYDBI_H_ */

mercurial