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