Upload Tizen:Base source
[toolchains/nspr.git] / mozilla / nsprpub / pr / include / obsolete / protypes.h
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  * SVR4 typedef of uint is commonly found on UNIX machines.
72  *
73  * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h)
74  * defines the types int8, int16, int32, and int64.
75  *
76  * On OS/2, sys/types.h defines uint.
77  */
78 #if defined(XP_UNIX) || defined(XP_OS2)
79 #include <sys/types.h>
80 #endif
81
82 /* model.h on HP-UX defines int8, int16, and int32. */
83 #ifdef HPUX
84 #include <model.h>
85 #endif
86
87 /*
88  * uint
89  */
90
91 #if !defined(XP_BEOS) && !defined(XP_OS2) && !defined(XP_UNIX) || defined(NTO)
92 typedef PRUintn uint;
93 #endif
94
95 /*
96  * uint64
97  */
98
99 #if !defined(XP_BEOS)
100 typedef PRUint64 uint64;
101 #endif
102
103 /*
104  * uint32
105  */
106
107 #if !defined(XP_BEOS)
108 #if !defined(_WIN32) && !defined(XP_OS2) && !defined(NTO)
109 typedef PRUint32 uint32;
110 #else
111 typedef unsigned long uint32;
112 #endif
113 #endif
114
115 /*
116  * uint16
117  */
118
119 #if !defined(XP_BEOS)
120 typedef PRUint16 uint16;
121 #endif
122
123 /*
124  * uint8
125  */
126
127 #if !defined(XP_BEOS)
128 typedef PRUint8 uint8;
129 #endif
130
131 /*
132  * int64
133  */
134
135 #if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES)
136 typedef PRInt64 int64;
137 #endif
138
139 /*
140  * int32
141  */
142
143 #if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
144     && !defined(HPUX)
145 #if !defined(_WIN32) && !defined(XP_OS2) && !defined(NTO)
146 typedef PRInt32 int32;
147 #else
148 typedef long int32;
149 #endif
150 #endif
151
152 /*
153  * int16
154  */
155
156 #if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
157     && !defined(HPUX)
158 typedef PRInt16 int16;
159 #endif
160
161 /*
162  * int8
163  */
164
165 #if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
166     && !defined(HPUX)
167 typedef PRInt8 int8;
168 #endif
169
170 typedef PRFloat64 float64;
171 typedef PRUptrdiff uptrdiff_t;
172 typedef PRUword uprword_t;
173 typedef PRWord prword_t;
174
175
176 /* Re: prbit.h */
177 #define TEST_BIT        PR_TEST_BIT
178 #define SET_BIT         PR_SET_BIT
179 #define CLEAR_BIT       PR_CLEAR_BIT
180
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
208
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
230
231 #endif /* !defined(PROTYPES_H) */