1 /* Copyright (C) 1990, 1991 Free Software Foundation, Inc.
3 This file is part of BFD, the Binary File Diddler.
5 BFD is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 1, or (at your option)
10 BFD is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with BFD; see the file COPYING. If not, write to
17 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
22 /* xoxorich. coelesced from other binutils. */
23 /* This crap should all be bundled with the binutils, or else be in its
24 own library, but for expediency we are doing it this way right now. */
27 * Last Mod Mon Feb 18 14:49:39 PST 1991, by rich@cygint.cygnus.com
33 extern char *realloc (char * ptr
, int size
);
34 extern char *malloc (int size
);
36 extern char *realloc ();
37 extern char *malloc ();
40 /* Print the filename of the current file on 'outfile' (a stdio stream). */
42 /* Current file's name */
46 /* Current member's name, or 0 if processing a non-library file. */
50 void print_file_name (outfile
)
53 fprintf (outfile
, "%s", input_name
);
55 fprintf (outfile
, "(%s)", input_member
);
58 /* process one input file */
63 /* Report a nonfatal error.
64 STRING is a format for printf, and ARG1 ... ARG3 are args for it. */
67 error (string
, arg1
, arg2
, arg3
)
68 char *string
, *arg1
, *arg2
, *arg3
;
70 fprintf (stderr
, "%s: ", program_name
);
71 fprintf (stderr
, string
, arg1
, arg2
, arg3
);
72 fprintf (stderr
, "\n");
77 /* Report a nonfatal error.
78 STRING is printed, followed by the current file name. */
81 error_with_file (string
)
84 fprintf (stderr
, "%s: ", program_name
);
85 print_file_name (stderr
);
86 fprintf (stderr
, ": ");
87 fprintf (stderr
, string
);
88 fprintf (stderr
, "\n");
91 /* Like malloc but get fatal error if memory is exhausted. */
94 /* Like realloc but get fatal error if memory is exhausted. */