1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6/*
7 * This header typedefs the old 'native' types to the new PR<type>s.
8 * These definitions are scheduled to be eliminated at the earliest
9 * possible time. The NSPR API is implemented and documented using
10 * the new definitions.
11 */
12
13#if !defined(PROTYPES_H)
14#define PROTYPES_H
15
16typedef PRUintn uintn;
17#ifndef _XP_Core_
18typedef PRIntn intn;
19#endif
20
21/*
22 * It is trickier to define uint, int8, uint8, int16, uint16,
23 * int32, uint32, int64, and uint64 because some of these int
24 * types are defined by standard header files on some platforms.
25 * Our strategy here is to include all such standard headers
26 * first, and then define these int types only if they are not
27 * defined by those standard headers.
28 */
29
30/*
31 * BeOS defines all the int types below in its standard header
32 * file SupportDefs.h.
33 */
34#ifdef XP_BEOS
35#include <support/SupportDefs.h>
36#endif
37
38/*
39 * SVR4 typedef of uint is commonly found on UNIX machines.
40 *
41 * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h)
42 * defines the types int8, int16, int32, and int64.
43 *
44 * On OS/2, sys/types.h defines uint.
45 */
46#if defined(XP_UNIX) || defined(XP_OS2)
47#include <sys/types.h>
48#endif
49
50/* model.h on HP-UX defines int8, int16, and int32. */
51#ifdef HPUX
52#include <model.h>
53#endif
54
55/*
56 * uint
57 */
58
59#if !defined(XP_BEOS) && !defined(XP_OS2) && !defined(XP_UNIX) || defined(NTO)
60typedef PRUintn uint;
61#endif
62
63/*
64 * uint64
65 */
66
67#if !defined(XP_BEOS)
68typedef PRUint64 uint64;
69#endif
70
71/*
72 * uint32
73 */
74
75#if !defined(XP_BEOS)
76#if !defined(_WIN32) && !defined(XP_OS2) && !defined(NTO)
77typedef PRUint32 uint32;
78#else
79typedef unsigned long uint32;
80#endif
81#endif
82
83/*
84 * uint16
85 */
86
87#if !defined(XP_BEOS)
88typedef PRUint16 uint16;
89#endif
90
91/*
92 * uint8
93 */
94
95#if !defined(XP_BEOS)
96typedef PRUint8 uint8;
97#endif
98
99/*
100 * int64
101 */
102
103#if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES)
104typedef PRInt64 int64;
105#endif
106
107/*
108 * int32
109 */
110
111#if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
112 && !defined(HPUX)
113#if !defined(_WIN32) && !defined(XP_OS2) && !defined(NTO)
114typedef PRInt32 int32;
115#else
116typedef long int32;
117#endif
118#endif
119
120/*
121 * int16
122 */
123
124#if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
125 && !defined(HPUX)
126typedef PRInt16 int16;
127#endif
128
129/*
130 * int8
131 */
132
133#if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
134 && !defined(HPUX)
135typedef PRInt8 int8;
136#endif
137
138typedef PRFloat64 float64;
139typedef PRUptrdiff uptrdiff_t;
140typedef PRUword uprword_t;
141typedef PRWord prword_t;
142
143
144/* Re: prbit.h */
145#define TEST_BIT PR_TEST_BIT
146#define SET_BIT PR_SET_BIT
147#define CLEAR_BIT PR_CLEAR_BIT
148
149/* Re: prarena.h->plarena.h */
150#define PRArena PLArena
151#define PRArenaPool PLArenaPool
152#define PRArenaStats PLArenaStats
153#define PR_ARENA_ALIGN PL_ARENA_ALIGN
154#define PR_INIT_ARENA_POOL PL_INIT_ARENA_POOL
155#define PR_ARENA_ALLOCATE PL_ARENA_ALLOCATE
156#define PR_ARENA_GROW PL_ARENA_GROW
157#define PR_ARENA_MARK PL_ARENA_MARK
158#define PR_CLEAR_UNUSED PL_CLEAR_UNUSED
159#define PR_CLEAR_ARENA PL_CLEAR_ARENA
160#define PR_ARENA_RELEASE PL_ARENA_RELEASE
161#define PR_COUNT_ARENA PL_COUNT_ARENA
162#define PR_ARENA_DESTROY PL_ARENA_DESTROY
163#define PR_InitArenaPool PL_InitArenaPool
164#define PR_FreeArenaPool PL_FreeArenaPool
165#define PR_FinishArenaPool PL_FinishArenaPool
166#define PR_CompactArenaPool PL_CompactArenaPool
167#define PR_ArenaFinish PL_ArenaFinish
168#define PR_ArenaAllocate PL_ArenaAllocate
169#define PR_ArenaGrow PL_ArenaGrow
170#define PR_ArenaRelease PL_ArenaRelease
171#define PR_ArenaCountAllocation PL_ArenaCountAllocation
172#define PR_ArenaCountInplaceGrowth PL_ArenaCountInplaceGrowth
173#define PR_ArenaCountGrowth PL_ArenaCountGrowth
174#define PR_ArenaCountRelease PL_ArenaCountRelease
175#define PR_ArenaCountRetract PL_ArenaCountRetract
176
177/* Re: prhash.h->plhash.h */
178#define PRHashEntry PLHashEntry
179#define PRHashTable PLHashTable
180#define PRHashNumber PLHashNumber
181#define PRHashFunction PLHashFunction
182#define PRHashComparator PLHashComparator
183#define PRHashEnumerator PLHashEnumerator
184#define PRHashAllocOps PLHashAllocOps
185#define PR_NewHashTable PL_NewHashTable
186#define PR_HashTableDestroy PL_HashTableDestroy
187#define PR_HashTableRawLookup PL_HashTableRawLookup
188#define PR_HashTableRawAdd PL_HashTableRawAdd
189#define PR_HashTableRawRemove PL_HashTableRawRemove
190#define PR_HashTableAdd PL_HashTableAdd
191#define PR_HashTableRemove PL_HashTableRemove
192#define PR_HashTableEnumerateEntries PL_HashTableEnumerateEntries
193#define PR_HashTableLookup PL_HashTableLookup
194#define PR_HashTableDump PL_HashTableDump
195#define PR_HashString PL_HashString
196#define PR_CompareStrings PL_CompareStrings
197#define PR_CompareValues PL_CompareValues
198
199#endif /* !defined(PROTYPES_H) */
200