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
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/
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
15 * The Original Code is the Netscape Portable Runtime (NSPR).
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.
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.
36 * ***** END LICENSE BLOCK ***** */
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.
45 #if !defined(PROTYPES_H)
48 typedef PRUintn uintn;
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.
63 * BeOS defines all the int types below in its standard header
67 #include <support/SupportDefs.h>
71 * SVR4 typedef of uint is commonly found on UNIX machines.
73 * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h)
74 * defines the types int8, int16, int32, and int64.
76 * On OS/2, sys/types.h defines uint.
78 #if defined(XP_UNIX) || defined(XP_OS2)
79 #include <sys/types.h>
82 /* model.h on HP-UX defines int8, int16, and int32. */
91 #if !defined(XP_BEOS) && !defined(XP_OS2) && !defined(XP_UNIX) || defined(NTO)
100 typedef PRUint64 uint64;
107 #if !defined(XP_BEOS)
108 #if !defined(_WIN32) && !defined(XP_OS2) && !defined(NTO)
109 typedef PRUint32 uint32;
111 typedef unsigned long uint32;
119 #if !defined(XP_BEOS)
120 typedef PRUint16 uint16;
127 #if !defined(XP_BEOS)
128 typedef PRUint8 uint8;
135 #if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES)
136 typedef PRInt64 int64;
143 #if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
145 #if !defined(_WIN32) && !defined(XP_OS2) && !defined(NTO)
146 typedef PRInt32 int32;
156 #if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
158 typedef PRInt16 int16;
165 #if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
170 typedef PRFloat64 float64;
171 typedef PRUptrdiff uptrdiff_t;
172 typedef PRUword uprword_t;
173 typedef PRWord prword_t;
177 #define TEST_BIT PR_TEST_BIT
178 #define SET_BIT PR_SET_BIT
179 #define CLEAR_BIT PR_CLEAR_BIT
181 /* Re: prarena.h->plarena.h */
182 #define PRArena PLArena
183 #define PRArenaPool PLArenaPool
184 #define PRArenaStats PLArenaStats
185 #define PR_ARENA_ALIGN PL_ARENA_ALIGN
186 #define PR_INIT_ARENA_POOL PL_INIT_ARENA_POOL
187 #define PR_ARENA_ALLOCATE PL_ARENA_ALLOCATE
188 #define PR_ARENA_GROW PL_ARENA_GROW
189 #define PR_ARENA_MARK PL_ARENA_MARK
190 #define PR_CLEAR_UNUSED PL_CLEAR_UNUSED
191 #define PR_CLEAR_ARENA PL_CLEAR_ARENA
192 #define PR_ARENA_RELEASE PL_ARENA_RELEASE
193 #define PR_COUNT_ARENA PL_COUNT_ARENA
194 #define PR_ARENA_DESTROY PL_ARENA_DESTROY
195 #define PR_InitArenaPool PL_InitArenaPool
196 #define PR_FreeArenaPool PL_FreeArenaPool
197 #define PR_FinishArenaPool PL_FinishArenaPool
198 #define PR_CompactArenaPool PL_CompactArenaPool
199 #define PR_ArenaFinish PL_ArenaFinish
200 #define PR_ArenaAllocate PL_ArenaAllocate
201 #define PR_ArenaGrow PL_ArenaGrow
202 #define PR_ArenaRelease PL_ArenaRelease
203 #define PR_ArenaCountAllocation PL_ArenaCountAllocation
204 #define PR_ArenaCountInplaceGrowth PL_ArenaCountInplaceGrowth
205 #define PR_ArenaCountGrowth PL_ArenaCountGrowth
206 #define PR_ArenaCountRelease PL_ArenaCountRelease
207 #define PR_ArenaCountRetract PL_ArenaCountRetract
209 /* Re: prhash.h->plhash.h */
210 #define PRHashEntry PLHashEntry
211 #define PRHashTable PLHashTable
212 #define PRHashNumber PLHashNumber
213 #define PRHashFunction PLHashFunction
214 #define PRHashComparator PLHashComparator
215 #define PRHashEnumerator PLHashEnumerator
216 #define PRHashAllocOps PLHashAllocOps
217 #define PR_NewHashTable PL_NewHashTable
218 #define PR_HashTableDestroy PL_HashTableDestroy
219 #define PR_HashTableRawLookup PL_HashTableRawLookup
220 #define PR_HashTableRawAdd PL_HashTableRawAdd
221 #define PR_HashTableRawRemove PL_HashTableRawRemove
222 #define PR_HashTableAdd PL_HashTableAdd
223 #define PR_HashTableRemove PL_HashTableRemove
224 #define PR_HashTableEnumerateEntries PL_HashTableEnumerateEntries
225 #define PR_HashTableLookup PL_HashTableLookup
226 #define PR_HashTableDump PL_HashTableDump
227 #define PR_HashString PL_HashString
228 #define PR_CompareStrings PL_CompareStrings
229 #define PR_CompareValues PL_CompareValues
231 #endif /* !defined(PROTYPES_H) */