Commit 0237b2dc by Joseph Myers Committed by Joseph Myers

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
parent 7b38bcac
2004-02-10 Joseph S. Myers <jsm@polyomino.org.uk>
* 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.
2004-02-08 Per Bothner <per@bothner.com>
* parse.y (resolve_qualified_expression_name): In case of inaccessible
......
# Top level -*- makefile -*- fragment for the GNU compiler for the Java(TM)
# language.
# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
#This file is part of GCC.
......@@ -108,14 +108,15 @@ JAVA_OBJS = java/parse.o java/class.o java/decl.o java/expr.o \
java/jcf-path.o java/xref.o java/boehm.o java/java-tree-inline.o mkdeps.o
GCJH_OBJS = java/gjavah.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \
java/win32-host.o java/zextract.o version.o mkdeps.o errors.o ggc-none.o
java/win32-host.o java/zextract.o version.o mkdeps.o errors.o ggc-none.o \
intl.o
JVSCAN_OBJS = java/parse-scan.o java/jv-scan.o version.o
JVSCAN_OBJS = java/parse-scan.o java/jv-scan.o version.o intl.o
JCFDUMP_OBJS = java/jcf-dump.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \
java/win32-host.o java/zextract.o errors.o version.o mkdeps.o ggc-none.o
java/win32-host.o java/zextract.o errors.o version.o mkdeps.o ggc-none.o intl.o
JVGENMAIN_OBJS = java/jvgenmain.o java/mangle_name.o errors.o
JVGENMAIN_OBJS = java/jvgenmain.o java/mangle_name.o errors.o intl.o
# Use loose warnings for this front end.
java-warn = $(WERROR)
......@@ -272,9 +273,10 @@ JAVA_LEX_C = java/lex.c java/keyword.h java/chartables.h
java/jcf-dump.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(JAVA_TREE_H) \
java/jcf-dump.c java/jcf-reader.c java/jcf.h java/javaop.h java/javaop.def \
version.h $(GGC_H)
version.h $(GGC_H) intl.h
java/gjavah.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(JAVA_TREE_H) \
java/gjavah.c java/jcf-reader.c java/jcf.h java/javaop.h version.h $(GGC_H)
java/gjavah.c java/jcf-reader.c java/jcf.h java/javaop.h version.h $(GGC_H) \
intl.h
java/boehm.o: java/boehm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(JAVA_TREE_H) java/parse.h toplev.h
java/buffer.o: java/buffer.c $(CONFIG_H) java/buffer.h $(SYSTEM_H) coretypes.h \
......@@ -308,9 +310,9 @@ java/jcf-write.o: java/jcf-write.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
$(RTL_H) java/java-opcodes.h java/parse.h java/buffer.h $(SYSTEM_H) \
coretypes.h $(TM_H) toplev.h $(GGC_H) gt-java-jcf-write.h $(TM_P_H)
java/jv-scan.o: java/jv-scan.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
version.h
version.h intl.h
java/jvgenmain.o: java/jvgenmain.c $(CONFIG_H) $(JAVA_TREE_H) $(SYSTEM_H) \
coretypes.h $(TM_H)
coretypes.h $(TM_H) intl.h
java/lang.o: java/lang.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h input.h \
toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(EXPR_H) diagnostic.h \
langhooks.h $(LANGHOOKS_DEF_H) gt-java-lang.h opts.h options.h
......
/* Program to dump out a Java(TM) .class file.
Functionally similar to Sun's javap.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GCC.
......@@ -54,6 +54,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "coretypes.h"
#include "tm.h"
#include "ggc.h"
#include "intl.h"
#include "jcf.h"
#include "tree.h"
......@@ -795,19 +796,19 @@ process_class (JCF *jcf)
{
int code;
if (jcf_parse_preamble (jcf) != 0)
fprintf (stderr, "Not a valid Java .class file.\n");
fprintf (stderr, _("Not a valid Java .class file.\n"));
/* Parse and possibly print constant pool */
code = jcf_parse_constant_pool (jcf);
if (code != 0)
{
fprintf (stderr, "error while parsing constant pool\n");
fprintf (stderr, _("error while parsing constant pool\n"));
exit (FATAL_EXIT_CODE);
}
code = verify_constant_pool (jcf);
if (code > 0)
{
fprintf (stderr, "error in constant pool entry #%d\n", code);
fprintf (stderr, _("error in constant pool entry #%d\n"), code);
exit (FATAL_EXIT_CODE);
}
if (flag_print_constant_pool)
......@@ -817,19 +818,19 @@ process_class (JCF *jcf)
code = jcf_parse_fields (jcf);
if (code != 0)
{
fprintf (stderr, "error while parsing fields\n");
fprintf (stderr, _("error while parsing fields\n"));
exit (FATAL_EXIT_CODE);
}
code = jcf_parse_methods (jcf);
if (code != 0)
{
fprintf (stderr, "error while parsing methods\n");
fprintf (stderr, _("error while parsing methods\n"));
exit (FATAL_EXIT_CODE);
}
code = jcf_parse_final_attributes (jcf);
if (code != 0)
{
fprintf (stderr, "error while parsing final attributes\n");
fprintf (stderr, _("error while parsing final attributes\n"));
exit (FATAL_EXIT_CODE);
}
jcf->filename = NULL;
......@@ -865,30 +866,30 @@ static const struct option options[] =
static void
usage (void)
{
fprintf (stderr, "Try `jcf-dump --help' for more information.\n");
fprintf (stderr, _("Try `jcf-dump --help' for more information.\n"));
exit (1);
}
static void
help (void)
{
printf ("Usage: jcf-dump [OPTION]... CLASS...\n\n");
printf ("Display contents of a class file in readable form.\n\n");
printf (" -c Disassemble method bodies\n");
printf (" --javap Generate output in `javap' format\n");
printf (_("Usage: jcf-dump [OPTION]... CLASS...\n\n"));
printf (_("Display contents of a class file in readable form.\n\n"));
printf (_(" -c Disassemble method bodies\n"));
printf (_(" --javap Generate output in `javap' format\n"));
printf ("\n");
printf (" --classpath PATH Set path to find .class files\n");
printf (" -IDIR Append directory to class path\n");
printf (" --bootclasspath PATH Override built-in class path\n");
printf (" --extdirs PATH Set extensions directory path\n");
printf (" -o FILE Set output file name\n");
printf (_(" --classpath PATH Set path to find .class files\n"));
printf (_(" -IDIR Append directory to class path\n"));
printf (_(" --bootclasspath PATH Override built-in class path\n"));
printf (_(" --extdirs PATH Set extensions directory path\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 (" -v, --verbose Print extra information while running\n");
printf (_(" --help Print this help, then exit\n"));
printf (_(" --version Print version number, then exit\n"));
printf (_(" -v, --verbose Print extra information while running\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);
}
......@@ -896,9 +897,9 @@ static void
version (void)
{
printf ("jcf-dump (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);
}
......@@ -908,9 +909,11 @@ main (int argc, char** argv)
JCF jcf[1];
int argi, opt;
gcc_init_libintl ();
if (argc <= 1)
{
fprintf (stderr, "jcf-dump: no classes specified\n");
fprintf (stderr, _("jcf-dump: no classes specified\n"));
usage ();
}
......@@ -975,7 +978,7 @@ main (int argc, char** argv)
if (optind == argc)
{
fprintf (stderr, "jcf-dump: no classes specified\n");
fprintf (stderr, _("jcf-dump: no classes specified\n"));
usage ();
}
......@@ -995,7 +998,7 @@ main (int argc, char** argv)
out = fopen (output_file, "w");
if (! out)
{
fprintf (stderr, "Cannot open '%s' for output.\n", output_file);
fprintf (stderr, _("Cannot open '%s' for output.\n"), output_file);
return FATAL_EXIT_CODE;
}
}
......@@ -1041,7 +1044,7 @@ main (int argc, char** argv)
break; /* got to central directory */
if (magic != 0x04034b50) /* ZIPMAGIC (little-endian) */
{
fprintf (stderr, "bad format of .zip/.jar archive\n");
fprintf (stderr, _("bad format of .zip/.jar archive\n"));
return FATAL_EXIT_CODE;
}
JCF_FILL (jcf, 26);
......@@ -1159,7 +1162,7 @@ disassemble_method (JCF* jcf, const unsigned char *byte_ops, int len)
#define VAR_INDEX_2 (saw_index = 1, IMMEDIATE_u2)
#define CHECK_PC_IN_RANGE(PC) (PC < 0 || PC > len ? \
(fprintf(stderr, "Bad byte codes.\n"), exit(-1)) : 1)
(fprintf(stderr, _("Bad byte codes.\n")), exit(-1)) : 1)
/* Print out operand (if not implied by the opcode) for PUSCH opcodes.
These all push a constant onto the opcode stack. */
......
/* 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);
}
/* Program to generate "main" a Java(TM) class containing a main method.
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GCC.
......@@ -33,6 +33,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "jcf.h"
#include "tree.h"
#include "java-tree.h"
#include "intl.h"
static char * do_mangle_classname (const char *string);
......@@ -44,7 +45,8 @@ static void usage (const char *) ATTRIBUTE_NORETURN;
static void
usage (const char *name)
{
fprintf (stderr, "Usage: %s [OPTIONS]... CLASSNAMEmain [OUTFILE]\n", name);
fprintf (stderr, _("Usage: %s [OPTIONS]... CLASSNAMEmain [OUTFILE]\n"),
name);
exit (1);
}
......@@ -56,6 +58,8 @@ main (int argc, char **argv)
const char *mangled_classname;
int i, last_arg;
gcc_init_libintl ();
if (argc < 2)
usage (argv[0]);
......@@ -91,7 +95,7 @@ main (int argc, char **argv)
stream = fopen (outfile, "w");
if (stream == NULL)
{
fprintf (stderr, "%s: Cannot open output file: %s\n",
fprintf (stderr, _("%s: Cannot open output file: %s\n"),
argv[0], outfile);
exit (1);
}
......@@ -128,7 +132,7 @@ main (int argc, char **argv)
fprintf (stream, "}\n");
if (stream != stdout && fclose (stream) != 0)
{
fprintf (stderr, "%s: Failed to close output file %s\n",
fprintf (stderr, _("%s: Failed to close output file %s\n"),
argv[0], argv[2]);
exit (1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment