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
;
138 class Character$Subset
;
139 class Character$UnicodeBlock
;
141 class ClassCastException
;
142 class ClassCircularityError
;
143 class ClassFormatError
;
145 class ClassNotFoundException
;
146 class CloneNotSupportedException
;
150 class ConcreteProcess
;
154 class ExceptionInInitializerError
;
156 class IllegalAccessError
;
157 class IllegalAccessException
;
158 class IllegalArgumentException
;
159 class IllegalMonitorStateException
;
160 class IllegalStateException
;
161 class IllegalThreadStateException
;
162 class IncompatibleClassChangeError
;
163 class IndexOutOfBoundsException
;
164 class InstantiationError
;
165 class InstantiationException
;
168 class InterruptedException
;
172 class NegativeArraySizeException
;
173 class NoClassDefFoundError
;
174 class NoSuchFieldError
;
175 class NoSuchFieldException
;
176 class NoSuchMethodError
;
177 class NoSuchMethodException
;
178 class NullPointerException
;
180 class NumberFormatException
;
182 class OutOfMemoryError
;
187 class RuntimeException
;
188 class RuntimePermission
;
189 class SecurityContext
;
190 class SecurityException
;
191 class SecurityManager
;
193 class StackOverflowError
;
195 class String$CaseInsensitiveComparator
;
197 class StringIndexOutOfBoundsException
;
203 class ThreadLocal$Value
;
206 class UnsatisfiedLinkError
;
207 class UnsupportedClassVersionError
;
208 class UnsupportedOperationException
;
210 class VMSecurityManager
;
212 class VirtualMachineError
;
216 class PhantomReference
;
218 class ReferenceQueue
;
225 class AccessibleObject
;
229 class InvocationTargetException
;
233 class ReflectPermission
;
239 class AbstractCollection
;
241 class AbstractList$AbstractListItr
;
243 class AbstractSequentialList
;
247 class Arrays$ListImpl
;
253 class Collections$ReverseComparator
;
254 class Collections$SynchronizedCollection
;
255 class Collections$SynchronizedIterator
;
256 class Collections$SynchronizedList
;
257 class Collections$SynchronizedListIterator
;
258 class Collections$SynchronizedMap
;
259 class Collections$SynchronizedSet
;
260 class Collections$SynchronizedSortedMap
;
261 class Collections$SynchronizedSortedSet
;
262 class Collections$UnmodifiableCollection
;
263 class Collections$UnmodifiableIterator
;
264 class Collections$UnmodifiableList
;
265 class Collections$UnmodifiableListIterator
;
266 class Collections$UnmodifiableMap
;
267 class Collections$UnmodifiableSet
;
268 class Collections$UnmodifiableSortedMap
;
269 class Collections$UnmodifiableSortedSet
;
271 class ConcurrentModificationException
;
274 class EmptyStackException
;
278 class GregorianCalendar
;
281 class HashMap$HashIterator
;
284 class Hashtable$Entry
;
285 class Hashtable$Enumerator
;
286 class Hashtable$HashIterator
;
287 class IdentityHashMap
;
288 class IdentityHashMap$IdentityIterator
;
291 class LinkedList$Entry
;
292 class LinkedList$LinkedListItr
;
295 class ListResourceBundle
;
299 class MissingResourceException
;
300 class NoSuchElementException
;
304 class PropertyPermission
;
305 class PropertyResourceBundle
;
307 class ResourceBundle
;
309 class SimpleTimeZone
;
313 class StringTokenizer
;
317 class Timer$Scheduler
;
318 class Timer$TaskQueue
;
320 class TooManyListenersException
;
323 class TreeMap$SubMap
;
324 class TreeMap$TreeIterator
;
325 class TreeMap$VerifyResult
;
329 class WeakHashMap$Entry
;
330 class WeakHashMap$WeakBucket
;
331 class WeakHashMap$WeakEntrySet
;
335 class Attributes$Name
;
339 class JarFile$JarEnumeration
;
340 class JarInputStream
;
341 class JarOutputStream
;
349 class CheckedInputStream
;
350 class CheckedOutputStream
;
352 class DataFormatException
;
354 class DeflaterOutputStream
;
355 class GZIPInputStream
;
356 class GZIPOutputStream
;
358 class InflaterInputStream
;
361 class ZipEnumeration
;
364 class ZipInputStream
;
365 class ZipOutputStream
;
371 typedef struct java::lang::Object
* jobject
;
372 typedef class java::lang::Class
* jclass
;
373 typedef class java::lang::Throwable
* jthrowable
;
374 typedef class java::lang::String
* jstring
;
377 typedef struct _Jv_Field
*jfieldID
;
378 typedef struct _Jv_Method
*jmethodID
;
380 extern "C" jobject
_Jv_AllocObject (jclass
, jint
) __attribute__((__malloc__
));
381 #ifdef JV_HASH_SYNCHRONIZATION
382 extern "C" jobject
_Jv_AllocPtrFreeObject (jclass
, jint
)
383 __attribute__((__malloc__
));
385 // Collector still needs to scan sync_info
386 static inline jobject
_Jv_AllocPtrFreeObject (jclass klass
, jint sz
)
388 return _Jv_AllocObject(klass
, sz
);
391 extern "C" jboolean
_Jv_IsInstanceOf(jobject
, jclass
);
392 extern "C" jstring
_Jv_AllocString(jsize
) __attribute__((__malloc__
));
393 extern "C" jstring
_Jv_NewString (const jchar
*, jsize
)
394 __attribute__((__malloc__
));
395 extern jint
_Jv_FormatInt (jchar
* bufend
, jint num
);
396 extern "C" jchar
* _Jv_GetStringChars (jstring str
);
397 extern "C" void _Jv_MonitorEnter (jobject
);
398 extern "C" void _Jv_MonitorExit (jobject
);
399 extern "C" jstring
_Jv_NewStringLatin1(const char*, jsize
)
400 __attribute__((__malloc__
));
401 extern "C" jsize
_Jv_GetStringUTFLength (jstring
);
402 extern "C" jsize
_Jv_GetStringUTFRegion (jstring
, jsize
, jsize
, char *);
404 extern jint
_Jv_CreateJavaVM (void* /*vm_args*/);
407 _Jv_ThreadRun (java::lang::Thread
* thread
);
409 _Jv_AttachCurrentThread(java::lang::Thread
* thread
);
410 extern "C" java::lang::Thread
*
411 _Jv_AttachCurrentThread(jstring name
, java::lang::ThreadGroup
* group
);
412 extern "C" jint
_Jv_DetachCurrentThread (void);
414 extern "C" void _Jv_Throw (jthrowable
) __attribute__ ((__noreturn__
));
415 extern "C" void* _Jv_Malloc (jsize
) __attribute__((__malloc__
));
416 extern "C" void* _Jv_Realloc (void *, jsize
);
417 extern "C" void _Jv_Free (void*);
418 extern void (*_Jv_RegisterClassHook
) (jclass cl
);
419 extern "C" void _Jv_RegisterClassHookDefault (jclass
);
421 typedef unsigned short _Jv_ushort
__attribute__((__mode__(__HI__
)));
422 typedef unsigned int _Jv_uint
__attribute__((__mode__(__SI__
)));
427 _Jv_ushort length
; /* In bytes, of data portion, without final '\0'. */
428 char data
[1]; /* In Utf8 format, with final '\0'. */
432 #endif /* __JAVAPRIMS_H__ */