1 /* vm/stringlocal.h - java.lang.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 1926 2005-02-10 10:47:29Z twisti $
36 #ifndef _STRINGLOCAL_H
37 #define _STRINGLOCAL_H
39 typedef struct literalstring literalstring;
42 #include "native/include/java_lang_String.h"
43 #include "vm/global.h"
44 #include "vm/tables.h"
48 /* data structure of internal javastrings stored in global hashtable **********/
50 struct literalstring {
51 literalstring *hashlink; /* link for external hash chain */
52 java_objectheader *string;
55 /* javastring-hashtable */
56 extern hashtable string_hash;
59 /* function prototypes ********************************************************/
61 void stringtable_update(void);
63 /* creates a new object of type java/lang/String from a utf-text */
64 java_lang_String *javastring_new(utf *text);
66 /* creates a new object of type java/lang/String from a c-string */
67 java_lang_String *javastring_new_char(const char *text);
69 /* make c-string from a javastring (debugging) */
70 char *javastring_tochar(java_objectheader *s);
72 /* make utf symbol from javastring */
73 utf *javastring_toutf(java_lang_String *string, bool isclassname);
75 /* creates a new javastring with the text of the u2-array */
76 java_objectheader *literalstring_u2(java_chararray *a, u4 length, u4 offset,
79 /* creates a new javastring with the text of the utf-symbol */
80 java_objectheader *literalstring_new(utf *u);
82 /* dispose a javastring */
83 void literalstring_free(java_objectheader*);
85 #endif /* _STRINGLOCAL_H */
89 * These are local overrides for various environment variables in Emacs.
90 * Please do not remove this and leave it at the end of the file, where
91 * Emacs will automagically detect them.
92 * ---------------------------------------------------------------------