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