+
+ /* check return argument for java.lang.Class or java.lang.String */
+
+ o = (java_objectheader *) (ptrint) l;
+
+ if (o != NULL) {
+ if (o->vftbl->class == class_java_lang_String) {
+ /* get java.lang.String object and the length of the
+ string */
+
+ s= (java_lang_String *) (ptrint) l;
+
+ len = strlen(", String = \"") + javastring_strlen(s) +
+ strlen("\"");
+
+ /* realloc memory for string length */
+
+ DMREALLOC(logtext, char, logtextlen, logtextlen + len);
+
+ /* convert to utf8 string and strcat it to the logtext */
+
+ u = javastring_toutf(s, false);
+
+ strcat(logtext, ", String = \"");
+ utf_strcat(logtext, u);
+ strcat(logtext, "\"");
+
+ } else {
+ if (o->vftbl->class == class_java_lang_Class) {
+ /* if the object returned is a java.lang.Class
+ cast it to classinfo structure and get the name
+ of the class */
+
+ c = (classinfo *) (ptrint) l;
+
+ u = c->name;
+
+ } else {
+ /* if the object returned is not a java.lang.String or
+ a java.lang.Class just print the name of the class */
+
+ u = o->vftbl->class->name;
+ }
+
+ len = strlen(", Class = \"") + utf_strlen(u) + strlen("\"");
+
+ /* realloc memory for string length */
+
+ DMREALLOC(logtext, char, logtextlen, logtextlen + len);
+
+ /* strcat to the logtext */
+
+ strcat(logtext, ", Class = \"");
+ utf_strcat(logtext, u);
+ strcat(logtext, "\"");
+ }
+ }