gjavah.c (jni_print_char): New function.
* gjavah.c (jni_print_char): New function. (print_full_cxx_name): Use it. (decode_signature_piece): Likewise. (print_cxx_classname): Likewise. From-SVN: r31989
This commit is contained in:
parent
17eb795180
commit
78de74bea9
|
@ -1,3 +1,10 @@
|
||||||
|
2000-02-15 Tom Tromey <tromey@cygnus.com>
|
||||||
|
|
||||||
|
* gjavah.c (jni_print_char): New function.
|
||||||
|
(print_full_cxx_name): Use it.
|
||||||
|
(decode_signature_piece): Likewise.
|
||||||
|
(print_cxx_classname): Likewise.
|
||||||
|
|
||||||
2000-02-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
2000-02-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||||
|
|
||||||
* Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with
|
* Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with
|
||||||
|
|
|
@ -248,6 +248,38 @@ DEFUN(print_name, (stream, jcf, name_index),
|
||||||
JPOOL_UTF_LENGTH (jcf, name_index));
|
JPOOL_UTF_LENGTH (jcf, name_index));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Print a character, appropriately mangled for JNI. */
|
||||||
|
|
||||||
|
static void
|
||||||
|
jni_print_char (stream, ch)
|
||||||
|
FILE *stream;
|
||||||
|
int ch;
|
||||||
|
{
|
||||||
|
if (! flag_jni)
|
||||||
|
jcf_print_char (stream, ch);
|
||||||
|
else if (ch == '(' || ch == ')')
|
||||||
|
{
|
||||||
|
/* Ignore. */
|
||||||
|
}
|
||||||
|
else if (ch == '_')
|
||||||
|
fputs ("_1", stream);
|
||||||
|
else if (ch == ';')
|
||||||
|
fputs ("_2", stream);
|
||||||
|
else if (ch == '[')
|
||||||
|
fputs ("_3", stream);
|
||||||
|
else if (ch == '/')
|
||||||
|
fputs ("_", stream);
|
||||||
|
else if ((ch >= '0' && ch <= '9')
|
||||||
|
|| (ch >= 'a' && ch <= 'z')
|
||||||
|
|| (ch >= 'A' && ch <= 'Z'))
|
||||||
|
fputc (ch, stream);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* "Unicode" character. */
|
||||||
|
fprintf (stream, "_0%04x", ch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Print base name of class. The base name is everything after the
|
/* Print base name of class. The base name is everything after the
|
||||||
final separator. */
|
final separator. */
|
||||||
|
|
||||||
|
@ -888,7 +920,7 @@ decode_signature_piece (stream, signature, limit, need_space)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
*need_space = 1;
|
*need_space = 1;
|
||||||
jcf_print_char (stream, *signature++);
|
jni_print_char (stream, *signature++);
|
||||||
break;
|
break;
|
||||||
printit:
|
printit:
|
||||||
signature++;
|
signature++;
|
||||||
|
@ -1006,33 +1038,12 @@ DEFUN(print_full_cxx_name, (stream, jcf, name_index, signature_index,
|
||||||
while (signature < limit)
|
while (signature < limit)
|
||||||
{
|
{
|
||||||
int ch = UTF8_GET (signature, limit);
|
int ch = UTF8_GET (signature, limit);
|
||||||
if (ch == '(')
|
jni_print_char (stream, ch);
|
||||||
{
|
if (ch == ')')
|
||||||
/* Ignore. */
|
|
||||||
}
|
|
||||||
else if (ch == ')')
|
|
||||||
{
|
{
|
||||||
/* Done. */
|
/* Done. */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (ch == '_')
|
|
||||||
fputs ("_1", stream);
|
|
||||||
else if (ch == ';')
|
|
||||||
fputs ("_2", stream);
|
|
||||||
else if (ch == '[')
|
|
||||||
fputs ("_3", stream);
|
|
||||||
else if (ch == '/')
|
|
||||||
fputs ("_", stream);
|
|
||||||
else if ((ch >= '0' && ch <= '9')
|
|
||||||
|| (ch >= 'a' && ch <= 'z')
|
|
||||||
|| (ch >= 'A' && ch <= 'Z'))
|
|
||||||
fputc (ch, stream);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* "Unicode" character. FIXME: upper or lower case
|
|
||||||
letters? */
|
|
||||||
fprintf (stream, "_0%04x", ch);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1223,7 +1234,7 @@ print_cxx_classname (stream, prefix, jcf, index)
|
||||||
if (c == '/')
|
if (c == '/')
|
||||||
fputs (flag_jni ? "_" : "::", stream);
|
fputs (flag_jni ? "_" : "::", stream);
|
||||||
else
|
else
|
||||||
jcf_print_char (stream, c);
|
jni_print_char (stream, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue