Debian Codegraph @

nsprpub/pr/include/obsolete/protypes.h

raw
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
16 typedef PRUintn uintn;
17 #ifndef _XP_Core_
18 typedef 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 * SVR4 typedef of uint is commonly found on UNIX machines.
32 *
33 * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h)
34 * defines the types int8, int16, int32, and int64.
35 *
36 * On OS/2, sys/types.h defines uint.
37 */
38 #if defined(XP_UNIX)
39 #include <sys/types.h>
40 #endif
41
42 /* model.h on HP-UX defines int8, int16, and int32. */
43 #ifdef HPUX
44 #include <model.h>
45 #endif
46
47 /*
48 * uint
49 */
50
51 #if !defined(XP_UNIX) || defined(NTO)
52 typedef PRUintn uint;
53 #endif
54
55 /*
56 * uint64
57 */
58
59 typedef PRUint64 uint64;
60
61 /*
62 * uint32
63 */
64
65 #if !defined(_WIN32) && !defined(NTO)
66 typedef PRUint32 uint32;
67 #else
68 typedef unsigned long uint32;
69 #endif
70
71 /*
72 * uint16
73 */
74
75 typedef PRUint16 uint16;
76
77 /*
78 * uint8
79 */
80
81 typedef PRUint8 uint8;
82
83 /*
84 * int64
85 */
86
87 #if !defined(_PR_AIX_HAVE_BSD_INT_TYPES)
88 typedef PRInt64 int64;
89 #endif
90
91 /*
92 * int32
93 */
94
95 #if !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
96 && !defined(HPUX)
97 #if !defined(_WIN32) && !defined(NTO)
98 typedef PRInt32 int32;
99 #else
100 typedef long int32;
101 #endif
102 #endif
103
104 /*
105 * int16
106 */
107
108 #if !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
109 && !defined(HPUX)
110 typedef PRInt16 int16;
111 #endif
112
113 /*
114 * int8
115 */
116
117 #if !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
118 && !defined(HPUX)
119 typedef PRInt8 int8;
120 #endif
121
122 typedef PRFloat64 float64;
123 typedef PRUptrdiff uptrdiff_t;
124 typedef PRUword uprword_t;
125 typedef PRWord prword_t;
126
127
128 /* Re: prbit.h */
129 #define TEST_BIT PR_TEST_BIT
130 #define SET_BIT PR_SET_BIT
131 #define CLEAR_BIT PR_CLEAR_BIT
132
133 /* Re: prarena.h->plarena.h */
134 #define PRArena PLArena
135 #define PRArenaPool PLArenaPool
136 #define PRArenaStats PLArenaStats
137 #define PR_ARENA_ALIGN PL_ARENA_ALIGN
138 #define PR_INIT_ARENA_POOL PL_INIT_ARENA_POOL
139 #define PR_ARENA_ALLOCATE PL_ARENA_ALLOCATE
140 #define PR_ARENA_GROW PL_ARENA_GROW
141 #define PR_ARENA_MARK PL_ARENA_MARK
142 #define PR_CLEAR_UNUSED PL_CLEAR_UNUSED
143 #define PR_CLEAR_ARENA PL_CLEAR_ARENA
144 #define PR_ARENA_RELEASE PL_ARENA_RELEASE
145 #define PR_COUNT_ARENA PL_COUNT_ARENA
146 #define PR_ARENA_DESTROY PL_ARENA_DESTROY
147 #define PR_InitArenaPool PL_InitArenaPool
148 #define PR_FreeArenaPool PL_FreeArenaPool
149 #define PR_FinishArenaPool PL_FinishArenaPool
150 #define PR_CompactArenaPool PL_CompactArenaPool
151 #define PR_ArenaFinish PL_ArenaFinish
152 #define PR_ArenaAllocate PL_ArenaAllocate
153 #define PR_ArenaGrow PL_ArenaGrow
154 #define PR_ArenaRelease PL_ArenaRelease
155 #define PR_ArenaCountAllocation PL_ArenaCountAllocation
156 #define PR_ArenaCountInplaceGrowth PL_ArenaCountInplaceGrowth
157 #define PR_ArenaCountGrowth PL_ArenaCountGrowth
158 #define PR_ArenaCountRelease PL_ArenaCountRelease
159 #define PR_ArenaCountRetract PL_ArenaCountRetract
160
161 /* Re: prhash.h->plhash.h */
162 #define PRHashEntry PLHashEntry
163 #define PRHashTable PLHashTable
164 #define PRHashNumber PLHashNumber
165 #define PRHashFunction PLHashFunction
166 #define PRHashComparator PLHashComparator
167 #define PRHashEnumerator PLHashEnumerator
168 #define PRHashAllocOps PLHashAllocOps
169 #define PR_NewHashTable PL_NewHashTable
170 #define PR_HashTableDestroy PL_HashTableDestroy
171 #define PR_HashTableRawLookup PL_HashTableRawLookup
172 #define PR_HashTableRawAdd PL_HashTableRawAdd
173 #define PR_HashTableRawRemove PL_HashTableRawRemove
174 #define PR_HashTableAdd PL_HashTableAdd
175 #define PR_HashTableRemove PL_HashTableRemove
176 #define PR_HashTableEnumerateEntries PL_HashTableEnumerateEntries
177 #define PR_HashTableLookup PL_HashTableLookup
178 #define PR_HashTableDump PL_HashTableDump
179 #define PR_HashString PL_HashString
180 #define PR_CompareStrings PL_CompareStrings
181 #define PR_CompareValues PL_CompareValues
182
183 #endif /* !defined(PROTYPES_H) */