javaprims.h: Rebuilt class list.
[gcc.git] / libjava / gcj / javaprims.h
1 // javaprims.h - Main external header file for libgcj. -*- c++ -*-
2
3 /* Copyright (C) 1998, 1999, 2000, 2001 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 Boolean;
135 class Byte;
136 class CPlusPlusDemangler;
137 class Character;
138 class Character$Subset;
139 class Character$UnicodeBlock;
140 class Class;
141 class ClassCastException;
142 class ClassCircularityError;
143 class ClassFormatError;
144 class ClassLoader;
145 class ClassNotFoundException;
146 class CloneNotSupportedException;
147 class Cloneable;
148 class Comparable;
149 class Compiler;
150 class ConcreteProcess;
151 class Double;
152 class Error;
153 class Exception;
154 class ExceptionInInitializerError;
155 class Float;
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;
166 class Integer;
167 class InternalError;
168 class InterruptedException;
169 class LinkageError;
170 class Long;
171 class Math;
172 class NegativeArraySizeException;
173 class NoClassDefFoundError;
174 class NoSuchFieldError;
175 class NoSuchFieldException;
176 class NoSuchMethodError;
177 class NoSuchMethodException;
178 class NullPointerException;
179 class Number;
180 class NumberFormatException;
181 class Object;
182 class OutOfMemoryError;
183 class Package;
184 class Process;
185 class Runnable;
186 class Runtime;
187 class RuntimeException;
188 class RuntimePermission;
189 class SecurityContext;
190 class SecurityException;
191 class SecurityManager;
192 class Short;
193 class StackOverflowError;
194 class String;
195 class String$CaseInsensitiveComparator;
196 class StringBuffer;
197 class StringIndexOutOfBoundsException;
198 class System;
199 class Thread;
200 class ThreadDeath;
201 class ThreadGroup;
202 class ThreadLocal;
203 class ThreadLocal$Value;
204 class Throwable;
205 class UnknownError;
206 class UnsatisfiedLinkError;
207 class UnsupportedClassVersionError;
208 class UnsupportedOperationException;
209 class VMClassLoader;
210 class VMSecurityManager;
211 class VerifyError;
212 class VirtualMachineError;
213 class Void;
214 namespace ref
215 {
216 class PhantomReference;
217 class Reference;
218 class ReferenceQueue;
219 class SoftReference;
220 class WeakReference;
221 };
222
223 namespace reflect
224 {
225 class AccessibleObject;
226 class Array;
227 class Constructor;
228 class Field;
229 class InvocationTargetException;
230 class Member;
231 class Method;
232 class Modifier;
233 class ReflectPermission;
234 };
235 };
236
237 namespace util
238 {
239 class AbstractCollection;
240 class AbstractList;
241 class AbstractList$AbstractListItr;
242 class AbstractMap;
243 class AbstractSequentialList;
244 class AbstractSet;
245 class ArrayList;
246 class Arrays;
247 class Arrays$ListImpl;
248 class BasicMapEntry;
249 class BitSet;
250 class Calendar;
251 class Collection;
252 class Collections;
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;
270 class Comparator;
271 class ConcurrentModificationException;
272 class Date;
273 class Dictionary;
274 class EmptyStackException;
275 class Enumeration;
276 class EventListener;
277 class EventObject;
278 class GregorianCalendar;
279 class HashMap;
280 class HashMap$Entry;
281 class HashMap$HashIterator;
282 class HashSet;
283 class Hashtable;
284 class Hashtable$Entry;
285 class Hashtable$Enumerator;
286 class Hashtable$HashIterator;
287 class IdentityHashMap;
288 class IdentityHashMap$IdentityIterator;
289 class Iterator;
290 class LinkedList;
291 class LinkedList$Entry;
292 class LinkedList$LinkedListItr;
293 class List;
294 class ListIterator;
295 class ListResourceBundle;
296 class Locale;
297 class Map;
298 class Map$Entry;
299 class MissingResourceException;
300 class NoSuchElementException;
301 class Observable;
302 class Observer;
303 class Properties;
304 class PropertyPermission;
305 class PropertyResourceBundle;
306 class Random;
307 class ResourceBundle;
308 class Set;
309 class SimpleTimeZone;
310 class SortedMap;
311 class SortedSet;
312 class Stack;
313 class StringTokenizer;
314 class SubList;
315 class TimeZone;
316 class Timer;
317 class Timer$Scheduler;
318 class Timer$TaskQueue;
319 class TimerTask;
320 class TooManyListenersException;
321 class TreeMap;
322 class TreeMap$Node;
323 class TreeMap$SubMap;
324 class TreeMap$TreeIterator;
325 class TreeMap$VerifyResult;
326 class TreeSet;
327 class Vector;
328 class WeakHashMap;
329 class WeakHashMap$Entry;
330 class WeakHashMap$WeakBucket;
331 class WeakHashMap$WeakEntrySet;
332 namespace jar
333 {
334 class Attributes;
335 class Attributes$Name;
336 class JarEntry;
337 class JarException;
338 class JarFile;
339 class JarFile$JarEnumeration;
340 class JarInputStream;
341 class JarOutputStream;
342 class Manifest;
343 };
344
345 namespace zip
346 {
347 class Adler32;
348 class CRC32;
349 class CheckedInputStream;
350 class CheckedOutputStream;
351 class Checksum;
352 class DataFormatException;
353 class Deflater;
354 class DeflaterOutputStream;
355 class GZIPInputStream;
356 class GZIPOutputStream;
357 class Inflater;
358 class InflaterInputStream;
359 class ZipConstants;
360 class ZipEntry;
361 class ZipEnumeration;
362 class ZipException;
363 class ZipFile;
364 class ZipInputStream;
365 class ZipOutputStream;
366 };
367 };
368 };
369 };
370
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;
375 struct _Jv_JNIEnv;
376
377 typedef struct _Jv_Field *jfieldID;
378 typedef struct _Jv_Method *jmethodID;
379
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__));
384 #else
385 // Collector still needs to scan sync_info
386 static inline jobject _Jv_AllocPtrFreeObject (jclass klass, jint sz)
387 {
388 return _Jv_AllocObject(klass, sz);
389 }
390 #endif
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 *);
403
404 extern jint _Jv_CreateJavaVM (void* /*vm_args*/);
405
406 void
407 _Jv_ThreadRun (java::lang::Thread* thread);
408 jint
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);
413
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);
420
421 typedef unsigned short _Jv_ushort __attribute__((__mode__(__HI__)));
422 typedef unsigned int _Jv_uint __attribute__((__mode__(__SI__)));
423
424 struct _Jv_Utf8Const
425 {
426 _Jv_ushort hash;
427 _Jv_ushort length; /* In bytes, of data portion, without final '\0'. */
428 char data[1]; /* In Utf8 format, with final '\0'. */
429 };
430
431
432 #endif /* __JAVAPRIMS_H__ */