extern.h revision 1.21
1/*	$NetBSD: extern.h,v 1.21 2000/02/17 03:06:13 itohy Exp $	*/
2
3/*-
4 * Copyright (c) 1992 Keith Muller.
5 * Copyright (c) 1992, 1993
6 *	The Regents of the University of California.  All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * Keith Muller of the University of California, San Diego.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 *    notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 *    notice, this list of conditions and the following disclaimer in the
18 *    documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 *    must display the following acknowledgement:
21 *	This product includes software developed by the University of
22 *	California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 *    may be used to endorse or promote products derived from this software
25 *    without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 *	@(#)extern.h	8.2 (Berkeley) 4/18/94
40 */
41
42/*
43 * External references from each source file
44 */
45
46#include <sys/cdefs.h>
47
48/*
49 * ar_io.c
50 */
51extern const char *arcname;
52extern int curdirfd;
53extern const char *gzip_program;
54extern time_t starttime;
55int ar_open __P((const char *));
56void ar_close __P((void));
57void ar_drain __P((void));
58int ar_set_wr __P((void));
59int ar_app_ok __P((void));
60#ifdef SYS_NO_RESTART
61int read_with_restart __P((int, void *, int));
62int write_with_restart __P((int, void *, int));
63#else
64#define read_with_restart	read
65#define write_with_restart	write
66#endif
67int xread __P((int, void *, int));
68int xwrite __P((int, void *, int));
69int ar_read __P((char *, int));
70int ar_write __P((char *, int));
71int ar_rdsync __P((void));
72int ar_fow __P((off_t, off_t *));
73int ar_rev __P((off_t ));
74int ar_next __P((void));
75void ar_summary __P((int));
76int ar_dochdir __P((char *));
77
78/*
79 * ar_subs.c
80 */
81extern u_long flcnt;
82extern ARCHD archd;
83void list __P((void));
84void extract __P((void));
85void append __P((void));
86void archive __P((void));
87void copy __P((void));
88
89/*
90 * buf_subs.c
91 */
92extern int blksz;
93extern int wrblksz;
94extern int maxflt;
95extern int rdblksz;
96extern off_t wrlimit;
97extern off_t rdcnt;
98extern off_t wrcnt;
99int wr_start __P((void));
100int rd_start __P((void));
101void cp_start __P((void));
102int appnd_start __P((off_t));
103int rd_sync __P((void));
104void pback __P((char *, int));
105int rd_skip __P((off_t));
106void wr_fin __P((void));
107int wr_rdbuf __P((char *, int));
108int rd_wrbuf __P((char *, int));
109int wr_skip __P((off_t));
110int wr_rdfile __P((ARCHD *, int, off_t *));
111int rd_wrfile __P((ARCHD *, int, off_t *));
112void cp_file __P((ARCHD *, int, int));
113int buf_fill __P((void));
114int buf_flush __P((int));
115
116/*
117 * cpio.c
118 */
119extern int cpio_swp_head;
120int cpio_strd __P((void));
121int cpio_subtrail __P((ARCHD *));
122int cpio_endwr __P((void));
123int cpio_id __P((char *, int));
124int cpio_rd __P((ARCHD *, char *));
125off_t cpio_endrd __P((void));
126int cpio_stwr __P((void));
127int cpio_wr __P((ARCHD *));
128int vcpio_id __P((char *, int));
129int crc_id __P((char *, int));
130int crc_strd __P((void));
131int vcpio_rd __P((ARCHD *, char *));
132off_t vcpio_endrd __P((void));
133int crc_stwr __P((void));
134int vcpio_wr __P((ARCHD *));
135int bcpio_id __P((char *, int));
136int bcpio_rd __P((ARCHD *, char *));
137off_t bcpio_endrd __P((void));
138int bcpio_wr __P((ARCHD *));
139
140/*
141 * file_subs.c
142 */
143extern char *gnu_hack_string;
144int file_creat __P((ARCHD *));
145void file_close __P((ARCHD *, int));
146int lnk_creat __P((ARCHD *));
147int cross_lnk __P((ARCHD *));
148int chk_same __P((ARCHD *));
149int node_creat __P((ARCHD *));
150int unlnk_exist __P((char *, int));
151int chk_path __P((char *, uid_t, gid_t));
152void set_ftime __P((char *fnm, time_t mtime, time_t atime, int frc));
153int set_ids __P((char *, uid_t, gid_t));
154void set_pmode __P((char *, mode_t));
155void set_chflags __P((char *fnm, u_int32_t flags));
156int file_write __P((int, char *, int, int *, int *, int, char *));
157void file_flush __P((int, char *, int));
158void rdfile_close __P((ARCHD *, int *));
159int set_crc __P((ARCHD *, int));
160
161/*
162 * ftree.c
163 */
164int ftree_start __P((void));
165int ftree_add __P((char *, int));
166void ftree_sel __P((ARCHD *));
167void ftree_chk __P((void));
168int next_file __P((ARCHD *));
169
170/*
171 * gen_subs.c
172 */
173void ls_list __P((ARCHD *, time_t));
174void ls_tty __P((ARCHD *));
175void zf_strncpy __P((char *, const char *, int));
176int l_strncpy __P((char *, const char *, int));
177u_long asc_ul __P((char *, int, int));
178int ul_asc __P((u_long, char *, int, int));
179#ifndef NET2_STAT
180u_quad_t asc_uqd __P((char *, int, int));
181int uqd_asc __P((u_quad_t, char *, int, int));
182#endif
183int check_Aflag __P((void));
184
185/*
186 * getoldopt.c
187 */
188int getoldopt __P((int, char **, char *));
189
190/*
191 * options.c
192 */
193extern FSUB fsub[];
194extern int ford[];
195extern int cpio_mode;
196void options __P((int, char **));
197OPLIST * opt_next __P((void));
198int opt_add __P((const char *));
199int opt_chdir __P((char *));
200int bad_opt __P((void));
201
202/*
203 * pat_rep.c
204 */
205int rep_add __P((char *));
206int pat_add __P((char *, int));
207void pat_chk __P((void));
208int pat_sel __P((ARCHD *));
209int pat_match __P((ARCHD *));
210int mod_name __P((ARCHD *));
211int set_dest __P((ARCHD *, char *, int));
212
213/*
214 * pax.c
215 */
216extern int act;
217extern FSUB *frmt;
218extern int Aflag;
219extern int cflag;
220extern int dflag;
221extern int iflag;
222extern int kflag;
223extern int lflag;
224extern int nflag;
225extern int tflag;
226extern int uflag;
227extern int vflag;
228extern int zflag;
229extern int Dflag;
230extern int Hflag;
231extern int Lflag;
232extern int Xflag;
233extern int Yflag;
234extern int Zflag;
235extern int vfpart;
236extern int patime;
237extern int pmtime;
238extern int pfflags;
239extern int pmode;
240extern int pids;
241extern int exit_val;
242extern int docrc;
243extern char *dirptr;
244extern const char *ltmfrmt;
245extern char *argv0;
246int main __P((int, char **));
247void sig_cleanup __P((int));
248
249/*
250 * sel_subs.c
251 */
252int sel_chk __P((ARCHD *));
253int grp_add __P((char *));
254int usr_add __P((char *));
255int trng_add __P((char *));
256
257/*
258 * tables.c
259 */
260int lnk_start __P((void));
261int chk_lnk __P((ARCHD *));
262void purg_lnk __P((ARCHD *));
263void lnk_end __P((void));
264int ftime_start __P((void));
265int chk_ftime __P((ARCHD *));
266int name_start __P((void));
267int add_name __P((char *, int, char *));
268void sub_name __P((char *, int *));
269int dev_start __P((void));
270int add_dev __P((ARCHD *));
271int map_dev __P((ARCHD *, u_long, u_long));
272int atdir_start __P((void));
273void atdir_end __P((void));
274void add_atdir __P((char *, dev_t, ino_t, time_t, time_t));
275int get_atdir __P((dev_t, ino_t, time_t *, time_t *));
276int dir_start __P((void));
277void add_dir __P((char *, int, struct stat *, int));
278void proc_dir __P((void));
279u_int st_hash __P((char *, int, int));
280
281/*
282 * tar.c
283 */
284extern int is_oldgnutar;
285int tar_endwr __P((void));
286off_t tar_endrd __P((void));
287int tar_trail __P((char *, int, int *));
288int tar_id __P((char *, int));
289int tar_opt __P((void));
290int tar_rd __P((ARCHD *, char *));
291int tar_wr __P((ARCHD *));
292int ustar_strd __P((void));
293int ustar_stwr __P((void));
294int ustar_id __P((char *, int));
295int ustar_rd __P((ARCHD *, char *));
296int ustar_wr __P((ARCHD *));
297int tar_gnutar_X_compat __P((const char *));
298
299/*
300 * tty_subs.c
301 */
302int tty_init __P((void));
303void tty_prnt __P((char *, ...))
304    __attribute__((format (printf, 1, 2)));
305int tty_read __P((char *, int));
306void tty_warn __P((int, char *, ...))
307    __attribute__((format (printf, 2, 3)));
308void syswarn __P((int, int, char *, ...))
309    __attribute__((format (printf, 3, 4)));
310