]>
Commit | Line | Data |
---|---|---|
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 | ||
5 | This file is part of GNU Binutils. | |
6 | ||
7 | This program is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 2 of the License, or | |
10 | (at your option) any later version. | |
11 | ||
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with this program; if not, write to the Free Software | |
19 | Foundation, 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 | |
39 | extern 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 | |
52 | extern char *strchr (); | |
53 | extern 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 | |
70 | extern char *strstr (); | |
71 | #endif | |
72 | ||
73 | #ifdef HAVE_SBRK | |
74 | #ifdef NEED_DECLARATION_SBRK | |
75 | extern char *sbrk (); | |
76 | #endif | |
77 | #endif | |
78 | ||
79 | #ifdef NEED_DECLARATION_GETENV | |
80 | extern char *getenv (); | |
81 | #endif | |
82 | ||
83 | #ifdef NEED_DECLARATION_ENVIRON | |
84 | extern 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) | |
114 | char *alloca (); | |
115 | # else | |
116 | void *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 */ | |
146 | void bfd_nonfatal PARAMS ((CONST char *)); | |
147 | ||
148 | void bfd_fatal PARAMS ((CONST char *)); | |
149 | ||
150 | void fatal PARAMS ((CONST char *, ...)); | |
151 | ||
152 | void non_fatal PARAMS ((CONST char *, ...)); | |
153 | ||
154 | void set_default_bfd_target PARAMS ((void)); | |
155 | ||
156 | void list_matching_formats PARAMS ((char **p)); | |
157 | ||
158 | void list_supported_targets PARAMS ((const char *, FILE *)); | |
159 | ||
160 | void print_arelt_descr PARAMS ((FILE *file, bfd *abfd, boolean verbose)); | |
161 | ||
162 | char *make_tempname PARAMS ((char *)); | |
163 | ||
164 | bfd_vma parse_vma PARAMS ((const char *, const char *)); | |
165 | ||
166 | extern char *program_name; | |
167 | ||
168 | /* filemode.c */ | |
169 | void mode_string PARAMS ((unsigned long mode, char *buf)); | |
170 | ||
171 | /* version.c */ | |
172 | extern void print_version PARAMS ((const char *)); | |
173 | ||
174 | /* rename.c */ | |
175 | extern void set_times PARAMS ((const char *, const struct stat *)); | |
176 | ||
177 | extern int smart_rename PARAMS ((const char *, const char *, int)); | |
178 | ||
179 | /* libiberty */ | |
180 | PTR xmalloc PARAMS ((size_t)); | |
181 | ||
182 | PTR xrealloc PARAMS ((PTR, size_t)); | |
183 | ||
184 | #endif /* _BUCOMM_H */ |