1 // javaprims.h - Main external header file for libgcj. -*- c++ -*-
3 /* Copyright (C) 1998, 1999, 2000, 2001, 2002 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 InheritableThreadLocal
;
166 class InstantiationError
;
167 class InstantiationException
;
170 class InterruptedException
;
174 class NegativeArraySizeException
;
175 class NoClassDefFoundError
;
176 class NoSuchFieldError
;
177 class NoSuchFieldException
;
178 class NoSuchMethodError
;
179 class NoSuchMethodException
;
180 class NullPointerException
;
182 class NumberFormatException
;
184 class OutOfMemoryError
;
189 class RuntimeException
;
190 class RuntimePermission
;
191 class SecurityContext
;
192 class SecurityException
;
193 class SecurityManager
;
195 class StackOverflowError
;
196 class StackTraceElement
;
199 class String$CaseInsensitiveComparator
;
201 class StringIndexOutOfBoundsException
;
207 class ThreadLocal$Value
;
210 class UnsatisfiedLinkError
;
211 class UnsupportedClassVersionError
;
212 class UnsupportedOperationException
;
214 class VMSecurityManager
;
216 class VirtualMachineError
;
220 class PhantomReference
;
222 class ReferenceQueue
;
229 class AccessibleObject
;
233 class InvocationTargetException
;
237 class ReflectPermission
;
243 class AbstractCollection
;
246 class AbstractSequentialList
;
250 class Arrays$ArrayList
;
251 class Arrays$ListImpl
;
257 class Collections$CopiesList
;
258 class Collections$EmptyList
;
259 class Collections$EmptyMap
;
260 class Collections$EmptySet
;
261 class Collections$ReverseComparator
;
262 class Collections$SingletonList
;
263 class Collections$SingletonMap
;
264 class Collections$SingletonSet
;
265 class Collections$SynchronizedCollection
;
266 class Collections$SynchronizedIterator
;
267 class Collections$SynchronizedList
;
268 class Collections$SynchronizedListIterator
;
269 class Collections$SynchronizedMap
;
270 class Collections$SynchronizedMapEntry
;
271 class Collections$SynchronizedRandomAccessList
;
272 class Collections$SynchronizedSet
;
273 class Collections$SynchronizedSortedMap
;
274 class Collections$SynchronizedSortedSet
;
275 class Collections$UnmodifiableCollection
;
276 class Collections$UnmodifiableEntrySet
;
277 class Collections$UnmodifiableIterator
;
278 class Collections$UnmodifiableList
;
279 class Collections$UnmodifiableListIterator
;
280 class Collections$UnmodifiableMap
;
281 class Collections$UnmodifiableRandomAccessList
;
282 class Collections$UnmodifiableSet
;
283 class Collections$UnmodifiableSortedMap
;
284 class Collections$UnmodifiableSortedSet
;
286 class ConcurrentModificationException
;
289 class EmptyStackException
;
293 class GregorianCalendar
;
295 class HashMap$HashEntry
;
296 class HashMap$HashIterator
;
299 class Hashtable$Enumerator
;
300 class Hashtable$HashEntry
;
301 class Hashtable$HashIterator
;
302 class IdentityHashMap
;
303 class IdentityHashMap$IdentityEntry
;
304 class IdentityHashMap$IdentityIterator
;
307 class LinkedHashMap$LinkedHashEntry
;
310 class LinkedList$Entry
;
311 class LinkedList$LinkedListItr
;
314 class ListResourceBundle
;
319 class MissingResourceException
;
320 class NoSuchElementException
;
324 class PropertyPermission
;
325 class PropertyResourceBundle
;
328 class RandomAccessSubList
;
329 class ResourceBundle
;
330 class ResourceBundle$Security
;
332 class SimpleTimeZone
;
336 class StringTokenizer
;
340 class Timer$Scheduler
;
341 class Timer$TaskQueue
;
343 class TooManyListenersException
;
346 class TreeMap$SubMap
;
347 class TreeMap$TreeIterator
;
351 class WeakHashMap$WeakBucket
;
352 class WeakHashMap$WeakEntry
;
353 class WeakHashMap$WeakEntrySet
;
357 class Attributes$Name
;
361 class JarFile$JarEnumeration
;
362 class JarInputStream
;
363 class JarOutputStream
;
371 class CheckedInputStream
;
372 class CheckedOutputStream
;
374 class DataFormatException
;
376 class DeflaterOutputStream
;
377 class GZIPInputStream
;
378 class GZIPOutputStream
;
380 class InflaterInputStream
;
383 class ZipEnumeration
;
386 class ZipInputStream
;
387 class ZipOutputStream
;
393 typedef struct java::lang::Object
* jobject
;
394 typedef class java::lang::Class
* jclass
;
395 typedef class java::lang::Throwable
* jthrowable
;
396 typedef class java::lang::String
* jstring
;
399 typedef struct _Jv_Field
*jfieldID
;
400 typedef struct _Jv_Method
*jmethodID
;
402 extern "C" jobject
_Jv_AllocObject (jclass
, jint
) __attribute__((__malloc__
));
403 extern "C" jobject
_Jv_AllocObjectNoFinalizer (jclass
, jint
) __attribute__((__malloc__
));
404 extern "C" jobject
_Jv_AllocObjectNoInitNoFinalizer (jclass
, jint
) __attribute__((__malloc__
));
405 #ifdef JV_HASH_SYNCHRONIZATION
406 extern "C" jobject
_Jv_AllocPtrFreeObject (jclass
, jint
)
407 __attribute__((__malloc__
));
409 // Collector still needs to scan sync_info
410 static inline jobject
_Jv_AllocPtrFreeObject (jclass klass
, jint sz
)
412 return _Jv_AllocObject(klass
, sz
);
415 extern "C" jboolean
_Jv_IsInstanceOf(jobject
, jclass
);
416 extern "C" jstring
_Jv_AllocString(jsize
) __attribute__((__malloc__
));
417 extern "C" jstring
_Jv_NewString (const jchar
*, jsize
)
418 __attribute__((__malloc__
));
419 extern jint
_Jv_FormatInt (jchar
* bufend
, jint num
);
420 extern "C" jchar
* _Jv_GetStringChars (jstring str
);
421 extern "C" void _Jv_MonitorEnter (jobject
);
422 extern "C" void _Jv_MonitorExit (jobject
);
423 extern "C" jstring
_Jv_NewStringLatin1(const char*, jsize
)
424 __attribute__((__malloc__
));
425 extern "C" jsize
_Jv_GetStringUTFLength (jstring
);
426 extern "C" jsize
_Jv_GetStringUTFRegion (jstring
, jsize
, jsize
, char *);
428 extern jint
_Jv_CreateJavaVM (void* /*vm_args*/);
431 _Jv_ThreadRun (java::lang::Thread
* thread
);
433 _Jv_AttachCurrentThread(java::lang::Thread
* thread
);
434 extern "C" java::lang::Thread
*
435 _Jv_AttachCurrentThread(jstring name
, java::lang::ThreadGroup
* group
);
436 extern "C" java::lang::Thread
*
437 _Jv_AttachCurrentThreadAsDaemon(jstring name
, java::lang::ThreadGroup
* group
);
438 extern "C" jint
_Jv_DetachCurrentThread (void);
440 extern "C" void _Jv_Throw (jthrowable
) __attribute__ ((__noreturn__
));
441 extern "C" void* _Jv_Malloc (jsize
) __attribute__((__malloc__
));
442 extern "C" void* _Jv_Realloc (void *, jsize
);
443 extern "C" void _Jv_Free (void*);
444 extern void (*_Jv_RegisterClassHook
) (jclass cl
);
445 extern "C" void _Jv_RegisterClassHookDefault (jclass
);
447 typedef unsigned short _Jv_ushort
__attribute__((__mode__(__HI__
)));
448 typedef unsigned int _Jv_uint
__attribute__((__mode__(__SI__
)));
453 _Jv_ushort length
; /* In bytes, of data portion, without final '\0'. */
454 char data
[1]; /* In Utf8 format, with final '\0'. */
458 #endif /* __JAVAPRIMS_H__ */