/* 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.
#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);
}
const char *mangled_classname;
int i, last_arg;
+ gcc_init_libintl ();
+
if (argc < 2)
usage (argv[0]);
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);
}
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);
}
static char *
-do_mangle_classname (string)
- const char *string;
+do_mangle_classname (const char *string)
{
const char *ptr;
int count = 0;