1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* 3 * The contents of this file are subject to the Mozilla Public 4 * License Version 1.1 (the "License"); you may not use this file 5 * except in compliance with the License. You may obtain a copy of 6 * the License at http://www.mozilla.org/MPL/ 7 * 8 * Software distributed under the License is distributed on an "AS 9 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 10 * implied. See the License for the specific language governing 11 * rights and limitations under the License. 12 * 13 * The Original Code is the Netscape Portable Runtime (NSPR). 14 * 15 * The Initial Developer of the Original Code is Netscape 16 * Communications Corporation. Portions created by Netscape are 17 * Copyright (C) 1998-2000 Netscape Communications Corporation. All 18 * Rights Reserved. 19 * 20 * Contributor(s): 21 * 22 * Alternatively, the contents of this file may be used under the 23 * terms of the GNU General Public License Version 2 or later (the 24 * "GPL"), in which case the provisions of the GPL are applicable 25 * instead of those above. If you wish to allow use of your 26 * version of this file only under the terms of the GPL and not to 27 * allow others to use your version of this file under the MPL, 28 * indicate your decision by deleting the provisions above and 29 * replace them with the notice and other provisions required by 30 * the GPL. If you do not delete the provisions above, a recipient 31 * may use your version of this file under either the MPL or the 32 * GPL. 33 */ 34 35 /* 36 * This header typedefs the old 'native' types to the new PR<type>s. 37 * These definitions are scheduled to be eliminated at the earliest 38 * possible time. The NSPR API is implemented and documented using 39 * the new definitions. 40 */ 41 42 #if !defined(PROTYPES_H) 43 #define PROTYPES_H 44 45 typedef PRUintn uintn; 46 #ifndef _XP_Core_ 47 typedef PRIntn intn; 48 #endif 49 50 /* 51 * It is trickier to define uint, int8, uint8, int16, uint16, 52 * int32, uint32, int64, and uint64 because some of these int 53 * types are defined by standard header files on some platforms. 54 * Our strategy here is to include all such standard headers 55 * first, and then define these int types only if they are not 56 * defined by those standard headers. 57 */ 58 59 /* 60 * BeOS defines all the int types below in its standard header 61 * file SupportDefs.h. 62 */ 63 #ifdef XP_BEOS 64 #include <support/SupportDefs.h> 65 #endif 66 67 /* 68 * OpenVMS defines all the int types below in its standard 69 * header files ints.h and types.h. 70 */ 71 #ifdef VMS 72 #include <ints.h> 73 #include <types.h> 74 #endif 75 76 /* 77 * SVR4 typedef of uint is commonly found on UNIX machines. 78 * 79 * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h) 80 * defines the types int8, int16, int32, and int64. 81 */ 82 #ifdef XP_UNIX 83 #include <sys/types.h> 84 #endif 85 86 /* model.h on HP-UX defines int8, int16, and int32. */ 87 #ifdef HPUX 88 #include <model.h> 89 #endif 90 91 /* 92 * uint 93 */ 94 95 #if !defined(XP_BEOS) && !defined(VMS) \ 96 && !defined(XP_UNIX) || defined(NTO) 97 typedef PRUintn uint; 98 #endif 99 100 /* 101 * uint64 102 */ 103 104 #if !defined(XP_BEOS) && !defined(VMS) 105 typedef PRUint64 uint64; 106 #endif 107 108 /* 109 * uint32 110 */ 111 112 #if !defined(XP_BEOS) && !defined(VMS) 113 #if !defined(XP_MAC) && !defined(_WIN32) && !defined(XP_OS2) && !defined(NTO) 114 typedef PRUint32 uint32; 115 #else 116 typedef unsigned long uint32; 117 #endif 118 #endif 119 120 /* 121 * uint16 122 */ 123 124 #if !defined(XP_BEOS) && !defined(VMS) 125 typedef PRUint16 uint16; 126 #endif 127 128 /* 129 * uint8 130 */ 131 132 #if !defined(XP_BEOS) && !defined(VMS) 133 typedef PRUint8 uint8; 134 #endif 135 136 /* 137 * int64 138 */ 139 140 #if !defined(XP_BEOS) && !defined(VMS) \ 141 && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) 142 typedef PRInt64 int64; 143 #endif 144 145 /* 146 * int32 147 */ 148 149 #if !defined(XP_BEOS) && !defined(VMS) \ 150 && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \ 151 && !defined(HPUX) 152 #if !defined(WIN32) || !defined(_WINSOCK2API_) /* defines its own "int32" */ 153 #if !defined(XP_MAC) && !defined(_WIN32) && !defined(XP_OS2) && !defined(NTO) 154 typedef PRInt32 int32; 155 #else 156 typedef long int32; 157 #endif 158 #endif 159 #endif 160 161 /* 162 * int16 163 */ 164 165 #if !defined(XP_BEOS) && !defined(VMS) \ 166 && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \ 167 && !defined(HPUX) 168 typedef PRInt16 int16; 169 #endif 170 171 /* 172 * int8 173 */ 174 175 #if !defined(XP_BEOS) && !defined(VMS) \ 176 && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \ 177 && !defined(HPUX) 178 typedef PRInt8 int8; 179 #endif 180 181 typedef PRFloat64 float64; 182 typedef PRUptrdiff uptrdiff_t; 183 typedef PRUword uprword_t; 184 typedef PRWord prword_t; 185 186 187 /* Re: prbit.h */ 188 #define TEST_BIT PR_TEST_BIT 189 #define SET_BIT PR_SET_BIT 190 #define CLEAR_BIT PR_CLEAR_BIT 191 192 /* Re: prarena.h->plarena.h */ 193 #define PRArena PLArena 194 #define PRArenaPool PLArenaPool 195 #define PRArenaStats PLArenaStats 196 #define PR_ARENA_ALIGN PL_ARENA_ALIGN 197 #define PR_INIT_ARENA_POOL PL_INIT_ARENA_POOL 198 #define PR_ARENA_ALLOCATE PL_ARENA_ALLOCATE 199 #define PR_ARENA_GROW PL_ARENA_GROW 200 #define PR_ARENA_MARK PL_ARENA_MARK 201 #define PR_CLEAR_UNUSED PL_CLEAR_UNUSED 202 #define PR_CLEAR_ARENA PL_CLEAR_ARENA 203 #define PR_ARENA_RELEASE PL_ARENA_RELEASE 204 #define PR_COUNT_ARENA PL_COUNT_ARENA 205 #define PR_ARENA_DESTROY PL_ARENA_DESTROY 206 #define PR_InitArenaPool PL_InitArenaPool 207 #define PR_FreeArenaPool PL_FreeArenaPool 208 #define PR_FinishArenaPool PL_FinishArenaPool 209 #define PR_CompactArenaPool PL_CompactArenaPool 210 #define PR_ArenaFinish PL_ArenaFinish 211 #define PR_ArenaAllocate PL_ArenaAllocate 212 #define PR_ArenaGrow PL_ArenaGrow 213 #define PR_ArenaRelease PL_ArenaRelease 214 #define PR_ArenaCountAllocation PL_ArenaCountAllocation 215 #define PR_ArenaCountInplaceGrowth PL_ArenaCountInplaceGrowth 216 #define PR_ArenaCountGrowth PL_ArenaCountGrowth 217 #define PR_ArenaCountRelease PL_ArenaCountRelease 218 #define PR_ArenaCountRetract PL_ArenaCountRetract 219 220 /* Re: prhash.h->plhash.h */ 221 #define PRHashEntry PLHashEntry 222 #define PRHashTable PLHashTable 223 #define PRHashNumber PLHashNumber 224 #define PRHashFunction PLHashFunction 225 #define PRHashComparator PLHashComparator 226 #define PRHashEnumerator PLHashEnumerator 227 #define PRHashAllocOps PLHashAllocOps 228 #define PR_NewHashTable PL_NewHashTable 229 #define PR_HashTableDestroy PL_HashTableDestroy 230 #define PR_HashTableRawLookup PL_HashTableRawLookup 231 #define PR_HashTableRawAdd PL_HashTableRawAdd 232 #define PR_HashTableRawRemove PL_HashTableRawRemove 233 #define PR_HashTableAdd PL_HashTableAdd 234 #define PR_HashTableRemove PL_HashTableRemove 235 #define PR_HashTableEnumerateEntries PL_HashTableEnumerateEntries 236 #define PR_HashTableLookup PL_HashTableLookup 237 #define PR_HashTableDump PL_HashTableDump 238 #define PR_HashString PL_HashString 239 #define PR_CompareStrings PL_CompareStrings 240 #define PR_CompareValues PL_CompareValues 241 242 #if defined(XP_MAC) 243 #ifndef TRUE /* Mac standard is lower case true */ 244 #define TRUE 1 245 #endif 246 #ifndef FALSE /* Mac standard is lower case false */ 247 #define FALSE 0 248 #endif 249 #endif 250 251 #endif /* !defined(PROTYPES_H) */ 252