aboutsummaryrefslogtreecommitdiff
path: root/bfd/misc.c
diff options
context:
space:
mode:
authorDavid Henkel-Wallace <gumby@cygnus>1991-03-21 21:11:25 +0000
committerDavid Henkel-Wallace <gumby@cygnus>1991-03-21 21:11:25 +0000
commit4a81b56152631cda9dc351cb4d2f61f395ee4414 (patch)
tree562bc9b14bcf414b6c301b769d4ce528c51d4703 /bfd/misc.c
parent907621824e31daf6504860009535f03676afee4d (diff)
downloadgdb-4a81b56152631cda9dc351cb4d2f61f395ee4414.zip
gdb-4a81b56152631cda9dc351cb4d2f61f395ee4414.tar.gz
gdb-4a81b56152631cda9dc351cb4d2f61f395ee4414.tar.bz2
Initial revision
Diffstat (limited to 'bfd/misc.c')
-rwxr-xr-xbfd/misc.c98
1 files changed, 98 insertions, 0 deletions
diff --git a/bfd/misc.c b/bfd/misc.c
new file mode 100755
index 0000000..041fcde
--- /dev/null
+++ b/bfd/misc.c
@@ -0,0 +1,98 @@
+/* Copyright (C) 1990, 1991 Free Software Foundation, Inc.
+
+This file is part of BFD, the Binary File Diddler.
+
+BFD is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, or (at your option)
+any later version.
+
+BFD is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with BFD; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* $Id$ */
+
+#if 0
+ /* xoxorich. coelesced from other binutils. */
+/* This crap should all be bundled with the binutils, or else be in its
+ own library, but for expediency we are doing it this way right now. */
+
+/*
+ * Last Mod Mon Feb 18 14:49:39 PST 1991, by rich@cygint.cygnus.com
+ */
+
+#include <stdio.h>
+#include "misc.h"
+#if __STDC__
+extern char *realloc (char * ptr, int size);
+extern char *malloc (int size);
+#else
+extern char *realloc ();
+extern char *malloc ();
+#endif
+
+/* Print the filename of the current file on 'outfile' (a stdio stream). */
+
+/* Current file's name */
+
+char *input_name;
+
+/* Current member's name, or 0 if processing a non-library file. */
+
+char *input_member;
+
+void print_file_name (outfile)
+ FILE *outfile;
+{
+ fprintf (outfile, "%s", input_name);
+ if (input_member)
+ fprintf (outfile, "(%s)", input_member);
+}
+
+/* process one input file */
+void scan_library ();
+
+char *program_name;
+
+/* Report a nonfatal error.
+ STRING is a format for printf, and ARG1 ... ARG3 are args for it. */
+/*VARARGS*/
+void
+error (string, arg1, arg2, arg3)
+ char *string, *arg1, *arg2, *arg3;
+{
+ fprintf (stderr, "%s: ", program_name);
+ fprintf (stderr, string, arg1, arg2, arg3);
+ fprintf (stderr, "\n");
+}
+
+
+
+/* Report a nonfatal error.
+ STRING is printed, followed by the current file name. */
+
+void
+error_with_file (string)
+ char *string;
+{
+ fprintf (stderr, "%s: ", program_name);
+ print_file_name (stderr);
+ fprintf (stderr, ": ");
+ fprintf (stderr, string);
+ fprintf (stderr, "\n");
+}
+
+/* Like malloc but get fatal error if memory is exhausted. */
+
+
+/* Like realloc but get fatal error if memory is exhausted. */
+
+
+/* end of misc.c */
+#endif