source: freewrt/tools/paxmirabilis/src/extern.h@ 3784d08

freewrt_1_0 freewrt_2_0
Last change on this file since 3784d08 was 08c8e8e, checked in by Thorsten Glaser <tg@…>, 16 years ago

sync with upstream (MirBSD), which gives us

  • improvements to fgetln(3) such as memory leak fixes and better congruence with other implementations even where not mandated by the API (manual page)
  • support for Mac OSX 10.6 Snow Leopard which removed the tape functions <sys/mtio.h> *even in a server operating system*
  • gcc warning fixes

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

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