xref: /freebsd/bin/pax/extern.h (revision b1787dec81c3778be385415c3eb6deaa6ba96ad2)
14b88c807SRodney W. Grimes /*-
24b88c807SRodney W. Grimes  * Copyright (c) 1992 Keith Muller.
34b88c807SRodney W. Grimes  * Copyright (c) 1992, 1993
44b88c807SRodney W. Grimes  *	The Regents of the University of California.  All rights reserved.
54b88c807SRodney W. Grimes  *
64b88c807SRodney W. Grimes  * This code is derived from software contributed to Berkeley by
74b88c807SRodney W. Grimes  * Keith Muller of the University of California, San Diego.
84b88c807SRodney W. Grimes  *
94b88c807SRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
104b88c807SRodney W. Grimes  * modification, are permitted provided that the following conditions
114b88c807SRodney W. Grimes  * are met:
124b88c807SRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
134b88c807SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
144b88c807SRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
154b88c807SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
164b88c807SRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
174b88c807SRodney W. Grimes  * 3. All advertising materials mentioning features or use of this software
184b88c807SRodney W. Grimes  *    must display the following acknowledgement:
194b88c807SRodney W. Grimes  *	This product includes software developed by the University of
204b88c807SRodney W. Grimes  *	California, Berkeley and its contributors.
214b88c807SRodney W. Grimes  * 4. Neither the name of the University nor the names of its contributors
224b88c807SRodney W. Grimes  *    may be used to endorse or promote products derived from this software
234b88c807SRodney W. Grimes  *    without specific prior written permission.
244b88c807SRodney W. Grimes  *
254b88c807SRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
264b88c807SRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
274b88c807SRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
284b88c807SRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
294b88c807SRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
304b88c807SRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
314b88c807SRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
324b88c807SRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
334b88c807SRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
344b88c807SRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
354b88c807SRodney W. Grimes  * SUCH DAMAGE.
364b88c807SRodney W. Grimes  *
374b88c807SRodney W. Grimes  *	@(#)extern.h	8.2 (Berkeley) 4/18/94
382a456239SPeter Wemm  * $FreeBSD$
394b88c807SRodney W. Grimes  */
404b88c807SRodney W. Grimes 
414b88c807SRodney W. Grimes /*
424b88c807SRodney W. Grimes  * External references from each source file
434b88c807SRodney W. Grimes  */
444b88c807SRodney W. Grimes 
454b88c807SRodney W. Grimes #include <sys/cdefs.h>
464b88c807SRodney W. Grimes 
474b88c807SRodney W. Grimes /*
484b88c807SRodney W. Grimes  * ar_io.c
494b88c807SRodney W. Grimes  */
504b88c807SRodney W. Grimes extern char *arcname;
511192d531SKris Kennaway extern const char *gzip_program;
524b88c807SRodney W. Grimes int ar_open __P((char *));
534b88c807SRodney W. Grimes void ar_close __P((void));
544b88c807SRodney W. Grimes void ar_drain __P((void));
554b88c807SRodney W. Grimes int ar_set_wr __P((void));
564b88c807SRodney W. Grimes int ar_app_ok __P((void));
574b88c807SRodney W. Grimes int ar_read __P((register char *, register int));
584b88c807SRodney W. Grimes int ar_write __P((register char *, register int));
594b88c807SRodney W. Grimes int ar_rdsync __P((void));
604b88c807SRodney W. Grimes int ar_fow __P((off_t, off_t *));
614b88c807SRodney W. Grimes int ar_rev __P((off_t ));
624b88c807SRodney W. Grimes int ar_next __P((void));
634b88c807SRodney W. Grimes 
644b88c807SRodney W. Grimes /*
654b88c807SRodney W. Grimes  * ar_subs.c
664b88c807SRodney W. Grimes  */
674b88c807SRodney W. Grimes extern u_long flcnt;
684b88c807SRodney W. Grimes void list __P((void));
694b88c807SRodney W. Grimes void extract __P((void));
704b88c807SRodney W. Grimes void append __P((void));
714b88c807SRodney W. Grimes void archive __P((void));
724b88c807SRodney W. Grimes void copy __P((void));
734b88c807SRodney W. Grimes 
744b88c807SRodney W. Grimes /*
754b88c807SRodney W. Grimes  * buf_subs.c
764b88c807SRodney W. Grimes  */
774b88c807SRodney W. Grimes extern int blksz;
784b88c807SRodney W. Grimes extern int wrblksz;
794b88c807SRodney W. Grimes extern int maxflt;
804b88c807SRodney W. Grimes extern int rdblksz;
814b88c807SRodney W. Grimes extern off_t wrlimit;
824b88c807SRodney W. Grimes extern off_t rdcnt;
834b88c807SRodney W. Grimes extern off_t wrcnt;
844b88c807SRodney W. Grimes int wr_start __P((void));
854b88c807SRodney W. Grimes int rd_start __P((void));
864b88c807SRodney W. Grimes void cp_start __P((void));
874b88c807SRodney W. Grimes int appnd_start __P((off_t));
884b88c807SRodney W. Grimes int rd_sync __P((void));
894b88c807SRodney W. Grimes void pback __P((char *, int));
904b88c807SRodney W. Grimes int rd_skip __P((off_t));
914b88c807SRodney W. Grimes void wr_fin __P((void));
924b88c807SRodney W. Grimes int wr_rdbuf __P((register char *, register int));
934b88c807SRodney W. Grimes int rd_wrbuf __P((register char *, register int));
944b88c807SRodney W. Grimes int wr_skip __P((off_t));
954b88c807SRodney W. Grimes int wr_rdfile __P((ARCHD *, int, off_t *));
964b88c807SRodney W. Grimes int rd_wrfile __P((ARCHD *, int, off_t *));
974b88c807SRodney W. Grimes void cp_file __P((ARCHD *, int, int));
984b88c807SRodney W. Grimes int buf_fill __P((void));
994b88c807SRodney W. Grimes int buf_flush __P((register int));
1004b88c807SRodney W. Grimes 
1014b88c807SRodney W. Grimes /*
1024b88c807SRodney W. Grimes  * cache.c
1034b88c807SRodney W. Grimes  */
1044b88c807SRodney W. Grimes int uidtb_start __P((void));
1054b88c807SRodney W. Grimes int gidtb_start __P((void));
1064b88c807SRodney W. Grimes int usrtb_start __P((void));
1074b88c807SRodney W. Grimes int grptb_start __P((void));
1084b88c807SRodney W. Grimes char * name_uid __P((uid_t, int));
1094b88c807SRodney W. Grimes char * name_gid __P((gid_t, int));
1104b88c807SRodney W. Grimes int uid_name __P((char *, uid_t *));
1114b88c807SRodney W. Grimes int gid_name __P((char *, gid_t *));
1124b88c807SRodney W. Grimes 
1134b88c807SRodney W. Grimes /*
1144b88c807SRodney W. Grimes  * cpio.c
1154b88c807SRodney W. Grimes  */
1164b88c807SRodney W. Grimes int cpio_strd __P((void));
1174b88c807SRodney W. Grimes int cpio_trail __P((register ARCHD *));
1184b88c807SRodney W. Grimes int cpio_endwr __P((void));
1194b88c807SRodney W. Grimes int cpio_id __P((char *, int));
1204b88c807SRodney W. Grimes int cpio_rd __P((register ARCHD *, register char *));
1214b88c807SRodney W. Grimes off_t cpio_endrd __P((void));
1224b88c807SRodney W. Grimes int cpio_stwr __P((void));
1234b88c807SRodney W. Grimes int cpio_wr __P((register ARCHD *));
1244b88c807SRodney W. Grimes int vcpio_id __P((char *, int));
1254b88c807SRodney W. Grimes int crc_id __P((char *, int));
1264b88c807SRodney W. Grimes int crc_strd __P((void));
1274b88c807SRodney W. Grimes int vcpio_rd __P((register ARCHD *, register char *));
1284b88c807SRodney W. Grimes off_t vcpio_endrd __P((void));
1294b88c807SRodney W. Grimes int crc_stwr __P((void));
1304b88c807SRodney W. Grimes int vcpio_wr __P((register ARCHD *));
1314b88c807SRodney W. Grimes int bcpio_id __P((char *, int));
1324b88c807SRodney W. Grimes int bcpio_rd __P((register ARCHD *, register char *));
1334b88c807SRodney W. Grimes off_t bcpio_endrd __P((void));
1344b88c807SRodney W. Grimes int bcpio_wr __P((register ARCHD *));
1354b88c807SRodney W. Grimes 
1364b88c807SRodney W. Grimes /*
1374b88c807SRodney W. Grimes  * file_subs.c
1384b88c807SRodney W. Grimes  */
1394b88c807SRodney W. Grimes int file_creat __P((register ARCHD *));
1404b88c807SRodney W. Grimes void file_close __P((register ARCHD *, int));
1414b88c807SRodney W. Grimes int lnk_creat __P((register ARCHD *));
1424b88c807SRodney W. Grimes int cross_lnk __P((register ARCHD *));
1434b88c807SRodney W. Grimes int chk_same __P((register ARCHD *));
1444b88c807SRodney W. Grimes int node_creat __P((register ARCHD *));
1454b88c807SRodney W. Grimes int unlnk_exist __P((register char *, register int));
1464b88c807SRodney W. Grimes int chk_path __P((register char *, uid_t, gid_t));
1474b88c807SRodney W. Grimes void set_ftime __P((char *fnm, time_t mtime, time_t atime, int frc));
1484b88c807SRodney W. Grimes int set_ids __P((char *, uid_t, gid_t));
149b1787decSKris Kennaway int set_lids __P((char *, uid_t, gid_t));
1504b88c807SRodney W. Grimes void set_pmode __P((char *, mode_t));
1514b88c807SRodney W. Grimes int file_write __P((int, char *, register int, int *, int *, int, char *));
1524b88c807SRodney W. Grimes void file_flush __P((int, char *, int));
1534b88c807SRodney W. Grimes void rdfile_close __P((register ARCHD *, register int *));
1544b88c807SRodney W. Grimes int set_crc __P((register ARCHD *, register int));
1554b88c807SRodney W. Grimes 
1564b88c807SRodney W. Grimes /*
1574b88c807SRodney W. Grimes  * ftree.c
1584b88c807SRodney W. Grimes  */
1594b88c807SRodney W. Grimes int ftree_start __P((void));
160b1787decSKris Kennaway int ftree_add __P((register char *, int));
1614b88c807SRodney W. Grimes void ftree_sel __P((register ARCHD *));
1624b88c807SRodney W. Grimes void ftree_chk __P((void));
1634b88c807SRodney W. Grimes int next_file __P((register ARCHD *));
1644b88c807SRodney W. Grimes 
1654b88c807SRodney W. Grimes /*
1664b88c807SRodney W. Grimes  * gen_subs.c
1674b88c807SRodney W. Grimes  */
168b1787decSKris Kennaway void ls_list __P((register ARCHD *, time_t, FILE *));
1694b88c807SRodney W. Grimes void ls_tty __P((register ARCHD *));
1704b88c807SRodney W. Grimes int l_strncpy __P((register char *, register char *, int));
1714b88c807SRodney W. Grimes u_long asc_ul __P((register char *, int, register int));
1724b88c807SRodney W. Grimes int ul_asc __P((u_long, register char *, register int, register int));
1734b88c807SRodney W. Grimes #ifndef NET2_STAT
1744b88c807SRodney W. Grimes u_quad_t asc_uqd __P((register char *, int, register int));
1754b88c807SRodney W. Grimes int uqd_asc __P((u_quad_t, register char *, register int, register int));
1764b88c807SRodney W. Grimes #endif
1774b88c807SRodney W. Grimes 
1784b88c807SRodney W. Grimes /*
179b1787decSKris Kennaway  * getoldopt.c
180b1787decSKris Kennaway  */
181b1787decSKris Kennaway int getoldopt __P((int, char **, char *));
182b1787decSKris Kennaway 
183b1787decSKris Kennaway /*
1844b88c807SRodney W. Grimes  * options.c
1854b88c807SRodney W. Grimes  */
1864b88c807SRodney W. Grimes extern FSUB fsub[];
1874b88c807SRodney W. Grimes extern int ford[];
1884b88c807SRodney W. Grimes void options __P((register int, register char **));
1894b88c807SRodney W. Grimes OPLIST * opt_next __P((void));
1904b88c807SRodney W. Grimes int opt_add __P((register char *));
1914b88c807SRodney W. Grimes int bad_opt __P((void));
192b1787decSKris Kennaway char *chdname;
1934b88c807SRodney W. Grimes 
1944b88c807SRodney W. Grimes /*
1954b88c807SRodney W. Grimes  * pat_rep.c
1964b88c807SRodney W. Grimes  */
1974b88c807SRodney W. Grimes int rep_add __P((register char *));
198b1787decSKris Kennaway int pat_add __P((char *, char *));
1994b88c807SRodney W. Grimes void pat_chk __P((void));
2004b88c807SRodney W. Grimes int pat_sel __P((register ARCHD *));
2014b88c807SRodney W. Grimes int pat_match __P((register ARCHD *));
2024b88c807SRodney W. Grimes int mod_name __P((register ARCHD *));
2034b88c807SRodney W. Grimes int set_dest __P((register ARCHD *, char *, int));
2044b88c807SRodney W. Grimes 
2054b88c807SRodney W. Grimes /*
2064b88c807SRodney W. Grimes  * pax.c
2074b88c807SRodney W. Grimes  */
2084b88c807SRodney W. Grimes extern int act;
2094b88c807SRodney W. Grimes extern FSUB *frmt;
2104b88c807SRodney W. Grimes extern int cflag;
211b1787decSKris Kennaway extern int cwdfd;
2124b88c807SRodney W. Grimes extern int dflag;
2134b88c807SRodney W. Grimes extern int iflag;
2144b88c807SRodney W. Grimes extern int kflag;
2154b88c807SRodney W. Grimes extern int lflag;
2164b88c807SRodney W. Grimes extern int nflag;
2174b88c807SRodney W. Grimes extern int tflag;
2184b88c807SRodney W. Grimes extern int uflag;
2194b88c807SRodney W. Grimes extern int vflag;
2204b88c807SRodney W. Grimes extern int Dflag;
2214b88c807SRodney W. Grimes extern int Hflag;
2224b88c807SRodney W. Grimes extern int Lflag;
2234b88c807SRodney W. Grimes extern int Xflag;
2244b88c807SRodney W. Grimes extern int Yflag;
2254b88c807SRodney W. Grimes extern int Zflag;
2264b88c807SRodney W. Grimes extern int vfpart;
2274b88c807SRodney W. Grimes extern int patime;
2284b88c807SRodney W. Grimes extern int pmtime;
229b1787decSKris Kennaway extern int nodirs;
2304b88c807SRodney W. Grimes extern int pmode;
2314b88c807SRodney W. Grimes extern int pids;
232b1787decSKris Kennaway extern int rmleadslash;
2334b88c807SRodney W. Grimes extern int exit_val;
2344b88c807SRodney W. Grimes extern int docrc;
2354b88c807SRodney W. Grimes extern char *dirptr;
2364b88c807SRodney W. Grimes extern char *argv0;
237b1787decSKris Kennaway extern FILE *listf;
238ffbef1cdSKris Kennaway extern char *tempfile;
239ffbef1cdSKris Kennaway extern char *tempbase;
240ffbef1cdSKris Kennaway 
2414b88c807SRodney W. Grimes int main __P((int, char **));
2424b88c807SRodney W. Grimes void sig_cleanup __P((int));
2434b88c807SRodney W. Grimes 
2444b88c807SRodney W. Grimes /*
2454b88c807SRodney W. Grimes  * sel_subs.c
2464b88c807SRodney W. Grimes  */
2474b88c807SRodney W. Grimes int sel_chk __P((register ARCHD *));
2484b88c807SRodney W. Grimes int grp_add __P((register char *));
2494b88c807SRodney W. Grimes int usr_add __P((register char *));
2504b88c807SRodney W. Grimes int trng_add __P((register char *));
2514b88c807SRodney W. Grimes 
2524b88c807SRodney W. Grimes /*
2534b88c807SRodney W. Grimes  * tables.c
2544b88c807SRodney W. Grimes  */
2554b88c807SRodney W. Grimes int lnk_start __P((void));
2564b88c807SRodney W. Grimes int chk_lnk __P((register ARCHD *));
2574b88c807SRodney W. Grimes void purg_lnk __P((register ARCHD *));
2584b88c807SRodney W. Grimes void lnk_end __P((void));
2594b88c807SRodney W. Grimes int ftime_start __P((void));
2604b88c807SRodney W. Grimes int chk_ftime __P((register ARCHD *));
2614b88c807SRodney W. Grimes int name_start __P((void));
2624b88c807SRodney W. Grimes int add_name __P((register char *, int, char *));
263b1787decSKris Kennaway void sub_name __P((register char *, int *, size_t));
2644b88c807SRodney W. Grimes int dev_start __P((void));
2654b88c807SRodney W. Grimes int add_dev __P((register ARCHD *));
2664b88c807SRodney W. Grimes int map_dev __P((register ARCHD *, u_long, u_long));
2674b88c807SRodney W. Grimes int atdir_start __P((void));
2684b88c807SRodney W. Grimes void atdir_end __P((void));
2694b88c807SRodney W. Grimes void add_atdir __P((char *, dev_t, ino_t, time_t, time_t));
2704b88c807SRodney W. Grimes int get_atdir __P((dev_t, ino_t, time_t *, time_t *));
2714b88c807SRodney W. Grimes int dir_start __P((void));
2724b88c807SRodney W. Grimes void add_dir __P((char *, int, struct stat *, int));
2734b88c807SRodney W. Grimes void proc_dir __P((void));
2744b88c807SRodney W. Grimes u_int st_hash __P((char *, int, int));
2754b88c807SRodney W. Grimes 
2764b88c807SRodney W. Grimes /*
2774b88c807SRodney W. Grimes  * tar.c
2784b88c807SRodney W. Grimes  */
2794b88c807SRodney W. Grimes int tar_endwr __P((void));
2804b88c807SRodney W. Grimes off_t tar_endrd __P((void));
2814b88c807SRodney W. Grimes int tar_trail __P((register char *, register int, register int *));
2824b88c807SRodney W. Grimes int tar_id __P((register char *, int));
2834b88c807SRodney W. Grimes int tar_opt __P((void));
2844b88c807SRodney W. Grimes int tar_rd __P((register ARCHD *, register char *));
2854b88c807SRodney W. Grimes int tar_wr __P((register ARCHD *));
2864b88c807SRodney W. Grimes int ustar_strd __P((void));
2874b88c807SRodney W. Grimes int ustar_stwr __P((void));
2884b88c807SRodney W. Grimes int ustar_id __P((char *, int));
2894b88c807SRodney W. Grimes int ustar_rd __P((register ARCHD *, register char *));
2904b88c807SRodney W. Grimes int ustar_wr __P((register ARCHD *));
2914b88c807SRodney W. Grimes 
2924b88c807SRodney W. Grimes /*
2934b88c807SRodney W. Grimes  * tty_subs.c
2944b88c807SRodney W. Grimes  */
2954b88c807SRodney W. Grimes int tty_init __P((void));
296a2e73040SKris Kennaway void tty_prnt __P((const char *, ...)) __printflike(1, 2);
2974b88c807SRodney W. Grimes int tty_read __P((char *, int));
298778766feSKris Kennaway void paxwarn __P((int, const char *, ...)) __printflike(2, 3);
299778766feSKris Kennaway void syswarn __P((int, int, const char *, ...)) __printflike(3, 4);
300