OSDN Git Service

* gcj/javaprims.h: Updated class declaration list.
[pf3gnuchains/gcc-fork.git] / libjava / gcj / javaprims.h
1 // javaprims.h - Main external header file for libgcj.  -*- c++ -*-
2
3 /* Copyright (C) 1998, 1999, 2000, 2001, 2002  Free Software Foundation
4
5    This file is part of libgcj.
6
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
9 details.  */
10
11 #ifndef __JAVAPRIMS_H__
12 #define __JAVAPRIMS_H__
13
14 // Force C++ compiler to use Java-style exceptions.
15 #pragma GCC java_exceptions
16
17 #include <gcj/libgcj-config.h>
18
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
21 // and FALSE.
22 #undef TRUE
23 #define TRUE TRUE
24 #undef FALSE
25 #define FALSE FALSE
26
27 // To force selection of correct types that will mangle consistently
28 // across platforms.
29 extern "Java"
30 {
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;
39   typedef jint jsize;
40
41   // The following class declarations are automatically generated by
42   // the `classes.pl' script.
43   namespace java
44   {
45     namespace io
46     {
47       class BufferedInputStream;
48       class BufferedOutputStream;
49       class BufferedReader;
50       class BufferedWriter;
51       class ByteArrayInputStream;
52       class ByteArrayOutputStream;
53       class CharArrayReader;
54       class CharArrayWriter;
55       class CharConversionException;
56       class DataInput;
57       class DataInputStream;
58       class DataOutput;
59       class DataOutputStream;
60       class EOFException;
61       class Externalizable;
62       class File;
63       class FileDescriptor;
64       class FileFilter;
65       class FileInputStream;
66       class FileNotFoundException;
67       class FileOutputStream;
68       class FilePermission;
69       class FileReader;
70       class FileWriter;
71       class FilenameFilter;
72       class FilterInputStream;
73       class FilterOutputStream;
74       class FilterReader;
75       class FilterWriter;
76       class IOException;
77       class InputStream;
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;
88       class ObjectInput;
89       class ObjectInputStream;
90       class ObjectInputStream$GetField;
91       class ObjectInputValidation;
92       class ObjectOutput;
93       class ObjectOutputStream;
94       class ObjectOutputStream$PutField;
95       class ObjectStreamClass;
96       class ObjectStreamConstants;
97       class ObjectStreamException;
98       class ObjectStreamField;
99       class OptionalDataException;
100       class OutputStream;
101       class OutputStreamWriter;
102       class PipedInputStream;
103       class PipedOutputStream;
104       class PipedReader;
105       class PipedWriter;
106       class PrintStream;
107       class PrintWriter;
108       class PushbackInputStream;
109       class PushbackReader;
110       class RandomAccessFile;
111       class Reader;
112       class SequenceInputStream;
113       class Serializable;
114       class SerializablePermission;
115       class StreamCorruptedException;
116       class StreamTokenizer;
117       class StringBufferInputStream;
118       class StringReader;
119       class StringWriter;
120       class SyncFailedException;
121       class UTFDataFormatException;
122       class UnsupportedEncodingException;
123       class ValidatorAndPriority;
124       class WriteAbortedException;
125       class Writer;
126     };
127
128     namespace lang
129     {
130       class AbstractMethodError;
131       class ArithmeticException;
132       class ArrayIndexOutOfBoundsException;
133       class ArrayStoreException;
134       class AssertionError;
135       class Boolean;
136       class Byte;
137       class CPlusPlusDemangler;
138       class CharSequence;
139       class Character;
140       class Character$Subset;
141       class Character$UnicodeBlock;
142       class Class;
143       class ClassCastException;
144       class ClassCircularityError;
145       class ClassFormatError;
146       class ClassLoader;
147       class ClassNotFoundException;
148       class CloneNotSupportedException;
149       class Cloneable;
150       class Comparable;
151       class Compiler;
152       class ConcreteProcess;
153       class Double;
154       class Error;
155       class Exception;
156       class ExceptionInInitializerError;
157       class Float;
158       class IllegalAccessError;
159       class IllegalAccessException;
160       class IllegalArgumentException;
161       class IllegalMonitorStateException;
162       class IllegalStateException;
163       class IllegalThreadStateException;
164       class IncompatibleClassChangeError;
165       class IndexOutOfBoundsException;
166       class InheritableThreadLocal;
167       class InstantiationError;
168       class InstantiationException;
169       class Integer;
170       class InternalError;
171       class InterruptedException;
172       class LinkageError;
173       class Long;
174       class Math;
175       class NegativeArraySizeException;
176       class NoClassDefFoundError;
177       class NoSuchFieldError;
178       class NoSuchFieldException;
179       class NoSuchMethodError;
180       class NoSuchMethodException;
181       class NullPointerException;
182       class Number;
183       class NumberFormatException;
184       class Object;
185       class OutOfMemoryError;
186       class Package;
187       class Process;
188       class Runnable;
189       class Runtime;
190       class RuntimeException;
191       class RuntimePermission;
192       class SecurityContext;
193       class SecurityException;
194       class SecurityManager;
195       class Short;
196       class StackOverflowError;
197       class StackTraceElement;
198       class StrictMath;
199       class String;
200       class String$CaseInsensitiveComparator;
201       class StringBuffer;
202       class StringIndexOutOfBoundsException;
203       class System;
204       class Thread;
205       class ThreadDeath;
206       class ThreadGroup;
207       class ThreadLocal;
208       class Throwable;
209       class UnknownError;
210       class UnsatisfiedLinkError;
211       class UnsupportedClassVersionError;
212       class UnsupportedOperationException;
213       class VMClassLoader;
214       class VMSecurityManager;
215       class VerifyError;
216       class VirtualMachineError;
217       class Void;
218       namespace ref
219       {
220         class PhantomReference;
221         class Reference;
222         class ReferenceQueue;
223         class SoftReference;
224         class WeakReference;
225       };
226
227       namespace reflect
228       {
229         class AccessibleObject;
230         class Array;
231         class Constructor;
232         class Field;
233         class InvocationTargetException;
234         class Member;
235         class Method;
236         class Modifier;
237         class ReflectPermission;
238       };
239     };
240
241     namespace util
242     {
243       class AbstractCollection;
244       class AbstractList;
245       class AbstractMap;
246       class AbstractMap$BasicMapEntry;
247       class AbstractSequentialList;
248       class AbstractSet;
249       class ArrayList;
250       class Arrays;
251       class Arrays$ArrayList;
252       class BitSet;
253       class Calendar;
254       class Collection;
255       class Collections;
256       class Collections$CopiesList;
257       class Collections$EmptyList;
258       class Collections$EmptyMap;
259       class Collections$EmptySet;
260       class Collections$ReverseComparator;
261       class Collections$SingletonList;
262       class Collections$SingletonMap;
263       class Collections$SingletonSet;
264       class Collections$SynchronizedCollection;
265       class Collections$SynchronizedIterator;
266       class Collections$SynchronizedList;
267       class Collections$SynchronizedListIterator;
268       class Collections$SynchronizedMap;
269       class Collections$SynchronizedMapEntry;
270       class Collections$SynchronizedRandomAccessList;
271       class Collections$SynchronizedSet;
272       class Collections$SynchronizedSortedMap;
273       class Collections$SynchronizedSortedSet;
274       class Collections$UnmodifiableCollection;
275       class Collections$UnmodifiableEntrySet;
276       class Collections$UnmodifiableIterator;
277       class Collections$UnmodifiableList;
278       class Collections$UnmodifiableListIterator;
279       class Collections$UnmodifiableMap;
280       class Collections$UnmodifiableRandomAccessList;
281       class Collections$UnmodifiableSet;
282       class Collections$UnmodifiableSortedMap;
283       class Collections$UnmodifiableSortedSet;
284       class Comparator;
285       class ConcurrentModificationException;
286       class Date;
287       class Dictionary;
288       class EmptyStackException;
289       class Enumeration;
290       class EventListener;
291       class EventListenerProxy;
292       class EventObject;
293       class GregorianCalendar;
294       class HashMap;
295       class HashMap$HashEntry;
296       class HashMap$HashIterator;
297       class HashSet;
298       class Hashtable;
299       class Hashtable$Enumerator;
300       class Hashtable$HashEntry;
301       class Hashtable$HashIterator;
302       class IdentityHashMap;
303       class IdentityHashMap$IdentityEntry;
304       class IdentityHashMap$IdentityIterator;
305       class Iterator;
306       class LinkedHashMap;
307       class LinkedHashMap$LinkedHashEntry;
308       class LinkedHashSet;
309       class LinkedList;
310       class LinkedList$Entry;
311       class LinkedList$LinkedListItr;
312       class List;
313       class ListIterator;
314       class ListResourceBundle;
315       class Locale;
316       class Map;
317       class Map$Entry;
318       class Map$Map;
319       class MissingResourceException;
320       class MyResources;
321       class NoSuchElementException;
322       class Observable;
323       class Observer;
324       class Properties;
325       class PropertyPermission;
326       class PropertyPermissionCollection;
327       class PropertyResourceBundle;
328       class Random;
329       class RandomAccess;
330       class RandomAccessSubList;
331       class ResourceBundle;
332       class ResourceBundle$Security;
333       class Set;
334       class SimpleTimeZone;
335       class SortedMap;
336       class SortedSet;
337       class Stack;
338       class StringTokenizer;
339       class SubList;
340       class TimeZone;
341       class Timer;
342       class Timer$Scheduler;
343       class Timer$TaskQueue;
344       class TimerTask;
345       class TooManyListenersException;
346       class TreeMap;
347       class TreeMap$Node;
348       class TreeMap$SubMap;
349       class TreeMap$TreeIterator;
350       class TreeSet;
351       class Vector;
352       class WeakHashMap;
353       class WeakHashMap$WeakBucket;
354       class WeakHashMap$WeakEntry;
355       class WeakHashMap$WeakEntrySet;
356       namespace jar
357       {
358         class Attributes;
359         class Attributes$Name;
360         class JarEntry;
361         class JarException;
362         class JarFile;
363         class JarFile$JarEnumeration;
364         class JarInputStream;
365         class JarOutputStream;
366         class Manifest;
367       };
368
369       namespace zip
370       {
371         class Adler32;
372         class CRC32;
373         class CheckedInputStream;
374         class CheckedOutputStream;
375         class Checksum;
376         class DataFormatException;
377         class Deflater;
378         class DeflaterOutputStream;
379         class GZIPInputStream;
380         class GZIPOutputStream;
381         class Inflater;
382         class InflaterInputStream;
383         class ZipConstants;
384         class ZipEntry;
385         class ZipException;
386         class ZipFile;
387         class ZipFile$PartialInputStream;
388         class ZipFile$ZipEntryEnumeration;
389         class ZipInputStream;
390         class ZipOutputStream;
391       };
392     };
393   };
394 };
395   
396 typedef struct java::lang::Object* jobject;
397 typedef class java::lang::Class* jclass;
398 typedef class java::lang::Throwable* jthrowable;
399 typedef class java::lang::String* jstring;
400 struct _Jv_JNIEnv;
401
402 typedef struct _Jv_Field *jfieldID;
403 typedef struct _Jv_Method *jmethodID;
404
405 extern "C" jobject _Jv_AllocObject (jclass, jint) __attribute__((__malloc__));
406 extern "C" jobject _Jv_AllocObjectNoFinalizer (jclass, jint) __attribute__((__malloc__));
407 extern "C" jobject _Jv_AllocObjectNoInitNoFinalizer (jclass, jint) __attribute__((__malloc__));
408 #ifdef JV_HASH_SYNCHRONIZATION
409   extern "C" jobject _Jv_AllocPtrFreeObject (jclass, jint)
410                             __attribute__((__malloc__));
411 #else
412   // Collector still needs to scan sync_info
413   static inline jobject _Jv_AllocPtrFreeObject (jclass klass, jint sz)
414   {
415     return _Jv_AllocObject(klass, sz);
416   }
417 #endif
418 extern "C" jboolean _Jv_IsInstanceOf(jobject, jclass);
419 extern "C" jstring _Jv_AllocString(jsize) __attribute__((__malloc__));
420 extern "C" jstring _Jv_NewString (const jchar*, jsize)
421   __attribute__((__malloc__));
422 extern jint _Jv_FormatInt (jchar* bufend, jint num);
423 extern "C" jchar* _Jv_GetStringChars (jstring str);
424 extern "C" void _Jv_MonitorEnter (jobject);
425 extern "C" void _Jv_MonitorExit (jobject);
426 extern "C" jstring _Jv_NewStringLatin1(const char*, jsize)
427   __attribute__((__malloc__));
428 extern "C" jsize _Jv_GetStringUTFLength (jstring);
429 extern "C" jsize _Jv_GetStringUTFRegion (jstring, jsize, jsize, char *);
430
431 extern jint _Jv_CreateJavaVM (void* /*vm_args*/);
432
433 void
434 _Jv_ThreadRun (java::lang::Thread* thread);
435 jint
436 _Jv_AttachCurrentThread(java::lang::Thread* thread);
437 extern "C" java::lang::Thread*
438 _Jv_AttachCurrentThread(jstring name, java::lang::ThreadGroup* group);
439 extern "C" java::lang::Thread*
440 _Jv_AttachCurrentThreadAsDaemon(jstring name, java::lang::ThreadGroup* group);
441 extern "C" jint _Jv_DetachCurrentThread (void);
442
443 extern "C" void _Jv_Throw (jthrowable) __attribute__ ((__noreturn__));
444 extern "C" void* _Jv_Malloc (jsize) __attribute__((__malloc__));
445 extern "C" void* _Jv_Realloc (void *, jsize);
446 extern "C" void _Jv_Free (void*);
447 extern void (*_Jv_RegisterClassHook) (jclass cl);
448 extern "C" void _Jv_RegisterClassHookDefault (jclass);
449
450 typedef unsigned short _Jv_ushort __attribute__((__mode__(__HI__)));
451 typedef unsigned int _Jv_uint __attribute__((__mode__(__SI__)));
452
453 struct _Jv_Utf8Const
454 {
455   _Jv_ushort hash;
456   _Jv_ushort length;    /* In bytes, of data portion, without final '\0'. */
457   char data[1];         /* In Utf8 format, with final '\0'. */
458 };
459
460
461 #endif /* __JAVAPRIMS_H__ */