* src/vm/options.c (opt_foo): Added. This is a development option.
[cacao.git] / src / vm / utf8.h
index e0934b17b8eab021d91289e2d3d7fe2fdbda6843..391054a9c003d1353b926df96476dc7b1532b5db 100644 (file)
@@ -1,9 +1,9 @@
-/* src/vm/utf.h - utf string header
+/* src/vm/utf8.h - utf8 string functions
 
-   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
-   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
-   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
-   Institut f. Computersprachen - TU Wien
+   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
+   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
+   J. Wenninger, Institut f. Computersprachen - TU Wien
 
    This file is part of CACAO.
 
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
 
-   Contact: cacao@complang.tuwien.ac.at
+   Contact: cacao@cacaojvm.org
 
    Authors: Christian Thalinger
 
-   Changes:
+   Changes: Edwin Steiner
 
-   $Id: utf8.h 3453 2005-10-19 22:03:06Z twisti $
+   $Id: utf8.h 5088 2006-07-08 20:16:05Z twisti $
 
 */
 
 #ifndef _UTF_H
 #define _UTF_H
 
-#include <stdio.h>
+#include "config.h"
 
+#include <stdio.h>
 
 /* forward typedefs ***********************************************************/
 
 typedef struct utf utf;
 
-
+#include "vm/types.h"
 #include "vm/global.h"
 
 
@@ -51,7 +52,7 @@ typedef struct utf utf;
 
 struct utf {
        utf  *hashlink;                     /* link for external hash chain       */
-       int   blength;                      /* text length in bytes               */
+       s4    blength;                      /* text length in bytes               */
        char *text;                         /* pointer to text                    */
 };
 
@@ -76,12 +77,19 @@ extern utf *utf_java_io_Serializable;
 extern utf *utf_java_lang_Throwable;
 extern utf *utf_java_lang_VMThrowable;
 extern utf *utf_java_lang_Error;
+extern utf *utf_java_lang_AbstractMethodError;
+extern utf *utf_java_lang_LinkageError;
 extern utf *utf_java_lang_NoClassDefFoundError;
+extern utf *utf_java_lang_NoSuchMethodError;
 extern utf *utf_java_lang_OutOfMemoryError;
 
 extern utf *utf_java_lang_Exception;
+extern utf *utf_java_lang_ClassCastException;
 extern utf *utf_java_lang_ClassNotFoundException;
 extern utf *utf_java_lang_IllegalArgumentException;
+extern utf *utf_java_lang_IllegalMonitorStateException;
+
+extern utf *utf_java_lang_NullPointerException;
 
 extern utf* utf_java_lang_Void;
 extern utf* utf_java_lang_Boolean;
@@ -152,15 +160,17 @@ extern utf *utf_java_lang_String__java_lang_Class;
 extern utf *utf_java_lang_Throwable__void;
 
 extern utf *utf_not_named_yet;
-
+extern utf *utf_null;
 extern utf *array_packagename;
 
 
 /* function prototypes ********************************************************/
 
-void utf8_init(void);
+/* initialize the utf8 subsystem */
+bool utf8_init(void);
 
 u4 utf_hashkey(const char *text, u4 length);
+u4 utf_full_hashkey(const char *text, u4 length);
 
 /* determine hashkey of a unicode-symbol */
 u4 unicode_hashkey(u2 *text, u2 length);
@@ -168,36 +178,42 @@ u4 unicode_hashkey(u2 *text, u2 length);
 /* create new utf-symbol */
 utf *utf_new(const char *text, u2 length);
 
-/* without locking (caller already holding lock*/
-utf *utf_new_intern(const char *text, u2 length);
-
 /* make utf symbol from u2 array */
 utf *utf_new_u2(u2 *unicodedata, u4 unicodelength, bool isclassname);
 
 utf *utf_new_char(const char *text);
 utf *utf_new_char_classname(const char *text);
 
+/* get number of bytes */
+u4 utf_bytes(utf *u);
+
 /* get next unicode character of a utf-string */
 u2 utf_nextu2(char **utf);
 
 /* get number of unicode characters of a utf string */
-u4 utf_strlen(utf *u);
+u4 utf_get_number_of_u2s(utf *u);
+u4 utf_get_number_of_u2s_for_buffer(const char *buffer, u4 blength);
 
 /* determine utf length in bytes of a u2 array */
 u4 u2_utflength(u2 *text, u4 u2_length);
 
+void utf_copy(char *buffer, utf *u);
+void utf_cat(char *buffer, utf *u);
+void utf_copy_classname(char *buffer, utf *u);
+void utf_cat_classname(char *buffer, utf *u);
+
 /* write utf symbol to file/buffer */
-void utf_display(utf *u);
-void utf_display_classname(utf *u);
+void utf_display_printable_ascii(utf *u);
+void utf_display_printable_ascii_classname(utf *u);
 
-void utf_sprint(char *buffer, utf *u);
-void utf_sprint_classname(char *buffer, utf *u);
+void utf_sprint_convert_to_latin1(char *buffer, utf *u);
+void utf_sprint_convert_to_latin1_classname(char *buffer, utf *u);
 
-void utf_strcat(char *buffer, utf *u);
-void utf_strcat_classname(char *buffer, utf *u);
+void utf_strcat_convert_to_latin1(char *buffer, utf *u);
+void utf_strcat_convert_to_latin1_classname(char *buffer, utf *u);
 
-void utf_fprint(FILE *file, utf *u);
-void utf_fprint_classname(FILE *file, utf *u);
+void utf_fprint_printable_ascii(FILE *file, utf *u);
+void utf_fprint_printable_ascii_classname(FILE *file, utf *u);
 
 /* check if a UTF-8 string is valid */
 bool is_valid_utf(char *utf_ptr, char *end_pos);
@@ -223,4 +239,5 @@ void utf_show(void);
  * c-basic-offset: 4
  * tab-width: 4
  * End:
+ * vim:noexpandtab:sw=4:ts=4:
  */