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