OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 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 | 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/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 /* | 5 /* |
6 * secport.h - portability interfaces for security libraries | 6 * secport.h - portability interfaces for security libraries |
7 */ | 7 */ |
8 | 8 |
9 #ifndef _SECPORT_H_ | 9 #ifndef _SECPORT_H_ |
10 #define _SECPORT_H_ | 10 #define _SECPORT_H_ |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 size_t oldsize, size_t newsize); | 80 size_t oldsize, size_t newsize); |
81 extern void *PORT_ArenaMark(PLArenaPool *arena); | 81 extern void *PORT_ArenaMark(PLArenaPool *arena); |
82 extern void PORT_ArenaRelease(PLArenaPool *arena, void *mark); | 82 extern void PORT_ArenaRelease(PLArenaPool *arena, void *mark); |
83 extern void PORT_ArenaZRelease(PLArenaPool *arena, void *mark); | 83 extern void PORT_ArenaZRelease(PLArenaPool *arena, void *mark); |
84 extern void PORT_ArenaUnmark(PLArenaPool *arena, void *mark); | 84 extern void PORT_ArenaUnmark(PLArenaPool *arena, void *mark); |
85 extern char *PORT_ArenaStrdup(PLArenaPool *arena, const char *str); | 85 extern char *PORT_ArenaStrdup(PLArenaPool *arena, const char *str); |
86 | 86 |
87 SEC_END_PROTOS | 87 SEC_END_PROTOS |
88 | 88 |
89 #define PORT_Assert PR_ASSERT | 89 #define PORT_Assert PR_ASSERT |
| 90 /* This runs a function that should return SECSuccess. |
| 91 * Intended for NSS internal use only. |
| 92 * The return value is asserted in a debug build, otherwise it is ignored. |
| 93 * This is no substitute for proper error handling. It is OK only if you |
| 94 * have ensured that the function cannot fail by other means such as checking |
| 95 * prerequisites. In that case this can be used as a safeguard against |
| 96 * unexpected changes in a function. |
| 97 */ |
| 98 #ifdef DEBUG |
| 99 #define PORT_CheckSuccess(f) PR_ASSERT((f) == SECSuccess) |
| 100 #else |
| 101 #define PORT_CheckSuccess(f) (f) |
| 102 #endif |
90 #define PORT_ZNew(type) (type*)PORT_ZAlloc(sizeof(type)) | 103 #define PORT_ZNew(type) (type*)PORT_ZAlloc(sizeof(type)) |
91 #define PORT_New(type) (type*)PORT_Alloc(sizeof(type)) | 104 #define PORT_New(type) (type*)PORT_Alloc(sizeof(type)) |
92 #define PORT_ArenaNew(poolp, type) \ | 105 #define PORT_ArenaNew(poolp, type) \ |
93 (type*) PORT_ArenaAlloc(poolp, sizeof(type)) | 106 (type*) PORT_ArenaAlloc(poolp, sizeof(type)) |
94 #define PORT_ArenaZNew(poolp, type) \ | 107 #define PORT_ArenaZNew(poolp, type) \ |
95 (type*) PORT_ArenaZAlloc(poolp, sizeof(type)) | 108 (type*) PORT_ArenaZAlloc(poolp, sizeof(type)) |
96 #define PORT_NewArray(type, num) \ | 109 #define PORT_NewArray(type, num) \ |
97 (type*) PORT_Alloc (sizeof(type)*(num)) | 110 (type*) PORT_Alloc (sizeof(type)*(num)) |
98 #define PORT_ZNewArray(type, num) \ | 111 #define PORT_ZNewArray(type, num) \ |
99 (type*) PORT_ZAlloc (sizeof(type)*(num)) | 112 (type*) PORT_ZAlloc (sizeof(type)*(num)) |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 */ | 256 */ |
244 PRLibrary * | 257 PRLibrary * |
245 PORT_LoadLibraryFromOrigin(const char* existingShLibName, | 258 PORT_LoadLibraryFromOrigin(const char* existingShLibName, |
246 PRFuncPtr staticShLibFunc, | 259 PRFuncPtr staticShLibFunc, |
247 const char *newShLibName); | 260 const char *newShLibName); |
248 #endif /* NSS_STATIC */ | 261 #endif /* NSS_STATIC */ |
249 | 262 |
250 SEC_END_PROTOS | 263 SEC_END_PROTOS |
251 | 264 |
252 #endif /* _SECPORT_H_ */ | 265 #endif /* _SECPORT_H_ */ |
OLD | NEW |