2
* The contents of this file are subject to the Mozilla Public
3
* License Version 1.1 (the "License"); you may not use this file
4
* except in compliance with the License. You may obtain a copy of
5
* the License at http://www.mozilla.org/MPL/
7
* Software distributed under the License is distributed on an "AS
8
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9
* implied. See the License for the specific language governing
10
* rights and limitations under the License.
12
* The Original Code is the Netscape security libraries.
14
* The Initial Developer of the Original Code is Netscape
15
* Communications Corporation. Portions created by Netscape are
16
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
21
* Alternatively, the contents of this file may be used under the
22
* terms of the GNU General Public License Version 2 or later (the
23
* "GPL"), in which case the provisions of the GPL are applicable
24
* instead of those above. If you wish to allow use of your
25
* version of this file only under the terms of the GPL and not to
26
* allow others to use your version of this file under the MPL,
27
* indicate your decision by deleting the provisions above and
28
* replace them with the notice and other provisions required by
29
* the GPL. If you do not delete the provisions above, a recipient
30
* may use your version of this file under either the MPL or the
38
static const char BASE_CVS_ID[] = "@(#) $RCSfile: base.h,v $ $Revision: 1.15 $ $Date: 2002/04/04 16:14:26 $ $Name: FIREFOX_1_0_RELEASE $";
44
* This header file contains basic prototypes and preprocessor
45
* definitions used throughout nss but not available publicly.
54
#endif /* NSSBASE_H */
64
* The nonpublic methods relating to this type are:
66
* nssArena_Create -- constructor
76
* Additionally, there are some preprocessor macros:
81
* In debug builds, the following calls are available:
83
* nssArena_verifyPointer
84
* nssArena_registerDestructor
85
* nssArena_deregisterDestructor
87
* The following preprocessor macro is also always available:
89
* nssArena_VERIFYPOINTER
91
* A constant PLHashAllocOps structure is available for users
92
* of the NSPL PLHashTable routines.
94
* nssArenaHashAllocOps
100
* This routine creates a new memory arena. This routine may return
101
* NULL upon error, in which case it will have set an error on the
104
* The error may be one of the following values:
105
* NSS_ERROR_NO_MEMORY
109
* A pointer to an NSSArena upon success
114
* Arenas can be named upon creation; this is mostly of use when
115
* debugging. Should we expose that here, allowing an optional
116
* "const char *name" argument? Should the public version of this
117
* call (NSSArena_Create) have it too?
120
NSS_EXTERN NSSArena *
126
extern const NSSError NSS_ERROR_NO_MEMORY;
131
* This routine will destroy the specified arena, freeing all memory
132
* allocated from it. This routine returns a PRStatus value; if
133
* successful, it will return PR_SUCCESS. If unsuccessful, it will
134
* set an error on the error stack and return PR_FAILURE.
136
* The error may be one of the following values:
137
* NSS_ERROR_INVALID_ARENA
150
extern const NSSError NSS_ERROR_INVALID_ARENA;
155
* This routine "marks" the current state of an arena. Space
156
* allocated after the arena has been marked can be freed by
157
* releasing the arena back to the mark with nssArena_Release,
158
* or committed by calling nssArena_Unmark. When successful,
159
* this routine returns a valid nssArenaMark pointer. This
160
* routine may return NULL upon error, in which case it will
161
* have set an error on the error stack.
163
* The error may be one of the following values:
164
* NSS_ERROR_INVALID_ARENA
165
* NSS_ERROR_NO_MEMORY
166
* NSS_ERROR_ARENA_MARKED_BY_ANOTHER_THREAD
170
* An nssArenaMark pointer upon success
173
NSS_EXTERN nssArenaMark *
179
extern const NSSError NSS_ERROR_INVALID_ARENA;
180
extern const NSSError NSS_ERROR_NO_MEMORY;
181
extern const NSSError NSS_ERROR_ARENA_MARKED_BY_ANOTHER_THREAD;
186
* This routine invalidates and releases all memory allocated from
187
* the specified arena after the point at which the specified mark
188
* was obtained. This routine returns a PRStatus value; if successful,
189
* it will return PR_SUCCESS. If unsuccessful, it will set an error
190
* on the error stack and return PR_FAILURE.
192
* The error may be one of the following values:
193
* NSS_ERROR_INVALID_ARENA
194
* NSS_ERROR_INVALID_ARENA_MARK
195
* NSS_ERROR_ARENA_MARKED_BY_ANOTHER_THREAD
206
nssArenaMark *arenaMark
209
extern const NSSError NSS_ERROR_INVALID_ARENA;
210
extern const NSSError NSS_ERROR_INVALID_ARENA_MARK;
215
* This routine "commits" the indicated mark and any marks after
216
* it, making them unreleasable. Note that any earlier marks can
217
* still be released, and such a release will invalidate these
218
* later unmarked regions. If an arena is to be safely shared by
219
* more than one thread, all marks must be either released or
220
* unmarked. This routine returns a PRStatus value; if successful,
221
* it will return PR_SUCCESS. If unsuccessful, it will set an error
222
* on the error stack and return PR_FAILURE.
224
* The error may be one of the following values:
225
* NSS_ERROR_INVALID_ARENA
226
* NSS_ERROR_INVALID_ARENA_MARK
227
* NSS_ERROR_ARENA_MARKED_BY_ANOTHER_THREAD
238
nssArenaMark *arenaMark
241
extern const NSSError NSS_ERROR_INVALID_ARENA;
242
extern const NSSError NSS_ERROR_INVALID_ARENA_MARK;
243
extern const NSSError NSS_ERROR_ARENA_MARKED_BY_ANOTHER_THREAD;
245
#ifdef ARENA_DESTRUCTOR_LIST
248
* nssArena_registerDestructor
250
* This routine stores a pointer to a callback and an arbitrary
251
* pointer-sized argument in the arena, at the current point in
252
* the mark stack. If the arena is destroyed, or an "earlier"
253
* mark is released, then this destructor will be called at that
254
* time. Note that the destructor will be called with the arena
255
* locked, which means the destructor may free memory in that
256
* arena, but it may not allocate or cause to be allocated any
257
* memory. This callback facility was included to support our
258
* debug-version pointer-tracker feature; overuse runs counter to
259
* the the original intent of arenas. This routine returns a
260
* PRStatus value; if successful, it will return PR_SUCCESS. If
261
* unsuccessful, it will set an error on the error stack and
264
* The error may be one of the following values:
265
* NSS_ERROR_INVALID_ARENA
266
* NSS_ERROR_NO_MEMORY
274
nssArena_registerDestructor
277
void (*destructor)(void *argument),
281
extern const NSSError NSS_ERROR_INVALID_ARENA;
282
extern const NSSError NSS_ERROR_NO_MEMORY;
285
* nssArena_deregisterDestructor
287
* This routine will remove the first destructor in the specified
288
* arena which has the specified destructor and argument values.
289
* The destructor will not be called. This routine returns a
290
* PRStatus value; if successful, it will return PR_SUCCESS. If
291
* unsuccessful, it will set an error on the error stack and
294
* The error may be one of the following values:
295
* NSS_ERROR_INVALID_ARENA
296
* NSS_ERROR_NOT_FOUND
304
nssArena_deregisterDestructor
307
void (*destructor)(void *argument),
311
extern const NSSError NSS_ERROR_INVALID_ITEM;
312
extern const NSSError NSS_ERROR_INVALID_ARENA;
313
extern const NSSError NSS_ERROR_NOT_FOUND;
315
#endif /* ARENA_DESTRUCTOR_LIST */
320
* This routine allocates and zeroes a section of memory of the
321
* size, and returns to the caller a pointer to that memory. If
322
* the optional arena argument is non-null, the memory will be
323
* obtained from that arena; otherwise, the memory will be obtained
324
* from the heap. This routine may return NULL upon error, in
325
* which case it will have set an error upon the error stack. The
326
* value specified for size may be zero; in which case a valid
327
* zero-length block of memory will be allocated. This block may
328
* be expanded by calling nss_ZRealloc.
330
* The error may be one of the following values:
331
* NSS_ERROR_INVALID_ARENA
332
* NSS_ERROR_NO_MEMORY
333
* NSS_ERROR_ARENA_MARKED_BY_ANOTHER_THREAD
337
* A pointer to the new segment of zeroed memory
347
extern const NSSError NSS_ERROR_INVALID_ARENA;
348
extern const NSSError NSS_ERROR_NO_MEMORY;
349
extern const NSSError NSS_ERROR_ARENA_MARKED_BY_ANOTHER_THREAD;
354
* If the specified pointer is non-null, then the region of memory
355
* to which it points -- which must have been allocated with
356
* nss_ZAlloc -- will be zeroed and released. This routine
357
* returns a PRStatus value; if successful, it will return PR_SUCCESS.
358
* If unsuccessful, it will set an error on the error stack and return
361
* The error may be one of the following values:
362
* NSS_ERROR_INVALID_POINTER
375
extern const NSSError NSS_ERROR_INVALID_POINTER;
380
* This routine reallocates a block of memory obtained by calling
381
* nss_ZAlloc or nss_ZRealloc. The portion of memory
382
* between the new and old sizes -- which is either being newly
383
* obtained or released -- is in either case zeroed. This routine
384
* may return NULL upon failure, in which case it will have placed
385
* an error on the error stack.
387
* The error may be one of the following values:
388
* NSS_ERROR_INVALID_POINTER
389
* NSS_ERROR_NO_MEMORY
390
* NSS_ERROR_ARENA_MARKED_BY_ANOTHER_THREAD
394
* A pointer to the replacement segment of memory
404
extern const NSSError NSS_ERROR_INVALID_POINTER;
405
extern const NSSError NSS_ERROR_NO_MEMORY;
406
extern const NSSError NSS_ERROR_ARENA_MARKED_BY_ANOTHER_THREAD;
411
* This preprocessor macro will allocate memory for a new object
412
* of the specified type with nss_ZAlloc, and will cast the
413
* return value appropriately. If the optional arena argument is
414
* non-null, the memory will be obtained from that arena; otherwise,
415
* the memory will be obtained from the heap. This routine may
416
* return NULL upon error, in which case it will have set an error
417
* upon the error stack.
419
* The error may be one of the following values:
420
* NSS_ERROR_INVALID_ARENA
421
* NSS_ERROR_NO_MEMORY
425
* A pointer to the new segment of zeroed memory
428
/* The following line exceeds 72 characters, but emacs screws up if I split it. */
429
#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
434
* This preprocessor macro will allocate memory for an array of
435
* new objects, and will cast the return value appropriately.
436
* If the optional arena argument is non-null, the memory will
437
* be obtained from that arena; otherwise, the memory will be
438
* obtained from the heap. This routine may return NULL upon
439
* error, in which case it will have set an error upon the error
440
* stack. The array size may be specified as zero.
442
* The error may be one of the following values:
443
* NSS_ERROR_INVALID_ARENA
444
* NSS_ERROR_NO_MEMORY
448
* A pointer to the new segment of zeroed memory
451
/* The following line exceeds 72 characters, but emacs screws up if I split it. */
452
#define nss_ZNEWARRAY(arenaOpt, type, quantity) ((type *)nss_ZAlloc((arenaOpt), sizeof(type) * (quantity)))
457
* This preprocessor macro will reallocate memory for an array of
458
* new objects, and will cast the return value appropriately.
459
* This routine may return NULL upon error, in which case it will
460
* have set an error upon the error stack.
462
* The error may be one of the following values:
463
* NSS_ERROR_INVALID_POINTER
464
* NSS_ERROR_NO_MEMORY
465
* NSS_ERROR_ARENA_MARKED_BY_ANOTHER_THREAD
469
* A pointer to the replacement segment of memory
471
#define nss_ZREALLOCARRAY(p, type, quantity) ((type *)nss_ZRealloc((p), sizeof(type) * (quantity)))
474
* nssArena_verifyPointer
476
* This method is only present in debug builds.
478
* If the specified pointer is a valid pointer to an NSSArena object,
479
* this routine will return PR_SUCCESS. Otherwise, it will put an
480
* error on the error stack and return PR_FAILURE.
482
* The error may be one of the following values:
483
* NSS_ERROR_INVALID_ARENA
486
* PR_SUCCESS if the pointer is valid
487
* PR_FAILURE if it isn't
492
nssArena_verifyPointer
494
const NSSArena *arena
497
extern const NSSError NSS_ERROR_INVALID_ARENA;
501
* nssArena_VERIFYPOINTER
503
* This macro is always available. In debug builds it will call
504
* nssArena_verifyPointer; in non-debug builds, it will merely
505
* check that the pointer is not null. Note that in non-debug
506
* builds it cannot place an error on the error stack.
509
* PR_SUCCESS if the pointer is valid
510
* PR_FAILURE if it isn't
514
#define nssArena_VERIFYPOINTER(p) nssArena_verifyPointer(p)
516
/* The following line exceeds 72 characters, but emacs screws up if I split it. */
517
#define nssArena_VERIFYPOINTER(p) (((NSSArena *)NULL == (p))?PR_FAILURE:PR_SUCCESS)
521
* nssArenaHashAllocOps
523
* This constant structure contains allocation callbacks designed for
524
* use with the NSPL routine PL_NewHashTable. For example:
526
* NSSArena *hashTableArena = nssArena_Create();
527
* PLHashTable *t = PL_NewHashTable(n, hasher, key_compare,
528
* value_compare, nssArenaHashAllocOps, hashTableArena);
531
NSS_EXTERN_DATA PLHashAllocOps nssArenaHashAllocOps;
536
* The nonpublic methods relating to the error stack are:
539
* nss_ClearErrorStack
545
* This routine places a new error code on the top of the calling
546
* thread's error stack. Calling this routine wiht an error code
547
* of zero will clear the error stack.
557
* nss_ClearErrorStack
559
* This routine clears the calling thread's error stack.
610
* nssUTF8_CaseIgnoreMatch
614
* nssUTF8_CopyIntoFixedBuffer
618
* nssUTF8_CaseIgnoreMatch
620
* Returns true if the two UTF8-encoded strings pointed to by the
621
* two specified NSSUTF8 pointers differ only in typcase.
623
* The error may be one of the following values:
624
* NSS_ERROR_INVALID_POINTER
627
* PR_TRUE if the strings match, ignoring case
628
* PR_FALSE if they don't
629
* PR_FALSE upon error
633
nssUTF8_CaseIgnoreMatch
643
* This routine duplicates the UTF8-encoded string pointed to by the
644
* specified NSSUTF8 pointer. If the optional arenaOpt argument is
645
* not null, the memory required will be obtained from that arena;
646
* otherwise, the memory required will be obtained from the heap.
647
* A pointer to the new string will be returned. In case of error,
648
* an error will be placed on the error stack and NULL will be
651
* The error may be one of the following values:
652
* NSS_ERROR_INVALID_POINTER
653
* NSS_ERROR_INVALID_ARENA
654
* NSS_ERROR_NO_MEMORY
665
* nssUTF8_PrintableMatch
667
* Returns true if the two Printable strings pointed to by the
668
* two specified NSSUTF8 pointers match when compared with the
669
* rules for Printable String (leading and trailing spaces are
670
* disregarded, extents of whitespace match irregardless of length,
671
* and case is not significant), then PR_TRUE will be returned.
672
* Otherwise, PR_FALSE will be returned. Upon failure, PR_FALSE
673
* will be returned. If the optional statusOpt argument is not
674
* NULL, then PR_SUCCESS or PR_FAILURE will be stored in that
677
* The error may be one of the following values:
678
* NSS_ERROR_INVALID_POINTER
681
* PR_TRUE if the strings match, ignoring case
682
* PR_FALSE if they don't
683
* PR_FALSE upon error
687
nssUTF8_PrintableMatch
697
* This routine returns the length in bytes (including the terminating
698
* null) of the UTF8-encoded string pointed to by the specified
699
* NSSUTF8 pointer. Zero is returned on error.
701
* The error may be one of the following values:
702
* NSS_ERROR_INVALID_POINTER
703
* NSS_ERROR_VALUE_TOO_LARGE
706
* nonzero size of the string
717
extern const NSSError NSS_ERROR_INVALID_POINTER;
718
extern const NSSError NSS_ERROR_VALUE_TOO_LARGE;
723
* This routine returns the length in characters (not including the
724
* terminating null) of the UTF8-encoded string pointed to by the
725
* specified NSSUTF8 pointer.
727
* The error may be one of the following values:
728
* NSS_ERROR_INVALID_POINTER
729
* NSS_ERROR_VALUE_TOO_LARGE
730
* NSS_ERROR_INVALID_STRING
733
* length of the string (which may be zero)
744
extern const NSSError NSS_ERROR_INVALID_POINTER;
745
extern const NSSError NSS_ERROR_VALUE_TOO_LARGE;
746
extern const NSSError NSS_ERROR_INVALID_STRING;
751
* This routine creates a UTF8 string from a string in some other
752
* format. Some types of string may include embedded null characters,
753
* so for them the length parameter must be used. For string types
754
* that are null-terminated, the length parameter is optional; if it
755
* is zero, it will be ignored. If the optional arena argument is
756
* non-null, the memory used for the new string will be obtained from
757
* that arena, otherwise it will be obtained from the heap. This
758
* routine may return NULL upon error, in which case it will have
759
* placed an error on the error stack.
761
* The error may be one of the following:
762
* NSS_ERROR_INVALID_POINTER
763
* NSS_ERROR_NO_MEMORY
764
* NSS_ERROR_UNSUPPORTED_TYPE
768
* A non-null pointer to a new UTF8 string otherwise
776
const void *inputString,
777
PRUint32 size /* in bytes, not characters */
780
extern const NSSError NSS_ERROR_INVALID_POINTER;
781
extern const NSSError NSS_ERROR_NO_MEMORY;
782
extern const NSSError NSS_ERROR_UNSUPPORTED_TYPE;
794
* nssUTF8_CopyIntoFixedBuffer
796
* This will copy a UTF8 string into a fixed-length buffer, making
797
* sure that the all characters are valid. Any remaining space will
798
* be padded with the specified ASCII character, typically either
804
extern const NSSError NSS_ERROR_INVALID_POINTER;
805
extern const NSSError NSS_ERROR_INVALID_ARGUMENT;
808
nssUTF8_CopyIntoFixedBuffer
832
* The goal is to provide a simple, optionally threadsafe, linked list
833
* class. Since NSS did not seem to use the circularity of PRCList
834
* much before, this provides a list that appears to be a linear,
835
* NULL-terminated list.
841
* If threadsafe is true, the list will be locked during modifications
864
nssListElementDestructorFunc destructor
868
* nssList_SetCompareFunction
870
* By default, two list elements will be compared by comparing their
871
* data pointers. By setting this function, the user can control
872
* how elements are compared.
875
nssList_SetCompareFunction
878
nssListCompareFunc compareFunc
882
* nssList_SetSortFunction
884
* Sort function to use for an ordered list.
887
nssList_SetSortFunction
890
nssListSortFunc sortFunc
906
* This will use the compare function to see if the element is already
919
* Uses the compare function to locate the element and remove it.
922
nssList_Remove(nssList *list, void *data);
927
* Uses the compare function to locate an element. Also serves as
949
* Fill rvArray, up to maxElements, with elements in the list. The
950
* array is NULL-terminated, so its allocated size must be maxElements + 1.
961
* nssList_CreateIterator
963
* Create an iterator for list traversal.
965
NSS_EXTERN nssListIterator *
966
nssList_CreateIterator
978
* nssListIterator_Destroy
981
nssListIterator_Destroy
983
nssListIterator *iter
987
* nssListIterator_Start
989
* Begin a list iteration. After this call, if the list is threadSafe,
990
* the list is *locked*.
993
nssListIterator_Start
995
nssListIterator *iter
999
* nssListIterator_Next
1001
* Continue a list iteration.
1004
nssListIterator_Next
1006
nssListIterator *iter
1010
* nssListIterator_Finish
1012
* Complete a list iteration. This *must* be called in order for the
1013
* lock to be released.
1016
nssListIterator_Finish
1018
nssListIterator *iter
1039
NSS_EXTERN nssHash *
1043
PRUint32 numBuckets,
1044
PLHashFunction keyHash,
1045
PLHashComparator keyCompare,
1046
PLHashComparator valueCompare
1049
NSS_EXTERN nssHash *
1050
nssHash_CreatePointer
1056
NSS_EXTERN nssHash *
1057
nssHash_CreateString
1063
NSS_EXTERN nssHash *
1085
extern const NSSError NSS_ERROR_HASH_COLLISION;
1146
nssHashIterator fcn,
1154
* This type and these methods are only present in debug builds.
1156
* The nonpublic methods relating to this type are:
1158
* nssPointerTracker_initialize
1159
* nssPointerTracker_finalize
1160
* nssPointerTracker_add
1161
* nssPointerTracker_remove
1162
* nssPointerTracker_verify
1166
* nssPointerTracker_initialize
1168
* This method is only present in debug builds.
1170
* This routine initializes an nssPointerTracker object. Note that
1171
* the object must have been declared *static* to guarantee that it
1172
* is in a zeroed state initially. This routine is idempotent, and
1173
* may even be safely called by multiple threads simultaneously with
1174
* the same argument. This routine returns a PRStatus value; if
1175
* successful, it will return PR_SUCCESS. On failure it will set an
1176
* error on the error stack and return PR_FAILURE.
1178
* The error may be one of the following values:
1179
* NSS_ERROR_NO_MEMORY
1188
nssPointerTracker_initialize
1190
nssPointerTracker *tracker
1193
extern const NSSError NSS_ERROR_NO_MEMORY;
1197
* nssPointerTracker_finalize
1199
* This method is only present in debug builds.
1201
* This routine returns the nssPointerTracker object to the pre-
1202
* initialized state, releasing all resources used by the object.
1203
* It will *NOT* destroy the objects being tracked by the pointer
1204
* (should any remain), and therefore cannot be used to "sweep up"
1205
* remaining objects. This routine returns a PRStatus value; if
1206
* successful, it will return PR_SUCCES. On failure it will set an
1207
* error on the error stack and return PR_FAILURE. If any objects
1208
* remain in the tracker when it is finalized, that will be treated
1211
* The error may be one of the following values:
1212
* NSS_ERROR_TRACKER_NOT_EMPTY
1221
nssPointerTracker_finalize
1223
nssPointerTracker *tracker
1226
extern const NSSError NSS_ERROR_TRACKER_NOT_EMPTY;
1230
* nssPointerTracker_add
1232
* This method is only present in debug builds.
1234
* This routine adds the specified pointer to the nssPointerTracker
1235
* object. It should be called in constructor objects to register
1236
* new valid objects. The nssPointerTracker is threadsafe, but this
1237
* call is not idempotent. This routine returns a PRStatus value;
1238
* if successful it will return PR_SUCCESS. On failure it will set
1239
* an error on the error stack and return PR_FAILURE.
1241
* The error may be one of the following values:
1242
* NSS_ERROR_NO_MEMORY
1243
* NSS_ERROR_TRACKER_NOT_INITIALIZED
1244
* NSS_ERROR_DUPLICATE_POINTER
1253
nssPointerTracker_add
1255
nssPointerTracker *tracker,
1259
extern const NSSError NSS_ERROR_NO_MEMORY;
1260
extern const NSSError NSS_ERROR_TRACKER_NOT_INITIALIZED;
1261
extern const NSSError NSS_ERROR_DUPLICATE_POINTER;
1265
* nssPointerTracker_remove
1267
* This method is only present in debug builds.
1269
* This routine removes the specified pointer from the
1270
* nssPointerTracker object. It does not call any destructor for the
1271
* object; rather, this should be called from the object's destructor.
1272
* The nssPointerTracker is threadsafe, but this call is not
1273
* idempotent. This routine returns a PRStatus value; if successful
1274
* it will return PR_SUCCESS. On failure it will set an error on the
1275
* error stack and return PR_FAILURE.
1277
* The error may be one of the following values:
1278
* NSS_ERROR_TRACKER_NOT_INITIALIZED
1279
* NSS_ERROR_POINTER_NOT_REGISTERED
1288
nssPointerTracker_remove
1290
nssPointerTracker *tracker,
1294
extern const NSSError NSS_ERROR_TRACKER_NOT_INITIALIZED;
1295
extern const NSSError NSS_ERROR_POINTER_NOT_REGISTERED;
1299
* nssPointerTracker_verify
1301
* This method is only present in debug builds.
1303
* This routine verifies that the specified pointer has been registered
1304
* with the nssPointerTracker object. The nssPointerTracker object is
1305
* threadsafe, and this call may be safely called from multiple threads
1306
* simultaneously with the same arguments. This routine returns a
1307
* PRStatus value; if the pointer is registered this will return
1308
* PR_SUCCESS. Otherwise it will set an error on the error stack and
1309
* return PR_FAILURE. Although the error is suitable for leaving on
1310
* the stack, callers may wish to augment the information available by
1311
* placing a more type-specific error on the stack.
1313
* The error may be one of the following values:
1314
* NSS_ERROR_POINTER_NOT_REGISTERED
1323
nssPointerTracker_verify
1325
nssPointerTracker *tracker,
1329
extern const NSSError NSS_ERROR_POINTER_NOT_REGISTERED;
1344
* NSS_ERROR_INVALID_POINTER
1348
* The destination pointer on success
1359
extern const NSSError NSS_ERROR_INVALID_POINTER;
1365
* NSS_ERROR_INVALID_POINTER
1369
* The destination pointer on success
1380
extern const NSSError NSS_ERROR_INVALID_POINTER;
1386
* NSS_ERROR_INVALID_POINTER
1389
* PR_TRUE if they match
1390
* PR_FALSE if they don't
1391
* PR_FALSE upon error
1403
extern const NSSError NSS_ERROR_INVALID_POINTER;
1405
#define nsslibc_offsetof(str, memb) ((PRPtrdiff)(&(((str *)0)->memb)))
1408
* nss_NewThreadPrivateIndex
1413
nss_NewThreadPrivateIndex
1416
PRThreadPrivateDTOR dtor
1420
* nss_GetThreadPrivate
1425
nss_GetThreadPrivate
1431
* nss_SetThreadPrivate
1436
nss_SetThreadPrivate