Code

moving trunk for module inkscape
[inkscape.git] / src / dom / js / jsotypes.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 Mozilla Communicator client code, released
16  * March 31, 1998.
17  *
18  * The Initial Developer of the Original Code is
19  * Netscape Communications Corporation.
20  * Portions created by the Initial Developer are Copyright (C) 1998
21  * the Initial Developer. All Rights Reserved.
22  *
23  * Contributor(s):
24  *
25  * Alternatively, the contents of this file may be used under the terms of
26  * either of the GNU General Public License Version 2 or later (the "GPL"),
27  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28  * in which case the provisions of the GPL or the LGPL are applicable instead
29  * of those above. If you wish to allow use of your version of this file only
30  * under the terms of either the GPL or the LGPL, and not to allow others to
31  * use your version of this file under the terms of the MPL, indicate your
32  * decision by deleting the provisions above and replace them with the notice
33  * and other provisions required by the GPL or the LGPL. If you do not delete
34  * the provisions above, a recipient may use your version of this file under
35  * the terms of any one of the MPL, the GPL or the LGPL.
36  *
37  * ***** END LICENSE BLOCK ***** */
39 /*
40  * This section typedefs the old 'native' types to the new PR<type>s.
41  * These definitions are scheduled to be eliminated at the earliest
42  * possible time. The NSPR API is implemented and documented using
43  * the new definitions.
44  */
46 /*
47  * Note that we test for PROTYPES_H, not JSOTYPES_H.  This is to avoid
48  * double-definitions of scalar types such as uint32, if NSPR's
49  * protypes.h is also included.
50  */
51 #ifndef PROTYPES_H
52 #define PROTYPES_H
54 #ifdef XP_BEOS
55 /* BeOS defines most int types in SupportDefs.h (int8, uint8, int16,
56  * uint16, int32, uint32, int64, uint64), so in the interest of
57  * not conflicting with other definitions elsewhere we have to skip the
58  * #ifdef jungle below, duplicate some definitions, and do our stuff.
59  */
60 #include <SupportDefs.h>
62 typedef JSUintn uintn;
63 #ifndef _XP_Core_
64 typedef JSIntn intn;
65 #endif
67 #else
69 /* SVR4 typedef of uint is commonly found on UNIX machines. */
70 #ifdef XP_UNIX
71 #include <sys/types.h>
72 #else
73 typedef JSUintn uint;
74 #endif
76 typedef JSUintn uintn;
77 typedef JSUint64 uint64;
78 #if !defined(XP_MAC) && !defined(_WIN32) && !defined(XP_OS2)
79 typedef JSUint32 uint32;
80 #else
81 typedef unsigned long uint32;
82 #endif
83 typedef JSUint16 uint16;
84 typedef JSUint8 uint8;
86 #ifndef _XP_Core_
87 typedef JSIntn intn;
88 #endif
90 /*
91  * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h, a very
92  * common header file) defines the types int8, int16, int32, and int64.
93  * So we don't define these four types here to avoid conflicts in case
94  * the code also includes sys/types.h.
95  */
96 #if defined(AIX) && defined(HAVE_SYS_INTTYPES_H)
97 #include <sys/inttypes.h>
98 #else
99 typedef JSInt64 int64;
101 /* /usr/include/model.h on HP-UX defines int8, int16, and int32 */
102 #ifdef HPUX
103 #include <model.h>
104 #else
105 #if !defined(XP_MAC) && !defined(_WIN32) && !defined(XP_OS2)
106 typedef JSInt32 int32;
107 #else
108 typedef long int32;
109 #endif
110 typedef JSInt16 int16;
111 typedef JSInt8 int8;
112 #endif /* HPUX */
113 #endif /* AIX && HAVE_SYS_INTTYPES_H */
115 #endif  /* XP_BEOS */
117 typedef JSFloat64 float64;
119 /* Re: jsbit.h */
120 #define TEST_BIT        JS_TEST_BIT
121 #define SET_BIT         JS_SET_BIT
122 #define CLEAR_BIT       JS_CLEAR_BIT
124 /* Re: prarena.h->plarena.h */
125 #define PRArena PLArena
126 #define PRArenaPool PLArenaPool
127 #define PRArenaStats PLArenaStats
128 #define PR_ARENA_ALIGN PL_ARENA_ALIGN
129 #define PR_INIT_ARENA_POOL PL_INIT_ARENA_POOL
130 #define PR_ARENA_ALLOCATE PL_ARENA_ALLOCATE
131 #define PR_ARENA_GROW PL_ARENA_GROW
132 #define PR_ARENA_MARK PL_ARENA_MARK
133 #define PR_CLEAR_UNUSED PL_CLEAR_UNUSED
134 #define PR_CLEAR_ARENA PL_CLEAR_ARENA
135 #define PR_ARENA_RELEASE PL_ARENA_RELEASE
136 #define PR_COUNT_ARENA PL_COUNT_ARENA
137 #define PR_ARENA_DESTROY PL_ARENA_DESTROY
138 #define PR_InitArenaPool PL_InitArenaPool
139 #define PR_FreeArenaPool PL_FreeArenaPool
140 #define PR_FinishArenaPool PL_FinishArenaPool
141 #define PR_CompactArenaPool PL_CompactArenaPool
142 #define PR_ArenaFinish PL_ArenaFinish
143 #define PR_ArenaAllocate PL_ArenaAllocate
144 #define PR_ArenaGrow PL_ArenaGrow
145 #define PR_ArenaRelease PL_ArenaRelease
146 #define PR_ArenaCountAllocation PL_ArenaCountAllocation
147 #define PR_ArenaCountInplaceGrowth PL_ArenaCountInplaceGrowth
148 #define PR_ArenaCountGrowth PL_ArenaCountGrowth
149 #define PR_ArenaCountRelease PL_ArenaCountRelease
150 #define PR_ArenaCountRetract PL_ArenaCountRetract
152 /* Re: prevent.h->plevent.h */
153 #define PREvent PLEvent
154 #define PREventQueue PLEventQueue
155 #define PR_CreateEventQueue PL_CreateEventQueue
156 #define PR_DestroyEventQueue PL_DestroyEventQueue
157 #define PR_GetEventQueueMonitor PL_GetEventQueueMonitor
158 #define PR_ENTER_EVENT_QUEUE_MONITOR PL_ENTER_EVENT_QUEUE_MONITOR
159 #define PR_EXIT_EVENT_QUEUE_MONITOR PL_EXIT_EVENT_QUEUE_MONITOR
160 #define PR_PostEvent PL_PostEvent
161 #define PR_PostSynchronousEvent PL_PostSynchronousEvent
162 #define PR_GetEvent PL_GetEvent
163 #define PR_EventAvailable PL_EventAvailable
164 #define PREventFunProc PLEventFunProc
165 #define PR_MapEvents PL_MapEvents
166 #define PR_RevokeEvents PL_RevokeEvents
167 #define PR_ProcessPendingEvents PL_ProcessPendingEvents
168 #define PR_WaitForEvent PL_WaitForEvent
169 #define PR_EventLoop PL_EventLoop
170 #define PR_GetEventQueueSelectFD PL_GetEventQueueSelectFD
171 #define PRHandleEventProc PLHandleEventProc
172 #define PRDestroyEventProc PLDestroyEventProc
173 #define PR_InitEvent PL_InitEvent
174 #define PR_GetEventOwner PL_GetEventOwner
175 #define PR_HandleEvent PL_HandleEvent
176 #define PR_DestroyEvent PL_DestroyEvent
177 #define PR_DequeueEvent PL_DequeueEvent
178 #define PR_GetMainEventQueue PL_GetMainEventQueue
180 /* Re: prhash.h->plhash.h */
181 #define PRHashEntry PLHashEntry
182 #define PRHashTable PLHashTable
183 #define PRHashNumber PLHashNumber
184 #define PRHashFunction PLHashFunction
185 #define PRHashComparator PLHashComparator
186 #define PRHashEnumerator PLHashEnumerator
187 #define PRHashAllocOps PLHashAllocOps
188 #define PR_NewHashTable PL_NewHashTable
189 #define PR_HashTableDestroy PL_HashTableDestroy
190 #define PR_HashTableRawLookup PL_HashTableRawLookup
191 #define PR_HashTableRawAdd PL_HashTableRawAdd
192 #define PR_HashTableRawRemove PL_HashTableRawRemove
193 #define PR_HashTableAdd PL_HashTableAdd
194 #define PR_HashTableRemove PL_HashTableRemove
195 #define PR_HashTableEnumerateEntries PL_HashTableEnumerateEntries
196 #define PR_HashTableLookup PL_HashTableLookup
197 #define PR_HashTableDump PL_HashTableDump
198 #define PR_HashString PL_HashString
199 #define PR_CompareStrings PL_CompareStrings
200 #define PR_CompareValues PL_CompareValues
202 #ifdef XP_MAC
203 #ifndef TRUE                            /* Mac standard is lower case true */
204         #define TRUE 1
205 #endif
206 #ifndef FALSE                           /* Mac standard is lower case false */
207         #define FALSE 0
208 #endif
209 #endif
211 #endif /* !defined(PROTYPES_H) */