OSDN Git Service

* gcj/javaprims.h: Rebuilt CNI namespace declarations.
[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  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 BlockDataException;
43       class BufferedInputStream;
44       class BufferedOutputStream;
45       class BufferedReader;
46       class BufferedWriter;
47       class ByteArrayInputStream;
48       class ByteArrayOutputStream;
49       class CharArrayReader;
50       class CharArrayWriter;
51       class CharConversionException;
52       class DataInput;
53       class DataInputStream;
54       class DataOutput;
55       class DataOutputStream;
56       class EOFException;
57       class Externalizable;
58       class File;
59       class FileDescriptor;
60       class FileFilter;
61       class FileInputStream;
62       class FileNotFoundException;
63       class FileOutputStream;
64       class FilePermission;
65       class FileReader;
66       class FileWriter;
67       class FilenameFilter;
68       class FilterInputStream;
69       class FilterOutputStream;
70       class FilterReader;
71       class FilterWriter;
72       class IOException;
73       class InputStream;
74       class InputStreamReader;
75       class InterfaceComparator;
76       class InterruptedIOException;
77       class InvalidClassException;
78       class InvalidObjectException;
79       class LineNumberInputStream;
80       class LineNumberReader;
81       class MemberComparator;
82       class NotActiveException;
83       class NotSerializableException;
84       class ObjectInput;
85       class ObjectInputStream;
86       class ObjectInputStream$GetField;
87       class ObjectInputValidation;
88       class ObjectOutput;
89       class ObjectOutputStream;
90       class ObjectOutputStream$PutField;
91       class ObjectStreamClass;
92       class ObjectStreamConstants;
93       class ObjectStreamException;
94       class ObjectStreamField;
95       class OptionalDataException;
96       class OutputStream;
97       class OutputStreamWriter;
98       class PipedInputStream;
99       class PipedOutputStream;
100       class PipedReader;
101       class PipedWriter;
102       class PrintStream;
103       class PrintWriter;
104       class PushbackInputStream;
105       class PushbackReader;
106       class RandomAccessFile;
107       class Reader;
108       class SequenceInputStream;
109       class Serializable;
110       class SerializablePermission;
111       class StreamCorruptedException;
112       class StreamTokenizer;
113       class StringBufferInputStream;
114       class StringReader;
115       class StringWriter;
116       class SyncFailedException;
117       class UTFDataFormatException;
118       class UnsupportedEncodingException;
119       class ValidatorAndPriority;
120       class WriteAbortedException;
121       class Writer;
122     };
123
124     namespace lang
125     {
126       class AbstractMethodError;
127       class ArithmeticException;
128       class ArrayIndexOutOfBoundsException;
129       class ArrayStoreException;
130       class Boolean;
131       class Byte;
132       class CPlusPlusDemangler;
133       class Character;
134       class Character$Subset;
135       class Character$UnicodeBlock;
136       class Class;
137       class ClassCastException;
138       class ClassCircularityError;
139       class ClassFormatError;
140       class ClassLoader;
141       class ClassNotFoundException;
142       class CloneNotSupportedException;
143       class Cloneable;
144       class Comparable;
145       class Compiler;
146       class ConcreteProcess;
147       class Double;
148       class Error;
149       class Exception;
150       class ExceptionInInitializerError;
151       class Float;
152       class IllegalAccessError;
153       class IllegalAccessException;
154       class IllegalArgumentException;
155       class IllegalMonitorStateException;
156       class IllegalStateException;
157       class IllegalThreadStateException;
158       class IncompatibleClassChangeError;
159       class IndexOutOfBoundsException;
160       class InstantiationError;
161       class InstantiationException;
162       class Integer;
163       class InternalError;
164       class InterruptedException;
165       class LinkageError;
166       class Long;
167       class Math;
168       class NegativeArraySizeException;
169       class NoClassDefFoundError;
170       class NoSuchFieldError;
171       class NoSuchFieldException;
172       class NoSuchMethodError;
173       class NoSuchMethodException;
174       class NullPointerException;
175       class Number;
176       class NumberFormatException;
177       class Object;
178       class OutOfMemoryError;
179       class Process;
180       class Runnable;
181       class Runtime;
182       class RuntimeException;
183       class RuntimePermission;
184       class SecurityException;
185       class SecurityManager;
186       class Short;
187       class StackOverflowError;
188       class String;
189       class StringBuffer;
190       class StringIndexOutOfBoundsException;
191       class System;
192       class Thread;
193       class ThreadDeath;
194       class ThreadGroup;
195       class Throwable;
196       class UnknownError;
197       class UnsatisfiedLinkError;
198       class UnsupportedOperationException;
199       class VerifyError;
200       class VirtualMachineError;
201       class Void;
202       namespace ref
203       {
204         class PhantomReference;
205         class Reference;
206         class ReferenceQueue;
207         class SoftReference;
208         class WeakReference;
209       };
210
211       namespace reflect
212       {
213         class AccessibleObject;
214         class Array;
215         class Constructor;
216         class Field;
217         class InvocationTargetException;
218         class Member;
219         class Method;
220         class Modifier;
221         class ReflectPermission;
222       };
223     };
224
225     namespace util
226     {
227       class AbstractCollection;
228       class AbstractList;
229       class AbstractList$AbstractListItr;
230       class AbstractMap;
231       class AbstractSequentialList;
232       class AbstractSet;
233       class ArrayList;
234       class Arrays;
235       class Arrays$ListImpl;
236       class BitSet;
237       class Calendar;
238       class Collection;
239       class Collections;
240       class Collections$SynchronizedCollection;
241       class Collections$SynchronizedIterator;
242       class Collections$SynchronizedList;
243       class Collections$SynchronizedListIterator;
244       class Collections$SynchronizedMap;
245       class Collections$SynchronizedSet;
246       class Collections$SynchronizedSortedMap;
247       class Collections$SynchronizedSortedSet;
248       class Collections$UnmodifiableCollection;
249       class Collections$UnmodifiableIterator;
250       class Collections$UnmodifiableList;
251       class Collections$UnmodifiableListIterator;
252       class Collections$UnmodifiableMap;
253       class Collections$UnmodifiableSet;
254       class Collections$UnmodifiableSortedMap;
255       class Collections$UnmodifiableSortedSet;
256       class Comparator;
257       class ConcurrentModificationException;
258       class Date;
259       class Dictionary;
260       class EmptyStackException;
261       class Enumeration;
262       class EventListener;
263       class EventObject;
264       class GregorianCalendar;
265       class HashMap;
266       class HashMap$Entry;
267       class HashMap$HashIterator;
268       class HashSet;
269       class Hashtable;
270       class Hashtable$Entry;
271       class Hashtable$Enumerator;
272       class Hashtable$HashIterator;
273       class Iterator;
274       class LinkedList;
275       class LinkedList$Entry;
276       class LinkedList$LinkedListItr;
277       class List;
278       class ListIterator;
279       class ListResourceBundle;
280       class Locale;
281       class Map;
282       class Map$Entry;
283       class MissingResourceException;
284       class NoSuchElementException;
285       class Observable;
286       class Observer;
287       class Properties;
288       class PropertyPermission;
289       class PropertyResourceBundle;
290       class Random;
291       class ResourceBundle;
292       class Set;
293       class SimpleTimeZone;
294       class SortedMap;
295       class SortedSet;
296       class Stack;
297       class StringTokenizer;
298       class SubList;
299       class TimeZone;
300       class Timer;
301       class Timer$Scheduler;
302       class Timer$TaskQueue;
303       class TimerTask;
304       class TooManyListenersException;
305       class Vector;
306       class WeakHashMap;
307       class WeakHashMap$Entry;
308       class WeakHashMap$WeakBucket;
309       class WeakHashMap$WeakEntrySet;
310       namespace jar
311       {
312         class Attributes;
313         class Attributes$Name;
314         class JarEntry;
315         class JarException;
316         class JarFile;
317         class JarFile$JarEnumeration;
318         class JarInputStream;
319         class JarOutputStream;
320         class Manifest;
321       };
322
323       namespace zip
324       {
325         class Adler32;
326         class CRC32;
327         class CheckedInputStream;
328         class CheckedOutputStream;
329         class Checksum;
330         class DataFormatException;
331         class Deflater;
332         class DeflaterOutputStream;
333         class GZIPInputStream;
334         class GZIPOutputStream;
335         class Inflater;
336         class InflaterInputStream;
337         class ZipConstants;
338         class ZipEntry;
339         class ZipEnumeration;
340         class ZipException;
341         class ZipFile;
342         class ZipInputStream;
343         class ZipOutputStream;
344       };
345     };
346   };
347 };
348   
349 typedef struct java::lang::Object* jobject;
350 typedef class java::lang::Class* jclass;
351 typedef class java::lang::Throwable* jthrowable;
352 typedef class java::lang::String* jstring;
353 struct _Jv_JNIEnv;
354
355 typedef struct _Jv_Field *jfieldID;
356 typedef struct _Jv_Method *jmethodID;
357
358 extern "C" jobject _Jv_AllocObject (jclass, jint) __attribute__((__malloc__));
359 extern "C" jboolean _Jv_IsInstanceOf(jobject, jclass);
360 extern "C" jstring _Jv_AllocString(jsize) __attribute__((__malloc__));
361 extern "C" jstring _Jv_NewString (const jchar*, jsize)
362   __attribute__((__malloc__));
363 extern "C" jchar* _Jv_GetStringChars (jstring str);
364 extern "C" jint _Jv_MonitorEnter (jobject);
365 extern "C" jint _Jv_MonitorExit (jobject);
366 extern "C" jstring _Jv_NewStringLatin1(const char*, jsize)
367   __attribute__((__malloc__));
368 extern "C" jsize _Jv_GetStringUTFLength (jstring);
369 extern "C" jsize _Jv_GetStringUTFRegion (jstring, jsize, jsize, char *);
370
371 extern "C" void _Jv_Throw (void *) __attribute__ ((__noreturn__));
372 extern "C" void _Jv_Sjlj_Throw (void *) __attribute__ ((__noreturn__));
373 extern "C" void* _Jv_Malloc (jsize) __attribute__((__malloc__));
374 extern "C" void* _Jv_Realloc (void *, jsize);
375 extern "C" void _Jv_Free (void*);
376
377 typedef unsigned short _Jv_ushort __attribute__((__mode__(__HI__)));
378 typedef unsigned int _Jv_uint __attribute__((__mode__(__SI__)));
379
380 struct _Jv_Utf8Const
381 {
382   _Jv_ushort hash;
383   _Jv_ushort length;    /* In bytes, of data portion, without final '\0'. */
384   char data[1];         /* In Utf8 format, with final '\0'. */
385 };
386
387 #endif /* __JAVAPRIMS_H__ */