extern.h revision 1.23.4.1
1/* $NetBSD: extern.h,v 1.23.4.1 2000/10/25 16:18:52 tv 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 */ 189int getoldopt __P((int, char **, char *)); 190 191/* 192 * options.c 193 */ 194extern FSUB fsub[]; 195extern int ford[]; 196extern int cpio_mode; 197void options __P((int, char **)); 198OPLIST * opt_next __P((void)); 199int opt_add __P((const char *)); 200int opt_chdir __P((char *)); 201int bad_opt __P((void)); 202 203/* 204 * pat_rep.c 205 */ 206int rep_add __P((char *)); 207int pat_add __P((char *, int)); 208void pat_chk __P((void)); 209int pat_sel __P((ARCHD *)); 210int pat_match __P((ARCHD *)); 211int mod_name __P((ARCHD *)); 212int set_dest __P((ARCHD *, char *, int)); 213 214/* 215 * pax.c 216 */ 217extern int act; 218extern FSUB *frmt; 219extern int Aflag; 220extern int cflag; 221extern int dflag; 222extern int iflag; 223extern int kflag; 224extern int lflag; 225extern int nflag; 226extern int tflag; 227extern int uflag; 228extern int vflag; 229extern int zflag; 230extern int Dflag; 231extern int Hflag; 232extern int Lflag; 233extern int Xflag; 234extern int Yflag; 235extern int Zflag; 236extern int vfpart; 237extern int patime; 238extern int pmtime; 239extern int pfflags; 240extern int pmode; 241extern int pids; 242extern int exit_val; 243extern int docrc; 244extern char *dirptr; 245extern char *argv0; 246int main __P((int, char **)); 247void sig_cleanup __P((int)); 248 249/* 250 * sel_subs.c 251 */ 252int sel_chk __P((ARCHD *)); 253int grp_add __P((char *)); 254int usr_add __P((char *)); 255int trng_add __P((char *)); 256 257/* 258 * tables.c 259 */ 260int lnk_start __P((void)); 261int chk_lnk __P((ARCHD *)); 262void purg_lnk __P((ARCHD *)); 263void lnk_end __P((void)); 264int ftime_start __P((void)); 265int chk_ftime __P((ARCHD *)); 266int name_start __P((void)); 267int add_name __P((char *, int, char *)); 268void sub_name __P((char *, int *)); 269int dev_start __P((void)); 270int add_dev __P((ARCHD *)); 271int map_dev __P((ARCHD *, u_long, u_long)); 272int atdir_start __P((void)); 273void atdir_end __P((void)); 274void add_atdir __P((char *, dev_t, ino_t, time_t, time_t)); 275int get_atdir __P((dev_t, ino_t, time_t *, time_t *)); 276int dir_start __P((void)); 277void add_dir __P((char *, int, struct stat *, int)); 278void proc_dir __P((void)); 279u_int st_hash __P((char *, int, int)); 280 281/* 282 * tar.c 283 */ 284extern int is_oldgnutar; 285int tar_endwr __P((void)); 286off_t tar_endrd __P((void)); 287int tar_trail __P((char *, int, int *)); 288int tar_id __P((char *, int)); 289int tar_opt __P((void)); 290int tar_rd __P((ARCHD *, char *)); 291int tar_wr __P((ARCHD *)); 292int ustar_strd __P((void)); 293int ustar_stwr __P((void)); 294int ustar_id __P((char *, int)); 295int ustar_rd __P((ARCHD *, char *)); 296int ustar_wr __P((ARCHD *)); 297int tar_gnutar_X_compat __P((const char *)); 298 299/* 300 * tty_subs.c 301 */ 302int tty_init __P((void)); 303void tty_prnt __P((char *, ...)) 304 __attribute__((format (printf, 1, 2))); 305int tty_read __P((char *, int)); 306void tty_warn __P((int, char *, ...)) 307 __attribute__((format (printf, 2, 3))); 308void syswarn __P((int, int, char *, ...)) 309 __attribute__((format (printf, 3, 4))); 310