Debian Codegraph @

extern.h

raw symbols SCIP
1 /* $OpenBSD: extern.h,v 1.59 2018/09/13 12:33:43 millert Exp $ */
2 /* $NetBSD: extern.h,v 1.5 1996/03/26 23:54:16 mrg Exp $ */
3
4 /*-
5 * Copyright © 2013, 2015, 2016, 2018, 2019
6 * mirabilos <[email protected]>
7 * Copyright (c) 1992 Keith Muller.
8 * Copyright (c) 1992, 1993
9 * The Regents of the University of California. All rights reserved.
10 *
11 * This code is derived from software contributed to Berkeley by
12 * Keith Muller of the University of California, San Diego.
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 * 3. Neither the name of the University nor the names of its contributors
23 * may be used to endorse or promote products derived from this software
24 * without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)extern.h 8.2 (Berkeley) 4/18/94
39 */
40
41 /*
42 * External references from each source file
43 */
44
45 #ifdef EXTERN
46 __IDSTRING(rcsid_extern_h, "$MirOS: src/bin/pax/extern.h,v 1.40 2020/04/07 11:56:43 tg Exp $");
47 #endif
48
49 #ifndef PAX_JUST_THE_WARNINGS
50 /*
51 * ar.c
52 */
53 int uar_stwr(int);
54 int uar_ismagic(char *);
55 int uar_id(char *, int) MKSH_A_NORETURN;
56 int uar_rd(ARCHD *, char *);
57 int uar_wr(ARCHD *);
58 int uar_wr_data(ARCHD *, int, off_t *);
59 off_t uar_endrd(void);
60 int uar_trail(ARCHD *, char *, int, int *) MKSH_A_NORETURN;
61
62 /*
63 * ar_io.c
64 */
65 extern const char *arcname;
66 extern const char *compress_program;
67 extern char force_one_volume;
68 int ar_open(const char *);
69 void ar_close(int _in_sig);
70 void ar_drain(void);
71 int ar_set_wr(void);
72 int ar_app_ok(void);
73 int ar_read(char *, int);
74 int ar_write(char *, int);
75 int ar_rdsync(void);
76 int ar_fow(off_t, off_t *);
77 int ar_rev(off_t );
78 int ar_next(void);
79 extern char ar_do_keepopen;
80 int ar_next_keepopen(void);
81
82 /*
83 * ar_subs.c
84 */
85 extern u_long flcnt;
86 void list(void);
87 void extract(void);
88 void append(void);
89 void archive(void);
90 void copy(void);
91
92 /*
93 * buf_subs.c
94 */
95 extern int blksz;
96 extern int wrblksz;
97 extern int maxflt;
98 extern int rdblksz;
99 extern off_t wrlimit;
100 extern off_t rdcnt;
101 extern off_t wrcnt;
102 int wr_start(void);
103 int rd_start(void);
104 void cp_start(void);
105 int appnd_start(off_t);
106 int rd_sync(void);
107 void pback(const char *, int);
108 int rd_skip(off_t);
109 void wr_fin(void);
110 int wr_rdbuf(const char *, int);
111 int rd_wrbuf(char *, int);
112 int wr_skip(off_t);
113 int wr_rdfile(ARCHD *, int, off_t *);
114 int rd_wrfile(ARCHD *, int, off_t *);
115 void cp_file(ARCHD *, int, int);
116 int buf_fill(void);
117 int buf_fill_internal(int);
118 int buf_flush(int);
119
120 /*
121 * cache.c
122 */
123 #if !HAVE_UG_FROM_UGID
124 int uidtb_start(void);
125 int gidtb_start(void);
126 const char *name_uid(uid_t, int);
127 const char *name_gid(gid_t, int);
128 #else
129 #define name_uid(u,frc) ((const char *)user_from_uid((u), !(frc)))
130 #define name_gid(g,frc) ((const char *)group_from_gid((g), !(frc)))
131 #endif
132 #if !HAVE_UGID_FROM_UG
133 int usrtb_start(void);
134 int grptb_start(void);
135 int uid_name(const char *, uid_t *);
136 int gid_name(const char *, gid_t *);
137 int uid_uncached(const char *, uid_t *);
138 int gid_uncached(const char *, gid_t *);
139 #else
140 #define uid_name uid_from_user
141 #define gid_name gid_from_group
142 #define uid_uncached uid_from_user
143 #define gid_uncached gid_from_group
144 #endif
145
146 /*
147 * cpio.c
148 */
149 int cpio_strd(void);
150 int cpio_trail(ARCHD *, char *, int, int *);
151 int cpio_endwr(void);
152 int cpio_id(char *, int);
153 int cpio_rd(ARCHD *, char *);
154 off_t cpio_endrd(void);
155 int cpio_stwr(int);
156 int dist_stwr(int);
157 int cpio_wr(ARCHD *);
158 int vcpio_id(char *, int);
159 int crc_id(char *, int);
160 int crc_strd(void);
161 int vcpio_rd(ARCHD *, char *);
162 off_t vcpio_endrd(void);
163 int crc_stwr(int);
164 int v4root_stwr(int);
165 int v4norm_stwr(int);
166 int vcpio_wr(ARCHD *);
167 int bcpio_id(char *, int);
168 int bcpio_rd(ARCHD *, char *);
169 off_t bcpio_endrd(void);
170 int bcpio_wr(ARCHD *);
171
172 /*
173 * file_subs.c
174 */
175 int file_creat(ARCHD *);
176 void file_close(ARCHD *, int);
177 int lnk_creat(ARCHD *, int *);
178 int cross_lnk(ARCHD *);
179 int chk_same(ARCHD *);
180 int node_creat(ARCHD *);
181 int unlnk_exist(char *, int);
182 int chk_path(char *, uid_t, gid_t);
183 void set_ftime(const char *, const struct stat *, int, int);
184 int set_ids(char *, uid_t, gid_t, int);
185 int fset_ids(char *, int, uid_t, gid_t);
186 void set_pmode(char *, mode_t, int);
187 void fset_pmode(char *, int, mode_t);
188 struct file_times; /* avoid pulling time.h globally */
189 int set_attr(const struct file_times *, int _force_times, mode_t,
190 int _do_mode, int _in_sig);
191 int file_write(int, char *, int, int *, int *, int, char *);
192 void file_flush(int, char *, int);
193 void rdfile_close(ARCHD *, int *);
194 int set_crc(ARCHD *, int);
195
196 /*
197 * ftree.c
198 */
199 int ftree_start(void);
200 int ftree_add(char *, int);
201 void ftree_sel(ARCHD *);
202 void ftree_skipped_newer(void);
203 void ftree_chk(void);
204 int next_file(ARCHD *);
205
206 /*
207 * gen_subs.c
208 */
209 void ls_list(ARCHD *, FILE *);
210 void ls_tty(ARCHD *);
211 void safe_print(const char *, FILE *);
212 u_long asc_ul(char *, int, int);
213 int ul_asc(u_long, char *, int, int);
214 unsigned long long asc_ull(char *, int, int);
215 int ull_asc(unsigned long long, char *, int, int);
216 size_t fieldcpy(char *, size_t, const char *, size_t);
217
218 /*
219 * getoldopt.c
220 */
221 int getoldopt(int, char **, const char *);
222
223 /*
224 * options.c
225 */
226 extern const FSUB fsub[];
227 extern const unsigned char ford[];
228 extern int anonarch;
229 extern char to_stdout;
230 void options(int, char **);
231 OPLIST * opt_next(void);
232 int opt_add(const char *);
233 int bad_opt(void);
234 void guess_compress_program(int);
235 void anonarch_init(void);
236 void mircpio_deprecated(const char *, const char *);
237 extern char *chdname;
238
239 /*
240 * pat_rep.c
241 */
242 int rep_add(char *);
243 int pat_add(char *, char *);
244 void pat_chk(void);
245 int pat_sel(ARCHD *);
246 int pat_match(ARCHD *);
247 int mod_name(ARCHD *);
248 int set_dest(ARCHD *, char *, int);
249 int has_dotdot(const char *);
250
251 /*
252 * pax.c
253 */
254 extern signed char act;
255 extern const FSUB *frmt;
256 extern signed char cflag;
257 extern signed char cwdfd;
258 extern signed char dflag;
259 extern signed char iflag;
260 extern signed char kflag;
261 extern signed char lflag;
262 extern signed char nflag;
263 extern signed char tflag;
264 extern signed char uflag;
265 extern signed char Vflag;
266 extern signed char vflag;
267 extern signed char Dflag;
268 extern signed char Hflag;
269 extern signed char Lflag;
270 extern signed char Xflag;
271 extern signed char Yflag;
272 extern signed char Zflag;
273 extern signed char zeroflag;
274 extern signed char vfpart;
275 extern signed char patime;
276 extern signed char pmtime;
277 extern signed char nodirs;
278 extern signed char pmode;
279 extern signed char pids;
280 extern signed char rmleadslash;
281 extern signed char exit_val;
282 extern signed char docrc;
283 extern char *dirptr;
284 extern const char *argv0;
285 extern enum op_mode { OP_PAX, OP_TAR, OP_CPIO } op_mode;
286 extern FILE *listf;
287 extern int listfd;
288 extern char *tempfile;
289 extern char *tempbase;
290 extern char havechd;
291 extern time_t now;
292
293 void sig_cleanup(int) MKSH_A_NORETURN;
294
295 /*
296 * sel_subs.c
297 */
298 int sel_chk(ARCHD *);
299 int grp_add(char *);
300 int usr_add(char *);
301 int trng_add(char *);
302
303 /*
304 * tables.c
305 */
306 int lnk_start(void);
307 int chk_lnk(ARCHD *);
308 void purg_lnk(ARCHD *);
309 void lnk_end(void);
310 int ftime_start(void);
311 int chk_ftime(ARCHD *);
312 int sltab_start(void);
313 int sltab_add_sym(const char *_path, const char *_value, mode_t _mode);
314 int sltab_add_link(const char *, const struct stat *);
315 void sltab_process(int _in_sig);
316 int name_start(void);
317 int add_name(char *, int, char *);
318 void sub_name(char *, int *, int);
319 int dev_start(void);
320 int add_dev(ARCHD *);
321 int map_dev(ARCHD *, u_long, u_long);
322 int atdir_start(void);
323 void atdir_end(void);
324 void add_atdir(const char *, const struct stat *);
325 int do_atdir(const char *, dev_t, ino_t);
326 int dir_start(void);
327 void add_dir(char *, struct stat *, int);
328 void delete_dir(dev_t, ino_t);
329 void proc_dir(int _in_sig);
330 unsigned int st_hash(const char *, int, int);
331 int flnk_start(void);
332 int chk_flnk(ARCHD *);
333
334 /*
335 * tar.c
336 */
337 #ifndef SMALL
338 extern char tar_nodir;
339 #endif
340 extern char *gnu_name_string, *gnu_link_string;
341 int tar_endwr(void);
342 off_t tar_endrd(void);
343 int tar_trail(ARCHD *, char *, int, int *);
344 int tar_id(char *, int);
345 #ifndef SMALL
346 int tar_opt(void);
347 #else
348 #define tar_opt bad_opt
349 #endif
350 int tar_rd(ARCHD *, char *);
351 int tar_wr(ARCHD *);
352 int ustar_strd(void);
353 int ustar_stwr(int);
354 int ustar_id(char *, int);
355 int ustar_rd(ARCHD *, char *);
356 int ustar_wr(ARCHD *);
357
358 /*
359 * tty_subs.c
360 */
361 extern char fdgetline_err;
362 char *fdgetline(int);
363 int tty_init(void);
364 void tty_prnt(const char *, ...)
365 MKSH_A_NONNULL(1)
366 MKSH_A_FORMAT(__printf__, 1, 2);
367 char *tty_rd(void);
368 #endif
369 void paxwarn(int, const char *, ...)
370 MKSH_A_NONNULL(2)
371 MKSH_A_FORMAT(__printf__, 2, 3);
372 void syswarn(int, int, const char *, ...)
373 MKSH_A_NONNULL(3)
374 MKSH_A_FORMAT(__printf__, 3, 4);