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