1 // javaprims.h - Main external header file for libgcj. -*- c++ -*-
3 /* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
5 This file is part of libgcj.
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
11 #ifndef __JAVAPRIMS_H__
12 #define __JAVAPRIMS_H__
14 // Force C++ compiler to use Java-style exceptions.
15 #pragma GCC java_exceptions
17 #include <gcj/libgcj-config.h>
19 // FIXME: this is a hack until we get a proper gcjh.
20 // It is needed to work around system header files that define TRUE
27 // To force selection of correct types that will mangle consistently
31 typedef __java_byte jbyte
;
32 typedef __java_short jshort
;
33 typedef __java_int jint
;
34 typedef __java_long jlong
;
35 typedef __java_float jfloat
;
36 typedef __java_double jdouble
;
37 typedef __java_char jchar
;
38 typedef __java_boolean jboolean
;
41 // The following class declarations are automatically generated by
42 // the `classes.pl' script.
47 class BufferedInputStream
;
48 class BufferedOutputStream
;
51 class ByteArrayInputStream
;
52 class ByteArrayOutputStream
;
53 class CharArrayReader
;
54 class CharArrayWriter
;
55 class CharConversionException
;
57 class DataInputStream
;
59 class DataOutputStream
;
65 class FileInputStream
;
66 class FileNotFoundException
;
67 class FileOutputStream
;
72 class FilterInputStream
;
73 class FilterOutputStream
;
78 class InputStreamReader
;
79 class InterfaceComparator
;
80 class InterruptedIOException
;
81 class InvalidClassException
;
82 class InvalidObjectException
;
83 class LineNumberInputStream
;
84 class LineNumberReader
;
85 class MemberComparator
;
86 class NotActiveException
;
87 class NotSerializableException
;
89 class ObjectInputStream
;
90 class ObjectInputStream$GetField
;
91 class ObjectInputValidation
;
93 class ObjectOutputStream
;
94 class ObjectOutputStream$PutField
;
95 class ObjectStreamClass
;
96 class ObjectStreamConstants
;
97 class ObjectStreamException
;
98 class ObjectStreamField
;
99 class OptionalDataException
;
101 class OutputStreamWriter
;
102 class PipedInputStream
;
103 class PipedOutputStream
;
108 class PushbackInputStream
;
109 class PushbackReader
;
110 class RandomAccessFile
;
112 class SequenceInputStream
;
114 class SerializablePermission
;
115 class StreamCorruptedException
;
116 class StreamTokenizer
;
117 class StringBufferInputStream
;
120 class SyncFailedException
;
121 class UTFDataFormatException
;
122 class UnsupportedEncodingException
;
123 class ValidatorAndPriority
;
124 class WriteAbortedException
;
130 class AbstractMethodError
;
131 class ArithmeticException
;
132 class ArrayIndexOutOfBoundsException
;
133 class ArrayStoreException
;
136 class CPlusPlusDemangler
;
139 class Character$Subset
;
140 class Character$UnicodeBlock
;
142 class ClassCastException
;
143 class ClassCircularityError
;
144 class ClassFormatError
;
146 class ClassNotFoundException
;
147 class CloneNotSupportedException
;
151 class ConcreteProcess
;
155 class ExceptionInInitializerError
;
157 class IllegalAccessError
;
158 class IllegalAccessException
;
159 class IllegalArgumentException
;
160 class IllegalMonitorStateException
;
161 class IllegalStateException
;
162 class IllegalThreadStateException
;
163 class IncompatibleClassChangeError
;
164 class IndexOutOfBoundsException
;
165 class InstantiationError
;
166 class InstantiationException
;
169 class InterruptedException
;
173 class NegativeArraySizeException
;
174 class NoClassDefFoundError
;
175 class NoSuchFieldError
;
176 class NoSuchFieldException
;
177 class NoSuchMethodError
;
178 class NoSuchMethodException
;
179 class NullPointerException
;
181 class NumberFormatException
;
183 class OutOfMemoryError
;
188 class RuntimeException
;
189 class RuntimePermission
;
190 class SecurityContext
;
191 class SecurityException
;
192 class SecurityManager
;
194 class StackOverflowError
;
196 class String$CaseInsensitiveComparator
;
198 class StringIndexOutOfBoundsException
;
204 class ThreadLocal$Value
;
207 class UnsatisfiedLinkError
;
208 class UnsupportedClassVersionError
;
209 class UnsupportedOperationException
;
211 class VMSecurityManager
;
213 class VirtualMachineError
;
217 class PhantomReference
;
219 class ReferenceQueue
;
226 class AccessibleObject
;
230 class InvocationTargetException
;
234 class ReflectPermission
;
240 class AbstractCollection
;
242 class AbstractList$AbstractListItr
;
244 class AbstractSequentialList
;
248 class Arrays$ListImpl
;
254 class Collections$ReverseComparator
;
255 class Collections$SynchronizedCollection
;
256 class Collections$SynchronizedIterator
;
257 class Collections$SynchronizedList
;
258 class Collections$SynchronizedListIterator
;
259 class Collections$SynchronizedMap
;
260 class Collections$SynchronizedSet
;
261 class Collections$SynchronizedSortedMap
;
262 class Collections$SynchronizedSortedSet
;
263 class Collections$UnmodifiableCollection
;
264 class Collections$UnmodifiableIterator
;
265 class Collections$UnmodifiableList
;
266 class Collections$UnmodifiableListIterator
;
267 class Collections$UnmodifiableMap
;
268 class Collections$UnmodifiableSet
;
269 class Collections$UnmodifiableSortedMap
;
270 class Collections$UnmodifiableSortedSet
;
272 class ConcurrentModificationException
;
275 class EmptyStackException
;
279 class GregorianCalendar
;
282 class HashMap$HashIterator
;
285 class Hashtable$Entry
;
286 class Hashtable$Enumerator
;
287 class Hashtable$HashIterator
;
288 class IdentityHashMap
;
289 class IdentityHashMap$IdentityIterator
;
292 class LinkedList$Entry
;
293 class LinkedList$LinkedListItr
;
296 class ListResourceBundle
;
300 class MissingResourceException
;
301 class NoSuchElementException
;
305 class PropertyPermission
;
306 class PropertyResourceBundle
;
308 class ResourceBundle
;
310 class SimpleTimeZone
;
314 class StringTokenizer
;
318 class Timer$Scheduler
;
319 class Timer$TaskQueue
;
321 class TooManyListenersException
;
324 class TreeMap$SubMap
;
325 class TreeMap$TreeIterator
;
326 class TreeMap$VerifyResult
;
330 class WeakHashMap$Entry
;
331 class WeakHashMap$WeakBucket
;
332 class WeakHashMap$WeakEntrySet
;
336 class Attributes$Name
;
340 class JarFile$JarEnumeration
;
341 class JarInputStream
;
342 class JarOutputStream
;
350 class CheckedInputStream
;
351 class CheckedOutputStream
;
353 class DataFormatException
;
355 class DeflaterOutputStream
;
356 class GZIPInputStream
;
357 class GZIPOutputStream
;
359 class InflaterInputStream
;
362 class ZipEnumeration
;
365 class ZipInputStream
;
366 class ZipOutputStream
;
372 typedef struct java::lang::Object
* jobject
;
373 typedef class java::lang::Class
* jclass
;
374 typedef class java::lang::Throwable
* jthrowable
;
375 typedef class java::lang::String
* jstring
;
378 typedef struct _Jv_Field
*jfieldID
;
379 typedef struct _Jv_Method
*jmethodID
;
381 extern "C" jobject
_Jv_AllocObject (jclass
, jint
) __attribute__((__malloc__
));
382 #ifdef JV_HASH_SYNCHRONIZATION
383 extern "C" jobject
_Jv_AllocPtrFreeObject (jclass
, jint
)
384 __attribute__((__malloc__
));
386 // Collector still needs to scan sync_info
387 static inline jobject
_Jv_AllocPtrFreeObject (jclass klass
, jint sz
)
389 return _Jv_AllocObject(klass
, sz
);
392 extern "C" jboolean
_Jv_IsInstanceOf(jobject
, jclass
);
393 extern "C" jstring
_Jv_AllocString(jsize
) __attribute__((__malloc__
));
394 extern "C" jstring
_Jv_NewString (const jchar
*, jsize
)
395 __attribute__((__malloc__
));
396 extern jint
_Jv_FormatInt (jchar
* bufend
, jint num
);
397 extern "C" jchar
* _Jv_GetStringChars (jstring str
);
398 extern "C" void _Jv_MonitorEnter (jobject
);
399 extern "C" void _Jv_MonitorExit (jobject
);
400 extern "C" jstring
_Jv_NewStringLatin1(const char*, jsize
)
401 __attribute__((__malloc__
));
402 extern "C" jsize
_Jv_GetStringUTFLength (jstring
);
403 extern "C" jsize
_Jv_GetStringUTFRegion (jstring
, jsize
, jsize
, char *);
405 extern jint
_Jv_CreateJavaVM (void* /*vm_args*/);
408 _Jv_ThreadRun (java::lang::Thread
* thread
);
410 _Jv_AttachCurrentThread(java::lang::Thread
* thread
);
411 extern "C" java::lang::Thread
*
412 _Jv_AttachCurrentThread(jstring name
, java::lang::ThreadGroup
* group
);
413 extern "C" jint
_Jv_DetachCurrentThread (void);
415 extern "C" void _Jv_Throw (jthrowable
) __attribute__ ((__noreturn__
));
416 extern "C" void* _Jv_Malloc (jsize
) __attribute__((__malloc__
));
417 extern "C" void* _Jv_Realloc (void *, jsize
);
418 extern "C" void _Jv_Free (void*);
419 extern void (*_Jv_RegisterClassHook
) (jclass cl
);
420 extern "C" void _Jv_RegisterClassHookDefault (jclass
);
422 typedef unsigned short _Jv_ushort
__attribute__((__mode__(__HI__
)));
423 typedef unsigned int _Jv_uint
__attribute__((__mode__(__SI__
)));
428 _Jv_ushort length
; /* In bytes, of data portion, without final '\0'. */
429 char data
[1]; /* In Utf8 format, with final '\0'. */
433 #endif /* __JAVAPRIMS_H__ */