1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 /*
6  * Allow freebl and softoken to be loaded without util or NSPR.
7  *
8  * These symbols are overridden once real NSPR, and libutil are attached.
9  */
10 
11 #ifndef _STUBS_H
12 #define _STUBS_H_ 1
13 
14 #ifdef _LIBUTIL_H_
15 /* must be included before util */
16 /*#error stubs.h included too late */
17 #define MP_DIGITES(x) "stubs included too late"
18 #endif
19 
20 /* hide libutil rename */
21 #define _LIBUTIL_H_ 1
22 
23 #define PORT_Alloc PORT_Alloc_stub
24 #define PORT_ArenaAlloc PORT_ArenaAlloc_stub
25 #define PORT_ArenaZAlloc PORT_ArenaZAlloc_stub
26 #define PORT_Free PORT_Free_stub
27 #define PORT_FreeArena PORT_FreeArena_stub
28 #define PORT_GetError PORT_GetError_stub
29 #define PORT_NewArena PORT_NewArena_stub
30 #define PORT_SetError PORT_SetError_stub
31 #define PORT_ZAlloc PORT_ZAlloc_stub
32 #define PORT_ZFree PORT_ZFree_stub
33 #define PORT_ZAllocAligned PORT_ZAllocAligned_stub
34 #define PORT_ZAllocAlignedOffset PORT_ZAllocAlignedOffset_stub
35 
36 #define SECITEM_AllocItem SECITEM_AllocItem_stub
37 #define SECITEM_CompareItem SECITEM_CompareItem_stub
38 #define SECITEM_CopyItem SECITEM_CopyItem_stub
39 #define SECITEM_FreeItem SECITEM_FreeItem_stub
40 #define SECITEM_ZfreeItem SECITEM_ZfreeItem_stub
41 #define SECOID_FindOIDTag SECOID_FindOIDTag_stub
42 #define NSS_SecureMemcmp NSS_SecureMemcmp_stub
43 #define NSS_SecureMemcmpZero NSS_SecureMemcmpZero_stub
44 
45 #define PR_Assert PR_Assert_stub
46 #define PR_Access PR_Access_stub
47 #define PR_CallOnce PR_CallOnce_stub
48 #define PR_Close PR_Close_stub
49 #define PR_DestroyCondVar PR_DestroyCondVar_stub
50 #define PR_DestroyLock PR_DestroyLock_stub
51 #define PR_Free PR_Free_stub
52 #define PR_GetLibraryFilePathname PR_GetLibraryFilePathname_stub
53 #define PR_ImportPipe PR_ImportPipe_stub
54 #define PR_Lock PR_Lock_stub
55 #define PR_NewCondVar PR_NewCondVar_stub
56 #define PR_NewLock PR_NewLock_stub
57 #define PR_NotifyCondVar PR_NotifyCondVar_stub
58 #define PR_NotifyAllCondVar PR_NotifyAllCondVar_stub
59 #define PR_Open PR_Open_stub
60 #define PR_Read PR_Read_stub
61 #define PR_Seek PR_Seek_stub
62 #define PR_Sleep PR_Sleep_stub
63 #define PR_Unlock PR_Unlock_stub
64 #define PR_WaitCondVar PR_WaitCondVar_stub
65 #define PR_GetEnvSecure PR_GetEnvSecure_stub
66 
67 extern int FREEBL_InitStubs(void);
68 
69 #endif
70