extern.h revision 1.18
1/*	$NetBSD: extern.h,v 1.18 1999/10/22 10:43:11 mrg 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 const char *gzip_program;
53extern time_t starttime;
54int ar_open __P((const char *));
55void ar_close __P((void));
56void ar_drain __P((void));
57int ar_set_wr __P((void));
58int ar_app_ok __P((void));
59int ar_read __P((char *, int));
60int ar_write __P((char *, int));
61int ar_rdsync __P((void));
62int ar_fow __P((off_t, off_t *));
63int ar_rev __P((off_t ));
64int ar_next __P((void));
65void ar_summary __P((int));
66
67/*
68 * ar_subs.c
69 */
70extern u_long flcnt;
71extern ARCHD archd;
72void list __P((void));
73void extract __P((void));
74void append __P((void));
75void archive __P((void));
76void copy __P((void));
77
78/*
79 * buf_subs.c
80 */
81extern int blksz;
82extern int wrblksz;
83extern int maxflt;
84extern int rdblksz;
85extern off_t wrlimit;
86extern off_t rdcnt;
87extern off_t wrcnt;
88int wr_start __P((void));
89int rd_start __P((void));
90void cp_start __P((void));
91int appnd_start __P((off_t));
92int rd_sync __P((void));
93void pback __P((char *, int));
94int rd_skip __P((off_t));
95void wr_fin __P((void));
96int wr_rdbuf __P((char *, int));
97int rd_wrbuf __P((char *, int));
98int wr_skip __P((off_t));
99int wr_rdfile __P((ARCHD *, int, off_t *));
100int rd_wrfile __P((ARCHD *, int, off_t *));
101void cp_file __P((ARCHD *, int, int));
102int buf_fill __P((void));
103int buf_flush __P((int));
104
105/*
106 * cpio.c
107 */
108extern int cpio_swp_head;
109int cpio_strd __P((void));
110int cpio_subtrail __P((ARCHD *));
111int cpio_endwr __P((void));
112int cpio_id __P((char *, int));
113int cpio_rd __P((ARCHD *, char *));
114off_t cpio_endrd __P((void));
115int cpio_stwr __P((void));
116int cpio_wr __P((ARCHD *));
117int vcpio_id __P((char *, int));
118int crc_id __P((char *, int));
119int crc_strd __P((void));
120int vcpio_rd __P((ARCHD *, char *));
121off_t vcpio_endrd __P((void));
122int crc_stwr __P((void));
123int vcpio_wr __P((ARCHD *));
124int bcpio_id __P((char *, int));
125int bcpio_rd __P((ARCHD *, char *));
126off_t bcpio_endrd __P((void));
127int bcpio_wr __P((ARCHD *));
128
129/*
130 * file_subs.c
131 */
132extern char *gnu_hack_string;
133int file_creat __P((ARCHD *));
134void file_close __P((ARCHD *, int));
135int lnk_creat __P((ARCHD *));
136int cross_lnk __P((ARCHD *));
137int chk_same __P((ARCHD *));
138int node_creat __P((ARCHD *));
139int unlnk_exist __P((char *, int));
140int chk_path __P((char *, uid_t, gid_t));
141void set_ftime __P((char *fnm, time_t mtime, time_t atime, int frc));
142int set_ids __P((char *, uid_t, gid_t));
143void set_pmode __P((char *, mode_t));
144int file_write __P((int, char *, int, int *, int *, int, char *));
145void file_flush __P((int, char *, int));
146void rdfile_close __P((ARCHD *, int *));
147int set_crc __P((ARCHD *, int));
148
149/*
150 * ftree.c
151 */
152int ftree_start __P((void));
153int ftree_add __P((char *));
154void ftree_sel __P((ARCHD *));
155void ftree_chk __P((void));
156int next_file __P((ARCHD *));
157
158/*
159 * gen_subs.c
160 */
161void ls_list __P((ARCHD *, time_t));
162void ls_tty __P((ARCHD *));
163void zf_strncpy __P((char *, const char *, int));
164int l_strncpy __P((char *, const char *, int));
165u_long asc_ul __P((char *, int, int));
166int ul_asc __P((u_long, char *, int, int));
167#ifndef NET2_STAT
168u_quad_t asc_uqd __P((char *, int, int));
169int uqd_asc __P((u_quad_t, char *, int, int));
170#endif
171int check_Aflag __P((void));
172
173/*
174 * getoldopt.c
175 */
176int getoldopt __P((int, char **, char *));
177
178/*
179 * options.c
180 */
181extern FSUB fsub[];
182extern int ford[];
183extern int cpio_mode;
184extern char *chdir_dir;
185void options __P((int, char **));
186OPLIST * opt_next __P((void));
187int opt_add __P((const char *));
188int bad_opt __P((void));
189
190/*
191 * pat_rep.c
192 */
193int rep_add __P((char *));
194int pat_add __P((char *));
195void pat_chk __P((void));
196int pat_sel __P((ARCHD *));
197int pat_match __P((ARCHD *));
198int mod_name __P((ARCHD *));
199int set_dest __P((ARCHD *, char *, int));
200
201/*
202 * pax.c
203 */
204extern int act;
205extern FSUB *frmt;
206extern int Aflag;
207extern int cflag;
208extern int dflag;
209extern int iflag;
210extern int kflag;
211extern int lflag;
212extern int nflag;
213extern int tflag;
214extern int uflag;
215extern int vflag;
216extern int zflag;
217extern int Dflag;
218extern int Hflag;
219extern int Lflag;
220extern int Xflag;
221extern int Yflag;
222extern int Zflag;
223extern int vfpart;
224extern int patime;
225extern int pmtime;
226extern int pmode;
227extern int pids;
228extern int exit_val;
229extern int docrc;
230extern char *dirptr;
231extern const char *ltmfrmt;
232extern char *argv0;
233int main __P((int, char **));
234void sig_cleanup __P((int));
235
236/*
237 * sel_subs.c
238 */
239int sel_chk __P((ARCHD *));
240int grp_add __P((char *));
241int usr_add __P((char *));
242int trng_add __P((char *));
243
244/*
245 * tables.c
246 */
247int lnk_start __P((void));
248int chk_lnk __P((ARCHD *));
249void purg_lnk __P((ARCHD *));
250void lnk_end __P((void));
251int ftime_start __P((void));
252int chk_ftime __P((ARCHD *));
253int name_start __P((void));
254int add_name __P((char *, int, char *));
255void sub_name __P((char *, int *));
256int dev_start __P((void));
257int add_dev __P((ARCHD *));
258int map_dev __P((ARCHD *, u_long, u_long));
259int atdir_start __P((void));
260void atdir_end __P((void));
261void add_atdir __P((char *, dev_t, ino_t, time_t, time_t));
262int get_atdir __P((dev_t, ino_t, time_t *, time_t *));
263int dir_start __P((void));
264void add_dir __P((char *, int, struct stat *, int));
265void proc_dir __P((void));
266u_int st_hash __P((char *, int, int));
267
268/*
269 * tar.c
270 */
271extern int is_oldgnutar;
272int tar_endwr __P((void));
273off_t tar_endrd __P((void));
274int tar_trail __P((char *, int, int *));
275int tar_id __P((char *, int));
276int tar_opt __P((void));
277int tar_rd __P((ARCHD *, char *));
278int tar_wr __P((ARCHD *));
279int ustar_strd __P((void));
280int ustar_stwr __P((void));
281int ustar_id __P((char *, int));
282int ustar_rd __P((ARCHD *, char *));
283int ustar_wr __P((ARCHD *));
284int tar_gnutar_X_compat __P((const char *));
285
286/*
287 * tty_subs.c
288 */
289int tty_init __P((void));
290void tty_prnt __P((char *, ...))
291    __attribute__((format (printf, 1, 2)));
292int tty_read __P((char *, int));
293void tty_warn __P((int, char *, ...))
294    __attribute__((format (printf, 2, 3)));
295void syswarn __P((int, int, char *, ...))
296    __attribute__((format (printf, 3, 4)));
297