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
;
134 class AssertionError
;
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
;
209 class UnsatisfiedLinkError
;
210 class UnsupportedClassVersionError
;
211 class UnsupportedOperationException
;
213 class VMSecurityManager
;
216 class VirtualMachineError
;
220 class PhantomReference
;
222 class ReferenceQueue
;
229 class AccessibleObject
;
233 class InvocationHandler
;
234 class InvocationTargetException
;
239 class Proxy$ProxyData
;
240 class Proxy$ProxyType
;
241 class ReflectPermission
;
242 class UndeclaredThrowableException
;
248 class AbstractCollection
;
251 class AbstractMap$BasicMapEntry
;
252 class AbstractSequentialList
;
256 class Arrays$ArrayList
;
261 class Collections$CopiesList
;
262 class Collections$EmptyList
;
263 class Collections$EmptyMap
;
264 class Collections$EmptySet
;
265 class Collections$ReverseComparator
;
266 class Collections$SingletonList
;
267 class Collections$SingletonMap
;
268 class Collections$SingletonSet
;
269 class Collections$SynchronizedCollection
;
270 class Collections$SynchronizedIterator
;
271 class Collections$SynchronizedList
;
272 class Collections$SynchronizedListIterator
;
273 class Collections$SynchronizedMap
;
274 class Collections$SynchronizedMapEntry
;
275 class Collections$SynchronizedRandomAccessList
;
276 class Collections$SynchronizedSet
;
277 class Collections$SynchronizedSortedMap
;
278 class Collections$SynchronizedSortedSet
;
279 class Collections$UnmodifiableCollection
;
280 class Collections$UnmodifiableEntrySet
;
281 class Collections$UnmodifiableIterator
;
282 class Collections$UnmodifiableList
;
283 class Collections$UnmodifiableListIterator
;
284 class Collections$UnmodifiableMap
;
285 class Collections$UnmodifiableRandomAccessList
;
286 class Collections$UnmodifiableSet
;
287 class Collections$UnmodifiableSortedMap
;
288 class Collections$UnmodifiableSortedSet
;
290 class ConcurrentModificationException
;
293 class EmptyStackException
;
296 class EventListenerProxy
;
298 class GregorianCalendar
;
300 class HashMap$HashEntry
;
301 class HashMap$HashIterator
;
304 class Hashtable$Enumerator
;
305 class Hashtable$HashEntry
;
306 class Hashtable$HashIterator
;
307 class IdentityHashMap
;
308 class IdentityHashMap$IdentityEntry
;
309 class IdentityHashMap$IdentityIterator
;
312 class LinkedHashMap$LinkedHashEntry
;
315 class LinkedList$Entry
;
316 class LinkedList$LinkedListItr
;
319 class ListResourceBundle
;
324 class MissingResourceException
;
326 class NoSuchElementException
;
330 class PropertyPermission
;
331 class PropertyPermissionCollection
;
332 class PropertyResourceBundle
;
335 class RandomAccessSubList
;
336 class ResourceBundle
;
337 class ResourceBundle$Security
;
339 class SimpleTimeZone
;
343 class StringTokenizer
;
347 class Timer$Scheduler
;
348 class Timer$TaskQueue
;
350 class TooManyListenersException
;
353 class TreeMap$SubMap
;
354 class TreeMap$TreeIterator
;
358 class WeakHashMap$WeakBucket
;
359 class WeakHashMap$WeakEntry
;
360 class WeakHashMap$WeakEntrySet
;
364 class Attributes$Name
;
368 class JarFile$JarEnumeration
;
369 class JarInputStream
;
370 class JarOutputStream
;
378 class CheckedInputStream
;
379 class CheckedOutputStream
;
381 class DataFormatException
;
383 class DeflaterOutputStream
;
384 class GZIPInputStream
;
385 class GZIPOutputStream
;
387 class InflaterInputStream
;
392 class ZipFile$PartialInputStream
;
393 class ZipFile$ZipEntryEnumeration
;
394 class ZipInputStream
;
395 class ZipOutputStream
;
401 typedef struct java::lang::Object
* jobject
;
402 typedef class java::lang::Class
* jclass
;
403 typedef class java::lang::Throwable
* jthrowable
;
404 typedef class java::lang::String
* jstring
;
407 typedef struct _Jv_Field
*jfieldID
;
408 typedef struct _Jv_Method
*jmethodID
;
410 extern "C" jobject
_Jv_AllocObject (jclass
, jint
) __attribute__((__malloc__
));
411 extern "C" jobject
_Jv_AllocObjectNoFinalizer (jclass
, jint
) __attribute__((__malloc__
));
412 extern "C" jobject
_Jv_AllocObjectNoInitNoFinalizer (jclass
, jint
) __attribute__((__malloc__
));
413 #ifdef JV_HASH_SYNCHRONIZATION
414 extern "C" jobject
_Jv_AllocPtrFreeObject (jclass
, jint
)
415 __attribute__((__malloc__
));
417 // Collector still needs to scan sync_info
418 static inline jobject
_Jv_AllocPtrFreeObject (jclass klass
, jint sz
)
420 return _Jv_AllocObject(klass
, sz
);
423 extern "C" jboolean
_Jv_IsInstanceOf(jobject
, jclass
);
424 extern "C" jstring
_Jv_AllocString(jsize
) __attribute__((__malloc__
));
425 extern "C" jstring
_Jv_NewString (const jchar
*, jsize
)
426 __attribute__((__malloc__
));
427 extern jint
_Jv_FormatInt (jchar
* bufend
, jint num
);
428 extern "C" jchar
* _Jv_GetStringChars (jstring str
);
429 extern "C" void _Jv_MonitorEnter (jobject
);
430 extern "C" void _Jv_MonitorExit (jobject
);
431 extern "C" jstring
_Jv_NewStringLatin1(const char*, jsize
)
432 __attribute__((__malloc__
));
433 extern "C" jsize
_Jv_GetStringUTFLength (jstring
);
434 extern "C" jsize
_Jv_GetStringUTFRegion (jstring
, jsize
, jsize
, char *);
436 extern jint
_Jv_CreateJavaVM (void* /*vm_args*/);
439 _Jv_ThreadRun (java::lang::Thread
* thread
);
441 _Jv_AttachCurrentThread(java::lang::Thread
* thread
);
442 extern "C" java::lang::Thread
*
443 _Jv_AttachCurrentThread(jstring name
, java::lang::ThreadGroup
* group
);
444 extern "C" java::lang::Thread
*
445 _Jv_AttachCurrentThreadAsDaemon(jstring name
, java::lang::ThreadGroup
* group
);
446 extern "C" jint
_Jv_DetachCurrentThread (void);
448 extern "C" void _Jv_Throw (jthrowable
) __attribute__ ((__noreturn__
));
449 extern "C" void* _Jv_Malloc (jsize
) __attribute__((__malloc__
));
450 extern "C" void* _Jv_Realloc (void *, jsize
);
451 extern "C" void _Jv_Free (void*);
452 extern void (*_Jv_RegisterClassHook
) (jclass cl
);
453 extern "C" void _Jv_RegisterClassHookDefault (jclass
);
455 typedef unsigned short _Jv_ushort
__attribute__((__mode__(__HI__
)));
456 typedef unsigned int _Jv_uint
__attribute__((__mode__(__SI__
)));
461 _Jv_ushort length
; /* In bytes, of data portion, without final '\0'. */
462 char data
[1]; /* In Utf8 format, with final '\0'. */
466 #endif /* __JAVAPRIMS_H__ */