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