summaryrefslogtreecommitdiffstats
path: root/bfd/misc.c
blob: 041fcde8623bc839be6ced3514bf5859cbfd3d0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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
OpenPOWER on IntegriCloud