source: freewrt/tools/paxmirabilis/src/extern.h@ 7417b08

freewrt_1_0 freewrt_2_0
Last change on this file since 7417b08 was a569125, checked in by Thorsten Glaser <tg@…>, 14 years ago

even FreeWRT 1.0-stable deserves paxmirabilis-20120216 compiled with LTO ☺

git-svn-id: svn://www.freewrt.org/branches/freewrt_1_0@3981 afb5a338-a214-0410-bd46-81f09a774fd1

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