File indexing completed on 2024-05-05 16:56:00

0001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
0002 /* ***** BEGIN LICENSE BLOCK *****
0003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
0004  *
0005  * The contents of this file are subject to the Mozilla Public License Version
0006  * 1.1 (the "License"); you may not use this file except in compliance with
0007  * the License. You may obtain a copy of the License at
0008  * http://www.mozilla.org/MPL/
0009  *
0010  * Software distributed under the License is distributed on an "AS IS" basis,
0011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
0012  * for the specific language governing rights and limitations under the
0013  * License.
0014  *
0015  * The Original Code is the Netscape Portable Runtime (NSPR).
0016  *
0017  * The Initial Developer of the Original Code is
0018  * Netscape Communications Corporation.
0019  * Portions created by the Initial Developer are Copyright (C) 1998-2000
0020  * the Initial Developer. All Rights Reserved.
0021  *
0022  * Contributor(s):
0023  *
0024  * Alternatively, the contents of this file may be used under the terms of
0025  * either the GNU General Public License Version 2 or later (the "GPL"), or
0026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
0027  * in which case the provisions of the GPL or the LGPL are applicable instead
0028  * of those above. If you wish to allow use of your version of this file only
0029  * under the terms of either the GPL or the LGPL, and not to allow others to
0030  * use your version of this file under the terms of the MPL, indicate your
0031  * decision by deleting the provisions above and replace them with the notice
0032  * and other provisions required by the GPL or the LGPL. If you do not delete
0033  * the provisions above, a recipient may use your version of this file under
0034  * the terms of any one of the MPL, the GPL or the LGPL.
0035  *
0036  * ***** END LICENSE BLOCK ***** */
0037 
0038 /*
0039  * This header typedefs the old 'native' types to the new PR<type>s.
0040  * These definitions are scheduled to be eliminated at the earliest
0041  * possible time. The NSPR API is implemented and documented using
0042  * the new definitions.
0043  */
0044 
0045 #if !defined(PROTYPES_H)
0046 #define PROTYPES_H
0047 
0048 typedef PRUintn uintn;
0049 #ifndef _XP_Core_
0050 typedef PRIntn intn;
0051 #endif
0052 
0053 /*
0054  * It is trickier to define uint, int8, uint8, int16, uint16,
0055  * int32, uint32, int64, and uint64 because some of these int
0056  * types are defined by standard header files on some platforms.
0057  * Our strategy here is to include all such standard headers
0058  * first, and then define these int types only if they are not
0059  * defined by those standard headers.
0060  */
0061 
0062 /*
0063  * BeOS defines all the int types below in its standard header
0064  * file SupportDefs.h.
0065  */
0066 #ifdef XP_BEOS
0067 #include <support/SupportDefs.h>
0068 #endif
0069 
0070 /*
0071  * SVR4 typedef of uint is commonly found on UNIX machines.
0072  *
0073  * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h)
0074  * defines the types int8, int16, int32, and int64.
0075  *
0076  * On OS/2, sys/types.h defines uint.
0077  */
0078 #if defined(XP_UNIX) || defined(XP_OS2)
0079 #include <sys/types.h>
0080 #endif
0081 
0082 /* model.h on HP-UX defines int8, int16, and int32. */
0083 #ifdef HPUX
0084 #include <model.h>
0085 #endif
0086 
0087 /*
0088  * uint
0089  */
0090 
0091 #if !defined(XP_BEOS) && !defined(XP_OS2) && !defined(XP_UNIX) || defined(NTO)
0092 typedef PRUintn uint;
0093 #endif
0094 
0095 /*
0096  * uint64
0097  */
0098 
0099 #if !defined(XP_BEOS)
0100 typedef PRUint64 uint64;
0101 #endif
0102 
0103 /*
0104  * uint32
0105  */
0106 
0107 #if !defined(XP_BEOS)
0108 #if !defined(_WIN32) && !defined(XP_OS2) && !defined(NTO)
0109 typedef PRUint32 uint32;
0110 #else
0111 typedef unsigned long uint32;
0112 #endif
0113 #endif
0114 
0115 /*
0116  * uint16
0117  */
0118 
0119 #if !defined(XP_BEOS)
0120 typedef PRUint16 uint16;
0121 #endif
0122 
0123 /*
0124  * uint8
0125  */
0126 
0127 #if !defined(XP_BEOS)
0128 typedef PRUint8 uint8;
0129 #endif
0130 
0131 /*
0132  * int64
0133  */
0134 
0135 #if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES)
0136 typedef PRInt64 int64;
0137 #endif
0138 
0139 /*
0140  * int32
0141  */
0142 
0143 #if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
0144     && !defined(HPUX)
0145 #if !defined(_WIN32) && !defined(XP_OS2) && !defined(NTO)
0146 typedef PRInt32 int32;
0147 #else
0148 typedef long int32;
0149 #endif
0150 #endif
0151 
0152 /*
0153  * int16
0154  */
0155 
0156 #if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
0157     && !defined(HPUX)
0158 typedef PRInt16 int16;
0159 #endif
0160 
0161 /*
0162  * int8
0163  */
0164 
0165 #if !defined(XP_BEOS) && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
0166     && !defined(HPUX)
0167 typedef PRInt8 int8;
0168 #endif
0169 
0170 typedef PRFloat64 float64;
0171 typedef PRUptrdiff uptrdiff_t;
0172 typedef PRUword uprword_t;
0173 typedef PRWord prword_t;
0174 
0175 
0176 /* Re: prbit.h */
0177 #define TEST_BIT    PR_TEST_BIT
0178 #define SET_BIT     PR_SET_BIT
0179 #define CLEAR_BIT   PR_CLEAR_BIT
0180 
0181 /* Re: prarena.h->plarena.h */
0182 #define PRArena PLArena
0183 #define PRArenaPool PLArenaPool
0184 #define PRArenaStats PLArenaStats
0185 #define PR_ARENA_ALIGN PL_ARENA_ALIGN
0186 #define PR_INIT_ARENA_POOL PL_INIT_ARENA_POOL
0187 #define PR_ARENA_ALLOCATE PL_ARENA_ALLOCATE
0188 #define PR_ARENA_GROW PL_ARENA_GROW
0189 #define PR_ARENA_MARK PL_ARENA_MARK
0190 #define PR_CLEAR_UNUSED PL_CLEAR_UNUSED
0191 #define PR_CLEAR_ARENA PL_CLEAR_ARENA
0192 #define PR_ARENA_RELEASE PL_ARENA_RELEASE
0193 #define PR_COUNT_ARENA PL_COUNT_ARENA
0194 #define PR_ARENA_DESTROY PL_ARENA_DESTROY
0195 #define PR_InitArenaPool PL_InitArenaPool
0196 #define PR_FreeArenaPool PL_FreeArenaPool
0197 #define PR_FinishArenaPool PL_FinishArenaPool
0198 #define PR_CompactArenaPool PL_CompactArenaPool
0199 #define PR_ArenaFinish PL_ArenaFinish
0200 #define PR_ArenaAllocate PL_ArenaAllocate
0201 #define PR_ArenaGrow PL_ArenaGrow
0202 #define PR_ArenaRelease PL_ArenaRelease
0203 #define PR_ArenaCountAllocation PL_ArenaCountAllocation
0204 #define PR_ArenaCountInplaceGrowth PL_ArenaCountInplaceGrowth
0205 #define PR_ArenaCountGrowth PL_ArenaCountGrowth
0206 #define PR_ArenaCountRelease PL_ArenaCountRelease
0207 #define PR_ArenaCountRetract PL_ArenaCountRetract
0208 
0209 /* Re: prhash.h->plhash.h */
0210 #define PRHashEntry PLHashEntry
0211 #define PRHashTable PLHashTable
0212 #define PRHashNumber PLHashNumber
0213 #define PRHashFunction PLHashFunction
0214 #define PRHashComparator PLHashComparator
0215 #define PRHashEnumerator PLHashEnumerator
0216 #define PRHashAllocOps PLHashAllocOps
0217 #define PR_NewHashTable PL_NewHashTable
0218 #define PR_HashTableDestroy PL_HashTableDestroy
0219 #define PR_HashTableRawLookup PL_HashTableRawLookup
0220 #define PR_HashTableRawAdd PL_HashTableRawAdd
0221 #define PR_HashTableRawRemove PL_HashTableRawRemove
0222 #define PR_HashTableAdd PL_HashTableAdd
0223 #define PR_HashTableRemove PL_HashTableRemove
0224 #define PR_HashTableEnumerateEntries PL_HashTableEnumerateEntries
0225 #define PR_HashTableLookup PL_HashTableLookup
0226 #define PR_HashTableDump PL_HashTableDump
0227 #define PR_HashString PL_HashString
0228 #define PR_CompareStrings PL_CompareStrings
0229 #define PR_CompareValues PL_CompareValues
0230 
0231 #endif /* !defined(PROTYPES_H) */