Jumbo patch:
[gcc.git] / libjava / gcj / javaprims.h
1 // javaprims.h - Main external header file for libgcj. -*- c++ -*-
2
3 /* Copyright (C) 1998, 1999, 2000 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 // FIXME: this is a hack until we get a proper gcjh.
15 // It is needed to work around system header files that define TRUE
16 // and FALSE.
17 #undef TRUE
18 #define TRUE TRUE
19 #undef FALSE
20 #define FALSE FALSE
21
22 // To force selection of correct types that will mangle consistently
23 // across platforms.
24 extern "Java"
25 {
26 typedef __java_byte jbyte;
27 typedef __java_short jshort;
28 typedef __java_int jint;
29 typedef __java_long jlong;
30 typedef __java_float jfloat;
31 typedef __java_double jdouble;
32 typedef __java_char jchar;
33 typedef __java_boolean jboolean;
34 typedef jint jsize;
35
36 // The following class declarations are automatically generated by
37 // the `classes.pl' script.
38 namespace java
39 {
40 namespace io
41 {
42 class BufferedInputStream;
43 class BufferedOutputStream;
44 class BufferedReader;
45 class BufferedWriter;
46 class ByteArrayInputStream;
47 class ByteArrayOutputStream;
48 class CharArrayReader;
49 class CharArrayWriter;
50 class CharConversionException;
51 class DataInput;
52 class DataInputStream;
53 class DataOutput;
54 class DataOutputStream;
55 class EOFException;
56 class File;
57 class FileDescriptor;
58 class FileInputStream;
59 class FileNotFoundException;
60 class FileOutputStream;
61 class FileReader;
62 class FileWriter;
63 class FilenameFilter;
64 class FilterInputStream;
65 class FilterOutputStream;
66 class FilterReader;
67 class FilterWriter;
68 class IOException;
69 class InputStream;
70 class InputStreamReader;
71 class InterruptedIOException;
72 class InvalidClassException;
73 class InvalidObjectException;
74 class LineNumberInputStream;
75 class LineNumberReader;
76 class NotActiveException;
77 class NotSerializableException;
78 class ObjectInput;
79 class ObjectInputStream;
80 class ObjectInputStream$GetField;
81 class ObjectInputValidation;
82 class ObjectOutput;
83 class ObjectOutputStream;
84 class ObjectOutputStream$PutField;
85 class ObjectStreamClass;
86 class ObjectStreamConstants;
87 class ObjectStreamException;
88 class ObjectStreamField;
89 class OptionalDataException;
90 class OutputStream;
91 class OutputStreamWriter;
92 class PipedInputStream;
93 class PipedOutputStream;
94 class PipedReader;
95 class PipedWriter;
96 class PrintStream;
97 class PrintWriter;
98 class PushbackInputStream;
99 class PushbackReader;
100 class RandomAccessFile;
101 class Reader;
102 class SequenceInputStream;
103 class Serializable;
104 class SerializablePermission;
105 class SimpleDigestStream;
106 class StreamCorruptedException;
107 class StreamTokenizer;
108 class StringBufferInputStream;
109 class StringReader;
110 class StringWriter;
111 class SyncFailedException;
112 class UTFDataFormatException;
113 class UnsupportedEncodingException;
114 class Writer;
115 }
116
117 namespace lang
118 {
119 class AbstractMethodError;
120 class ArithmeticException;
121 class ArrayIndexOutOfBoundsException;
122 class ArrayStoreException;
123 class Boolean;
124 class Byte;
125 class Character;
126 class Class;
127 class ClassCastException;
128 class ClassCircularityError;
129 class ClassFormatError;
130 class ClassLoader;
131 class ClassNotFoundException;
132 class CloneNotSupportedException;
133 class Cloneable;
134 class Comparable;
135 class Compiler;
136 class ConcreteProcess;
137 class Double;
138 class Error;
139 class Exception;
140 class ExceptionInInitializerError;
141 class Float;
142 class IllegalAccessError;
143 class IllegalAccessException;
144 class IllegalArgumentException;
145 class IllegalMonitorStateException;
146 class IllegalStateException;
147 class IllegalThreadStateException;
148 class IncompatibleClassChangeError;
149 class IndexOutOfBoundsException;
150 class InstantiationError;
151 class InstantiationException;
152 class Integer;
153 class InternalError;
154 class InterruptedException;
155 class LinkageError;
156 class Long;
157 class Math;
158 class NegativeArraySizeException;
159 class NoClassDefFoundError;
160 class NoSuchFieldError;
161 class NoSuchFieldException;
162 class NoSuchMethodError;
163 class NoSuchMethodException;
164 class NullPointerException;
165 class Number;
166 class NumberFormatException;
167 class Object;
168 class OutOfMemoryError;
169 class Process;
170 class Runnable;
171 class Runtime;
172 class RuntimeException;
173 class SecurityException;
174 class SecurityManager;
175 class Short;
176 class StackOverflowError;
177 class String;
178 class StringBuffer;
179 class StringIndexOutOfBoundsException;
180 class System;
181 class Thread;
182 class ThreadDeath;
183 class ThreadGroup;
184 class Throwable;
185 class UnknownError;
186 class UnsatisfiedLinkError;
187 class UnsupportedOperationException;
188 class VerifyError;
189 class VirtualMachineError;
190 class Void;
191 namespace reflect
192 {
193 class AccessibleObject;
194 class Array;
195 class Constructor;
196 class Field;
197 class InvocationTargetException;
198 class Member;
199 class Method;
200 class Modifier;
201 }
202 }
203
204 namespace util
205 {
206 class BitSet;
207 class Calendar;
208 class ConcurrentModificationException;
209 class Date;
210 class Dictionary;
211 class EmptyStackException;
212 class Enumeration;
213 class EventListener;
214 class EventObject;
215 class GregorianCalendar;
216 class Hashtable;
217 class HashtableEntry;
218 class HashtableEnumeration;
219 class ListResourceBundle;
220 class Locale;
221 class MissingResourceException;
222 class NoSuchElementException;
223 class Observable;
224 class Observer;
225 class Properties;
226 class PropertyResourceBundle;
227 class Random;
228 class ResourceBundle;
229 class SimpleTimeZone;
230 class Stack;
231 class StringTokenizer;
232 class TimeZone;
233 class TooManyListenersException;
234 class Vector;
235 class VectorEnumeration;
236 namespace jar
237 {
238 class JarEntry;
239 class JarFile;
240 class JarInputStream;
241 }
242
243 namespace zip
244 {
245 class Adler32;
246 class CRC32;
247 class CheckedInputStream;
248 class CheckedOutputStream;
249 class Checksum;
250 class DataFormatException;
251 class Deflater;
252 class DeflaterOutputStream;
253 class GZIPInputStream;
254 class GZIPOutputStream;
255 class Inflater;
256 class InflaterInputStream;
257 class ZipConstants;
258 class ZipEntry;
259 class ZipEnumeration;
260 class ZipException;
261 class ZipFile;
262 class ZipInputStream;
263 class ZipOutputStream;
264 }
265 }
266 }
267 };
268
269 typedef struct java::lang::Object* jobject;
270 typedef class java::lang::Class* jclass;
271 typedef class java::lang::Throwable* jthrowable;
272 typedef class java::lang::String* jstring;
273 struct _Jv_JNIEnv;
274
275 typedef struct _Jv_Field *jfieldID;
276 typedef struct _Jv_Method *jmethodID;
277
278 extern "C" jobject _Jv_AllocObject (jclass, jint) __attribute__((__malloc__));
279 extern "C" jboolean _Jv_IsInstanceOf(jobject, jclass);
280 extern "C" jstring _Jv_AllocString(jsize) __attribute__((__malloc__));
281 extern "C" jstring _Jv_NewString (const jchar*, jsize)
282 __attribute__((__malloc__));
283 extern "C" jchar* _Jv_GetStringChars (jstring str);
284 extern "C" jint _Jv_MonitorEnter (jobject);
285 extern "C" jint _Jv_MonitorExit (jobject);
286 extern "C" jstring _Jv_NewStringLatin1(const char*, jsize)
287 __attribute__((__malloc__));
288 extern "C" jsize _Jv_GetStringUTFLength (jstring);
289 extern "C" jsize _Jv_GetStringUTFRegion (jstring, jsize, jsize, char *);
290
291 extern "C" void _Jv_Throw (void *) __attribute__ ((__noreturn__));
292 extern "C" void _Jv_Sjlj_Throw (void *) __attribute__ ((__noreturn__));
293 extern "C" void* _Jv_Malloc (jsize) __attribute__((__malloc__));
294 extern "C" void* _Jv_Realloc (void *, jsize);
295 extern "C" void _Jv_Free (void*);
296
297 typedef unsigned short _Jv_ushort __attribute__((__mode__(__HI__)));
298 typedef unsigned int _Jv_uint __attribute__((__mode__(__SI__)));
299
300 struct _Jv_Utf8Const
301 {
302 _Jv_ushort hash;
303 _Jv_ushort length; /* In bytes, of data portion, without final '\0'. */
304 char data[1]; /* In Utf8 format, with final '\0'. */
305 };
306
307 #endif /* __JAVAPRIMS_H__ */