Back to index

lightning-sunbird  0.9+nobinonly
protypes.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is the Netscape Portable Runtime (NSPR).
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998-2000
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 /*
00039  * This header typedefs the old 'native' types to the new PR<type>s.
00040  * These definitions are scheduled to be eliminated at the earliest
00041  * possible time. The NSPR API is implemented and documented using
00042  * the new definitions.
00043  */
00044 
00045 #if !defined(PROTYPES_H)
00046 #define PROTYPES_H
00047 
00048 typedef PRUintn uintn;
00049 #ifndef _XP_Core_
00050 typedef PRIntn intn;
00051 #endif
00052 
00053 /*
00054  * It is trickier to define uint, int8, uint8, int16, uint16,
00055  * int32, uint32, int64, and uint64 because some of these int
00056  * types are defined by standard header files on some platforms.
00057  * Our strategy here is to include all such standard headers
00058  * first, and then define these int types only if they are not
00059  * defined by those standard headers.
00060  */
00061 
00062 /*
00063  * BeOS defines all the int types below in its standard header
00064  * file SupportDefs.h.
00065  */
00066 #ifdef XP_BEOS
00067 #include <support/SupportDefs.h>
00068 #endif
00069 
00070 /*
00071  * OpenVMS defines all the int types below in its standard
00072  * header files ints.h and types.h.
00073  */
00074 #ifdef VMS
00075 #include <ints.h>
00076 #include <types.h>
00077 #endif
00078 
00079 /*
00080  * SVR4 typedef of uint is commonly found on UNIX machines.
00081  *
00082  * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h)
00083  * defines the types int8, int16, int32, and int64.
00084  */
00085 #ifdef XP_UNIX
00086 #include <sys/types.h>
00087 #endif
00088 
00089 /* model.h on HP-UX defines int8, int16, and int32. */
00090 #ifdef HPUX
00091 #include <model.h>
00092 #endif
00093 
00094 /*
00095  * uint
00096  */
00097 
00098 #if !defined(XP_BEOS) && !defined(VMS) \
00099     && !defined(XP_UNIX) || defined(NTO)
00100 typedef PRUintn uint;
00101 #endif
00102 
00103 /*
00104  * uint64
00105  */
00106 
00107 #if !defined(XP_BEOS) && !defined(VMS)
00108 typedef PRUint64 uint64;
00109 #endif
00110 
00111 /*
00112  * uint32
00113  */
00114 
00115 #if !defined(XP_BEOS) && !defined(VMS)
00116 #if !defined(XP_MAC) && !defined(_WIN32) && !defined(XP_OS2) && !defined(NTO)
00117 typedef PRUint32 uint32;
00118 #else
00119 typedef unsigned long uint32;
00120 #endif
00121 #endif
00122 
00123 /*
00124  * uint16
00125  */
00126 
00127 #if !defined(XP_BEOS) && !defined(VMS)
00128 typedef PRUint16 uint16;
00129 #endif
00130 
00131 /*
00132  * uint8
00133  */
00134 
00135 #if !defined(XP_BEOS) && !defined(VMS)
00136 typedef PRUint8 uint8;
00137 #endif
00138 
00139 /*
00140  * int64
00141  */
00142 
00143 #if !defined(XP_BEOS) && !defined(VMS) \
00144     && !defined(_PR_AIX_HAVE_BSD_INT_TYPES)
00145 typedef PRInt64 int64;
00146 #endif
00147 
00148 /*
00149  * int32
00150  */
00151 
00152 #if !defined(XP_BEOS) && !defined(VMS) \
00153     && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
00154     && !defined(HPUX)
00155 #if !defined(XP_MAC) && !defined(_WIN32) && !defined(XP_OS2) && !defined(NTO)
00156 typedef PRInt32 int32;
00157 #else
00158 typedef long int32;
00159 #endif
00160 #endif
00161 
00162 /*
00163  * int16
00164  */
00165 
00166 #if !defined(XP_BEOS) && !defined(VMS) \
00167     && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
00168     && !defined(HPUX)
00169 typedef PRInt16 int16;
00170 #endif
00171 
00172 /*
00173  * int8
00174  */
00175 
00176 #if !defined(XP_BEOS) && !defined(VMS) \
00177     && !defined(_PR_AIX_HAVE_BSD_INT_TYPES) \
00178     && !defined(HPUX)
00179 typedef PRInt8 int8;
00180 #endif
00181 
00182 typedef PRFloat64 float64;
00183 typedef PRUptrdiff uptrdiff_t;
00184 typedef PRUword uprword_t;
00185 typedef PRWord prword_t;
00186 
00187 
00188 /* Re: prbit.h */
00189 #define TEST_BIT     PR_TEST_BIT
00190 #define SET_BIT             PR_SET_BIT
00191 #define CLEAR_BIT    PR_CLEAR_BIT
00192 
00193 /* Re: prarena.h->plarena.h */
00194 #define PRArena PLArena
00195 #define PRArenaPool PLArenaPool
00196 #define PRArenaStats PLArenaStats
00197 #define PR_ARENA_ALIGN PL_ARENA_ALIGN
00198 #define PR_INIT_ARENA_POOL PL_INIT_ARENA_POOL
00199 #define PR_ARENA_ALLOCATE PL_ARENA_ALLOCATE
00200 #define PR_ARENA_GROW PL_ARENA_GROW
00201 #define PR_ARENA_MARK PL_ARENA_MARK
00202 #define PR_CLEAR_UNUSED PL_CLEAR_UNUSED
00203 #define PR_CLEAR_ARENA PL_CLEAR_ARENA
00204 #define PR_ARENA_RELEASE PL_ARENA_RELEASE
00205 #define PR_COUNT_ARENA PL_COUNT_ARENA
00206 #define PR_ARENA_DESTROY PL_ARENA_DESTROY
00207 #define PR_InitArenaPool PL_InitArenaPool
00208 #define PR_FreeArenaPool PL_FreeArenaPool
00209 #define PR_FinishArenaPool PL_FinishArenaPool
00210 #define PR_CompactArenaPool PL_CompactArenaPool
00211 #define PR_ArenaFinish PL_ArenaFinish
00212 #define PR_ArenaAllocate PL_ArenaAllocate
00213 #define PR_ArenaGrow PL_ArenaGrow
00214 #define PR_ArenaRelease PL_ArenaRelease
00215 #define PR_ArenaCountAllocation PL_ArenaCountAllocation
00216 #define PR_ArenaCountInplaceGrowth PL_ArenaCountInplaceGrowth
00217 #define PR_ArenaCountGrowth PL_ArenaCountGrowth
00218 #define PR_ArenaCountRelease PL_ArenaCountRelease
00219 #define PR_ArenaCountRetract PL_ArenaCountRetract
00220 
00221 /* Re: prhash.h->plhash.h */
00222 #define PRHashEntry PLHashEntry
00223 #define PRHashTable PLHashTable
00224 #define PRHashNumber PLHashNumber
00225 #define PRHashFunction PLHashFunction
00226 #define PRHashComparator PLHashComparator
00227 #define PRHashEnumerator PLHashEnumerator
00228 #define PRHashAllocOps PLHashAllocOps
00229 #define PR_NewHashTable PL_NewHashTable
00230 #define PR_HashTableDestroy PL_HashTableDestroy
00231 #define PR_HashTableRawLookup PL_HashTableRawLookup
00232 #define PR_HashTableRawAdd PL_HashTableRawAdd
00233 #define PR_HashTableRawRemove PL_HashTableRawRemove
00234 #define PR_HashTableAdd PL_HashTableAdd
00235 #define PR_HashTableRemove PL_HashTableRemove
00236 #define PR_HashTableEnumerateEntries PL_HashTableEnumerateEntries
00237 #define PR_HashTableLookup PL_HashTableLookup
00238 #define PR_HashTableDump PL_HashTableDump
00239 #define PR_HashString PL_HashString
00240 #define PR_CompareStrings PL_CompareStrings
00241 #define PR_CompareValues PL_CompareValues
00242 
00243 #if defined(XP_MAC)
00244 #ifndef TRUE                       /* Mac standard is lower case true */
00245        #define TRUE 1
00246 #endif
00247 #ifndef FALSE                      /* Mac standard is lower case false */
00248        #define FALSE 0
00249 #endif
00250 #endif
00251 
00252 #endif /* !defined(PROTYPES_H) */