source: freewrt/tools/paxmirabilis/extern.h@ c6ac237

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

Import paxmirabilis (MirCpio) from CVS as of today:
cvs -d anoncvs@…:/cvs co src/bin/pax

This will be used to replace the dependency on
GNU tar, reduce bugs and add flexibility.

ok wbx@

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

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