extern.h revision 1.17.2.1
1/* $NetBSD: extern.h,v 1.17.2.1 1999/12/27 18:27:07 wrstuden 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 int curdirfd; 53extern const char *gzip_program; 54extern time_t starttime; 55int ar_open __P((const char *)); 56void ar_close __P((void)); 57void ar_drain __P((void)); 58int ar_set_wr __P((void)); 59int ar_app_ok __P((void)); 60int ar_read __P((char *, int)); 61int ar_write __P((char *, int)); 62int ar_rdsync __P((void)); 63int ar_fow __P((off_t, off_t *)); 64int ar_rev __P((off_t )); 65int ar_next __P((void)); 66void ar_summary __P((int)); 67int ar_dochdir __P((char *)); 68 69/* 70 * ar_subs.c 71 */ 72extern u_long flcnt; 73extern ARCHD archd; 74void list __P((void)); 75void extract __P((void)); 76void append __P((void)); 77void archive __P((void)); 78void copy __P((void)); 79 80/* 81 * buf_subs.c 82 */ 83extern int blksz; 84extern int wrblksz; 85extern int maxflt; 86extern int rdblksz; 87extern off_t wrlimit; 88extern off_t rdcnt; 89extern off_t wrcnt; 90int wr_start __P((void)); 91int rd_start __P((void)); 92void cp_start __P((void)); 93int appnd_start __P((off_t)); 94int rd_sync __P((void)); 95void pback __P((char *, int)); 96int rd_skip __P((off_t)); 97void wr_fin __P((void)); 98int wr_rdbuf __P((char *, int)); 99int rd_wrbuf __P((char *, int)); 100int wr_skip __P((off_t)); 101int wr_rdfile __P((ARCHD *, int, off_t *)); 102int rd_wrfile __P((ARCHD *, int, off_t *)); 103void cp_file __P((ARCHD *, int, int)); 104int buf_fill __P((void)); 105int buf_flush __P((int)); 106 107/* 108 * cpio.c 109 */ 110extern int cpio_swp_head; 111int cpio_strd __P((void)); 112int cpio_subtrail __P((ARCHD *)); 113int cpio_endwr __P((void)); 114int cpio_id __P((char *, int)); 115int cpio_rd __P((ARCHD *, char *)); 116off_t cpio_endrd __P((void)); 117int cpio_stwr __P((void)); 118int cpio_wr __P((ARCHD *)); 119int vcpio_id __P((char *, int)); 120int crc_id __P((char *, int)); 121int crc_strd __P((void)); 122int vcpio_rd __P((ARCHD *, char *)); 123off_t vcpio_endrd __P((void)); 124int crc_stwr __P((void)); 125int vcpio_wr __P((ARCHD *)); 126int bcpio_id __P((char *, int)); 127int bcpio_rd __P((ARCHD *, char *)); 128off_t bcpio_endrd __P((void)); 129int bcpio_wr __P((ARCHD *)); 130 131/* 132 * file_subs.c 133 */ 134extern char *gnu_hack_string; 135int file_creat __P((ARCHD *)); 136void file_close __P((ARCHD *, int)); 137int lnk_creat __P((ARCHD *)); 138int cross_lnk __P((ARCHD *)); 139int chk_same __P((ARCHD *)); 140int node_creat __P((ARCHD *)); 141int unlnk_exist __P((char *, int)); 142int chk_path __P((char *, uid_t, gid_t)); 143void set_ftime __P((char *fnm, time_t mtime, time_t atime, int frc)); 144int set_ids __P((char *, uid_t, gid_t)); 145void set_pmode __P((char *, mode_t)); 146void set_chflags __P((char *fnm, u_int32_t flags)); 147int file_write __P((int, char *, int, int *, int *, int, char *)); 148void file_flush __P((int, char *, int)); 149void rdfile_close __P((ARCHD *, int *)); 150int set_crc __P((ARCHD *, int)); 151 152/* 153 * ftree.c 154 */ 155int ftree_start __P((void)); 156int ftree_add __P((char *, int)); 157void ftree_sel __P((ARCHD *)); 158void ftree_chk __P((void)); 159int next_file __P((ARCHD *)); 160 161/* 162 * gen_subs.c 163 */ 164void ls_list __P((ARCHD *, time_t)); 165void ls_tty __P((ARCHD *)); 166void zf_strncpy __P((char *, const char *, int)); 167int l_strncpy __P((char *, const char *, int)); 168u_long asc_ul __P((char *, int, int)); 169int ul_asc __P((u_long, char *, int, int)); 170#ifndef NET2_STAT 171u_quad_t asc_uqd __P((char *, int, int)); 172int uqd_asc __P((u_quad_t, char *, int, int)); 173#endif 174int check_Aflag __P((void)); 175 176/* 177 * getoldopt.c 178 */ 179int getoldopt __P((int, char **, char *)); 180 181/* 182 * options.c 183 */ 184extern FSUB fsub[]; 185extern int ford[]; 186extern int cpio_mode; 187void options __P((int, char **)); 188OPLIST * opt_next __P((void)); 189int opt_add __P((const char *)); 190int opt_chdir __P((char *)); 191int bad_opt __P((void)); 192 193/* 194 * pat_rep.c 195 */ 196int rep_add __P((char *)); 197int pat_add __P((char *, int)); 198void pat_chk __P((void)); 199int pat_sel __P((ARCHD *)); 200int pat_match __P((ARCHD *)); 201int mod_name __P((ARCHD *)); 202int set_dest __P((ARCHD *, char *, int)); 203 204/* 205 * pax.c 206 */ 207extern int act; 208extern FSUB *frmt; 209extern int Aflag; 210extern int cflag; 211extern int dflag; 212extern int iflag; 213extern int kflag; 214extern int lflag; 215extern int nflag; 216extern int tflag; 217extern int uflag; 218extern int vflag; 219extern int zflag; 220extern int Dflag; 221extern int Hflag; 222extern int Lflag; 223extern int Xflag; 224extern int Yflag; 225extern int Zflag; 226extern int vfpart; 227extern int patime; 228extern int pmtime; 229extern int pfflags; 230extern int pmode; 231extern int pids; 232extern int exit_val; 233extern int docrc; 234extern char *dirptr; 235extern const char *ltmfrmt; 236extern char *argv0; 237int main __P((int, char **)); 238void sig_cleanup __P((int)); 239 240/* 241 * sel_subs.c 242 */ 243int sel_chk __P((ARCHD *)); 244int grp_add __P((char *)); 245int usr_add __P((char *)); 246int trng_add __P((char *)); 247 248/* 249 * tables.c 250 */ 251int lnk_start __P((void)); 252int chk_lnk __P((ARCHD *)); 253void purg_lnk __P((ARCHD *)); 254void lnk_end __P((void)); 255int ftime_start __P((void)); 256int chk_ftime __P((ARCHD *)); 257int name_start __P((void)); 258int add_name __P((char *, int, char *)); 259void sub_name __P((char *, int *)); 260int dev_start __P((void)); 261int add_dev __P((ARCHD *)); 262int map_dev __P((ARCHD *, u_long, u_long)); 263int atdir_start __P((void)); 264void atdir_end __P((void)); 265void add_atdir __P((char *, dev_t, ino_t, time_t, time_t)); 266int get_atdir __P((dev_t, ino_t, time_t *, time_t *)); 267int dir_start __P((void)); 268void add_dir __P((char *, int, struct stat *, int)); 269void proc_dir __P((void)); 270u_int st_hash __P((char *, int, int)); 271 272/* 273 * tar.c 274 */ 275extern int is_oldgnutar; 276int tar_endwr __P((void)); 277off_t tar_endrd __P((void)); 278int tar_trail __P((char *, int, int *)); 279int tar_id __P((char *, int)); 280int tar_opt __P((void)); 281int tar_rd __P((ARCHD *, char *)); 282int tar_wr __P((ARCHD *)); 283int ustar_strd __P((void)); 284int ustar_stwr __P((void)); 285int ustar_id __P((char *, int)); 286int ustar_rd __P((ARCHD *, char *)); 287int ustar_wr __P((ARCHD *)); 288int tar_gnutar_X_compat __P((const char *)); 289 290/* 291 * tty_subs.c 292 */ 293int tty_init __P((void)); 294void tty_prnt __P((char *, ...)) 295 __attribute__((format (printf, 1, 2))); 296int tty_read __P((char *, int)); 297void tty_warn __P((int, char *, ...)) 298 __attribute__((format (printf, 2, 3))); 299void syswarn __P((int, int, char *, ...)) 300 __attribute__((format (printf, 3, 4))); 301