extern.h revision 1.19
131183Speter/*	$NetBSD: extern.h,v 1.19 1999/10/22 20:59:08 is Exp $	*/
231183Speter
331183Speter/*-
431183Speter * Copyright (c) 1992 Keith Muller.
553024Sguido * Copyright (c) 1992, 1993
631183Speter *	The Regents of the University of California.  All rights reserved.
731183Speter *
831183Speter * This code is derived from software contributed to Berkeley by
931183Speter * Keith Muller of the University of California, San Diego.
1031183Speter *
1131183Speter * Redistribution and use in source and binary forms, with or without
1231183Speter * modification, are permitted provided that the following conditions
1331183Speter * are met:
1431183Speter * 1. Redistributions of source code must retain the above copyright
1531183Speter *    notice, this list of conditions and the following disclaimer.
1631183Speter * 2. Redistributions in binary form must reproduce the above copyright
1731183Speter *    notice, this list of conditions and the following disclaimer in the
1831183Speter *    documentation and/or other materials provided with the distribution.
1931183Speter * 3. All advertising materials mentioning features or use of this software
2031183Speter *    must display the following acknowledgement:
2131183Speter *	This product includes software developed by the University of
2231183Speter *	California, Berkeley and its contributors.
2331183Speter * 4. Neither the name of the University nor the names of its contributors
2431183Speter *    may be used to endorse or promote products derived from this software
2531183Speter *    without specific prior written permission.
2631183Speter *
2731183Speter * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2831183Speter * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2931183Speter * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3031183Speter * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3131183Speter * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3231183Speter * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3331183Speter * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3431183Speter * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3531183Speter * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3637074Speter * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3731183Speter * SUCH DAMAGE.
3831183Speter *
3931183Speter *	@(#)extern.h	8.2 (Berkeley) 4/18/94
4031183Speter */
4131183Speter
4231183Speter/*
4331183Speter * External references from each source file
4431183Speter */
4531183Speter
4631183Speter#include <sys/cdefs.h>
4731183Speter
4831183Speter/*
4931183Speter * ar_io.c
5031183Speter */
5131183Speterextern const char *arcname;
5231183Speterextern int curdirfd;
5331183Speterextern const char *gzip_program;
5431183Speterextern time_t starttime;
5531183Speterint ar_open __P((const char *));
5631183Spetervoid ar_close __P((void));
5731183Spetervoid ar_drain __P((void));
5831183Speterint ar_set_wr __P((void));
59255332Scyint ar_app_ok __P((void));
6031183Speterint ar_read __P((char *, int));
6131183Speterint ar_write __P((char *, int));
6231183Speterint ar_rdsync __P((void));
6331183Speterint ar_fow __P((off_t, off_t *));
6431183Speterint ar_rev __P((off_t ));
6531183Speterint ar_next __P((void));
6631183Spetervoid ar_summary __P((int));
6731183Speterint ar_dochdir __P((char *));
6831183Speter
6931183Speter/*
7031183Speter * ar_subs.c
7131183Speter */
7231183Speterextern u_long flcnt;
73extern ARCHD archd;
74void list __P((void));
75void extract __P((void));
76void append __P((void));
77void archive __P((void));
78void copy __P((void));
79
80/*
81 * buf_subs.c
82 */
83extern int blksz;
84extern int wrblksz;
85extern int maxflt;
86extern int rdblksz;
87extern off_t wrlimit;
88extern off_t rdcnt;
89extern off_t wrcnt;
90int wr_start __P((void));
91int rd_start __P((void));
92void cp_start __P((void));
93int appnd_start __P((off_t));
94int rd_sync __P((void));
95void pback __P((char *, int));
96int rd_skip __P((off_t));
97void wr_fin __P((void));
98int wr_rdbuf __P((char *, int));
99int rd_wrbuf __P((char *, int));
100int wr_skip __P((off_t));
101int wr_rdfile __P((ARCHD *, int, off_t *));
102int rd_wrfile __P((ARCHD *, int, off_t *));
103void cp_file __P((ARCHD *, int, int));
104int buf_fill __P((void));
105int buf_flush __P((int));
106
107/*
108 * cpio.c
109 */
110extern int cpio_swp_head;
111int cpio_strd __P((void));
112int cpio_subtrail __P((ARCHD *));
113int cpio_endwr __P((void));
114int cpio_id __P((char *, int));
115int cpio_rd __P((ARCHD *, char *));
116off_t cpio_endrd __P((void));
117int cpio_stwr __P((void));
118int cpio_wr __P((ARCHD *));
119int vcpio_id __P((char *, int));
120int crc_id __P((char *, int));
121int crc_strd __P((void));
122int vcpio_rd __P((ARCHD *, char *));
123off_t vcpio_endrd __P((void));
124int crc_stwr __P((void));
125int vcpio_wr __P((ARCHD *));
126int bcpio_id __P((char *, int));
127int bcpio_rd __P((ARCHD *, char *));
128off_t bcpio_endrd __P((void));
129int bcpio_wr __P((ARCHD *));
130
131/*
132 * file_subs.c
133 */
134extern char *gnu_hack_string;
135int file_creat __P((ARCHD *));
136void file_close __P((ARCHD *, int));
137int lnk_creat __P((ARCHD *));
138int cross_lnk __P((ARCHD *));
139int chk_same __P((ARCHD *));
140int node_creat __P((ARCHD *));
141int unlnk_exist __P((char *, int));
142int chk_path __P((char *, uid_t, gid_t));
143void set_ftime __P((char *fnm, time_t mtime, time_t atime, int frc));
144int set_ids __P((char *, uid_t, gid_t));
145void set_pmode __P((char *, mode_t));
146int file_write __P((int, char *, int, int *, int *, int, char *));
147void file_flush __P((int, char *, int));
148void rdfile_close __P((ARCHD *, int *));
149int set_crc __P((ARCHD *, int));
150
151/*
152 * ftree.c
153 */
154int ftree_start __P((void));
155int ftree_add __P((char *, int));
156void ftree_sel __P((ARCHD *));
157void ftree_chk __P((void));
158int next_file __P((ARCHD *));
159
160/*
161 * gen_subs.c
162 */
163void ls_list __P((ARCHD *, time_t));
164void ls_tty __P((ARCHD *));
165void zf_strncpy __P((char *, const char *, int));
166int l_strncpy __P((char *, const char *, int));
167u_long asc_ul __P((char *, int, int));
168int ul_asc __P((u_long, char *, int, int));
169#ifndef NET2_STAT
170u_quad_t asc_uqd __P((char *, int, int));
171int uqd_asc __P((u_quad_t, char *, int, int));
172#endif
173int check_Aflag __P((void));
174
175/*
176 * getoldopt.c
177 */
178int getoldopt __P((int, char **, char *));
179
180/*
181 * options.c
182 */
183extern FSUB fsub[];
184extern int ford[];
185extern int cpio_mode;
186void options __P((int, char **));
187OPLIST * opt_next __P((void));
188int opt_add __P((const char *));
189int opt_chdir __P((char *));
190int bad_opt __P((void));
191
192/*
193 * pat_rep.c
194 */
195int rep_add __P((char *));
196int pat_add __P((char *, int));
197void pat_chk __P((void));
198int pat_sel __P((ARCHD *));
199int pat_match __P((ARCHD *));
200int mod_name __P((ARCHD *));
201int set_dest __P((ARCHD *, char *, int));
202
203/*
204 * pax.c
205 */
206extern int act;
207extern FSUB *frmt;
208extern int Aflag;
209extern int cflag;
210extern int dflag;
211extern int iflag;
212extern int kflag;
213extern int lflag;
214extern int nflag;
215extern int tflag;
216extern int uflag;
217extern int vflag;
218extern int zflag;
219extern int Dflag;
220extern int Hflag;
221extern int Lflag;
222extern int Xflag;
223extern int Yflag;
224extern int Zflag;
225extern int vfpart;
226extern int patime;
227extern int pmtime;
228extern int pmode;
229extern int pids;
230extern int exit_val;
231extern int docrc;
232extern char *dirptr;
233extern const char *ltmfrmt;
234extern char *argv0;
235int main __P((int, char **));
236void sig_cleanup __P((int));
237
238/*
239 * sel_subs.c
240 */
241int sel_chk __P((ARCHD *));
242int grp_add __P((char *));
243int usr_add __P((char *));
244int trng_add __P((char *));
245
246/*
247 * tables.c
248 */
249int lnk_start __P((void));
250int chk_lnk __P((ARCHD *));
251void purg_lnk __P((ARCHD *));
252void lnk_end __P((void));
253int ftime_start __P((void));
254int chk_ftime __P((ARCHD *));
255int name_start __P((void));
256int add_name __P((char *, int, char *));
257void sub_name __P((char *, int *));
258int dev_start __P((void));
259int add_dev __P((ARCHD *));
260int map_dev __P((ARCHD *, u_long, u_long));
261int atdir_start __P((void));
262void atdir_end __P((void));
263void add_atdir __P((char *, dev_t, ino_t, time_t, time_t));
264int get_atdir __P((dev_t, ino_t, time_t *, time_t *));
265int dir_start __P((void));
266void add_dir __P((char *, int, struct stat *, int));
267void proc_dir __P((void));
268u_int st_hash __P((char *, int, int));
269
270/*
271 * tar.c
272 */
273extern int is_oldgnutar;
274int tar_endwr __P((void));
275off_t tar_endrd __P((void));
276int tar_trail __P((char *, int, int *));
277int tar_id __P((char *, int));
278int tar_opt __P((void));
279int tar_rd __P((ARCHD *, char *));
280int tar_wr __P((ARCHD *));
281int ustar_strd __P((void));
282int ustar_stwr __P((void));
283int ustar_id __P((char *, int));
284int ustar_rd __P((ARCHD *, char *));
285int ustar_wr __P((ARCHD *));
286int tar_gnutar_X_compat __P((const char *));
287
288/*
289 * tty_subs.c
290 */
291int tty_init __P((void));
292void tty_prnt __P((char *, ...))
293    __attribute__((format (printf, 1, 2)));
294int tty_read __P((char *, int));
295void tty_warn __P((int, char *, ...))
296    __attribute__((format (printf, 2, 3)));
297void syswarn __P((int, int, char *, ...))
298    __attribute__((format (printf, 3, 4)));
299