2000-10-22 19:41:31 +04:00
|
|
|
/* $NetBSD: extern.h,v 1.25 2000/10/22 15:41:31 kleink Exp $ */
|
1995-03-21 12:01:59 +03:00
|
|
|
|
1994-06-13 20:13:35 +04:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 1992 Keith Muller.
|
|
|
|
* Copyright (c) 1992, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to Berkeley by
|
|
|
|
* Keith Muller of the University of California, San Diego.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
* 4. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
1995-03-21 12:01:59 +03:00
|
|
|
* @(#)extern.h 8.2 (Berkeley) 4/18/94
|
1994-06-13 20:13:35 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* External references from each source file
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ar_io.c
|
|
|
|
*/
|
1998-07-27 20:43:25 +04:00
|
|
|
extern const char *arcname;
|
1999-10-23 00:59:08 +04:00
|
|
|
extern int curdirfd;
|
1998-07-27 20:43:25 +04:00
|
|
|
extern const char *gzip_program;
|
1999-03-03 21:06:52 +03:00
|
|
|
extern time_t starttime;
|
2000-03-30 21:53:04 +04:00
|
|
|
extern int force_one_volume;
|
1998-07-27 20:43:25 +04:00
|
|
|
int ar_open __P((const char *));
|
1994-06-13 20:13:35 +04:00
|
|
|
void ar_close __P((void));
|
|
|
|
void ar_drain __P((void));
|
|
|
|
int ar_set_wr __P((void));
|
|
|
|
int ar_app_ok __P((void));
|
2000-02-17 06:06:12 +03:00
|
|
|
#ifdef SYS_NO_RESTART
|
|
|
|
int read_with_restart __P((int, void *, int));
|
|
|
|
int write_with_restart __P((int, void *, int));
|
|
|
|
#else
|
|
|
|
#define read_with_restart read
|
|
|
|
#define write_with_restart write
|
|
|
|
#endif
|
|
|
|
int xread __P((int, void *, int));
|
|
|
|
int xwrite __P((int, void *, int));
|
1997-09-14 18:54:32 +04:00
|
|
|
int ar_read __P((char *, int));
|
|
|
|
int ar_write __P((char *, int));
|
1994-06-13 20:13:35 +04:00
|
|
|
int ar_rdsync __P((void));
|
|
|
|
int ar_fow __P((off_t, off_t *));
|
|
|
|
int ar_rev __P((off_t ));
|
|
|
|
int ar_next __P((void));
|
1999-03-03 21:06:52 +03:00
|
|
|
void ar_summary __P((int));
|
1999-10-23 00:59:08 +04:00
|
|
|
int ar_dochdir __P((char *));
|
1994-06-13 20:13:35 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* ar_subs.c
|
|
|
|
*/
|
|
|
|
extern u_long flcnt;
|
1999-03-03 21:06:52 +03:00
|
|
|
extern ARCHD archd;
|
1994-06-13 20:13:35 +04:00
|
|
|
void list __P((void));
|
|
|
|
void extract __P((void));
|
|
|
|
void append __P((void));
|
|
|
|
void archive __P((void));
|
|
|
|
void copy __P((void));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* buf_subs.c
|
|
|
|
*/
|
|
|
|
extern int blksz;
|
|
|
|
extern int wrblksz;
|
|
|
|
extern int maxflt;
|
|
|
|
extern int rdblksz;
|
|
|
|
extern off_t wrlimit;
|
|
|
|
extern off_t rdcnt;
|
|
|
|
extern off_t wrcnt;
|
|
|
|
int wr_start __P((void));
|
|
|
|
int rd_start __P((void));
|
|
|
|
void cp_start __P((void));
|
|
|
|
int appnd_start __P((off_t));
|
|
|
|
int rd_sync __P((void));
|
|
|
|
void pback __P((char *, int));
|
|
|
|
int rd_skip __P((off_t));
|
|
|
|
void wr_fin __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int wr_rdbuf __P((char *, int));
|
|
|
|
int rd_wrbuf __P((char *, int));
|
1994-06-13 20:13:35 +04:00
|
|
|
int wr_skip __P((off_t));
|
|
|
|
int wr_rdfile __P((ARCHD *, int, off_t *));
|
|
|
|
int rd_wrfile __P((ARCHD *, int, off_t *));
|
|
|
|
void cp_file __P((ARCHD *, int, int));
|
|
|
|
int buf_fill __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int buf_flush __P((int));
|
1994-06-13 20:13:35 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* cpio.c
|
|
|
|
*/
|
1998-02-28 18:53:00 +03:00
|
|
|
extern int cpio_swp_head;
|
1994-06-13 20:13:35 +04:00
|
|
|
int cpio_strd __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int cpio_subtrail __P((ARCHD *));
|
1994-06-13 20:13:35 +04:00
|
|
|
int cpio_endwr __P((void));
|
|
|
|
int cpio_id __P((char *, int));
|
1997-09-14 18:54:32 +04:00
|
|
|
int cpio_rd __P((ARCHD *, char *));
|
1994-06-13 20:13:35 +04:00
|
|
|
off_t cpio_endrd __P((void));
|
|
|
|
int cpio_stwr __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int cpio_wr __P((ARCHD *));
|
1994-06-13 20:13:35 +04:00
|
|
|
int vcpio_id __P((char *, int));
|
|
|
|
int crc_id __P((char *, int));
|
|
|
|
int crc_strd __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int vcpio_rd __P((ARCHD *, char *));
|
1994-06-13 20:13:35 +04:00
|
|
|
off_t vcpio_endrd __P((void));
|
|
|
|
int crc_stwr __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int vcpio_wr __P((ARCHD *));
|
1994-06-13 20:13:35 +04:00
|
|
|
int bcpio_id __P((char *, int));
|
1997-09-14 18:54:32 +04:00
|
|
|
int bcpio_rd __P((ARCHD *, char *));
|
1994-06-13 20:13:35 +04:00
|
|
|
off_t bcpio_endrd __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int bcpio_wr __P((ARCHD *));
|
1994-06-13 20:13:35 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* file_subs.c
|
|
|
|
*/
|
1999-10-22 14:43:11 +04:00
|
|
|
extern char *gnu_hack_string;
|
1997-09-14 18:54:32 +04:00
|
|
|
int file_creat __P((ARCHD *));
|
|
|
|
void file_close __P((ARCHD *, int));
|
|
|
|
int lnk_creat __P((ARCHD *));
|
|
|
|
int cross_lnk __P((ARCHD *));
|
|
|
|
int chk_same __P((ARCHD *));
|
|
|
|
int node_creat __P((ARCHD *));
|
|
|
|
int unlnk_exist __P((char *, int));
|
|
|
|
int chk_path __P((char *, uid_t, gid_t));
|
1994-06-13 20:13:35 +04:00
|
|
|
void set_ftime __P((char *fnm, time_t mtime, time_t atime, int frc));
|
|
|
|
int set_ids __P((char *, uid_t, gid_t));
|
|
|
|
void set_pmode __P((char *, mode_t));
|
1999-11-01 04:35:58 +03:00
|
|
|
void set_chflags __P((char *fnm, u_int32_t flags));
|
1997-09-14 18:54:32 +04:00
|
|
|
int file_write __P((int, char *, int, int *, int *, int, char *));
|
1994-06-13 20:13:35 +04:00
|
|
|
void file_flush __P((int, char *, int));
|
1997-09-14 18:54:32 +04:00
|
|
|
void rdfile_close __P((ARCHD *, int *));
|
|
|
|
int set_crc __P((ARCHD *, int));
|
1994-06-13 20:13:35 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* ftree.c
|
|
|
|
*/
|
|
|
|
int ftree_start __P((void));
|
1999-10-23 00:59:08 +04:00
|
|
|
int ftree_add __P((char *, int));
|
1997-09-14 18:54:32 +04:00
|
|
|
void ftree_sel __P((ARCHD *));
|
1994-06-13 20:13:35 +04:00
|
|
|
void ftree_chk __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int next_file __P((ARCHD *));
|
1994-06-13 20:13:35 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gen_subs.c
|
|
|
|
*/
|
1997-09-14 18:54:32 +04:00
|
|
|
void ls_list __P((ARCHD *, time_t));
|
|
|
|
void ls_tty __P((ARCHD *));
|
1998-07-26 23:34:10 +04:00
|
|
|
void zf_strncpy __P((char *, const char *, int));
|
|
|
|
int l_strncpy __P((char *, const char *, int));
|
1997-09-14 18:54:32 +04:00
|
|
|
u_long asc_ul __P((char *, int, int));
|
|
|
|
int ul_asc __P((u_long, char *, int, int));
|
1994-06-13 20:13:35 +04:00
|
|
|
#ifndef NET2_STAT
|
1997-09-14 18:54:32 +04:00
|
|
|
u_quad_t asc_uqd __P((char *, int, int));
|
|
|
|
int uqd_asc __P((u_quad_t, char *, int, int));
|
1994-06-13 20:13:35 +04:00
|
|
|
#endif
|
1999-08-24 11:57:06 +04:00
|
|
|
int check_Aflag __P((void));
|
1994-06-13 20:13:35 +04:00
|
|
|
|
2000-02-17 06:12:22 +03:00
|
|
|
/*
|
1994-12-04 10:11:37 +03:00
|
|
|
* getoldopt.c
|
|
|
|
*/
|
2000-07-04 21:17:49 +04:00
|
|
|
struct option;
|
|
|
|
int getoldopt __P((int, char **, const char *, struct option *, int *));
|
1994-12-04 10:11:37 +03:00
|
|
|
|
1994-06-13 20:13:35 +04:00
|
|
|
/*
|
|
|
|
* options.c
|
|
|
|
*/
|
|
|
|
extern FSUB fsub[];
|
|
|
|
extern int ford[];
|
1998-03-06 12:13:01 +03:00
|
|
|
extern int cpio_mode;
|
1997-09-14 18:54:32 +04:00
|
|
|
void options __P((int, char **));
|
1994-06-13 20:13:35 +04:00
|
|
|
OPLIST * opt_next __P((void));
|
1999-02-07 18:08:50 +03:00
|
|
|
int opt_add __P((const char *));
|
1999-10-23 00:59:08 +04:00
|
|
|
int opt_chdir __P((char *));
|
1994-06-13 20:13:35 +04:00
|
|
|
int bad_opt __P((void));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* pat_rep.c
|
|
|
|
*/
|
1997-09-14 18:54:32 +04:00
|
|
|
int rep_add __P((char *));
|
1999-10-23 00:59:08 +04:00
|
|
|
int pat_add __P((char *, int));
|
1994-06-13 20:13:35 +04:00
|
|
|
void pat_chk __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int pat_sel __P((ARCHD *));
|
|
|
|
int pat_match __P((ARCHD *));
|
|
|
|
int mod_name __P((ARCHD *));
|
|
|
|
int set_dest __P((ARCHD *, char *, int));
|
1994-06-13 20:13:35 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* pax.c
|
|
|
|
*/
|
|
|
|
extern int act;
|
|
|
|
extern FSUB *frmt;
|
1999-08-24 11:57:06 +04:00
|
|
|
extern int Aflag;
|
1994-06-13 20:13:35 +04:00
|
|
|
extern int cflag;
|
|
|
|
extern int dflag;
|
|
|
|
extern int iflag;
|
|
|
|
extern int kflag;
|
|
|
|
extern int lflag;
|
|
|
|
extern int nflag;
|
|
|
|
extern int tflag;
|
|
|
|
extern int uflag;
|
|
|
|
extern int vflag;
|
1996-03-27 02:54:13 +03:00
|
|
|
extern int zflag;
|
1994-06-13 20:13:35 +04:00
|
|
|
extern int Dflag;
|
|
|
|
extern int Hflag;
|
|
|
|
extern int Lflag;
|
|
|
|
extern int Xflag;
|
|
|
|
extern int Yflag;
|
|
|
|
extern int Zflag;
|
|
|
|
extern int vfpart;
|
|
|
|
extern int patime;
|
|
|
|
extern int pmtime;
|
1999-11-01 04:35:58 +03:00
|
|
|
extern int pfflags;
|
1994-06-13 20:13:35 +04:00
|
|
|
extern int pmode;
|
|
|
|
extern int pids;
|
|
|
|
extern int exit_val;
|
|
|
|
extern int docrc;
|
|
|
|
extern char *dirptr;
|
|
|
|
extern char *argv0;
|
|
|
|
int main __P((int, char **));
|
|
|
|
void sig_cleanup __P((int));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* sel_subs.c
|
|
|
|
*/
|
1997-09-14 18:54:32 +04:00
|
|
|
int sel_chk __P((ARCHD *));
|
|
|
|
int grp_add __P((char *));
|
|
|
|
int usr_add __P((char *));
|
|
|
|
int trng_add __P((char *));
|
1994-06-13 20:13:35 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* tables.c
|
|
|
|
*/
|
|
|
|
int lnk_start __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int chk_lnk __P((ARCHD *));
|
|
|
|
void purg_lnk __P((ARCHD *));
|
1994-06-13 20:13:35 +04:00
|
|
|
void lnk_end __P((void));
|
|
|
|
int ftime_start __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int chk_ftime __P((ARCHD *));
|
1994-06-13 20:13:35 +04:00
|
|
|
int name_start __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int add_name __P((char *, int, char *));
|
|
|
|
void sub_name __P((char *, int *));
|
1994-06-13 20:13:35 +04:00
|
|
|
int dev_start __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int add_dev __P((ARCHD *));
|
|
|
|
int map_dev __P((ARCHD *, u_long, u_long));
|
1994-06-13 20:13:35 +04:00
|
|
|
int atdir_start __P((void));
|
|
|
|
void atdir_end __P((void));
|
|
|
|
void add_atdir __P((char *, dev_t, ino_t, time_t, time_t));
|
|
|
|
int get_atdir __P((dev_t, ino_t, time_t *, time_t *));
|
|
|
|
int dir_start __P((void));
|
|
|
|
void add_dir __P((char *, int, struct stat *, int));
|
|
|
|
void proc_dir __P((void));
|
|
|
|
u_int st_hash __P((char *, int, int));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* tar.c
|
|
|
|
*/
|
1998-08-11 02:34:59 +04:00
|
|
|
extern int is_oldgnutar;
|
1994-06-13 20:13:35 +04:00
|
|
|
int tar_endwr __P((void));
|
|
|
|
off_t tar_endrd __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int tar_trail __P((char *, int, int *));
|
|
|
|
int tar_id __P((char *, int));
|
1994-06-13 20:13:35 +04:00
|
|
|
int tar_opt __P((void));
|
1997-09-14 18:54:32 +04:00
|
|
|
int tar_rd __P((ARCHD *, char *));
|
|
|
|
int tar_wr __P((ARCHD *));
|
1994-06-13 20:13:35 +04:00
|
|
|
int ustar_strd __P((void));
|
|
|
|
int ustar_stwr __P((void));
|
|
|
|
int ustar_id __P((char *, int));
|
1997-09-14 18:54:32 +04:00
|
|
|
int ustar_rd __P((ARCHD *, char *));
|
|
|
|
int ustar_wr __P((ARCHD *));
|
1999-01-20 17:45:09 +03:00
|
|
|
int tar_gnutar_X_compat __P((const char *));
|
1994-06-13 20:13:35 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* tty_subs.c
|
|
|
|
*/
|
|
|
|
int tty_init __P((void));
|
1997-07-21 00:32:15 +04:00
|
|
|
void tty_prnt __P((char *, ...))
|
|
|
|
__attribute__((format (printf, 1, 2)));
|
1994-06-13 20:13:35 +04:00
|
|
|
int tty_read __P((char *, int));
|
1997-07-21 00:32:15 +04:00
|
|
|
void tty_warn __P((int, char *, ...))
|
|
|
|
__attribute__((format (printf, 2, 3)));
|
|
|
|
void syswarn __P((int, int, char *, ...))
|
|
|
|
__attribute__((format (printf, 3, 4)));
|