source: trunk/minix/commands/pax/extern.h@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

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