aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jv-scan.c
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2004-02-10 19:12:34 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2004-02-10 19:12:34 +0000
commit0237b2dc30312a14a02cd6cc42daeec82b49b913 (patch)
tree5164f4a96fabe5e2f67cebaaee4cba2f0cdec4b3 /gcc/java/jv-scan.c
parent7b38bcac645a40e200bcb270f8857ac7cf73a717 (diff)
downloadgcc-0237b2dc30312a14a02cd6cc42daeec82b49b913.zip
gcc-0237b2dc30312a14a02cd6cc42daeec82b49b913.tar.gz
gcc-0237b2dc30312a14a02cd6cc42daeec82b49b913.tar.bz2
gjavah.c: Include "intl.h".
* gjavah.c: Include "intl.h". (error): New function. (main): Call gcc_init_libintl. (get_field_name, throwable_p, print_c_decl, print_full_cxx_name, print_stub_or_jni, process_file, main): Use error rather than fprintf. (print_method_info, usage, help, version, main): Mark strings for translation with _. Avoid splitting up sentences. Send information messages to stdout. * jcf-dump.c: Include "intl.h". (main): Call gcc_init_libintl. (process_class, usage, help, version, main, CHECK_PC_IN_RANGE): Mark error, usage and version messages for translation with _. Avoid splitting up sentences. * jv-scan.c: Include "intl.h". (fatal_error, warning): Change parameter s to msgid. Translate messages. (main): Call gcc_init_libintl. (usage, help, version): Mark error, usage and version messages for translation with _. Avoid splitting up sentences. * jvgenmain.c: Include "intl.h". (main): Call gcc_init_libintl. (usage, main): Mark error messages for translation with _. * Make-lang.in (GCJH_OBJS, JVSCAN_OBJS, JCFDUMP_OBJS, JVGENMAIN_OBJS): Add intl.o. (java/jcf-dump.o, java/gjavah.o, java/jv-scan.o, java/jvgenmain.o): Update dependencies. From-SVN: r77614
Diffstat (limited to 'gcc/java/jv-scan.c')
-rw-r--r--gcc/java/jv-scan.c59
1 files changed, 31 insertions, 28 deletions
diff --git a/gcc/java/jv-scan.c b/gcc/java/jv-scan.c
index 7c8d2d3..1e9490b 100644
--- a/gcc/java/jv-scan.c
+++ b/gcc/java/jv-scan.c
@@ -1,5 +1,5 @@
/* Main for jv-scan
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
@@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA. */
#include "system.h"
#include "coretypes.h"
#include "tm.h"
+#include "intl.h"
#include "obstack.h" /* We use obstacks in lex.c */
@@ -39,9 +40,9 @@ Boston, MA 02111-1307, USA. */
#include <getopt.h>
-extern void fatal_error (const char *s, ...)
+extern void fatal_error (const char *msgid, ...)
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
-void warning (const char *s, ...) ATTRIBUTE_PRINTF_1;
+void warning (const char *msgid, ...) ATTRIBUTE_PRINTF_1;
void report (void);
static void usage (void) ATTRIBUTE_NORETURN;
@@ -93,28 +94,28 @@ static const struct option options[] =
static void
usage (void)
{
- fprintf (stderr, "Try `jv-scan --help' for more information.\n");
+ fprintf (stderr, _("Try `jv-scan --help' for more information.\n"));
exit (1);
}
static void
help (void)
{
- printf ("Usage: jv-scan [OPTION]... FILE...\n\n");
- printf ("Print useful information read from Java source files.\n\n");
- printf (" --no-assert Don't recognize the assert keyword\n");
- printf (" --complexity Print cyclomatic complexity of input file\n");
- printf (" --encoding NAME Specify encoding of input file\n");
- printf (" --print-main Print name of class containing `main'\n");
- printf (" --list-class List all classes defined in file\n");
- printf (" --list-filename Print input filename when listing class names\n");
- printf (" -o FILE Set output file name\n");
+ printf (_("Usage: jv-scan [OPTION]... FILE...\n\n"));
+ printf (_("Print useful information read from Java source files.\n\n"));
+ printf (_(" --no-assert Don't recognize the assert keyword\n"));
+ printf (_(" --complexity Print cyclomatic complexity of input file\n"));
+ printf (_(" --encoding NAME Specify encoding of input file\n"));
+ printf (_(" --print-main Print name of class containing `main'\n"));
+ printf (_(" --list-class List all classes defined in file\n"));
+ printf (_(" --list-filename Print input filename when listing class names\n"));
+ printf (_(" -o FILE Set output file name\n"));
printf ("\n");
- printf (" --help Print this help, then exit\n");
- printf (" --version Print version number, then exit\n");
+ printf (_(" --help Print this help, then exit\n"));
+ printf (_(" --version Print version number, then exit\n"));
printf ("\n");
- printf ("For bug reporting instructions, please see:\n");
- printf ("%s.\n", bug_report_url);
+ printf (_("For bug reporting instructions, please see:\n"
+ "%s.\n"), bug_report_url);
exit (0);
}
@@ -122,9 +123,9 @@ static void
version (void)
{
printf ("jv-scan (GCC) %s\n\n", version_string);
- printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n");
- printf ("This is free software; see the source for copying conditions. There is NO\n");
- printf ("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n");
+ printf ("Copyright %s 2004 Free Software Foundation, Inc.\n", _("(C)"));
+ printf (_("This is free software; see the source for copying conditions. There is NO\n"
+ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"));
exit (0);
}
@@ -143,6 +144,8 @@ main (int argc, char **argv)
/* Default for output */
out = stdout;
+ gcc_init_libintl ();
+
/* Process options first. We use getopt_long and not
getopt_long_only because we only support `--' long options here. */
while ((opt = getopt_long (argc, argv, "o:", options, NULL)) != -1)
@@ -237,24 +240,24 @@ main (int argc, char **argv)
functions */
void
-fatal_error (const char *s, ...)
+fatal_error (const char *msgid, ...)
{
va_list ap;
- va_start (ap, s);
- fprintf (stderr, "%s: error: ", exec_name);
- vfprintf (stderr, s, ap);
+ va_start (ap, msgid);
+ fprintf (stderr, _("%s: error: "), exec_name);
+ vfprintf (stderr, _(msgid), ap);
fputc ('\n', stderr);
va_end (ap);
exit (1);
}
void
-warning (const char *s, ...)
+warning (const char *msgid, ...)
{
va_list ap;
- va_start (ap, s);
- fprintf (stderr, "%s: warning: ", exec_name);
- vfprintf (stderr, s, ap);
+ va_start (ap, msgid);
+ fprintf (stderr, _("%s: warning: "), exec_name);
+ vfprintf (stderr, _(msgid), ap);
fputc ('\n', stderr);
va_end (ap);
}