resolve.cc (_Jv_SearchMethodInClass): New function.
[gcc.git] / libjava / gcj / javaprims.h
1 // javaprims.h - Main external header file for libgcj. -*- c++ -*-
2
3 /* Copyright (C) 1998, 1999 Red Hat, Inc.
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 LineNumberInputStream;
73 class LineNumberReader;
74 class OutputStream;
75 class OutputStreamWriter;
76 class PipedInputStream;
77 class PipedOutputStream;
78 class PipedReader;
79 class PipedWriter;
80 class PrintStream;
81 class PrintWriter;
82 class PushbackInputStream;
83 class PushbackReader;
84 class RandomAccessFile;
85 class Reader;
86 class SequenceInputStream;
87 class Serializable;
88 class StreamTokenizer;
89 class StringBufferInputStream;
90 class StringReader;
91 class StringWriter;
92 class SyncFailedException;
93 class UTFDataFormatException;
94 class UnsupportedEncodingException;
95 class Writer;
96 }
97
98 namespace lang
99 {
100 class AbstractMethodError;
101 class ArithmeticException;
102 class ArrayIndexOutOfBoundsException;
103 class ArrayStoreException;
104 class Boolean;
105 class Byte;
106 class Character;
107 class Class;
108 class ClassCastException;
109 class ClassCircularityError;
110 class ClassFormatError;
111 class ClassLoader;
112 class ClassNotFoundException;
113 class CloneNotSupportedException;
114 class Cloneable;
115 class Comparable;
116 class Compiler;
117 class ConcreteProcess;
118 class Double;
119 class Error;
120 class Exception;
121 class ExceptionInInitializerError;
122 class Float;
123 class IllegalAccessError;
124 class IllegalAccessException;
125 class IllegalArgumentException;
126 class IllegalMonitorStateException;
127 class IllegalStateException;
128 class IllegalThreadStateException;
129 class IncompatibleClassChangeError;
130 class IndexOutOfBoundsException;
131 class InstantiationError;
132 class InstantiationException;
133 class Integer;
134 class InternalError;
135 class InterruptedException;
136 class LinkageError;
137 class Long;
138 class Math;
139 class NegativeArraySizeException;
140 class NoClassDefFoundError;
141 class NoSuchFieldError;
142 class NoSuchFieldException;
143 class NoSuchMethodError;
144 class NoSuchMethodException;
145 class NullPointerException;
146 class Number;
147 class NumberFormatException;
148 class Object;
149 class OutOfMemoryError;
150 class Process;
151 class Runnable;
152 class Runtime;
153 class RuntimeException;
154 class SecurityException;
155 class SecurityManager;
156 class Short;
157 class StackOverflowError;
158 class String;
159 class StringBuffer;
160 class StringIndexOutOfBoundsException;
161 class System;
162 class Thread;
163 class ThreadDeath;
164 class ThreadGroup;
165 class Throwable;
166 class UnknownError;
167 class UnsatisfiedLinkError;
168 class UnsupportedOperationException;
169 class VerifyError;
170 class VirtualMachineError;
171 class Void;
172 namespace reflect
173 {
174 class AccessibleObject;
175 class Array;
176 class Constructor;
177 class Field;
178 class InvocationTargetException;
179 class Member;
180 class Method;
181 class Modifier;
182 }
183 }
184
185 namespace util
186 {
187 class BitSet;
188 class Calendar;
189 class ConcurrentModificationException;
190 class Date;
191 class Dictionary;
192 class EmptyStackException;
193 class Enumeration;
194 class EventListener;
195 class EventObject;
196 class GregorianCalendar;
197 class Hashtable;
198 class HashtableEntry;
199 class HashtableEnumeration;
200 class ListResourceBundle;
201 class Locale;
202 class MissingResourceException;
203 class NoSuchElementException;
204 class Observable;
205 class Observer;
206 class Properties;
207 class PropertyResourceBundle;
208 class Random;
209 class ResourceBundle;
210 class SimpleTimeZone;
211 class Stack;
212 class StringTokenizer;
213 class TimeZone;
214 class TooManyListenersException;
215 class Vector;
216 class VectorEnumeration;
217 namespace jar
218 {
219 class JarEntry;
220 class JarFile;
221 class JarInputStream;
222 }
223
224 namespace zip
225 {
226 class Adler32;
227 class CRC32;
228 class CheckedInputStream;
229 class CheckedOutputStream;
230 class Checksum;
231 class DataFormatException;
232 class Deflater;
233 class DeflaterOutputStream;
234 class GZIPInputStream;
235 class GZIPOutputStream;
236 class Inflater;
237 class InflaterInputStream;
238 class ZipConstants;
239 class ZipEntry;
240 class ZipEnumeration;
241 class ZipException;
242 class ZipFile;
243 class ZipInputStream;
244 class ZipOutputStream;
245 }
246 }
247 }
248 };
249
250 typedef struct java::lang::Object* jobject;
251 typedef class java::lang::Class* jclass;
252 typedef class java::lang::Throwable* jthrowable;
253 typedef class java::lang::String* jstring;
254 struct _Jv_JNIEnv;
255
256 typedef struct _Jv_Field *jfieldID;
257 typedef struct _Jv_Method *jmethodID;
258
259 extern "C" jobject _Jv_AllocObject (jclass, jint) __attribute__((__malloc__));
260 extern "C" jboolean _Jv_IsInstanceOf(jobject, jclass);
261 extern "C" jstring _Jv_AllocString(jsize) __attribute__((__malloc__));
262 extern "C" jstring _Jv_NewString (const jchar*, jsize)
263 __attribute__((__malloc__));
264 extern "C" jchar* _Jv_GetStringChars (jstring str);
265 extern "C" jint _Jv_MonitorEnter (jobject);
266 extern "C" jint _Jv_MonitorExit (jobject);
267 extern "C" jstring _Jv_NewStringLatin1(const char*, jsize)
268 __attribute__((__malloc__));
269 extern "C" jsize _Jv_GetStringUTFLength (jstring);
270 extern "C" jsize _Jv_GetStringUTFRegion (jstring, jsize, jsize, char *);
271
272 extern "C" void _Jv_Throw (void *) __attribute__ ((__noreturn__));
273 extern "C" void _Jv_Sjlj_Throw (void *) __attribute__ ((__noreturn__));
274 extern "C" void* _Jv_Malloc (jsize) __attribute__((__malloc__));
275 extern "C" void* _Jv_Realloc (void *, jsize);
276 extern "C" void _Jv_Free (void*);
277
278 typedef unsigned short _Jv_ushort __attribute__((__mode__(__HI__)));
279 typedef unsigned int _Jv_uint __attribute__((__mode__(__SI__)));
280
281 typedef union {
282 jobject o;
283 jint i; // Also stores smaller integral types.
284 jfloat f;
285 jint ia[1]; // Half of _Jv_word2.
286 void* p;
287
288 // these are things we will store in the constant
289 jclass clazz;
290 jstring string;
291 struct _Jv_Field *field;
292 struct _Jv_Utf8Const *utf8;
293 struct _Jv_ResolvedMethod *rmethod;
294 } _Jv_word;
295
296 typedef union {
297 jint ia[2];
298 jlong l;
299 jdouble d;
300 } _Jv_word2;
301
302 struct _Jv_Utf8Const
303 {
304 _Jv_ushort hash;
305 _Jv_ushort length; /* In bytes, of data portion, without final '\0'. */
306 char data[1]; /* In Utf8 format, with final '\0'. */
307 };
308
309 #endif /* __JAVAPRIMS_H__ */