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