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