andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: andre@0: #ifndef NSSBASET_H andre@0: #define NSSBASET_H andre@0: andre@0: /* andre@0: * nssbaset.h andre@0: * andre@0: * This file contains the most low-level, fundamental public types. andre@0: */ andre@0: andre@0: #include "nspr.h" andre@0: #include "nssilock.h" andre@0: andre@0: /* andre@0: * NSS_EXTERN, NSS_IMPLEMENT, NSS_EXTERN_DATA, NSS_IMPLEMENT_DATA andre@0: * andre@0: * NSS has its own versions of these NSPR macros, in a form which andre@0: * does not confuse ctags and other related utilities. NSPR andre@0: * defines these macros to take the type as an argument, because andre@0: * of certain OS requirements on platforms not supported by NSS. andre@0: */ andre@0: andre@0: #define DUMMY /* dummy */ andre@0: #define NSS_EXTERN extern andre@0: #define NSS_EXTERN_DATA extern andre@0: #define NSS_IMPLEMENT andre@0: #define NSS_IMPLEMENT_DATA andre@0: andre@0: PR_BEGIN_EXTERN_C andre@0: andre@0: /* andre@0: * NSSError andre@0: * andre@0: * Calls to NSS routines may result in one or more errors being placed andre@0: * on the calling thread's "error stack." Every possible error that andre@0: * may be returned from a function is declared where the function is andre@0: * prototyped. All errors are of the following type. andre@0: */ andre@0: andre@0: typedef PRInt32 NSSError; andre@0: andre@0: /* andre@0: * NSSArena andre@0: * andre@0: * Arenas are logical sets of heap memory, from which memory may be andre@0: * allocated. When an arena is destroyed, all memory allocated within andre@0: * that arena is implicitly freed. These arenas are thread-safe: andre@0: * an arena pointer may be used by multiple threads simultaneously. andre@0: * However, as they are not backed by shared memory, they may only be andre@0: * used within one process. andre@0: */ andre@0: andre@0: struct NSSArenaStr; andre@0: typedef struct NSSArenaStr NSSArena; andre@0: andre@0: /* andre@0: * NSSItem andre@0: * andre@0: * This is the basic type used to refer to an unconstrained datum of andre@0: * arbitrary size. andre@0: */ andre@0: andre@0: struct NSSItemStr { andre@0: void *data; andre@0: PRUint32 size; andre@0: }; andre@0: typedef struct NSSItemStr NSSItem; andre@0: andre@0: andre@0: /* andre@0: * NSSBER andre@0: * andre@0: * Data packed according to the Basic Encoding Rules of ASN.1. andre@0: */ andre@0: andre@0: typedef NSSItem NSSBER; andre@0: andre@0: /* andre@0: * NSSDER andre@0: * andre@0: * Data packed according to the Distinguished Encoding Rules of ASN.1; andre@0: * this form is also known as the Canonical Encoding Rules form (CER). andre@0: */ andre@0: andre@0: typedef NSSBER NSSDER; andre@0: andre@0: /* andre@0: * NSSBitString andre@0: * andre@0: * Some ASN.1 types use "bit strings," which are passed around as andre@0: * octet strings but whose length is counted in bits. We use this andre@0: * typedef of NSSItem to point out the occasions when the length andre@0: * is counted in bits, not octets. andre@0: */ andre@0: andre@0: typedef NSSItem NSSBitString; andre@0: andre@0: /* andre@0: * NSSUTF8 andre@0: * andre@0: * Character strings encoded in UTF-8, as defined by RFC 2279. andre@0: */ andre@0: andre@0: typedef char NSSUTF8; andre@0: andre@0: /* andre@0: * NSSASCII7 andre@0: * andre@0: * Character strings guaranteed to be 7-bit ASCII. andre@0: */ andre@0: andre@0: typedef char NSSASCII7; andre@0: andre@0: PR_END_EXTERN_C andre@0: andre@0: #endif /* NSSBASET_H */