#include <assert.h>
+#include "vmcore/system.h"
+
#include "vm/types.h"
#include "vm/global.h"
#include "vm/array.h"
#include "vm/builtin.h"
#include "vm/exceptions.h"
-#include "vm/primitive.h"
+#include "vm/primitive.hpp"
#include "vm/stringlocal.h"
#include "vm/vm.h"
if (!a->header.objheader.vftbl)
/* vftbl of character-array is NULL */
a->header.objheader.vftbl =
- primitive_arrayclass_get_by_type(ARRAYTYPE_CHAR)->vftbl;
+ Primitive_get_arrayclass_by_type(ARRAYTYPE_CHAR)->vftbl;
/* follow link in external hash chain */
s = s->hashlink;
s4 nbytes;
s4 len;
- assert(text);
+ if (text == NULL)
+ return NULL;
/* Get number of bytes. We need this to completely emulate the messy */
/* behaviour of the RI. :( */
/* location in hashtable found, complete arrayheader */
ca->header.objheader.vftbl =
- primitive_arrayclass_get_by_type(ARRAYTYPE_CHAR)->vftbl;
+ Primitive_get_arrayclass_by_type(ARRAYTYPE_CHAR)->vftbl;
ca->header.size = length;
assert(class_java_lang_String);
}
-/* javastring_print ************************************************************
+/* javastring_fprint ***********************************************************
- Print the given Java string.
+ Print the given Java string to the given stream.
*******************************************************************************/
-void javastring_print(java_handle_t *s)
+void javastring_fprint(java_handle_t *s, FILE *stream)
{
java_lang_String *so;
java_handle_chararray_t *value;
for (i = offset; i < offset + count; i++) {
c = LLNI_array_direct(value, i);
- putchar(c);
+ fputc(c, stream);
}
}