* alpha-opc.c (unop): Encode with RB as $sp.
[deliverable/binutils-gdb.git] / binutils / sysdump.c
index 6810f6f14e9fa03ddafb2adc836290db45bf886f..0b0d49524ffd14b695ac0e7c205b7d237d733dc4 100644 (file)
@@ -1,5 +1,5 @@
 /* Sysroff object format dumper.
-   Copyright (C) 1994, 95, 1998 Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
 
 #include "bfd.h"
 #include "bucomm.h"
+#include "safe-ctype.h"
 
 #include <stdio.h>
-#include <ctype.h>
 #include <libiberty.h>
 #include <getopt.h>
 #include "sysroff.h"
 
-#define PROGRAM_VERSION "1.0"
-
 static int dump = 1;
 static int segmented_p;
 static int code;
 static int addrsize = 4;
 static FILE *file;
 
+static void dh PARAMS ((unsigned char *, int));
+static void itheader PARAMS ((char *, int));
+static void p PARAMS ((void));
+static void tabout PARAMS ((void));
+static void pbarray PARAMS ((barray *));
+static int getone PARAMS ((int));
+static int opt PARAMS ((int));
+static void must PARAMS ((int));
+static void tab PARAMS ((int, char *));
+static void dump_symbol_info PARAMS ((void));
+static void derived_type PARAMS ((void));
+static void module PARAMS ((void));
+static void show_usage PARAMS ((FILE *, int));
+static void show_help PARAMS ((void));
+
+extern char *getCHARS PARAMS ((unsigned char *, int *, int, int));
+extern int fillup PARAMS ((char *));
+extern barray getBARRAY PARAMS ((unsigned char *, int *, int, int));
+extern int getINT PARAMS ((unsigned char *, int *, int, int));
+extern int getBITS PARAMS ((char *, int *, int, int));
+extern void sysroff_swap_tr_in PARAMS ((void));
+extern void sysroff_print_tr_out PARAMS ((void));
+extern int main PARAMS ((int, char **));
+
 char *
 getCHARS (ptr, idx, size, max)
      unsigned char *ptr;
@@ -131,8 +153,8 @@ barray
 getBARRAY (ptr, idx, dsize, max)
      unsigned char *ptr;
      int *idx;
-     int dsize;
-     int max;
+     int dsize ATTRIBUTE_UNUSED;
+     int max ATTRIBUTE_UNUSED;
 {
   barray res;
   int i;
@@ -236,7 +258,8 @@ pbarray (y)
   printf ("%d (", y->len);
   for (x = 0; x < y->len; x++)
     {
-      printf ("(%02x %c)", y->data[x], isprint (y->data[x]) ? y->data[x] : '.');
+      printf ("(%02x %c)", y->data[x],
+             ISPRINT (y->data[x]) ? y->data[x] : '.');
     }
   printf (")\n");
 }
@@ -548,8 +571,6 @@ tab (i, s)
     }
 }
 
-static void derived_type ();
-
 static void
 dump_symbol_info ()
 {
@@ -735,8 +756,11 @@ main (ac, av)
     {NULL, no_argument, 0, 0}
   };
 
-#ifdef HAVE_SETLOCALE
+#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
   setlocale (LC_MESSAGES, "");
+#endif
+#if defined (HAVE_SETLOCALE)
+  setlocale (LC_CTYPE, "");
 #endif
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
@@ -752,7 +776,7 @@ main (ac, av)
          show_help ();
          /*NOTREACHED*/
        case 'V':
-         printf (_("GNU %s version %s\n"), program_name, PROGRAM_VERSION);
+         print_version ("sysdump");
          exit (0);
          /*NOTREACHED*/
        case 0:
@@ -772,17 +796,13 @@ main (ac, av)
 
   if (!input_file)
     {
-      fprintf (stderr, _("%s: no input file specified\n"),
-              program_name);
-      exit (1);
+      fatal (_("no input file specified"));
     }
 
   file = fopen (input_file, FOPEN_RB);
   if (!file)
     {
-      fprintf (stderr, _("%s: cannot open input file %s\n"),
-              program_name, input_file);
-      exit (1);
+      fatal (_("cannot open input file %s"), input_file);
     }
 
   module ();
This page took 0.024218 seconds and 4 git commands to generate.