1 /* src/vm/stringlocal.h - string header
3 Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4 R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5 C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6 Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Christian Thalinger
31 $Id: stringlocal.h 3984 2005-12-22 10:56:20Z twisti $
36 #ifndef _STRINGLOCAL_H
37 #define _STRINGLOCAL_H
39 typedef struct literalstring literalstring;
45 #include "vm/global.h" /* required before java_lang_String.h */
46 #include "native/include/java_lang_String.h"
48 #include "vm/hashtable.h"
52 /* data structure of internal javastrings stored in global hashtable **********/
54 struct literalstring {
55 literalstring *hashlink; /* link for external hash chain */
56 java_objectheader *string;
60 /* javastring-hashtable */
61 extern hashtable hashtable_string;
64 /* global string definitions **************************************************/
66 /* exception/error super class */
68 extern const char *string_java_lang_Throwable;
69 extern const char *string_java_lang_VMThrowable;
72 /* specify some exception strings for code generation */
74 extern const char *string_java_lang_ArithmeticException;
75 extern const char *string_java_lang_ArithmeticException_message;
76 extern const char *string_java_lang_ArrayIndexOutOfBoundsException;
77 extern const char *string_java_lang_ArrayStoreException;
78 extern const char *string_java_lang_ClassCastException;
79 extern const char *string_java_lang_ClassNotFoundException;
80 extern const char *string_java_lang_CloneNotSupportedException;
81 extern const char *string_java_lang_Exception;
82 extern const char *string_java_lang_IllegalAccessException;
83 extern const char *string_java_lang_IllegalArgumentException;
84 extern const char *string_java_lang_IllegalMonitorStateException;
85 extern const char *string_java_lang_IndexOutOfBoundsException;
86 extern const char *string_java_lang_InstantiationException;
87 extern const char *string_java_lang_InterruptedException;
88 extern const char *string_java_lang_NegativeArraySizeException;
89 extern const char *string_java_lang_NoSuchFieldException;
90 extern const char *string_java_lang_NoSuchMethodException;
91 extern const char *string_java_lang_NullPointerException;
92 extern const char *string_java_lang_reflect_InvocationTargetException;
95 /* specify some error strings for code generation */
97 extern const char *string_java_lang_AbstractMethodError;
98 extern const char *string_java_lang_ClassCircularityError;
99 extern const char *string_java_lang_ClassFormatError;
100 extern const char *string_java_lang_Error;
101 extern const char *string_java_lang_ExceptionInInitializerError;
102 extern const char *string_java_lang_IncompatibleClassChangeError;
103 extern const char *string_java_lang_InternalError;
104 extern const char *string_java_lang_InstantiationError;
105 extern const char *string_java_lang_LinkageError;
106 extern const char *string_java_lang_NoClassDefFoundError;
107 extern const char *string_java_lang_NoSuchFieldError;
108 extern const char *string_java_lang_NoSuchMethodError;
109 extern const char *string_java_lang_OutOfMemoryError;
110 extern const char *string_java_lang_UnsatisfiedLinkError;
111 extern const char *string_java_lang_UnsupportedClassVersionError;
112 extern const char *string_java_lang_VerifyError;
113 extern const char *string_java_lang_VirtualMachineError;
116 /* function prototypes ********************************************************/
118 /* initialize string subsystem */
119 bool string_init(void);
121 void stringtable_update(void);
123 /* creates a new object of type java/lang/String from a utf-text */
124 java_lang_String *javastring_new(utf *text);
126 /* creates a new object of type java/lang/String from a utf-text, changes slashes to dots */
127 java_lang_String *javastring_new_slash_to_dot(utf *text);
129 /* creates a new object of type java/lang/String from a c-string */
130 java_lang_String *javastring_new_char(const char *text);
132 /* make c-string from a javastring (debugging) */
133 char *javastring_tochar(java_objectheader *s);
135 /* make utf symbol from javastring */
136 utf *javastring_toutf(java_lang_String *string, bool isclassname);
138 /* returns length of javastring */
139 s4 javastring_strlen(java_lang_String *s);
141 /* creates a new javastring with the text of the u2-array */
142 java_objectheader *literalstring_u2(java_chararray *a, u4 length, u4 offset,
145 /* creates a new javastring with the text of the utf-symbol */
146 java_objectheader *literalstring_new(utf *u);
148 /* dispose a javastring */
149 void literalstring_free(java_objectheader*);
151 #endif /* _STRINGLOCAL_H */
155 * These are local overrides for various environment variables in Emacs.
156 * Please do not remove this and leave it at the end of the file, where
157 * Emacs will automagically detect them.
158 * ---------------------------------------------------------------------
161 * indent-tabs-mode: t