Fixed the whitespace
[deliverable/binutils-gdb.git] / bfd / misc.c
CommitLineData
4a81b561
DHW
1/* Copyright (C) 1990, 1991 Free Software Foundation, Inc.
2
3This file is part of BFD, the Binary File Diddler.
4
5BFD is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation; either version 1, or (at your option)
8any later version.
9
10BFD is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BFD; see the file COPYING. If not, write to
17the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
18
19/* $Id$ */
20
21#if 0
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. */
25
26/*
27 * Last Mod Mon Feb 18 14:49:39 PST 1991, by rich@cygint.cygnus.com
28 */
29
30#include <stdio.h>
31#include "misc.h"
32#if __STDC__
33extern char *realloc (char * ptr, int size);
34extern char *malloc (int size);
35#else
36extern char *realloc ();
37extern char *malloc ();
38#endif
39
40/* Print the filename of the current file on 'outfile' (a stdio stream). */
41
42/* Current file's name */
43
44char *input_name;
45
46/* Current member's name, or 0 if processing a non-library file. */
47
48char *input_member;
49
50void print_file_name (outfile)
51 FILE *outfile;
52{
53 fprintf (outfile, "%s", input_name);
54 if (input_member)
55 fprintf (outfile, "(%s)", input_member);
56}
57\f
58/* process one input file */
59void scan_library ();
60
61char *program_name;
62
63/* Report a nonfatal error.
64 STRING is a format for printf, and ARG1 ... ARG3 are args for it. */
65/*VARARGS*/
66void
67error (string, arg1, arg2, arg3)
68 char *string, *arg1, *arg2, *arg3;
69{
70 fprintf (stderr, "%s: ", program_name);
71 fprintf (stderr, string, arg1, arg2, arg3);
72 fprintf (stderr, "\n");
73}
74
75
76
77/* Report a nonfatal error.
78 STRING is printed, followed by the current file name. */
79
80void
81error_with_file (string)
82 char *string;
83{
84 fprintf (stderr, "%s: ", program_name);
85 print_file_name (stderr);
86 fprintf (stderr, ": ");
87 fprintf (stderr, string);
88 fprintf (stderr, "\n");
89}
90
91/* Like malloc but get fatal error if memory is exhausted. */
92
93
94/* Like realloc but get fatal error if memory is exhausted. */
95
96
97/* end of misc.c */
98#endif
This page took 0.046241 seconds and 4 git commands to generate.