OSDN Git Service

Prepare for %q, %< and %> in diagnostic message strings.
[pf3gnuchains/gcc-fork.git] / gcc / java / jvgenmain.c
index 61e70a7..1e228a1 100644 (file)
@@ -1,5 +1,5 @@
 /* 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,38 +33,20 @@ 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);
 
 struct obstack  name_obstack;
 struct obstack *mangle_obstack = &name_obstack;
 
-void
-gcc_obstack_init (obstack)
-     struct obstack *obstack;
-{
-  /* Let particular systems override the size of a chunk.  */
-#ifndef OBSTACK_CHUNK_SIZE
-#define OBSTACK_CHUNK_SIZE 0
-#endif
-  /* Let them override the alloc and free routines too.  */
-#ifndef OBSTACK_CHUNK_ALLOC
-#define OBSTACK_CHUNK_ALLOC xmalloc
-#endif
-#ifndef OBSTACK_CHUNK_FREE
-#define OBSTACK_CHUNK_FREE free
-#endif
-  _obstack_begin (obstack, OBSTACK_CHUNK_SIZE, 0,
-                 (void *(*) (long)) OBSTACK_CHUNK_ALLOC,
-                 (void (*) (void *)) OBSTACK_CHUNK_FREE);
-}
-
 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);
 }
 
@@ -76,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]);
 
@@ -111,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);
        }
@@ -148,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);
     }
@@ -157,8 +141,7 @@ main (int argc, char **argv)
 
 
 static char *
-do_mangle_classname (string)
-     const char *string;
+do_mangle_classname (const char *string)
 {
   const char *ptr;
   int count = 0;