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 SecurityException;
190 class SecurityManager;
192 class StackOverflowError;
195 class StringIndexOutOfBoundsException;
201 class ThreadLocal$Value;
204 class UnsatisfiedLinkError;
205 class UnsupportedOperationException;
208 class VirtualMachineError;
212 class PhantomReference;
214 class ReferenceQueue;
221 class AccessibleObject;
225 class InvocationTargetException;
229 class ReflectPermission;
235 class AbstractCollection;
237 class AbstractList$AbstractListItr;
239 class AbstractSequentialList;
243 class Arrays$ListImpl;
249 class Collections$ReverseComparator;
250 class Collections$SynchronizedCollection;
251 class Collections$SynchronizedIterator;
252 class Collections$SynchronizedList;
253 class Collections$SynchronizedListIterator;
254 class Collections$SynchronizedMap;
255 class Collections$SynchronizedSet;
256 class Collections$SynchronizedSortedMap;
257 class Collections$SynchronizedSortedSet;
258 class Collections$UnmodifiableCollection;
259 class Collections$UnmodifiableIterator;
260 class Collections$UnmodifiableList;
261 class Collections$UnmodifiableListIterator;
262 class Collections$UnmodifiableMap;
263 class Collections$UnmodifiableSet;
264 class Collections$UnmodifiableSortedMap;
265 class Collections$UnmodifiableSortedSet;
267 class ConcurrentModificationException;
270 class EmptyStackException;
274 class GregorianCalendar;
277 class HashMap$HashIterator;
280 class Hashtable$Entry;
281 class Hashtable$Enumerator;
282 class Hashtable$HashIterator;
285 class LinkedList$Entry;
286 class LinkedList$LinkedListItr;
289 class ListResourceBundle;
293 class MissingResourceException;
294 class NoSuchElementException;
298 class PropertyPermission;
299 class PropertyResourceBundle;
301 class ResourceBundle;
303 class SimpleTimeZone;
307 class StringTokenizer;
311 class Timer$Scheduler;
312 class Timer$TaskQueue;
314 class TooManyListenersException;
317 class TreeMap$SubMap;
318 class TreeMap$TreeIterator;
319 class TreeMap$VerifyResult;
323 class WeakHashMap$Entry;
324 class WeakHashMap$WeakBucket;
325 class WeakHashMap$WeakEntrySet;
329 class Attributes$Name;
333 class JarFile$JarEnumeration;
334 class JarInputStream;
335 class JarOutputStream;
343 class CheckedInputStream;
344 class CheckedOutputStream;
346 class DataFormatException;
348 class DeflaterOutputStream;
349 class GZIPInputStream;
350 class GZIPOutputStream;
352 class InflaterInputStream;
355 class ZipEnumeration;
358 class ZipInputStream;
359 class ZipOutputStream;
365 typedef struct java::lang::Object* jobject;
366 typedef class java::lang::Class* jclass;
367 typedef class java::lang::Throwable* jthrowable;
368 typedef class java::lang::String* jstring;
371 typedef struct _Jv_Field *jfieldID;
372 typedef struct _Jv_Method *jmethodID;
374 extern "C" jobject _Jv_AllocObject (jclass, jint) __attribute__((__malloc__));
375 #ifdef JV_HASH_SYNCHRONIZATION
376 extern "C" jobject _Jv_AllocPtrFreeObject (jclass, jint)
377 __attribute__((__malloc__));
379 // Collector still needs to scan sync_info
380 static inline jobject _Jv_AllocPtrFreeObject (jclass klass, jint sz)
382 return _Jv_AllocObject(klass, sz);
385 extern "C" jboolean _Jv_IsInstanceOf(jobject, jclass);
386 extern "C" jstring _Jv_AllocString(jsize) __attribute__((__malloc__));
387 extern "C" jstring _Jv_NewString (const jchar*, jsize)
388 __attribute__((__malloc__));
389 extern jint _Jv_FormatInt (jchar* bufend, jint num);
390 extern "C" jchar* _Jv_GetStringChars (jstring str);
391 extern "C" void _Jv_MonitorEnter (jobject);
392 extern "C" void _Jv_MonitorExit (jobject);
393 extern "C" jstring _Jv_NewStringLatin1(const char*, jsize)
394 __attribute__((__malloc__));
395 extern "C" jsize _Jv_GetStringUTFLength (jstring);
396 extern "C" jsize _Jv_GetStringUTFRegion (jstring, jsize, jsize, char *);
398 extern jint _Jv_CreateJavaVM (void* /*vm_args*/);
399 extern "C" java::lang::Thread*
400 _Jv_AttachCurrentThread(jstring name, java::lang::ThreadGroup* group);
401 extern "C" jint _Jv_DetachCurrentThread (void);
403 extern "C" void _Jv_Throw (jthrowable) __attribute__ ((__noreturn__));
404 extern "C" void* _Jv_Malloc (jsize) __attribute__((__malloc__));
405 extern "C" void* _Jv_Realloc (void *, jsize);
406 extern "C" void _Jv_Free (void*);
408 typedef unsigned short _Jv_ushort __attribute__((__mode__(__HI__)));
409 typedef unsigned int _Jv_uint __attribute__((__mode__(__SI__)));
414 _Jv_ushort length; /* In bytes, of data portion, without final '\0'. */
415 char data[1]; /* In Utf8 format, with final '\0'. */
419 #endif /* __JAVAPRIMS_H__ */