1 // javaprims.h - Main external header file for libgcj. -*- c++ -*-
4 /* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
5 2008, 2009 Free Software Foundation
7 This file is part of libgcj.
9 This software is copyrighted work licensed under the terms of the
10 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
13 #ifndef __JAVAPRIMS_H__
14 #define __JAVAPRIMS_H__
16 // Force C++ compiler to use Java-style exceptions.
17 #pragma GCC java_exceptions
19 #include <gcj/libgcj-config.h>
21 // FIXME: this is a hack until we get a proper gcjh.
22 // It is needed to work around system header files that define TRUE
29 // JNI calling convention also defined in jni.h */
31 #if (defined (_WIN32) || defined (__WIN32__) || defined (WIN32)) && !defined (_WIN64)
32 #define JNICALL __stdcall
38 // To force selection of correct types that will mangle consistently
42 typedef __java_byte jbyte
;
43 typedef __java_short jshort
;
44 typedef __java_int jint
;
45 typedef __java_long jlong
;
46 typedef __java_float jfloat
;
47 typedef __java_double jdouble
;
48 typedef __java_char jchar
;
49 typedef __java_boolean jboolean
;
52 // The following class declarations are automatically generated by
53 // the `classes.pl' script.
58 class BufferedInputStream
;
59 class BufferedOutputStream
;
62 class ByteArrayInputStream
;
63 class ByteArrayOutputStream
;
64 class CharArrayReader
;
65 class CharArrayWriter
;
66 class CharConversionException
;
70 class DataInputStream
;
72 class DataOutputStream
;
73 class DeleteFileHelper
;
74 class DeleteFileHelper$
1;
80 class FileInputStream
;
81 class FileNotFoundException
;
82 class FileOutputStream
;
87 class FilterInputStream
;
88 class FilterOutputStream
;
95 class InputStreamReader
;
96 class InterruptedIOException
;
97 class InvalidClassException
;
98 class InvalidObjectException
;
99 class LineNumberInputStream
;
100 class LineNumberReader
;
101 class NotActiveException
;
102 class NotSerializableException
;
104 class ObjectInputStream
;
105 class ObjectInputStream$
1;
106 class ObjectInputStream$
2;
107 class ObjectInputStream$GetField
;
108 class ObjectInputStream$ValidatorAndPriority
;
109 class ObjectInputValidation
;
111 class ObjectOutputStream
;
112 class ObjectOutputStream$
1;
113 class ObjectOutputStream$
2;
114 class ObjectOutputStream$PutField
;
115 class ObjectStreamClass
;
116 class ObjectStreamClass$
1;
117 class ObjectStreamClass$
2;
118 class ObjectStreamClass$InterfaceComparator
;
119 class ObjectStreamClass$MemberComparator
;
120 class ObjectStreamConstants
;
121 class ObjectStreamException
;
122 class ObjectStreamField
;
123 class ObjectStreamField$
1;
124 class OptionalDataException
;
126 class OutputStreamWriter
;
127 class PipedInputStream
;
128 class PipedOutputStream
;
133 class PushbackInputStream
;
134 class PushbackReader
;
135 class RandomAccessFile
;
137 class SequenceInputStream
;
139 class SerializablePermission
;
140 class StreamCorruptedException
;
141 class StreamTokenizer
;
142 class StringBufferInputStream
;
145 class SyncFailedException
;
146 class UTFDataFormatException
;
147 class UnsupportedEncodingException
;
149 class VMObjectInputStream
;
150 class VMObjectStreamClass
;
151 class WriteAbortedException
;
157 class AbstractMethodError
;
158 class AbstractStringBuffer
;
160 class ArithmeticException
;
161 class ArrayIndexOutOfBoundsException
;
162 class ArrayStoreException
;
163 class AssertionError
;
169 class Character$Subset
;
170 class Character$UnicodeBlock
;
171 class Character$UnicodeBlock$NameType
;
174 class ClassCastException
;
175 class ClassCircularityError
;
176 class ClassFormatError
;
178 class ClassLoader$AnnotationsKey
;
179 class ClassNotFoundException
;
180 class CloneNotSupportedException
;
188 class EnumConstantNotPresentException
;
191 class ExceptionInInitializerError
;
193 class IllegalAccessError
;
194 class IllegalAccessException
;
195 class IllegalArgumentException
;
196 class IllegalMonitorStateException
;
197 class IllegalStateException
;
198 class IllegalThreadStateException
;
199 class IncompatibleClassChangeError
;
200 class IndexOutOfBoundsException
;
201 class InheritableThreadLocal
;
202 class InstantiationError
;
203 class InstantiationException
;
206 class InterruptedException
;
211 class NegativeArraySizeException
;
212 class NoClassDefFoundError
;
213 class NoSuchFieldError
;
214 class NoSuchFieldException
;
215 class NoSuchMethodError
;
216 class NoSuchMethodException
;
217 class NullPointerException
;
219 class NumberFormatException
;
221 class OutOfMemoryError
;
225 class PosixProcess$EOFInputStream
;
226 class PosixProcess$ProcessManager
;
228 class ProcessBuilder
;
230 class ReflectiveOperationException
;
233 class RuntimeException
;
234 class RuntimePermission
;
235 class SecurityException
;
236 class SecurityManager
;
237 class SecurityManager$
1;
239 class StackOverflowError
;
240 class StackTraceElement
;
243 class String$CaseInsensitiveComparator
;
246 class StringIndexOutOfBoundsException
;
247 class SuppressWarnings
;
249 class System$EnvironmentCollection
;
250 class System$EnvironmentMap
;
251 class System$EnvironmentSet
;
254 class Thread$UncaughtExceptionHandler
;
258 class ThreadLocalMap
;
259 class ThreadLocalMap$Entry
;
261 class Throwable$StaticData
;
262 class TypeNotPresentException
;
264 class UnsatisfiedLinkError
;
265 class UnsupportedClassVersionError
;
266 class UnsupportedOperationException
;
274 class VirtualMachineError
;
277 class Win32Process$EOFInputStream
;
281 class AnnotationFormatError
;
282 class AnnotationTypeMismatchException
;
285 class IncompleteAnnotationException
;
288 class RetentionPolicy
;
294 class ClassDefinition
;
295 class ClassFileTransformer
;
296 class IllegalClassFormatException
;
297 class Instrumentation
;
298 class UnmodifiableClassException
;
303 class ClassLoadingMXBean
;
304 class CompilationMXBean
;
305 class GarbageCollectorMXBean
;
307 class ManagementFactory
;
308 class ManagementFactory$ManagementInvocationHandler
;
309 class ManagementPermission
;
311 class MemoryManagerMXBean
;
312 class MemoryNotificationInfo
;
313 class MemoryPoolMXBean
;
317 class OperatingSystemMXBean
;
321 class VMManagementFactory
;
326 class PhantomReference
;
328 class ReferenceQueue
;
335 class AccessibleObject
;
336 class AnnotatedElement
;
340 class GenericArrayType
;
341 class GenericDeclaration
;
342 class GenericSignatureFormatError
;
343 class InvocationHandler
;
344 class InvocationTargetException
;
345 class MalformedParameterizedTypeException
;
349 class ParameterizedType
;
351 class Proxy$ClassFactory
;
352 class Proxy$ProxyData
;
353 class Proxy$ProxySignature
;
354 class Proxy$ProxyType
;
355 class ReflectPermission
;
358 class UndeclaredThrowableException
;
366 class AbstractCollection
;
368 class AbstractList$
1;
369 class AbstractList$
2;
370 class AbstractList$
3;
371 class AbstractList$RandomAccessSubList
;
372 class AbstractList$SubList
;
378 class AbstractMap$SimpleEntry
;
379 class AbstractMap$SimpleImmutableEntry
;
381 class AbstractSequentialList
;
384 class ArrayDeque$DeqIterator
;
385 class ArrayDeque$DescendingIterator
;
388 class Arrays$ArrayList
;
394 class Collections$
1$SynchronizedMapEntry
;
403 class Collections$CheckedCollection
;
404 class Collections$CheckedIterator
;
405 class Collections$CheckedList
;
406 class Collections$CheckedListIterator
;
407 class Collections$CheckedMap
;
408 class Collections$CheckedMap$CheckedEntrySet
;
409 class Collections$CheckedRandomAccessList
;
410 class Collections$CheckedSet
;
411 class Collections$CheckedSortedMap
;
412 class Collections$CheckedSortedSet
;
413 class Collections$CopiesList
;
414 class Collections$EmptyList
;
415 class Collections$EmptyMap
;
416 class Collections$EmptySet
;
417 class Collections$LIFOQueue
;
418 class Collections$MapSet
;
419 class Collections$ReverseComparator
;
420 class Collections$SingletonList
;
421 class Collections$SingletonMap
;
422 class Collections$SingletonSet
;
423 class Collections$SynchronizedCollection
;
424 class Collections$SynchronizedIterator
;
425 class Collections$SynchronizedList
;
426 class Collections$SynchronizedListIterator
;
427 class Collections$SynchronizedMap
;
428 class Collections$SynchronizedRandomAccessList
;
429 class Collections$SynchronizedSet
;
430 class Collections$SynchronizedSortedMap
;
431 class Collections$SynchronizedSortedSet
;
432 class Collections$UnmodifiableCollection
;
433 class Collections$UnmodifiableIterator
;
434 class Collections$UnmodifiableList
;
435 class Collections$UnmodifiableListIterator
;
436 class Collections$UnmodifiableMap
;
437 class Collections$UnmodifiableMap$UnmodifiableEntrySet
;
438 class Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableMapEntry
;
439 class Collections$UnmodifiableRandomAccessList
;
440 class Collections$UnmodifiableSet
;
441 class Collections$UnmodifiableSortedMap
;
442 class Collections$UnmodifiableSortedSet
;
444 class ConcurrentModificationException
;
449 class DuplicateFormatFlagsException
;
450 class EmptyStackException
;
464 class EventListenerProxy
;
466 class FormatFlagsConversionMismatchException
;
468 class FormattableFlags
;
470 class Formatter$BigDecimalLayoutForm
;
471 class FormatterClosedException
;
472 class GregorianCalendar
;
477 class HashMap$HashEntry
;
478 class HashMap$HashIterator
;
484 class Hashtable$EntryEnumerator
;
485 class Hashtable$EntryIterator
;
486 class Hashtable$HashEntry
;
487 class Hashtable$KeyEnumerator
;
488 class Hashtable$KeyIterator
;
489 class Hashtable$ValueEnumerator
;
490 class Hashtable$ValueIterator
;
491 class IdentityHashMap
;
492 class IdentityHashMap$
1;
493 class IdentityHashMap$
2;
494 class IdentityHashMap$
3;
495 class IdentityHashMap$IdentityEntry
;
496 class IdentityHashMap$IdentityIterator
;
497 class IllegalFormatCodePointException
;
498 class IllegalFormatConversionException
;
499 class IllegalFormatException
;
500 class IllegalFormatFlagsException
;
501 class IllegalFormatPrecisionException
;
502 class IllegalFormatWidthException
;
503 class InputMismatchException
;
504 class InvalidPropertiesFormatException
;
507 class LinkedHashMap$
1;
508 class LinkedHashMap$LinkedHashEntry
;
512 class LinkedList$Entry
;
513 class LinkedList$LinkedListItr
;
516 class ListResourceBundle
;
520 class MissingFormatArgumentException
;
521 class MissingFormatWidthException
;
522 class MissingResourceException
;
525 class NoSuchElementException
;
529 class PriorityQueue$
1;
531 class PropertyPermission
;
532 class PropertyPermissionCollection
;
533 class PropertyResourceBundle
;
537 class ResourceBundle
;
538 class ResourceBundle$
1;
539 class ResourceBundle$BundleKey
;
541 class ServiceConfigurationError
;
543 class ServiceLoader$
1;
545 class SimpleTimeZone
;
549 class StringTokenizer
;
553 class Timer$Scheduler
;
554 class Timer$TaskQueue
;
556 class TooManyListenersException
;
565 class TreeMap$DescendingMap
;
566 class TreeMap$DescendingSet
;
567 class TreeMap$EntrySet
;
568 class TreeMap$KeySet
;
569 class TreeMap$NavigableEntrySet
;
570 class TreeMap$NavigableKeySet
;
572 class TreeMap$SubMap
;
573 class TreeMap$SubMap$EntrySet
;
574 class TreeMap$SubMap$KeySet
;
575 class TreeMap$SubMap$NavigableEntrySet
;
576 class TreeMap$SubMap$NavigableKeySet
;
577 class TreeMap$TreeIterator
;
580 class UnknownFormatConversionException
;
581 class UnknownFormatFlagsException
;
588 class WeakHashMap$WeakBucket
;
589 class WeakHashMap$WeakBucket$WeakEntry
;
590 class WeakHashMap$WeakEntrySet
;
593 class AbstractExecutorService
;
594 class ArrayBlockingQueue
;
595 class ArrayBlockingQueue$Itr
;
598 class BrokenBarrierException
;
600 class CancellationException
;
601 class CompletionService
;
602 class ConcurrentHashMap
;
603 class ConcurrentHashMap$EntryIterator
;
604 class ConcurrentHashMap$EntrySet
;
605 class ConcurrentHashMap$HashEntry
;
606 class ConcurrentHashMap$HashIterator
;
607 class ConcurrentHashMap$KeyIterator
;
608 class ConcurrentHashMap$KeySet
;
609 class ConcurrentHashMap$Segment
;
610 class ConcurrentHashMap$ValueIterator
;
611 class ConcurrentHashMap$Values
;
612 class ConcurrentHashMap$WriteThroughEntry
;
613 class ConcurrentLinkedQueue
;
614 class ConcurrentLinkedQueue$Itr
;
615 class ConcurrentLinkedQueue$Node
;
617 class ConcurrentNavigableMap
;
618 class ConcurrentSkipListMap
;
619 class ConcurrentSkipListMap$ComparableUsingComparator
;
620 class ConcurrentSkipListMap$EntryIterator
;
621 class ConcurrentSkipListMap$EntrySet
;
622 class ConcurrentSkipListMap$HeadIndex
;
623 class ConcurrentSkipListMap$Index
;
624 class ConcurrentSkipListMap$Iter
;
625 class ConcurrentSkipListMap$KeyIterator
;
626 class ConcurrentSkipListMap$KeySet
;
627 class ConcurrentSkipListMap$Node
;
628 class ConcurrentSkipListMap$SubMap
;
629 class ConcurrentSkipListMap$SubMap$SubMapEntryIterator
;
630 class ConcurrentSkipListMap$SubMap$SubMapIter
;
631 class ConcurrentSkipListMap$SubMap$SubMapKeyIterator
;
632 class ConcurrentSkipListMap$SubMap$SubMapValueIterator
;
633 class ConcurrentSkipListMap$ValueIterator
;
634 class ConcurrentSkipListMap$Values
;
635 class ConcurrentSkipListSet
;
636 class CopyOnWriteArrayList
;
637 class CopyOnWriteArrayList$
1;
638 class CopyOnWriteArrayList$
2;
639 class CopyOnWriteArrayList$
3;
640 class CopyOnWriteArrayList$RandomAccessSubList
;
641 class CopyOnWriteArrayList$SubList
;
642 class CopyOnWriteArraySet
;
643 class CountDownLatch
;
644 class CountDownLatch$Sync
;
646 class CyclicBarrier$Generation
;
648 class DelayQueue$Itr
;
651 class Exchanger$Node
;
652 class Exchanger$Slot
;
653 class ExecutionException
;
655 class ExecutorCompletionService
;
656 class ExecutorCompletionService$QueueingFuture
;
657 class ExecutorService
;
665 class Executors$DefaultThreadFactory
;
666 class Executors$DelegatedExecutorService
;
667 class Executors$DelegatedScheduledExecutorService
;
668 class Executors$FinalizableDelegatedExecutorService
;
669 class Executors$PrivilegedCallable
;
670 class Executors$PrivilegedCallableUsingCurrentClassLoader
;
671 class Executors$PrivilegedThreadFactory
;
672 class Executors$RunnableAdapter
;
675 class FutureTask$Sync
;
676 class LinkedBlockingDeque
;
677 class LinkedBlockingDeque$AbstractItr
;
678 class LinkedBlockingDeque$DescendingItr
;
679 class LinkedBlockingDeque$Itr
;
680 class LinkedBlockingDeque$Node
;
681 class LinkedBlockingQueue
;
682 class LinkedBlockingQueue$Itr
;
683 class LinkedBlockingQueue$Node
;
684 class PriorityBlockingQueue
;
685 class PriorityBlockingQueue$Itr
;
686 class RejectedExecutionException
;
687 class RejectedExecutionHandler
;
688 class RunnableFuture
;
689 class RunnableScheduledFuture
;
690 class ScheduledExecutorService
;
691 class ScheduledFuture
;
692 class ScheduledThreadPoolExecutor
;
693 class ScheduledThreadPoolExecutor$
1;
694 class ScheduledThreadPoolExecutor$DelayedWorkQueue
;
695 class ScheduledThreadPoolExecutor$ScheduledFutureTask
;
697 class Semaphore$FairSync
;
698 class Semaphore$NonfairSync
;
699 class Semaphore$Sync
;
700 class SynchronousQueue
;
701 class SynchronousQueue$EmptyIterator
;
702 class SynchronousQueue$FifoWaitQueue
;
703 class SynchronousQueue$LifoWaitQueue
;
704 class SynchronousQueue$TransferQueue
;
705 class SynchronousQueue$TransferQueue$QNode
;
706 class SynchronousQueue$TransferStack
;
707 class SynchronousQueue$TransferStack$SNode
;
708 class SynchronousQueue$Transferer
;
709 class SynchronousQueue$WaitQueue
;
711 class ThreadPoolExecutor
;
712 class ThreadPoolExecutor$AbortPolicy
;
713 class ThreadPoolExecutor$CallerRunsPolicy
;
714 class ThreadPoolExecutor$DiscardOldestPolicy
;
715 class ThreadPoolExecutor$DiscardPolicy
;
716 class ThreadPoolExecutor$Worker
;
725 class TimeoutException
;
730 class AtomicIntegerArray
;
731 class AtomicIntegerFieldUpdater
;
732 class AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl
;
734 class AtomicLongArray
;
735 class AtomicLongFieldUpdater
;
736 class AtomicLongFieldUpdater$CASUpdater
;
737 class AtomicLongFieldUpdater$LockedUpdater
;
738 class AtomicMarkableReference
;
739 class AtomicMarkableReference$ReferenceBooleanPair
;
740 class AtomicReference
;
741 class AtomicReferenceArray
;
742 class AtomicReferenceFieldUpdater
;
743 class AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl
;
744 class AtomicStampedReference
;
745 class AtomicStampedReference$ReferenceIntegerPair
;
750 class AbstractOwnableSynchronizer
;
751 class AbstractQueuedLongSynchronizer
;
752 class AbstractQueuedLongSynchronizer$ConditionObject
;
753 class AbstractQueuedLongSynchronizer$Node
;
754 class AbstractQueuedSynchronizer
;
755 class AbstractQueuedSynchronizer$ConditionObject
;
756 class AbstractQueuedSynchronizer$Node
;
762 class ReentrantLock$FairSync
;
763 class ReentrantLock$NonfairSync
;
764 class ReentrantLock$Sync
;
765 class ReentrantReadWriteLock
;
766 class ReentrantReadWriteLock$FairSync
;
767 class ReentrantReadWriteLock$NonfairSync
;
768 class ReentrantReadWriteLock$ReadLock
;
769 class ReentrantReadWriteLock$Sync
;
770 class ReentrantReadWriteLock$Sync$HoldCounter
;
771 class ReentrantReadWriteLock$Sync$ThreadLocalHoldCounter
;
772 class ReentrantReadWriteLock$WriteLock
;
779 class Attributes$Name
;
783 class JarFile$EntryInputStream
;
784 class JarFile$JarEnumeration
;
785 class JarInputStream
;
786 class JarOutputStream
;
792 class ConsoleHandler
;
795 class FileHandler$ostr
;
806 class LoggingPermission
;
808 class SimpleFormatter
;
816 class AbstractPreferences
;
817 class AbstractPreferences$
1;
818 class AbstractPreferences$
2;
819 class BackingStoreException
;
820 class InvalidPreferencesFormatException
;
821 class NodeChangeEvent
;
822 class NodeChangeListener
;
823 class PreferenceChangeEvent
;
824 class PreferenceChangeListener
;
827 class PreferencesFactory
;
835 class PatternSyntaxException
;
840 class CurrencyNameProvider
;
841 class LocaleNameProvider
;
842 class LocaleServiceProvider
;
843 class TimeZoneNameProvider
;
850 class CheckedInputStream
;
851 class CheckedOutputStream
;
853 class DataFormatException
;
855 class DeflaterOutputStream
;
856 class GZIPInputStream
;
857 class GZIPOutputStream
;
859 class InflaterInputStream
;
865 class ZipFile$PartialInputStream
;
866 class ZipFile$ZipEntryEnumeration
;
867 class ZipInputStream
;
868 class ZipOutputStream
;
872 // end of output of the `classes.pl' script.
875 typedef struct java::lang::Object
* jobject
;
876 typedef class java::lang::Class
* jclass
;
877 typedef class java::lang::Throwable
* jthrowable
;
878 typedef class java::lang::String
* jstring
;
881 typedef struct _Jv_Field
*jfieldID
;
882 typedef struct _Jv_Method
*jmethodID
;
884 extern "C" jobject
_Jv_AllocObject (jclass
) __attribute__((__malloc__
));
885 extern "C" jobject
_Jv_AllocObjectNoFinalizer (jclass
) __attribute__((__malloc__
));
886 extern "C" jobject
_Jv_AllocObjectNoInitNoFinalizer (jclass
) __attribute__((__malloc__
));
887 #ifdef JV_HASH_SYNCHRONIZATION
888 extern "C" jobject
_Jv_AllocPtrFreeObject (jclass
)
889 __attribute__((__malloc__
));
891 // Collector still needs to scan sync_info
892 static inline jobject
_Jv_AllocPtrFreeObject (jclass klass
)
894 return _Jv_AllocObject(klass
);
897 extern "C" jboolean
_Jv_IsInstanceOf(jobject
, jclass
);
898 extern "C" jstring
_Jv_AllocString(jsize
) __attribute__((__malloc__
));
899 extern "C" jstring
_Jv_NewString (const jchar
*, jsize
)
900 __attribute__((__malloc__
));
901 extern jint
_Jv_FormatInt (jchar
* bufend
, jint num
);
902 extern "C" jchar
* _Jv_GetStringChars (jstring str
);
903 extern "C" void _Jv_MonitorEnter (jobject
);
904 extern "C" void _Jv_MonitorExit (jobject
);
905 extern "C" jstring
_Jv_NewStringUTF (const char *bytes
)
906 __attribute__((__malloc__
));
907 extern "C" jstring
_Jv_NewStringLatin1(const char*, jsize
)
908 __attribute__((__malloc__
));
909 extern "C" jsize
_Jv_GetStringUTFLength (jstring
);
910 extern "C" jsize
_Jv_GetStringUTFRegion (jstring
, jsize
, jsize
, char *);
911 extern "C" jint
_Jv_hashUtf8String (const char*, int);
912 extern bool _Jv_is_proxy (void *pc
);
916 // a VM initialization option
918 // extra information associated with this option
922 struct _Jv_VMInitArgs
924 // for compatibility with JavaVMInitArgs
927 // number of VM initialization options
930 // an array of VM initialization options
931 struct _Jv_VMOption
* options
;
933 // true if the option parser should ignore unrecognized options
934 jboolean ignoreUnrecognized
;
937 extern "C" jint
_Jv_CreateJavaVM (struct _Jv_VMInitArgs
*);
940 _Jv_ThreadRun (java::lang::Thread
* thread
);
942 _Jv_AttachCurrentThread(java::lang::Thread
* thread
);
943 extern "C" java::lang::Thread
*
944 _Jv_AttachCurrentThread(jstring name
, java::lang::ThreadGroup
* group
);
945 extern "C" java::lang::Thread
*
946 _Jv_AttachCurrentThreadAsDaemon(jstring name
, java::lang::ThreadGroup
* group
);
947 extern "C" jint
_Jv_DetachCurrentThread (void);
949 extern "C" void _Jv_Throw (jthrowable
) __attribute__ ((__noreturn__
));
950 extern "C" void* _Jv_Malloc (jsize
) __attribute__((__malloc__
));
951 extern "C" void* _Jv_Realloc (void *, jsize
);
952 extern "C" void _Jv_Free (void*);
953 extern void (*_Jv_RegisterClassHook
) (jclass cl
);
954 extern "C" void _Jv_RegisterClassHookDefault (jclass
);
956 typedef unsigned short _Jv_ushort
__attribute__((__mode__(__HI__
)));
957 typedef unsigned int _Jv_uint
__attribute__((__mode__(__SI__
)));
958 typedef unsigned int _Jv_ulong
__attribute__((__mode__(__DI__
)));
960 // The type to use when treating a pointer as an integer. Similar to
962 typedef unsigned int _Jv_uintptr_t
__attribute__((__mode__(__pointer__
)));
967 _Jv_ushort length
; /* In bytes, of data portion, without final '\0'. */
968 char data
[1]; /* In Utf8 format, with final '\0'. */
970 /** Return same value of java.lang.String's hashCode. */
971 jint
hash32() { return _Jv_hashUtf8String(data
, length
); }
972 /** Return a hash code that has at least 16 bits of information. */
973 _Jv_ushort
hash16 () { return hash
; }
974 /** Return a hash code that has at least 8 bits of information. */
975 _Jv_ushort
hash8 () { return hash
; }
976 /** Length in bytes of the UTF8-encoding. */
977 _Jv_ushort
len () const { return length
; }
978 /** Pointer to the first byte in the NUL-terminated UTF8-encoding. */
979 char* chars() { return data
; }
980 /** Pointer to the NUL byte that terminated the UTF8-encoding. */
981 char* limit() { return data
+length
; }
982 /** Return the first byte in the UTF8-encoding. */
983 char first() const { return data
[0]; }
984 /** Create a (non-interned) java.lang.String from this UTF8Const. */
985 jstring
toString() { return _Jv_NewStringUTF(data
); }
986 /** Given an UTF8 string, how many bytes needed for a UTF8Const,
987 including struct header, and final NUL. I.e. what to pas to malloc. */
988 static int space_needed (const char *, int len
)
989 { return sizeof (_Jv_Utf8Const
) + len
+ 1; }
990 /** Given an allocated _Jv_Utf8Const, copy / fill it in. */
991 void init (const char *s
, int len
);
992 friend jboolean
_Jv_equalUtf8Consts (const _Jv_Utf8Const
*, const _Jv_Utf8Const
*);
993 friend jboolean
_Jv_equal (_Jv_Utf8Const
*, jstring
, jint
);
994 friend jboolean
_Jv_equaln (_Jv_Utf8Const
*, jstring
, jint
);
995 friend jboolean
_Jv_equalUtf8Classnames (const _Jv_Utf8Const
*,
996 const _Jv_Utf8Const
*);
997 friend jboolean
_Jv_isPrimitiveOrDerived (const _Jv_Utf8Const
*);
998 friend _Jv_Utf8Const
*_Jv_makeUtf8Const (const char*, int);
999 friend _Jv_Utf8Const
*_Jv_makeUtf8Const (jstring
);
1000 friend jstring
_Jv_NewStringUtf8Const (_Jv_Utf8Const
*);
1004 #endif /* __JAVAPRIMS_H__ */