source: freewrt/tools/paxmirabilis/src/extern.h@ fdd4f59

freewrt_1_0 freewrt_2_0
Last change on this file since fdd4f59 was 9ec66c9, checked in by Thorsten Glaser <tg@…>, 19 years ago

sync with upstream after feeding the patches back

git-svn-id: svn://www.freewrt.org/trunk/freewrt@225 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 7.5 KB
Line 
1/** $MirOS: src/bin/pax/extern.h,v 1.7 2006/07/16 17:56:29 tg Exp $ */
2/* $OpenBSD: extern.h,v 1.31 2005/04/28 06:58:07 otto Exp $ */
3/* $NetBSD: extern.h,v 1.5 1996/03/26 23:54:16 mrg Exp $ */
4
5/*-
6 * Copyright (c) 1992 Keith Muller.
7 * Copyright (c) 1992, 1993
8 * The Regents of the University of California. All rights reserved.
9 *
10 * This code is derived from software contributed to Berkeley by
11 * Keith Muller of the University of California, San Diego.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. 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 */
39
40/*
41 * External references from each source file
42 */
43
44#include <sys/cdefs.h>
45#if defined(__GLIBC__)
46#include <time.h>
47#endif
48
49/*
50 * ar_io.c
51 */
52extern const char *arcname;
53extern const char *gzip_program;
54extern int force_one_volume;
55int ar_open(const char *);
56void ar_close(void);
57void ar_drain(void);
58int ar_set_wr(void);
59int ar_app_ok(void);
60int ar_read(char *, int);
61int ar_write(char *, int);
62int ar_rdsync(void);
63int ar_fow(off_t, off_t *);
64int ar_rev(off_t );
65int ar_next(void);
66
67/*
68 * ar_subs.c
69 */
70extern u_long flcnt;
71void list(void);
72void extract(void);
73void append(void);
74void archive(void);
75void copy(void);
76
77/*
78 * buf_subs.c
79 */
80extern int blksz;
81extern int wrblksz;
82extern int maxflt;
83extern int rdblksz;
84extern off_t wrlimit;
85extern off_t rdcnt;
86extern off_t wrcnt;
87int wr_start(void);
88int rd_start(void);
89void cp_start(void);
90int appnd_start(off_t);
91int rd_sync(void);
92void pback(char *, int);
93int rd_skip(off_t);
94void wr_fin(void);
95int wr_rdbuf(char *, int);
96int rd_wrbuf(char *, int);
97int wr_skip(off_t);
98int wr_rdfile(ARCHD *, int, off_t *);
99int rd_wrfile(ARCHD *, int, off_t *);
100void cp_file(ARCHD *, int, int);
101int buf_fill(void);
102int buf_flush(int);
103
104/*
105 * cache.c
106 */
107int uidtb_start(void);
108int gidtb_start(void);
109int usrtb_start(void);
110int grptb_start(void);
111char * name_uid(uid_t, int);
112char * name_gid(gid_t, int);
113int uid_name(char *, uid_t *);
114int gid_name(char *, gid_t *);
115
116/*
117 * cpio.c
118 */
119int cpio_strd(void);
120int cpio_trail(ARCHD *, char *, int, int *);
121int cpio_endwr(void);
122int cpio_id(char *, int);
123int cpio_rd(ARCHD *, char *);
124off_t cpio_endrd(void);
125int cpio_stwr(void);
126int dist_stwr(void);
127int cpio_wr(ARCHD *);
128int vcpio_id(char *, int);
129int crc_id(char *, int);
130int crc_strd(void);
131int vcpio_rd(ARCHD *, char *);
132off_t vcpio_endrd(void);
133int crc_stwr(void);
134int v4root_stwr(void);
135int v4norm_stwr(void);
136int vcpio_wr(ARCHD *);
137int bcpio_id(char *, int);
138int bcpio_rd(ARCHD *, char *);
139off_t bcpio_endrd(void);
140int bcpio_wr(ARCHD *);
141
142/*
143 * file_subs.c
144 */
145extern char *gnu_name_string, *gnu_link_string;
146int file_creat(ARCHD *);
147void file_close(ARCHD *, int);
148int lnk_creat(ARCHD *);
149int cross_lnk(ARCHD *);
150int chk_same(ARCHD *);
151int node_creat(ARCHD *);
152int unlnk_exist(char *, int);
153int chk_path(char *, uid_t, gid_t);
154void set_ftime(char *fnm, time_t mtime, time_t atime, int frc);
155void fset_ftime(char *fnm, int, time_t mtime, time_t atime, int frc);
156int set_ids(char *, uid_t, gid_t);
157int fset_ids(char *, int, uid_t, gid_t);
158int set_lids(char *, uid_t, gid_t);
159void set_pmode(char *, mode_t);
160void fset_pmode(char *, int, mode_t);
161int file_write(int, char *, int, int *, int *, int, char *);
162void file_flush(int, char *, int);
163void rdfile_close(ARCHD *, int *);
164int set_crc(ARCHD *, int);
165
166/*
167 * ftree.c
168 */
169int ftree_start(void);
170int ftree_add(char *, int);
171void ftree_sel(ARCHD *);
172void ftree_chk(void);
173int next_file(ARCHD *);
174
175/*
176 * gen_subs.c
177 */
178void ls_list(ARCHD *, time_t, FILE *);
179void ls_tty(ARCHD *);
180void safe_print(const char *, FILE *);
181u_long asc_ul(char *, int, int);
182int ul_asc(u_long, char *, int, int);
183#ifndef LONG_OFF_T
184u_quad_t asc_uqd(char *, int, int);
185int uqd_asc(u_quad_t, char *, int, int);
186#endif
187size_t fieldcpy(char *, size_t, const char *, size_t);
188
189/*
190 * getoldopt.c
191 */
192int getoldopt(int, char **, const char *);
193
194/*
195 * options.c
196 */
197extern FSUB fsub[];
198extern int ford[];
199void options(int, char **);
200OPLIST * opt_next(void);
201int opt_add(const char *);
202int bad_opt(void);
203char *chdname;
204
205/*
206 * pat_rep.c
207 */
208int rep_add(char *);
209int pat_add(char *, char *);
210void pat_chk(void);
211int pat_sel(ARCHD *);
212int pat_match(ARCHD *);
213int mod_name(ARCHD *);
214int set_dest(ARCHD *, char *, int);
215
216/*
217 * pax.c
218 */
219extern int act;
220extern FSUB *frmt;
221extern int cflag;
222extern int cwdfd;
223extern int dflag;
224extern int iflag;
225extern int kflag;
226extern int lflag;
227extern int nflag;
228extern int tflag;
229extern int uflag;
230extern int vflag;
231extern int Dflag;
232extern int Hflag;
233extern int Lflag;
234extern int Xflag;
235extern int Yflag;
236extern int Zflag;
237extern int zeroflag;
238extern int vfpart;
239extern int patime;
240extern int pmtime;
241extern int nodirs;
242extern int pmode;
243extern int pids;
244extern int rmleadslash;
245extern int exit_val;
246extern int docrc;
247extern char *dirptr;
248extern char *ltmfrmt;
249extern char *argv0;
250extern FILE *listf;
251extern char *tempfile;
252extern char *tempbase;
253
254int main(int, char **);
255void sig_cleanup(int);
256
257/*
258 * sel_subs.c
259 */
260int sel_chk(ARCHD *);
261int grp_add(char *);
262int usr_add(char *);
263int trng_add(char *);
264
265/*
266 * tables.c
267 */
268int lnk_start(void);
269int chk_lnk(ARCHD *);
270void purg_lnk(ARCHD *);
271void lnk_end(void);
272int ftime_start(void);
273int chk_ftime(ARCHD *);
274int name_start(void);
275int add_name(char *, int, char *);
276void sub_name(char *, int *, size_t);
277int dev_start(void);
278int add_dev(ARCHD *);
279int map_dev(ARCHD *, u_long, u_long);
280int atdir_start(void);
281void atdir_end(void);
282void add_atdir(char *, dev_t, ino_t, time_t, time_t);
283int get_atdir(dev_t, ino_t, time_t *, time_t *);
284int dir_start(void);
285void add_dir(char *, struct stat *, int);
286void proc_dir(void);
287u_int st_hash(char *, int, int);
288int flnk_start(void);
289int chk_flnk(ARCHD *);
290
291/*
292 * tar.c
293 */
294extern char *gnu_hack_string;
295int tar_endwr(void);
296off_t tar_endrd(void);
297int tar_trail(ARCHD *, char *, int, int *);
298int tar_id(char *, int);
299int tar_opt(void);
300int tar_rd(ARCHD *, char *);
301int tar_wr(ARCHD *);
302int ustar_strd(void);
303int ustar_stwr(void);
304int ustar_id(char *, int);
305int ustar_rd(ARCHD *, char *);
306int ustar_wr(ARCHD *);
307
308/*
309 * tty_subs.c
310 */
311int tty_init(void);
312void tty_prnt(const char *, ...);
313int tty_read(char *, int);
314void paxwarn(int, const char *, ...);
315void syswarn(int, int, const char *, ...);
Note: See TracBrowser for help on using the repository browser.