xref: /freebsd/bin/pax/extern.h (revision 4b88c807ea9c629dc5691abc7e3cac9ea0d776dd)
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
384b88c807SRodney W. Grimes  */
394b88c807SRodney W. Grimes 
404b88c807SRodney W. Grimes /*
414b88c807SRodney W. Grimes  * External references from each source file
424b88c807SRodney W. Grimes  */
434b88c807SRodney W. Grimes 
444b88c807SRodney W. Grimes #include <sys/cdefs.h>
454b88c807SRodney W. Grimes 
464b88c807SRodney W. Grimes /*
474b88c807SRodney W. Grimes  * ar_io.c
484b88c807SRodney W. Grimes  */
494b88c807SRodney W. Grimes extern char *arcname;
504b88c807SRodney W. Grimes int ar_open __P((char *));
514b88c807SRodney W. Grimes void ar_close __P((void));
524b88c807SRodney W. Grimes void ar_drain __P((void));
534b88c807SRodney W. Grimes int ar_set_wr __P((void));
544b88c807SRodney W. Grimes int ar_app_ok __P((void));
554b88c807SRodney W. Grimes int ar_read __P((register char *, register int));
564b88c807SRodney W. Grimes int ar_write __P((register char *, register int));
574b88c807SRodney W. Grimes int ar_rdsync __P((void));
584b88c807SRodney W. Grimes int ar_fow __P((off_t, off_t *));
594b88c807SRodney W. Grimes int ar_rev __P((off_t ));
604b88c807SRodney W. Grimes int ar_next __P((void));
614b88c807SRodney W. Grimes 
624b88c807SRodney W. Grimes /*
634b88c807SRodney W. Grimes  * ar_subs.c
644b88c807SRodney W. Grimes  */
654b88c807SRodney W. Grimes extern u_long flcnt;
664b88c807SRodney W. Grimes void list __P((void));
674b88c807SRodney W. Grimes void extract __P((void));
684b88c807SRodney W. Grimes void append __P((void));
694b88c807SRodney W. Grimes void archive __P((void));
704b88c807SRodney W. Grimes void copy __P((void));
714b88c807SRodney W. Grimes 
724b88c807SRodney W. Grimes /*
734b88c807SRodney W. Grimes  * buf_subs.c
744b88c807SRodney W. Grimes  */
754b88c807SRodney W. Grimes extern int blksz;
764b88c807SRodney W. Grimes extern int wrblksz;
774b88c807SRodney W. Grimes extern int maxflt;
784b88c807SRodney W. Grimes extern int rdblksz;
794b88c807SRodney W. Grimes extern off_t wrlimit;
804b88c807SRodney W. Grimes extern off_t rdcnt;
814b88c807SRodney W. Grimes extern off_t wrcnt;
824b88c807SRodney W. Grimes int wr_start __P((void));
834b88c807SRodney W. Grimes int rd_start __P((void));
844b88c807SRodney W. Grimes void cp_start __P((void));
854b88c807SRodney W. Grimes int appnd_start __P((off_t));
864b88c807SRodney W. Grimes int rd_sync __P((void));
874b88c807SRodney W. Grimes void pback __P((char *, int));
884b88c807SRodney W. Grimes int rd_skip __P((off_t));
894b88c807SRodney W. Grimes void wr_fin __P((void));
904b88c807SRodney W. Grimes int wr_rdbuf __P((register char *, register int));
914b88c807SRodney W. Grimes int rd_wrbuf __P((register char *, register int));
924b88c807SRodney W. Grimes int wr_skip __P((off_t));
934b88c807SRodney W. Grimes int wr_rdfile __P((ARCHD *, int, off_t *));
944b88c807SRodney W. Grimes int rd_wrfile __P((ARCHD *, int, off_t *));
954b88c807SRodney W. Grimes void cp_file __P((ARCHD *, int, int));
964b88c807SRodney W. Grimes int buf_fill __P((void));
974b88c807SRodney W. Grimes int buf_flush __P((register int));
984b88c807SRodney W. Grimes 
994b88c807SRodney W. Grimes /*
1004b88c807SRodney W. Grimes  * cache.c
1014b88c807SRodney W. Grimes  */
1024b88c807SRodney W. Grimes int uidtb_start __P((void));
1034b88c807SRodney W. Grimes int gidtb_start __P((void));
1044b88c807SRodney W. Grimes int usrtb_start __P((void));
1054b88c807SRodney W. Grimes int grptb_start __P((void));
1064b88c807SRodney W. Grimes char * name_uid __P((uid_t, int));
1074b88c807SRodney W. Grimes char * name_gid __P((gid_t, int));
1084b88c807SRodney W. Grimes int uid_name __P((char *, uid_t *));
1094b88c807SRodney W. Grimes int gid_name __P((char *, gid_t *));
1104b88c807SRodney W. Grimes 
1114b88c807SRodney W. Grimes /*
1124b88c807SRodney W. Grimes  * cpio.c
1134b88c807SRodney W. Grimes  */
1144b88c807SRodney W. Grimes int cpio_strd __P((void));
1154b88c807SRodney W. Grimes int cpio_trail __P((register ARCHD *));
1164b88c807SRodney W. Grimes int cpio_endwr __P((void));
1174b88c807SRodney W. Grimes int cpio_id __P((char *, int));
1184b88c807SRodney W. Grimes int cpio_rd __P((register ARCHD *, register char *));
1194b88c807SRodney W. Grimes off_t cpio_endrd __P((void));
1204b88c807SRodney W. Grimes int cpio_stwr __P((void));
1214b88c807SRodney W. Grimes int cpio_wr __P((register ARCHD *));
1224b88c807SRodney W. Grimes int vcpio_id __P((char *, int));
1234b88c807SRodney W. Grimes int crc_id __P((char *, int));
1244b88c807SRodney W. Grimes int crc_strd __P((void));
1254b88c807SRodney W. Grimes int vcpio_rd __P((register ARCHD *, register char *));
1264b88c807SRodney W. Grimes off_t vcpio_endrd __P((void));
1274b88c807SRodney W. Grimes int crc_stwr __P((void));
1284b88c807SRodney W. Grimes int vcpio_wr __P((register ARCHD *));
1294b88c807SRodney W. Grimes int bcpio_id __P((char *, int));
1304b88c807SRodney W. Grimes int bcpio_rd __P((register ARCHD *, register char *));
1314b88c807SRodney W. Grimes off_t bcpio_endrd __P((void));
1324b88c807SRodney W. Grimes int bcpio_wr __P((register ARCHD *));
1334b88c807SRodney W. Grimes 
1344b88c807SRodney W. Grimes /*
1354b88c807SRodney W. Grimes  * file_subs.c
1364b88c807SRodney W. Grimes  */
1374b88c807SRodney W. Grimes int file_creat __P((register ARCHD *));
1384b88c807SRodney W. Grimes void file_close __P((register ARCHD *, int));
1394b88c807SRodney W. Grimes int lnk_creat __P((register ARCHD *));
1404b88c807SRodney W. Grimes int cross_lnk __P((register ARCHD *));
1414b88c807SRodney W. Grimes int chk_same __P((register ARCHD *));
1424b88c807SRodney W. Grimes int node_creat __P((register ARCHD *));
1434b88c807SRodney W. Grimes int unlnk_exist __P((register char *, register int));
1444b88c807SRodney W. Grimes int chk_path __P((register char *, uid_t, gid_t));
1454b88c807SRodney W. Grimes void set_ftime __P((char *fnm, time_t mtime, time_t atime, int frc));
1464b88c807SRodney W. Grimes int set_ids __P((char *, uid_t, gid_t));
1474b88c807SRodney W. Grimes void set_pmode __P((char *, mode_t));
1484b88c807SRodney W. Grimes int file_write __P((int, char *, register int, int *, int *, int, char *));
1494b88c807SRodney W. Grimes void file_flush __P((int, char *, int));
1504b88c807SRodney W. Grimes void rdfile_close __P((register ARCHD *, register int *));
1514b88c807SRodney W. Grimes int set_crc __P((register ARCHD *, register int));
1524b88c807SRodney W. Grimes 
1534b88c807SRodney W. Grimes /*
1544b88c807SRodney W. Grimes  * ftree.c
1554b88c807SRodney W. Grimes  */
1564b88c807SRodney W. Grimes int ftree_start __P((void));
1574b88c807SRodney W. Grimes int ftree_add __P((register char *));
1584b88c807SRodney W. Grimes void ftree_sel __P((register ARCHD *));
1594b88c807SRodney W. Grimes void ftree_chk __P((void));
1604b88c807SRodney W. Grimes int next_file __P((register ARCHD *));
1614b88c807SRodney W. Grimes 
1624b88c807SRodney W. Grimes /*
1634b88c807SRodney W. Grimes  * gen_subs.c
1644b88c807SRodney W. Grimes  */
1654b88c807SRodney W. Grimes void ls_list __P((register ARCHD *, time_t));
1664b88c807SRodney W. Grimes void ls_tty __P((register ARCHD *));
1674b88c807SRodney W. Grimes void zf_strncpy __P((register char *, register char *, int));
1684b88c807SRodney W. Grimes int l_strncpy __P((register char *, register char *, int));
1694b88c807SRodney W. Grimes u_long asc_ul __P((register char *, int, register int));
1704b88c807SRodney W. Grimes int ul_asc __P((u_long, register char *, register int, register int));
1714b88c807SRodney W. Grimes #ifndef NET2_STAT
1724b88c807SRodney W. Grimes u_quad_t asc_uqd __P((register char *, int, register int));
1734b88c807SRodney W. Grimes int uqd_asc __P((u_quad_t, register char *, register int, register int));
1744b88c807SRodney W. Grimes #endif
1754b88c807SRodney W. Grimes 
1764b88c807SRodney W. Grimes /*
1774b88c807SRodney W. Grimes  * options.c
1784b88c807SRodney W. Grimes  */
1794b88c807SRodney W. Grimes extern FSUB fsub[];
1804b88c807SRodney W. Grimes extern int ford[];
1814b88c807SRodney W. Grimes void options __P((register int, register char **));
1824b88c807SRodney W. Grimes OPLIST * opt_next __P((void));
1834b88c807SRodney W. Grimes int opt_add __P((register char *));
1844b88c807SRodney W. Grimes int bad_opt __P((void));
1854b88c807SRodney W. Grimes 
1864b88c807SRodney W. Grimes /*
1874b88c807SRodney W. Grimes  * pat_rep.c
1884b88c807SRodney W. Grimes  */
1894b88c807SRodney W. Grimes int rep_add __P((register char *));
1904b88c807SRodney W. Grimes int pat_add __P((char *));
1914b88c807SRodney W. Grimes void pat_chk __P((void));
1924b88c807SRodney W. Grimes int pat_sel __P((register ARCHD *));
1934b88c807SRodney W. Grimes int pat_match __P((register ARCHD *));
1944b88c807SRodney W. Grimes int mod_name __P((register ARCHD *));
1954b88c807SRodney W. Grimes int set_dest __P((register ARCHD *, char *, int));
1964b88c807SRodney W. Grimes 
1974b88c807SRodney W. Grimes /*
1984b88c807SRodney W. Grimes  * pax.c
1994b88c807SRodney W. Grimes  */
2004b88c807SRodney W. Grimes extern int act;
2014b88c807SRodney W. Grimes extern FSUB *frmt;
2024b88c807SRodney W. Grimes extern int cflag;
2034b88c807SRodney W. Grimes extern int dflag;
2044b88c807SRodney W. Grimes extern int iflag;
2054b88c807SRodney W. Grimes extern int kflag;
2064b88c807SRodney W. Grimes extern int lflag;
2074b88c807SRodney W. Grimes extern int nflag;
2084b88c807SRodney W. Grimes extern int tflag;
2094b88c807SRodney W. Grimes extern int uflag;
2104b88c807SRodney W. Grimes extern int vflag;
2114b88c807SRodney W. Grimes extern int Dflag;
2124b88c807SRodney W. Grimes extern int Hflag;
2134b88c807SRodney W. Grimes extern int Lflag;
2144b88c807SRodney W. Grimes extern int Xflag;
2154b88c807SRodney W. Grimes extern int Yflag;
2164b88c807SRodney W. Grimes extern int Zflag;
2174b88c807SRodney W. Grimes extern int vfpart;
2184b88c807SRodney W. Grimes extern int patime;
2194b88c807SRodney W. Grimes extern int pmtime;
2204b88c807SRodney W. Grimes extern int pmode;
2214b88c807SRodney W. Grimes extern int pids;
2224b88c807SRodney W. Grimes extern int exit_val;
2234b88c807SRodney W. Grimes extern int docrc;
2244b88c807SRodney W. Grimes extern char *dirptr;
2254b88c807SRodney W. Grimes extern char *ltmfrmt;
2264b88c807SRodney W. Grimes extern char *argv0;
2274b88c807SRodney W. Grimes int main __P((int, char **));
2284b88c807SRodney W. Grimes void sig_cleanup __P((int));
2294b88c807SRodney W. Grimes 
2304b88c807SRodney W. Grimes /*
2314b88c807SRodney W. Grimes  * sel_subs.c
2324b88c807SRodney W. Grimes  */
2334b88c807SRodney W. Grimes int sel_chk __P((register ARCHD *));
2344b88c807SRodney W. Grimes int grp_add __P((register char *));
2354b88c807SRodney W. Grimes int usr_add __P((register char *));
2364b88c807SRodney W. Grimes int trng_add __P((register char *));
2374b88c807SRodney W. Grimes 
2384b88c807SRodney W. Grimes /*
2394b88c807SRodney W. Grimes  * tables.c
2404b88c807SRodney W. Grimes  */
2414b88c807SRodney W. Grimes int lnk_start __P((void));
2424b88c807SRodney W. Grimes int chk_lnk __P((register ARCHD *));
2434b88c807SRodney W. Grimes void purg_lnk __P((register ARCHD *));
2444b88c807SRodney W. Grimes void lnk_end __P((void));
2454b88c807SRodney W. Grimes int ftime_start __P((void));
2464b88c807SRodney W. Grimes int chk_ftime __P((register ARCHD *));
2474b88c807SRodney W. Grimes int name_start __P((void));
2484b88c807SRodney W. Grimes int add_name __P((register char *, int, char *));
2494b88c807SRodney W. Grimes void sub_name __P((register char *, int *));
2504b88c807SRodney W. Grimes int dev_start __P((void));
2514b88c807SRodney W. Grimes int add_dev __P((register ARCHD *));
2524b88c807SRodney W. Grimes int map_dev __P((register ARCHD *, u_long, u_long));
2534b88c807SRodney W. Grimes int atdir_start __P((void));
2544b88c807SRodney W. Grimes void atdir_end __P((void));
2554b88c807SRodney W. Grimes void add_atdir __P((char *, dev_t, ino_t, time_t, time_t));
2564b88c807SRodney W. Grimes int get_atdir __P((dev_t, ino_t, time_t *, time_t *));
2574b88c807SRodney W. Grimes int dir_start __P((void));
2584b88c807SRodney W. Grimes void add_dir __P((char *, int, struct stat *, int));
2594b88c807SRodney W. Grimes void proc_dir __P((void));
2604b88c807SRodney W. Grimes u_int st_hash __P((char *, int, int));
2614b88c807SRodney W. Grimes 
2624b88c807SRodney W. Grimes /*
2634b88c807SRodney W. Grimes  * tar.c
2644b88c807SRodney W. Grimes  */
2654b88c807SRodney W. Grimes int tar_endwr __P((void));
2664b88c807SRodney W. Grimes off_t tar_endrd __P((void));
2674b88c807SRodney W. Grimes int tar_trail __P((register char *, register int, register int *));
2684b88c807SRodney W. Grimes int tar_id __P((register char *, int));
2694b88c807SRodney W. Grimes int tar_opt __P((void));
2704b88c807SRodney W. Grimes int tar_rd __P((register ARCHD *, register char *));
2714b88c807SRodney W. Grimes int tar_wr __P((register ARCHD *));
2724b88c807SRodney W. Grimes int ustar_strd __P((void));
2734b88c807SRodney W. Grimes int ustar_stwr __P((void));
2744b88c807SRodney W. Grimes int ustar_id __P((char *, int));
2754b88c807SRodney W. Grimes int ustar_rd __P((register ARCHD *, register char *));
2764b88c807SRodney W. Grimes int ustar_wr __P((register ARCHD *));
2774b88c807SRodney W. Grimes 
2784b88c807SRodney W. Grimes /*
2794b88c807SRodney W. Grimes  * tty_subs.c
2804b88c807SRodney W. Grimes  */
2814b88c807SRodney W. Grimes int tty_init __P((void));
2824b88c807SRodney W. Grimes void tty_prnt __P((char *, ...));
2834b88c807SRodney W. Grimes int tty_read __P((char *, int));
2844b88c807SRodney W. Grimes void warn __P((int, char *, ...));
2854b88c807SRodney W. Grimes void syswarn __P((int, int, char *, ...));
286