]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - binutils/bucomm.h
From 2000-03-27 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>:
[thirdparty/binutils-gdb.git] / binutils / bucomm.h
CommitLineData
252b5132
RH
1/* bucomm.h -- binutils common include file.
2 Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 1999
3 Free Software Foundation, Inc.
4
5This file is part of GNU Binutils.
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
19Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20\f
21#ifndef _BUCOMM_H
22#define _BUCOMM_H
23
24#include "ansidecl.h"
25#include <stdio.h>
26#include <sys/types.h>
27
28#include "config.h"
c20f4f8c 29#include "bin-bugs.h"
252b5132
RH
30
31#ifdef USE_BINARY_FOPEN
32#include "fopen-bin.h"
33#else
34#include "fopen-same.h"
35#endif
36
37#include <errno.h>
38#ifndef errno
39extern int errno;
40#endif
41
42#ifdef HAVE_UNISTD_H
43#include <unistd.h>
44#endif
45
46#ifdef HAVE_STRING_H
47#include <string.h>
48#else
49#ifdef HAVE_STRINGS_H
50#include <strings.h>
51#else
52extern char *strchr ();
53extern char *strrchr ();
54#endif
55#endif
56
57#ifdef HAVE_STDLIB_H
58#include <stdlib.h>
59#endif
60
61#ifdef HAVE_FCNTL_H
62#include <fcntl.h>
63#else
64#ifdef HAVE_SYS_FILE_H
65#include <sys/file.h>
66#endif
67#endif
68
69#ifdef NEED_DECLARATION_STRSTR
70extern char *strstr ();
71#endif
72
73#ifdef HAVE_SBRK
74#ifdef NEED_DECLARATION_SBRK
75extern char *sbrk ();
76#endif
77#endif
78
79#ifdef NEED_DECLARATION_GETENV
80extern char *getenv ();
81#endif
82
83#ifdef NEED_DECLARATION_ENVIRON
84extern char **environ;
85#endif
86
87#ifndef O_RDONLY
88#define O_RDONLY 0
89#endif
90
91#ifndef O_RDWR
92#define O_RDWR 2
93#endif
94
95#ifndef SEEK_SET
96#define SEEK_SET 0
97#endif
98#ifndef SEEK_CUR
99#define SEEK_CUR 1
100#endif
101#ifndef SEEK_END
102#define SEEK_END 2
103#endif
104
105#if defined(__GNUC__) && !defined(C_ALLOCA)
106# undef alloca
107# define alloca __builtin_alloca
108#else
109# if defined(HAVE_ALLOCA_H) && !defined(C_ALLOCA)
110# include <alloca.h>
111# else
112# ifndef alloca /* predefined by HP cc +Olibcalls */
113# if !defined (__STDC__) && !defined (__hpux)
114char *alloca ();
115# else
116void *alloca ();
117# endif /* __STDC__, __hpux */
118# endif /* alloca */
119# endif /* HAVE_ALLOCA_H */
120#endif
121
122#ifdef HAVE_LOCALE_H
123# include <locale.h>
124#endif
125
126#ifdef ENABLE_NLS
127# include <libintl.h>
128# define _(String) gettext (String)
129# ifdef gettext_noop
130# define N_(String) gettext_noop (String)
131# else
132# define N_(String) (String)
133# endif
134#else
135/* Stubs that do something close enough. */
136# define textdomain(String) (String)
137# define gettext(String) (String)
138# define dgettext(Domain,Message) (Message)
139# define dcgettext(Domain,Message,Type) (Message)
140# define bindtextdomain(Domain,Directory) (Domain)
141# define _(String) (String)
142# define N_(String) (String)
143#endif
144
145/* bucomm.c */
146void bfd_nonfatal PARAMS ((CONST char *));
147
148void bfd_fatal PARAMS ((CONST char *));
149
150void fatal PARAMS ((CONST char *, ...));
151
152void non_fatal PARAMS ((CONST char *, ...));
153
154void set_default_bfd_target PARAMS ((void));
155
156void list_matching_formats PARAMS ((char **p));
157
158void list_supported_targets PARAMS ((const char *, FILE *));
159
160void print_arelt_descr PARAMS ((FILE *file, bfd *abfd, boolean verbose));
161
162char *make_tempname PARAMS ((char *));
163
164bfd_vma parse_vma PARAMS ((const char *, const char *));
165
166extern char *program_name;
167
168/* filemode.c */
169void mode_string PARAMS ((unsigned long mode, char *buf));
170
171/* version.c */
172extern void print_version PARAMS ((const char *));
173
174/* rename.c */
175extern void set_times PARAMS ((const char *, const struct stat *));
176
177extern int smart_rename PARAMS ((const char *, const char *, int));
178
179/* libiberty */
180PTR xmalloc PARAMS ((size_t));
181
182PTR xrealloc PARAMS ((PTR, size_t));
183
184#endif /* _BUCOMM_H */