* Removed all Id tags.
[cacao.git] / src / vm / string.c
index 837d27e90f409426a536e3c05b66cecba0f0fdf9..d8a1520b4e2d894a3c9c2d35359790459576d8f6 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: string.c 8343 2007-08-17 21:39:32Z michi $
-
 */
 
 
@@ -701,6 +699,61 @@ void literalstring_free(java_object_t* string)
 }
 
 
+/* javastring_intern ***********************************************************
+
+   Intern the given Java string.
+
+*******************************************************************************/
+
+java_handle_t *javastring_intern(java_handle_t *s)
+{
+       java_lang_String *so;
+       java_chararray_t *value;
+       int32_t           count;
+       int32_t           offset;
+/*     java_lang_String *o; */
+       java_object_t    *o;
+
+       so = (java_lang_String *) s;
+
+       value  = LLNI_field_direct(so, value);
+       count  = LLNI_field_direct(so, count);
+       offset = LLNI_field_direct(so, offset);
+
+       o = literalstring_u2(value, count, offset, true);
+
+       return o;
+}
+
+
+/* javastring_print ************************************************************
+
+   Print the given Java string.
+
+*******************************************************************************/
+
+void javastring_print(java_handle_t *s)
+{
+       java_lang_String *so;
+       java_chararray_t *value;
+       int32_t           count;
+       int32_t           offset;
+       uint16_t          c;
+       int               i;
+
+       so = (java_lang_String *) s;
+
+       value  = LLNI_field_direct(so, value);
+       count  = LLNI_field_direct(so, count);
+       offset = LLNI_field_direct(so, offset);
+
+       for (i = offset; i < offset + count; i++) {
+               c = LLNI_array_direct(value, i);
+               putchar(c);
+       }
+}
+
+
 /*
  * These are local overrides for various environment variables in Emacs.
  * Please do not remove this and leave it at the end of the file, where