diff options
Diffstat (limited to 'bin/pax')
-rw-r--r-- | bin/pax/ar_io.c | 72 | ||||
-rw-r--r-- | bin/pax/ar_subs.c | 47 | ||||
-rw-r--r-- | bin/pax/buf_subs.c | 103 | ||||
-rw-r--r-- | bin/pax/cache.c | 52 | ||||
-rw-r--r-- | bin/pax/cpio.c | 136 | ||||
-rw-r--r-- | bin/pax/file_subs.c | 131 | ||||
-rw-r--r-- | bin/pax/ftree.c | 38 | ||||
-rw-r--r-- | bin/pax/gen_subs.c | 59 | ||||
-rw-r--r-- | bin/pax/options.c | 93 | ||||
-rw-r--r-- | bin/pax/pat_rep.c | 97 | ||||
-rw-r--r-- | bin/pax/pax.c | 22 | ||||
-rw-r--r-- | bin/pax/sel_subs.c | 53 | ||||
-rw-r--r-- | bin/pax/tables.c | 140 | ||||
-rw-r--r-- | bin/pax/tar.c | 109 | ||||
-rw-r--r-- | bin/pax/tty_subs.c | 59 |
15 files changed, 33 insertions, 1178 deletions
diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c index 37e1561cd37..567208bc012 100644 --- a/bin/pax/ar_io.c +++ b/bin/pax/ar_io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar_io.c,v 1.25 2002/02/16 21:27:07 millert Exp $ */ +/* $OpenBSD: ar_io.c,v 1.26 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: ar_io.c,v 1.5 1996/03/26 23:54:13 mrg Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: ar_io.c,v 1.25 2002/02/16 21:27:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: ar_io.c,v 1.26 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -103,14 +103,8 @@ static void ar_start_gzip(int, const char *, int); * -1 on failure, 0 otherwise */ -#ifdef __STDC__ int ar_open(char *name) -#else -int -ar_open(name) - char *name; -#endif { struct mtget mb; @@ -308,13 +302,8 @@ ar_open(name) * ar_close() * closes archive device, increments volume number, and prints i/o summary */ -#ifdef __STDC__ void ar_close(void) -#else -void -ar_close() -#endif { if (arfd < 0) { @@ -430,13 +419,8 @@ ar_close() * other side of the pipe from getting a SIGPIPE (pax will stop * reading an archive once a format dependent trailer is detected). */ -#ifdef __STDC__ void ar_drain(void) -#else -void -ar_drain() -#endif { register int res; char drbuf[MAXBLK]; @@ -467,13 +451,8 @@ ar_drain() * 0 if all ready to write, -1 otherwise */ -#ifdef __STDC__ int ar_set_wr(void) -#else -int -ar_set_wr() -#endif { off_t cpos; @@ -510,13 +489,8 @@ ar_set_wr() * 0 if we can append, -1 otherwise. */ -#ifdef __STDC__ int ar_app_ok(void) -#else -int -ar_app_ok() -#endif { if (artyp == ISPIPE) { paxwarn(1, "Cannot append to an archive obtained from a pipe."); @@ -539,15 +513,8 @@ ar_app_ok() * Number of bytes in buffer. 0 for end of file, -1 for a read error. */ -#ifdef __STDC__ int ar_read(register char *buf, register int cnt) -#else -int -ar_read(buf, cnt) - register char *buf; - register int cnt; -#endif { register int res = 0; @@ -629,15 +596,8 @@ ar_read(buf, cnt) * error in the archive occurred. */ -#ifdef __STDC__ int ar_write(register char *buf, register int bsz) -#else -int -ar_write(buf, bsz) - register char *buf; - register int bsz; -#endif { register int res; off_t cpos; @@ -754,13 +714,8 @@ ar_write(buf, bsz) * 0 when ok to try i/o again, -1 otherwise. */ -#ifdef __STDC__ int ar_rdsync(void) -#else -int -ar_rdsync() -#endif { long fsbz; off_t cpos; @@ -845,15 +800,8 @@ ar_rdsync() * partial move (the amount moved is in skipped) */ -#ifdef __STDC__ int ar_fow(off_t sksz, off_t *skipped) -#else -int -ar_fow(sksz, skipped) - off_t sksz; - off_t *skipped; -#endif { off_t cpos; off_t mpos; @@ -911,14 +859,8 @@ ar_fow(sksz, skipped) * 0 if moved the requested distance, -1 on complete failure */ -#ifdef __STDC__ int ar_rev(off_t sksz) -#else -int -ar_rev(sksz) - off_t sksz; -#endif { off_t cpos; struct mtop mb; @@ -1049,13 +991,8 @@ ar_rev(sksz) * physical block size if ok (ok > 0), -1 otherwise */ -#ifdef __STDC__ static int get_phys(void) -#else -static int -get_phys() -#endif { register int padsz = 0; register int res; @@ -1167,13 +1104,8 @@ get_phys() * 0 when ready to continue, -1 when all done */ -#ifdef __STDC__ int ar_next(void) -#else -int -ar_next() -#endif { char buf[PAXPATHLEN+2]; static int freeit = 0; diff --git a/bin/pax/ar_subs.c b/bin/pax/ar_subs.c index c5ceee60c88..bd598706f1c 100644 --- a/bin/pax/ar_subs.c +++ b/bin/pax/ar_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ar_subs.c,v 1.17 2002/02/16 21:27:07 millert Exp $ */ +/* $OpenBSD: ar_subs.c,v 1.18 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: ar_subs.c,v 1.5 1995/03/21 09:07:06 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)ar_subs.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: ar_subs.c,v 1.17 2002/02/16 21:27:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: ar_subs.c,v 1.18 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -79,13 +79,8 @@ u_long flcnt; /* number of files processed */ * (no pattern matches all). */ -#ifdef __STDC__ void list(void) -#else -void -list() -#endif { register ARCHD *arcn; register int res; @@ -161,13 +156,8 @@ list() * pattern(s) (no patterns extracts all members) */ -#ifdef __STDC__ void extract(void) -#else -void -extract() -#endif { register ARCHD *arcn; register int res; @@ -372,15 +362,8 @@ extract() * previously written archive. */ -#ifdef __STDC__ static void wr_archive(register ARCHD *arcn, int is_app) -#else -static void -wr_archive(arcn, is_app) - register ARCHD *arcn; - int is_app; -#endif { register int res; register int hlk; @@ -582,13 +565,8 @@ wr_archive(arcn, is_app) * over write existing files that it creates. */ -#ifdef __STDC__ void append(void) -#else -void -append() -#endif { register ARCHD *arcn; register int res; @@ -723,13 +701,8 @@ append() * write a new archive */ -#ifdef __STDC__ void archive(void) -#else -void -archive() -#endif { ARCHD archd; @@ -754,13 +727,8 @@ archive() * (except the files are forced to be under the destination directory). */ -#ifdef __STDC__ void copy(void) -#else -void -copy() -#endif { register ARCHD *arcn; register int res; @@ -1006,14 +974,8 @@ copy() * the specs for rd_wrbuf() for more details) */ -#ifdef __STDC__ static int next_head(register ARCHD *arcn) -#else -static int -next_head(arcn) - register ARCHD *arcn; -#endif { register int ret; register char *hdend; @@ -1164,13 +1126,8 @@ next_head(arcn) * 0 if archive found -1 otherwise */ -#ifdef __STDC__ static int get_arc(void) -#else -static int -get_arc() -#endif { register int i; register int hdsz = 0; diff --git a/bin/pax/buf_subs.c b/bin/pax/buf_subs.c index 3050fcada14..24dfb6b1d8e 100644 --- a/bin/pax/buf_subs.c +++ b/bin/pax/buf_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buf_subs.c,v 1.10 2001/10/06 20:21:55 niklas Exp $ */ +/* $OpenBSD: buf_subs.c,v 1.11 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: buf_subs.c,v 1.5 1995/03/21 09:07:08 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)buf_subs.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: buf_subs.c,v 1.10 2001/10/06 20:21:55 niklas Exp $"; +static char rcsid[] = "$OpenBSD: buf_subs.c,v 1.11 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -89,13 +89,8 @@ off_t rdcnt; /* # of bytes read on current vol */ * 0 if ok, -1 if the user specified write block size violates pax spec */ -#ifdef __STDC__ int wr_start(void) -#else -int -wr_start() -#endif { buf = &(bufmem[BLKMULT]); /* @@ -142,13 +137,8 @@ wr_start() * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int rd_start(void) -#else -int -rd_start() -#endif { /* * leave space for the header pushback (see get_arc()). If we are @@ -185,13 +175,8 @@ rd_start() * set up buffer system for copying within the file system */ -#ifdef __STDC__ void cp_start(void) -#else -void -cp_start() -#endif { buf = &(bufmem[BLKMULT]); rdblksz = blksz = MAXBLK; @@ -229,14 +214,8 @@ cp_start() * 0 for success, -1 for failure */ -#ifdef __STDC__ int appnd_start(off_t skcnt) -#else -int -appnd_start(skcnt) - off_t skcnt; -#endif { register int res; off_t cnt; @@ -334,13 +313,8 @@ appnd_start(skcnt) * 0 on success, and -1 on failure */ -#ifdef __STDC__ int rd_sync(void) -#else -int -rd_sync() -#endif { register int errcnt = 0; register int res; @@ -407,15 +381,8 @@ rd_sync() * pback space is increased. */ -#ifdef __STDC__ void pback(char *pt, int cnt) -#else -void -pback(pt, cnt) - char *pt; - int cnt; -#endif { bufpt -= cnt; memcpy(bufpt, pt, cnt); @@ -430,14 +397,8 @@ pback(pt, cnt) * 0 if ok, -1 failure, and 1 when EOF on the archive volume was detected. */ -#ifdef __STDC__ int rd_skip(off_t skcnt) -#else -int -rd_skip(skcnt) - off_t skcnt; -#endif { off_t res; off_t cnt; @@ -505,13 +466,8 @@ rd_skip(skcnt) * BE a requirement.... */ -#ifdef __STDC__ void wr_fin(void) -#else -void -wr_fin() -#endif { if (bufpt > buf) { memset(bufpt, 0, bufend - bufpt); @@ -531,15 +487,8 @@ wr_fin() * 0 if buffer was filled ok, -1 o.w. (buffer flush failure) */ -#ifdef __STDC__ int wr_rdbuf(register char *out, register int outcnt) -#else -int -wr_rdbuf(out, outcnt) - register char *out; - register int outcnt; -#endif { register int cnt; @@ -574,15 +523,8 @@ wr_rdbuf(out, outcnt) * -1 is a read error */ -#ifdef __STDC__ int rd_wrbuf(register char *in, register int cpcnt) -#else -int -rd_wrbuf(in, cpcnt) - register char *in; - register int cpcnt; -#endif { register int res; register int cnt; @@ -629,14 +571,8 @@ rd_wrbuf(in, cpcnt) * 0 if ok, -1 if there was a buf_flush failure */ -#ifdef __STDC__ int wr_skip(off_t skcnt) -#else -int -wr_skip(skcnt) - off_t skcnt; -#endif { register int cnt; @@ -673,16 +609,8 @@ wr_skip(skcnt) * 0, but "left" is set to be greater than zero. */ -#ifdef __STDC__ int wr_rdfile(ARCHD *arcn, int ifd, off_t *left) -#else -int -wr_rdfile(arcn, ifd, left) - ARCHD *arcn; - int ifd; - off_t *left; -#endif { register int cnt; register int res = 0; @@ -742,16 +670,8 @@ wr_rdfile(arcn, ifd, left) * we return a 0 but "left" is set to be the amount unwritten */ -#ifdef __STDC__ int rd_wrfile(ARCHD *arcn, int ofd, off_t *left) -#else -int -rd_wrfile(arcn, ofd, left) - ARCHD *arcn; - int ofd; - off_t *left; -#endif { register int cnt = 0; register off_t size = arcn->sb.st_size; @@ -838,16 +758,8 @@ rd_wrfile(arcn, ofd, left) * destination file so we can properly copy files with holes. */ -#ifdef __STDC__ void cp_file(ARCHD *arcn, int fd1, int fd2) -#else -void -cp_file(arcn, fd1, fd2) - ARCHD *arcn; - int fd1; - int fd2; -#endif { register int cnt; register off_t cpcnt = 0L; @@ -927,13 +839,8 @@ cp_file(arcn, fd1, fd2) * 0 when finished (user specified termination in ar_next()). */ -#ifdef __STDC__ int buf_fill(void) -#else -int -buf_fill() -#endif { register int cnt; static int fini = 0; @@ -977,14 +884,8 @@ buf_fill() * 0 if all is ok, -1 when a write error occurs. */ -#ifdef __STDC__ int buf_flush(register int bufcnt) -#else -int -buf_flush(bufcnt) - register int bufcnt; -#endif { register int cnt; register int push = 0; diff --git a/bin/pax/cache.c b/bin/pax/cache.c index 36a9280c5f3..eb9e1e35c25 100644 --- a/bin/pax/cache.c +++ b/bin/pax/cache.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cache.c,v 1.9 2001/06/26 14:19:33 lebel Exp $ */ +/* $OpenBSD: cache.c,v 1.10 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: cache.c,v 1.4 1995/03/21 09:07:10 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: cache.c,v 1.9 2001/06/26 14:19:33 lebel Exp $"; +static char rcsid[] = "$OpenBSD: cache.c,v 1.10 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -81,13 +81,8 @@ static GIDC **grptb = NULL; /* group name to gid cache */ * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int uidtb_start(void) -#else -int -uidtb_start() -#endif { static int fail = 0; @@ -110,13 +105,8 @@ uidtb_start() * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int gidtb_start(void) -#else -int -gidtb_start() -#endif { static int fail = 0; @@ -139,13 +129,8 @@ gidtb_start() * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int usrtb_start(void) -#else -int -usrtb_start() -#endif { static int fail = 0; @@ -168,13 +153,8 @@ usrtb_start() * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int grptb_start(void) -#else -int -grptb_start() -#endif { static int fail = 0; @@ -198,15 +178,8 @@ grptb_start() * Pointer to stored name (or a empty string) */ -#ifdef __STDC__ char * name_uid(uid_t uid, int frc) -#else -char * -name_uid(uid, frc) - uid_t uid; - int frc; -#endif { register struct passwd *pw; register UIDC *ptr; @@ -271,15 +244,8 @@ name_uid(uid, frc) * Pointer to stored name (or a empty string) */ -#ifdef __STDC__ char * name_gid(gid_t gid, int frc) -#else -char * -name_gid(gid, frc) - gid_t gid; - int frc; -#endif { register struct group *gr; register GIDC *ptr; @@ -343,15 +309,8 @@ name_gid(gid, frc) * the uid (if any) for a user name, or a -1 if no match can be found */ -#ifdef __STDC__ int uid_name(char *name, uid_t *uid) -#else -int -uid_name(name, uid) - char *name; - uid_t *uid; -#endif { register struct passwd *pw; register UIDC *ptr; @@ -413,15 +372,8 @@ uid_name(name, uid) * the gid (if any) for a group name, or a -1 if no match can be found */ -#ifdef __STDC__ int gid_name(char *name, gid_t *gid) -#else -int -gid_name(name, gid) - char *name; - gid_t *gid; -#endif { register struct group *gr; register GIDC *ptr; diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c index 5d75a0567f9..d6e516fe391 100644 --- a/bin/pax/cpio.c +++ b/bin/pax/cpio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpio.c,v 1.8 2002/02/16 21:27:07 millert Exp $ */ +/* $OpenBSD: cpio.c,v 1.9 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: cpio.c,v 1.5 1995/03/21 09:07:13 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)cpio.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: cpio.c,v 1.8 2002/02/16 21:27:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: cpio.c,v 1.9 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -79,13 +79,8 @@ static int swp_head; /* binary cpio header byte swap */ * 0 if ok -1 otherwise (the return values of lnk_start()) */ -#ifdef __STDC__ int cpio_strd(void) -#else -int -cpio_strd() -#endif { return(lnk_start()); } @@ -100,14 +95,8 @@ cpio_strd() * 0 if a valid trailer, -1 if not a valid trailer, */ -#ifdef __STDC__ int cpio_trail(register ARCHD *arcn) -#else -int -cpio_trail(arcn) - register ARCHD *arcn; -#endif { /* * look for trailer id in file we are about to process @@ -124,14 +113,8 @@ cpio_trail(arcn) * 0 */ -#ifdef __STDC__ static int com_rd(register ARCHD *arcn) -#else -static int -com_rd(arcn) - register ARCHD *arcn; -#endif { arcn->skip = 0; arcn->pat = NULL; @@ -179,13 +162,8 @@ com_rd(arcn) * result of the write of the trailer from the cpio specific write func */ -#ifdef __STDC__ int cpio_endwr(void) -#else -int -cpio_endwr() -#endif { ARCHD last; @@ -207,15 +185,8 @@ cpio_endwr() * 0 if ok, -1 otherwise */ -#ifdef __STDC__ static int rd_nm(register ARCHD *arcn, int nsz) -#else -static int -rd_nm(arcn, nsz) - register ARCHD *arcn; - int nsz; -#endif { /* * do not even try bogus values @@ -244,14 +215,8 @@ rd_nm(arcn, nsz) * 0 if ok, -1 otherwise */ -#ifdef __STDC__ static int rd_ln_nm(register ARCHD *arcn) -#else -static int -rd_ln_nm(arcn) - register ARCHD *arcn; -#endif { /* * check the length specified for bogus values @@ -301,15 +266,8 @@ rd_ln_nm(arcn) * 0 if a valid header, -1 otherwise */ -#ifdef __STDC__ int cpio_id(char *blk, int size) -#else -int -cpio_id(blk, size) - char *blk; - int size; -#endif { if ((size < sizeof(HD_CPIO)) || (strncmp(blk, AMAGIC, sizeof(AMAGIC) - 1) != 0)) @@ -325,15 +283,8 @@ cpio_id(blk, size) * 0 if a valid header, -1 otherwise. */ -#ifdef __STDC__ int cpio_rd(register ARCHD *arcn, register char *buf) -#else -int -cpio_rd(arcn, buf) - register ARCHD *arcn; - register char *buf; -#endif { register int nsz; register HD_CPIO *hd; @@ -408,13 +359,8 @@ cpio_rd(arcn, buf) * size of trailer header in this format */ -#ifdef __STDC__ off_t cpio_endrd(void) -#else -off_t -cpio_endrd() -#endif { return((off_t)(sizeof(HD_CPIO) + sizeof(TRAILER))); } @@ -426,13 +372,8 @@ cpio_endrd() * 0 if ok, -1 otherwise (what dev_start() returns) */ -#ifdef __STDC__ int cpio_stwr(void) -#else -int -cpio_stwr() -#endif { return(dev_start()); } @@ -446,14 +387,8 @@ cpio_stwr() * data to write after the header, -1 if archive write failed */ -#ifdef __STDC__ int cpio_wr(register ARCHD *arcn) -#else -int -cpio_wr(arcn) - register ARCHD *arcn; -#endif { register HD_CPIO *hd; register int nsz; @@ -582,15 +517,8 @@ cpio_wr(arcn) * 0 if a valid header, -1 otherwise */ -#ifdef __STDC__ int vcpio_id(char *blk, int size) -#else -int -vcpio_id(blk, size) - char *blk; - int size; -#endif { if ((size < sizeof(HD_VCPIO)) || (strncmp(blk, AVMAGIC, sizeof(AVMAGIC) - 1) != 0)) @@ -606,15 +534,8 @@ vcpio_id(blk, size) * 0 if a valid header, -1 otherwise */ -#ifdef __STDC__ int crc_id(char *blk, int size) -#else -int -crc_id(blk, size) - char *blk; - int size; -#endif { if ((size < sizeof(HD_VCPIO)) || (strncmp(blk, AVCMAGIC, sizeof(AVCMAGIC) - 1) != 0)) @@ -629,13 +550,8 @@ crc_id(blk, size) * 0 if ok -1 otherwise (the return values of lnk_start()) */ -#ifdef __STDC__ int crc_strd(void) -#else -int -crc_strd() -#endif { docrc = 1; return(lnk_start()); @@ -649,15 +565,8 @@ crc_strd() * 0 if a valid header, -1 otherwise. */ -#ifdef __STDC__ int vcpio_rd(register ARCHD *arcn, register char *buf) -#else -int -vcpio_rd(arcn, buf) - register ARCHD *arcn; - register char *buf; -#endif { register HD_VCPIO *hd; dev_t devminor; @@ -755,13 +664,8 @@ vcpio_rd(arcn, buf) * size of trailer header in this format */ -#ifdef __STDC__ off_t vcpio_endrd(void) -#else -off_t -vcpio_endrd() -#endif { return((off_t)(sizeof(HD_VCPIO) + sizeof(TRAILER) + (VCPIO_PAD(sizeof(HD_VCPIO) + sizeof(TRAILER))))); @@ -774,13 +678,8 @@ vcpio_endrd() * 0 if ok, -1 otherwise (what dev_start() returns) */ -#ifdef __STDC__ int crc_stwr(void) -#else -int -crc_stwr() -#endif { docrc = 1; return(dev_start()); @@ -795,14 +694,8 @@ crc_stwr() * NO data to write after the header, -1 if archive write failed */ -#ifdef __STDC__ int vcpio_wr(register ARCHD *arcn) -#else -int -vcpio_wr(arcn) - register ARCHD *arcn; -#endif { register HD_VCPIO *hd; unsigned int nsz; @@ -958,15 +851,8 @@ vcpio_wr(arcn) * 0 if a valid header, -1 otherwise */ -#ifdef __STDC__ int bcpio_id(char *blk, int size) -#else -int -bcpio_id(blk, size) - char *blk; - int size; -#endif { if (size < sizeof(HD_BCPIO)) return(-1); @@ -993,15 +879,8 @@ bcpio_id(blk, size) * 0 if a valid header, -1 otherwise. */ -#ifdef __STDC__ int bcpio_rd(register ARCHD *arcn, register char *buf) -#else -int -bcpio_rd(arcn, buf) - register ARCHD *arcn; - register char *buf; -#endif { register HD_BCPIO *hd; register int nsz; @@ -1097,13 +976,8 @@ bcpio_rd(arcn, buf) * size of trailer header in this format */ -#ifdef __STDC__ off_t bcpio_endrd(void) -#else -off_t -bcpio_endrd() -#endif { return((off_t)(sizeof(HD_BCPIO) + sizeof(TRAILER) + (BCPIO_PAD(sizeof(HD_BCPIO) + sizeof(TRAILER))))); @@ -1120,14 +994,8 @@ bcpio_endrd() * data to write after the header, -1 if archive write failed */ -#ifdef __STDC__ int bcpio_wr(register ARCHD *arcn) -#else -int -bcpio_wr(arcn) - register ARCHD *arcn; -#endif { register HD_BCPIO *hd; register int nsz; diff --git a/bin/pax/file_subs.c b/bin/pax/file_subs.c index 8138094c8d2..eccfb08a971 100644 --- a/bin/pax/file_subs.c +++ b/bin/pax/file_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file_subs.c,v 1.16 2002/02/16 21:27:07 millert Exp $ */ +/* $OpenBSD: file_subs.c,v 1.17 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: file_subs.c,v 1.4 1995/03/21 09:07:18 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)file_subs.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: file_subs.c,v 1.16 2002/02/16 21:27:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: file_subs.c,v 1.17 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -80,14 +80,8 @@ mk_link(register char *,register struct stat *,register char *, int); * file descriptor or -1 for failure */ -#ifdef __STDC__ int file_creat(register ARCHD *arcn) -#else -int -file_creat(arcn) - register ARCHD *arcn; -#endif { int fd = -1; mode_t file_mode; @@ -143,15 +137,8 @@ file_creat(arcn) * 0 for success, -1 for failure */ -#ifdef __STDC__ void file_close(register ARCHD *arcn, int fd) -#else -void -file_close(arcn, fd) - register ARCHD *arcn; - int fd; -#endif { int res = 0; @@ -190,14 +177,8 @@ file_close(arcn, fd) * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int lnk_creat(register ARCHD *arcn) -#else -int -lnk_creat(arcn) - register ARCHD *arcn; -#endif { struct stat sb; @@ -230,14 +211,8 @@ lnk_creat(arcn) * 0 if cross_lnk() ok, -1 for fatal flaw (like linking to self). */ -#ifdef __STDC__ int cross_lnk(register ARCHD *arcn) -#else -int -cross_lnk(arcn) - register ARCHD *arcn; -#endif { /* * try to make a link to orginal file (-l flag in copy mode). make sure @@ -260,14 +235,8 @@ cross_lnk(arcn) * 0 skip it file exists (-k) or may be the same as source file */ -#ifdef __STDC__ int chk_same(register ARCHD *arcn) -#else -int -chk_same(arcn) - register ARCHD *arcn; -#endif { struct stat sb; @@ -303,18 +272,9 @@ chk_same(arcn) * allowed option). -1 an error occurred. */ -#ifdef __STDC__ static int mk_link(register char *to, register struct stat *to_sb, register char *from, int ign) -#else -static int -mk_link(to, to_sb, from, ign) - register char *to; - register struct stat *to_sb; - register char *from; - int ign; -#endif { struct stat sb; int oerrno; @@ -385,14 +345,8 @@ mk_link(to, to_sb, from, ign) * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int node_creat(register ARCHD *arcn) -#else -int -node_creat(arcn) - register ARCHD *arcn; -#endif { register int res; register int ign = 0; @@ -581,15 +535,8 @@ badlink: * 1 we found a directory and we were going to create a directory. */ -#ifdef __STDC__ int unlnk_exist(register char *name, register int type) -#else -int -unlnk_exist(name, type) - register char *name; - register int type; -#endif { struct stat sb; @@ -639,16 +586,8 @@ unlnk_exist(name, type) * 0 otherwise */ -#ifdef __STDC__ int chk_path( register char *name, uid_t st_uid, gid_t st_gid) -#else -int -chk_path(name, st_uid, st_gid) - register char *name; - uid_t st_uid; - gid_t st_gid; -#endif { register char *spt = name; struct stat sb; @@ -731,17 +670,8 @@ chk_path(name, st_uid, st_gid) * not set request. */ -#ifdef __STDC__ void set_ftime(char *fnm, time_t mtime, time_t atime, int frc) -#else -void -set_ftime(fnm, mtime, atime, frc) - char *fnm; - time_t mtime; - time_t atime; - int frc; -#endif { static struct timeval tv[2] = {{0L, 0L}, {0L, 0L}}; struct stat sb; @@ -778,16 +708,8 @@ set_ftime(fnm, mtime, atime, frc) * 0 when set, -1 on failure */ -#ifdef __STDC__ int set_ids(char *fnm, uid_t uid, gid_t gid) -#else -int -set_ids(fnm, uid, gid) - char *fnm; - uid_t uid; - gid_t gid; -#endif { if (chown(fnm, uid, gid) < 0) { /* @@ -810,16 +732,8 @@ set_ids(fnm, uid, gid) * 0 when set, -1 on failure */ -#ifdef __STDC__ int set_lids(char *fnm, uid_t uid, gid_t gid) -#else -int -set_lids(fnm, uid, gid) - char *fnm; - uid_t uid; - gid_t gid; -#endif { if (lchown(fnm, uid, gid) < 0) { /* @@ -840,15 +754,8 @@ set_lids(fnm, uid, gid) * Set file access mode */ -#ifdef __STDC__ void set_pmode(char *fnm, mode_t mode) -#else -void -set_pmode(fnm, mode) - char *fnm; - mode_t mode; -#endif { mode &= ABITS; if (chmod(fnm, mode) < 0) @@ -904,21 +811,9 @@ set_pmode(fnm, mode) * number of bytes written, -1 on write (or lseek) error. */ -#ifdef __STDC__ int file_write(int fd, char *str, register int cnt, int *rem, int *isempt, int sz, char *name) -#else -int -file_write(fd, str, cnt, rem, isempt, sz, name) - int fd; - char *str; - register int cnt; - int *rem; - int *isempt; - int sz; - char *name; -#endif { register char *pt; register char *end; @@ -997,16 +892,8 @@ file_write(fd, str, cnt, rem, isempt, sz, name) * write the last BYTE with a zero (back up one byte and write a zero). */ -#ifdef __STDC__ void file_flush(int fd, char *fname, int isempt) -#else -void -file_flush(fd, fname, isempt) - int fd; - char *fname; - int isempt; -#endif { static char blnk[] = "\0"; @@ -1036,15 +923,8 @@ file_flush(fd, fname, isempt) * reset access time (tflag) do so (the times are stored in arcn). */ -#ifdef __STDC__ void rdfile_close(register ARCHD *arcn, register int *fd) -#else -void -rdfile_close(arcn, fd) - register ARCHD *arcn; - register int *fd; -#endif { /* * make sure the file is open @@ -1073,15 +953,8 @@ rdfile_close(arcn, fd) * 0 if was able to calculate the crc, -1 otherwise */ -#ifdef __STDC__ int set_crc(register ARCHD *arcn, register int fd) -#else -int -set_crc(arcn, fd) - register ARCHD *arcn; - register int fd; -#endif { register int i; register int res; diff --git a/bin/pax/ftree.c b/bin/pax/ftree.c index c5e400409a5..4fa1a2cfcfc 100644 --- a/bin/pax/ftree.c +++ b/bin/pax/ftree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftree.c,v 1.17 2002/02/16 21:27:07 millert Exp $ */ +/* $OpenBSD: ftree.c,v 1.18 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: ftree.c,v 1.4 1995/03/21 09:07:21 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)ftree.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: ftree.c,v 1.17 2002/02/16 21:27:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: ftree.c,v 1.18 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -95,13 +95,8 @@ static int ftree_arg(void); * 0 if there is at least one valid file arg to process, -1 otherwise */ -#ifdef __STDC__ int ftree_start(void) -#else -int -ftree_start() -#endif { /* * set up the operation mode of fts, open the first file arg. We must @@ -150,15 +145,8 @@ ftree_start() * 0 if added to the linked list, -1 if failed */ -#ifdef __STDC__ int ftree_add(register char *str, int chflg) -#else -int -ftree_add(str, chflg) - register char *str; - int chflg; -#endif { register FTREE *ft; register int len; @@ -202,14 +190,8 @@ ftree_add(str, chflg) * -n and -d processing. */ -#ifdef __STDC__ void ftree_sel(register ARCHD *arcn) -#else -void -ftree_sel(arcn) - register ARCHD *arcn; -#endif { /* * set reference bit for this pattern. This linked list is only used @@ -241,13 +223,8 @@ ftree_sel(arcn) * have a selected member (reference count still 0) */ -#ifdef __STDC__ void ftree_chk(void) -#else -void -ftree_chk() -#endif { register FTREE *ft; register int wban = 0; @@ -283,13 +260,8 @@ ftree_chk() * stdin). */ -#ifdef __STDC__ static int ftree_arg(void) -#else -static int -ftree_arg() -#endif { register char *pt; @@ -362,14 +334,8 @@ ftree_arg() * 0 when contents of arcn have been set with the next file, -1 when done. */ -#ifdef __STDC__ int next_file(register ARCHD *arcn) -#else -int -next_file(arcn) - register ARCHD *arcn; -#endif { register int cnt; time_t atime; diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c index c9a40df003e..7ac24c7c62f 100644 --- a/bin/pax/gen_subs.c +++ b/bin/pax/gen_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gen_subs.c,v 1.12 2001/07/17 18:19:49 millert Exp $ */ +/* $OpenBSD: gen_subs.c,v 1.13 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: gen_subs.c,v 1.5 1995/03/21 09:07:26 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: gen_subs.c,v 1.12 2001/07/17 18:19:49 millert Exp $"; +static char rcsid[] = "$OpenBSD: gen_subs.c,v 1.13 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -79,16 +79,8 @@ static char rcsid[] = "$OpenBSD: gen_subs.c,v 1.12 2001/07/17 18:19:49 millert E * list the members of an archive in ls format */ -#ifdef __STDC__ void ls_list(register ARCHD *arcn, time_t now, FILE *fp) -#else -void -ls_list(arcn, now, fp) - register ARCHD *arcn; - time_t now; - FILE *fp; -#endif { register struct stat *sbp; char f_mode[MODELEN]; @@ -173,14 +165,8 @@ ls_list(arcn, now, fp) * print a short summary of file to tty. */ -#ifdef __STDC__ void ls_tty(register ARCHD *arcn) -#else -void -ls_tty(arcn) - register ARCHD *arcn; -#endif { char f_date[DATELEN]; char f_mode[MODELEN]; @@ -208,15 +194,8 @@ ls_tty(arcn) return; } -#ifdef __STDC__ void safe_print(char *str, FILE *fp) -#else -void -safe_print(str, fp) - char *str; - FILE *fp; -#endif { char visbuf[5]; char *cp; @@ -244,16 +223,8 @@ safe_print(str, fp) * unsigned long value */ -#ifdef __STDC__ u_long asc_ul(register char *str, int len, register int base) -#else -u_long -asc_ul(str, len, base) - register char *str; - int len; - register int base; -#endif { register char *stop; u_long tval = 0; @@ -295,17 +266,8 @@ asc_ul(str, len, base) * NOTE: the string created is NOT TERMINATED. */ -#ifdef __STDC__ int ul_asc(u_long val, register char *str, register int len, register int base) -#else -int -ul_asc(val, str, len, base) - u_long val; - register char *str; - register int len; - register int base; -#endif { register char *pt; u_long digit; @@ -358,16 +320,8 @@ ul_asc(val, str, len, base) * u_quad_t value */ -#ifdef __STDC__ u_quad_t asc_uqd(register char *str, int len, register int base) -#else -u_quad_t -asc_uqd(str, len, base) - register char *str; - int len; - register int base; -#endif { register char *stop; u_quad_t tval = 0; @@ -409,17 +363,8 @@ asc_uqd(str, len, base) * NOTE: the string created is NOT TERMINATED. */ -#ifdef __STDC__ int uqd_asc(u_quad_t val, register char *str, register int len, register int base) -#else -int -uqd_asc(val, str, len, base) - u_quad_t val; - register char *str; - register int len; - register int base; -#endif { register char *pt; u_quad_t digit; diff --git a/bin/pax/options.c b/bin/pax/options.c index 95192097057..08d668dce15 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.49 2002/02/16 21:27:07 millert Exp $ */ +/* $OpenBSD: options.c,v 1.50 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: options.c,v 1.49 2002/02/16 21:27:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: options.c,v 1.50 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -153,15 +153,8 @@ int ford[] = {5, 4, 3, 2, 1, 0, -1 }; * parser */ -#ifdef __STDC__ void options(register int argc, register char **argv) -#else -void -options(argc, argv) - register int argc; - register char **argv; -#endif { /* @@ -189,15 +182,8 @@ options(argc, argv) * the user specified a legal set of flags. If not, complain and exit */ -#ifdef __STDC__ static void pax_options(register int argc, register char **argv) -#else -static void -pax_options(argc, argv) - register int argc; - register char **argv; -#endif { register int c; register int i; @@ -594,15 +580,8 @@ pax_options(argc, argv) * the user specified a legal set of flags. If not, complain and exit */ -#ifdef __STDC__ static void tar_options(register int argc, register char **argv) -#else -static void -tar_options(argc, argv) - register int argc; - register char **argv; -#endif { register int c; int fstdin = 0; @@ -1026,15 +1005,8 @@ mkpath(path) * the user specified a legal set of flags. If not, complain and exit */ -#ifdef __STDC__ static void cpio_options(register int argc, register char **argv) -#else -static void -cpio_options(argc, argv) - register int argc; - register char **argv; -#endif { register int c, i; char *str; @@ -1293,14 +1265,8 @@ cpio_options(argc, argv) * print out those invalid flag sets found to the user */ -#ifdef __STDC__ static void printflg(unsigned int flg) -#else -static void -printflg(flg) - unsigned int flg; -#endif { int nxt; int pos = 0; @@ -1320,15 +1286,8 @@ printflg(flg) * by the user */ -#ifdef __STDC__ static int c_frmt(const void *a, const void *b) -#else -static int -c_frmt(a, b) - void *a; - void *b; -#endif { return(strcmp(((FSUB *)a)->name, ((FSUB *)b)->name)); } @@ -1341,13 +1300,8 @@ c_frmt(a, b) * pointer to next OPLIST entry or NULL (end of list). */ -#ifdef __STDC__ OPLIST * opt_next(void) -#else -OPLIST * -opt_next() -#endif { OPLIST *opt; @@ -1362,13 +1316,8 @@ opt_next() * when the format does not support options. */ -#ifdef __STDC__ int bad_opt(void) -#else -int -bad_opt() -#endif { register OPLIST *opt; @@ -1393,14 +1342,8 @@ bad_opt() * 0 if format in name=value format, -1 if -o is passed junk */ -#ifdef __STDC__ int opt_add(register char *str) -#else -int -opt_add(str) - register char *str; -#endif { register OPLIST *opt; register char *frpt; @@ -1468,14 +1411,8 @@ opt_add(str) * 0 for an error, a positive value o.w. */ -#ifdef __STDC__ static off_t str_offt(char *val) -#else -static off_t -str_offt(val) - char *val; -#endif { char *expr; off_t num, t; @@ -1536,14 +1473,8 @@ str_offt(val) return(num); } -#ifdef __STDC__ char * getline(FILE *f) -#else -char * -getline(f) - FILE *f; -#endif { char *name, *temp; size_t len; @@ -1572,13 +1503,8 @@ getline(f) * 0 */ -#ifdef __STDC__ static int no_op(void) -#else -static int -no_op() -#endif { return(0); } @@ -1588,13 +1514,8 @@ no_op() * print the usage summary to the user */ -#ifdef __STDC__ void pax_usage(void) -#else -void -pax_usage() -#endif { (void)fputs("usage: pax [-cdnvz] [-E limit] [-f archive] ", stderr); (void)fputs("[-s replstr] ... [-U user] ...", stderr); @@ -1627,13 +1548,8 @@ pax_usage() * print the usage summary to the user */ -#ifdef __STDC__ void tar_usage(void) -#else -void -tar_usage() -#endif { (void)fputs("usage: tar [-]{crtux}[-befhmopqsvwzHLOPXZ014578] [blocksize] ", stderr); @@ -1647,13 +1563,8 @@ tar_usage() * print the usage summary to the user */ -#ifdef __STDC__ void cpio_usage(void) -#else -void -cpio_usage() -#endif { (void)fputs("usage: cpio -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive]\n", stderr); (void)fputs(" [-F archive] < name-list [> archive]\n", stderr); diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c index 9e9474f755e..f88ce717c12 100644 --- a/bin/pax/pat_rep.c +++ b/bin/pax/pat_rep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pat_rep.c,v 1.16 2002/02/16 21:27:07 millert Exp $ */ +/* $OpenBSD: pat_rep.c,v 1.17 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: pat_rep.c,v 1.4 1995/03/21 09:07:33 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: pat_rep.c,v 1.16 2002/02/16 21:27:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: pat_rep.c,v 1.17 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -96,14 +96,8 @@ static int resub(regex_t *, regmatch_t *, char *, char *, char *, char *); * the list of replacement patterns; -1 otherwise. */ -#ifdef __STDC__ int rep_add(register char *str) -#else -int -rep_add(str) - register char *str; -#endif { register char *pt1; register char *pt2; @@ -226,15 +220,8 @@ rep_add(str) * 0 if the pattern was added to the list, -1 otherwise */ -#ifdef __STDC__ int pat_add(char *str, char *chdname) -#else -int -pat_add(str, chdname) - char *str; - char *chdname; -#endif { register PATTERN *pt; @@ -278,13 +265,8 @@ pat_add(str, chdname) * a selected archive member. */ -#ifdef __STDC__ void pat_chk(void) -#else -void -pat_chk() -#endif { register PATTERN *pt; register int wban = 0; @@ -320,14 +302,8 @@ pat_chk() * match, -1 otherwise. */ -#ifdef __STDC__ int pat_sel(register ARCHD *arcn) -#else -int -pat_sel(arcn) - register ARCHD *arcn; -#endif { register PATTERN *pt; register PATTERN **ppt; @@ -445,14 +421,8 @@ pat_sel(arcn) * looking for more members) */ -#ifdef __STDC__ int pat_match(register ARCHD *arcn) -#else -int -pat_match(arcn) - register ARCHD *arcn; -#endif { register PATTERN *pt; @@ -523,16 +493,8 @@ pat_match(arcn) * Note: *pend may be changed to show where the prefix ends. */ -#ifdef __STDC__ static int fn_match(register char *pattern, register char *string, char **pend) -#else -static int -fn_match(pattern, string, pend) - register char *pattern; - register char *string; - char **pend; -#endif { register char c; char test; @@ -604,15 +566,8 @@ fn_match(pattern, string, pend) /* NOTREACHED */ } -#ifdef __STDC__ static char * range_match(register char *pattern, register int test) -#else -static char * -range_match(pattern, test) - register char *pattern; - register int test; -#endif { register char c; register char c2; @@ -654,14 +609,8 @@ range_match(pattern, test) * 0 continue to process file, 1 skip this file, -1 pax is finished */ -#ifdef __STDC__ int mod_name(register ARCHD *arcn) -#else -int -mod_name(arcn) - register ARCHD *arcn; -#endif { register int res = 0; @@ -753,14 +702,8 @@ mod_name(arcn) * 0 process this file, 1 skip this file, -1 we need to exit pax */ -#ifdef __STDC__ static int tty_rename(register ARCHD *arcn) -#else -static int -tty_rename(arcn) - register ARCHD *arcn; -#endif { char tmpname[PAXPATHLEN+2]; int res; @@ -824,16 +767,8 @@ tty_rename(arcn) * 0 if ok, -1 if failure (name too long) */ -#ifdef __STDC__ int set_dest(register ARCHD *arcn, char *dest_dir, int dir_len) -#else -int -set_dest(arcn, dest_dir, dir_len) - register ARCHD *arcn; - char *dest_dir; - int dir_len; -#endif { if (fix_path(arcn->name, &(arcn->nlen), dest_dir, dir_len) < 0) return(-1); @@ -859,17 +794,8 @@ set_dest(arcn, dest_dir, dir_len) * 0 if ok, -1 if the final name is too long */ -#ifdef __STDC__ static int fix_path( char *or_name, int *or_len, char *dir_name, int dir_len) -#else -static int -fix_path(or_name, or_len, dir_name, dir_len) - char *or_name; - int *or_len; - char *dir_name; - int dir_len; -#endif { register char *src; register char *dest; @@ -931,16 +857,8 @@ fix_path(or_name, or_len, dir_name, dir_len) * ended up empty) */ -#ifdef __STDC__ static int rep_name(char *name, int *nlen, int prnt) -#else -static int -rep_name(name, nlen, prnt) - char *name; - int *nlen; - int prnt; -#endif { register REPLACE *pt; register char *inpt; @@ -1085,20 +1003,9 @@ rep_name(name, nlen, prnt) * -1 if error, or the number of characters added to the destination. */ -#ifdef __STDC__ static int resub(regex_t *rp, register regmatch_t *pm, char *src, char *inpt, char *dest, register char *destend) -#else -static int -resub(rp, pm, src, inpt, dest, destend) - regex_t *rp; - register regmatch_t *pm; - char *src; - char *inpt; - char *dest; - register char *destend; -#endif { register char *spt; register char *dpt; diff --git a/bin/pax/pax.c b/bin/pax/pax.c index 91f3fc8e2db..142dd059c73 100644 --- a/bin/pax/pax.c +++ b/bin/pax/pax.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pax.c,v 1.19 2002/02/16 21:27:07 millert Exp $ */ +/* $OpenBSD: pax.c,v 1.20 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: pax.c,v 1.5 1996/03/26 23:54:20 mrg Exp $ */ /*- @@ -48,7 +48,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: pax.c,v 1.19 2002/02/16 21:27:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: pax.c,v 1.20 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -232,15 +232,8 @@ char *tempbase; /* basename of tempfile to use for mkstemp(3) */ * Return: 0 if ok, 1 otherwise */ -#ifdef __STDC__ int main(int argc, char **argv) -#else -int -main(argc, argv) - int argc; - char **argv; -#endif { char *tmpdir; size_t tdlen; @@ -314,14 +307,8 @@ main(argc, argv) * never.... */ -#ifdef __STDC__ void sig_cleanup(int which_sig) -#else -void -sig_cleanup(which_sig) - int which_sig; -#endif { /* XXX signal races */ @@ -349,13 +336,8 @@ sig_cleanup(which_sig) * when dealing with a medium to large sized archives. */ -#ifdef __STDC__ static int gen_init(void) -#else -static int -gen_init() -#endif { struct rlimit reslimit; struct sigaction n_hand; diff --git a/bin/pax/sel_subs.c b/bin/pax/sel_subs.c index 34f4512e017..aa7efceaa36 100644 --- a/bin/pax/sel_subs.c +++ b/bin/pax/sel_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sel_subs.c,v 1.9 2002/02/16 21:27:07 millert Exp $ */ +/* $OpenBSD: sel_subs.c,v 1.10 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: sel_subs.c,v 1.5 1995/03/21 09:07:42 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)sel_subs.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: sel_subs.c,v 1.9 2002/02/16 21:27:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: sel_subs.c,v 1.10 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -81,14 +81,8 @@ static GRPT **grptb = NULL; /* group selection table */ * 0 if this archive member should be processed, 1 if it should be skipped */ -#ifdef __STDC__ int sel_chk(register ARCHD *arcn) -#else -int -sel_chk(arcn) - register ARCHD *arcn; -#endif { if (((usrtb != NULL) && usr_match(arcn)) || ((grptb != NULL) && grp_match(arcn)) || @@ -112,14 +106,8 @@ sel_chk(arcn) * 0 if added ok, -1 otherwise; */ -#ifdef __STDC__ int usr_add(register char *str) -#else -int -usr_add(str) - register char *str; -#endif { register u_int indx; register USRT *pt; @@ -187,14 +175,8 @@ usr_add(str) * 0 if this archive member should be processed, 1 if it should be skipped */ -#ifdef __STDC__ static int usr_match(register ARCHD *arcn) -#else -static int -usr_match(arcn) - register ARCHD *arcn; -#endif { register USRT *pt; @@ -221,14 +203,8 @@ usr_match(arcn) * 0 if added ok, -1 otherwise; */ -#ifdef __STDC__ int grp_add(register char *str) -#else -int -grp_add(str) - register char *str; -#endif { register u_int indx; register GRPT *pt; @@ -296,14 +272,8 @@ grp_add(str) * 0 if this archive member should be processed, 1 if it should be skipped */ -#ifdef __STDC__ static int grp_match(register ARCHD *arcn) -#else -static int -grp_match(arcn) - register ARCHD *arcn; -#endif { register GRPT *pt; @@ -352,14 +322,8 @@ grp_match(arcn) * 0 if the time range was added to the list, -1 otherwise */ -#ifdef __STDC__ int trng_add(register char *str) -#else -int -trng_add(str) - register char *str; -#endif { register TIME_RNG *pt; register char *up_pt = NULL; @@ -498,14 +462,8 @@ trng_add(str) * 0 if this archive member should be processed, 1 if it should be skipped */ -#ifdef __STDC__ static int trng_match(register ARCHD *arcn) -#else -static int -trng_match(arcn) - register ARCHD *arcn; -#endif { register TIME_RNG *pt; @@ -573,15 +531,8 @@ trng_match(arcn) * 0 if converted ok, -1 otherwise */ -#ifdef __STDC__ static int str_sec(register char *str, time_t *tval) -#else -static int -str_sec(str, tval) - register char *str; - time_t *tval; -#endif { register struct tm *lt; register char *dot = NULL; diff --git a/bin/pax/tables.c b/bin/pax/tables.c index ebdfdf0de29..b52c469e95b 100644 --- a/bin/pax/tables.c +++ b/bin/pax/tables.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tables.c,v 1.14 2002/02/16 21:27:07 millert Exp $ */ +/* $OpenBSD: tables.c,v 1.15 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: tables.c,v 1.4 1995/03/21 09:07:45 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)tables.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: tables.c,v 1.14 2002/02/16 21:27:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: tables.c,v 1.15 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -109,13 +109,8 @@ static DEVT *chk_dev(dev_t, int); * 0 if created, -1 if failure */ -#ifdef __STDC__ int lnk_start(void) -#else -int -lnk_start() -#endif { if (ltab != NULL) return(0); @@ -138,14 +133,8 @@ lnk_start() * if found returns 1; if not found returns 0; -1 on error */ -#ifdef __STDC__ int chk_lnk(register ARCHD *arcn) -#else -int -chk_lnk(arcn) - register ARCHD *arcn; -#endif { register HRDLNK *pt; register HRDLNK **ppt; @@ -230,14 +219,8 @@ chk_lnk(arcn) * we do not want to accidently point another file at it later on. */ -#ifdef __STDC__ void purg_lnk(register ARCHD *arcn) -#else -void -purg_lnk(arcn) - register ARCHD *arcn; -#endif { register HRDLNK *pt; register HRDLNK **ppt; @@ -290,13 +273,8 @@ purg_lnk(arcn) * write phase */ -#ifdef __STDC__ void lnk_end(void) -#else -void -lnk_end() -#endif { register int i; register HRDLNK *pt; @@ -355,13 +333,8 @@ lnk_end() * 0 if the table and file was created ok, -1 otherwise */ -#ifdef __STDC__ int ftime_start(void) -#else -int -ftime_start() -#endif { if (ftab != NULL) @@ -398,14 +371,8 @@ ftime_start() * -1 on error */ -#ifdef __STDC__ int chk_ftime(register ARCHD *arcn) -#else -int -chk_ftime(arcn) - register ARCHD *arcn; -#endif { register FTM *pt; register int namelen; @@ -523,13 +490,8 @@ chk_ftime(arcn) * 0 if successful, -1 otherwise */ -#ifdef __STDC__ int name_start(void) -#else -int -name_start() -#endif { if (ntab != NULL) return(0); @@ -549,16 +511,8 @@ name_start() * 0 if added, -1 otherwise */ -#ifdef __STDC__ int add_name(register char *oname, int onamelen, char *nname) -#else -int -add_name(oname, onamelen, nname) - register char *oname; - int onamelen; - char *nname; -#endif { register NAMT *pt; register u_int indx; @@ -625,16 +579,8 @@ add_name(oname, onamelen, nname) * new name (oname is the link to name) */ -#ifdef __STDC__ void sub_name(register char *oname, int *onamelen, size_t onamesize) -#else -void -sub_name(oname, onamelen, onamesize) - register char *oname; - int *onamelen; - size_t onamesize; -#endif { register NAMT *pt; register u_int indx; @@ -716,13 +662,8 @@ sub_name(oname, onamelen, onamesize) * 0 if successful, -1 otherwise */ -#ifdef __STDC__ int dev_start(void) -#else -int -dev_start() -#endif { if (dtab != NULL) return(0); @@ -743,14 +684,8 @@ dev_start() * 0 if added ok, -1 otherwise */ -#ifdef __STDC__ int add_dev(register ARCHD *arcn) -#else -int -add_dev(arcn) - register ARCHD *arcn; -#endif { if (chk_dev(arcn->sb.st_dev, 1) == NULL) return(-1); @@ -770,15 +705,8 @@ add_dev(arcn) * is returned (indicates an error). */ -#ifdef __STDC__ static DEVT * chk_dev(dev_t dev, int add) -#else -static DEVT * -chk_dev(dev, add) - dev_t dev; - int add; -#endif { register DEVT *pt; register u_int indx; @@ -835,16 +763,8 @@ chk_dev(dev, add) * 0 if all ok, -1 otherwise. */ -#ifdef __STDC__ int map_dev(register ARCHD *arcn, u_long dev_mask, u_long ino_mask) -#else -int -map_dev(arcn, dev_mask, ino_mask) - register ARCHD *arcn; - u_long dev_mask; - u_long ino_mask; -#endif { register DEVT *pt; register DLIST *dpt; @@ -985,13 +905,8 @@ map_dev(arcn, dev_mask, ino_mask) * 0 is created ok, -1 otherwise. */ -#ifdef __STDC__ int atdir_start(void) -#else -int -atdir_start() -#endif { if (atab != NULL) return(0); @@ -1010,13 +925,8 @@ atdir_start() * entries are for directories READ by pax */ -#ifdef __STDC__ void atdir_end(void) -#else -void -atdir_end() -#endif { register ATDIR *pt; register int i; @@ -1046,18 +956,8 @@ atdir_end() * and chained by inode number. This is for directories READ by pax */ -#ifdef __STDC__ void add_atdir(char *fname, dev_t dev, ino_t ino, time_t mtime, time_t atime) -#else -void -add_atdir(fname, dev, ino, mtime, atime) - char *fname; - dev_t dev; - ino_t ino; - time_t mtime; - time_t atime; -#endif { register ATDIR *pt; register u_int indx; @@ -1118,17 +1018,8 @@ add_atdir(fname, dev, ino, mtime, atime) * 0 if found, -1 if not found. */ -#ifdef __STDC__ int get_atdir(dev_t dev, ino_t ino, time_t *mtime, time_t *atime) -#else -int -get_atdir(dev, ino, mtime, atime) - dev_t dev; - ino_t ino; - time_t *mtime; - time_t *atime; -#endif { register ATDIR *pt; register ATDIR **ppt; @@ -1202,13 +1093,8 @@ get_atdir(dev, ino, mtime, atime) * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int dir_start(void) -#else -int -dir_start() -#endif { if (dirfd != -1) @@ -1240,17 +1126,8 @@ dir_start() * pax spec) */ -#ifdef __STDC__ void add_dir(char *name, int nlen, struct stat *psb, int frc_mode) -#else -void -add_dir(name, nlen, psb, frc_mode) - char *name; - int nlen; - struct stat *psb; - int frc_mode; -#endif { DIRDATA dblk; @@ -1290,13 +1167,8 @@ add_dir(name, nlen, psb, frc_mode) * by pax */ -#ifdef __STDC__ void proc_dir(void) -#else -void -proc_dir() -#endif { char name[PAXPATHLEN+1]; DIRDATA dblk; @@ -1358,16 +1230,8 @@ proc_dir() * the hash value of the string MOD (%) the table size. */ -#ifdef __STDC__ u_int st_hash(char *name, int len, int tabsz) -#else -u_int -st_hash(name, len, tabsz) - char *name; - int len; - int tabsz; -#endif { register char *pt; register char *dest; diff --git a/bin/pax/tar.c b/bin/pax/tar.c index adf8967b298..3b121659234 100644 --- a/bin/pax/tar.c +++ b/bin/pax/tar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tar.c,v 1.24 2002/02/16 21:27:07 millert Exp $ */ +/* $OpenBSD: tar.c,v 1.25 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: tar.c,v 1.5 1995/03/21 09:07:49 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)tar.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: tar.c,v 1.24 2002/02/16 21:27:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: tar.c,v 1.25 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -82,13 +82,8 @@ static int tar_nodir; /* do not write dirs under old tar */ * 0 if ok, -1 otherwise (what wr_skip returns) */ -#ifdef __STDC__ int tar_endwr(void) -#else -int -tar_endwr() -#endif { return(wr_skip((off_t)(NULLCNT*BLKMULT))); } @@ -100,13 +95,8 @@ tar_endwr() * size of trailer (2 * BLKMULT) */ -#ifdef __STDC__ off_t tar_endrd(void) -#else -off_t -tar_endrd() -#endif { return((off_t)(NULLCNT*BLKMULT)); } @@ -122,16 +112,8 @@ tar_endrd() * could never contain a header. */ -#ifdef __STDC__ int tar_trail(register char *buf, register int in_resync, register int *cnt) -#else -int -tar_trail(buf, in_resync, cnt) - register char *buf; - register int in_resync; - register int *cnt; -#endif { register int i; @@ -173,17 +155,8 @@ tar_trail(buf, in_resync, cnt) * 0 if the number fit into the string, -1 otherwise */ -#ifdef __STDC__ static int ul_oct(u_long val, register char *str, register int len, int term) -#else -static int -ul_oct(val, str, len, term) - u_long val; - register char *str; - register int len; - int term; -#endif { register char *pt; @@ -237,17 +210,8 @@ ul_oct(val, str, len, term) * 0 if the number fit into the string, -1 otherwise */ -#ifdef __STDC__ static int uqd_oct(u_quad_t val, register char *str, register int len, int term) -#else -static int -uqd_oct(val, str, len, term) - u_quad_t val; - register char *str; - register int len; - int term; -#endif { register char *pt; @@ -300,15 +264,8 @@ uqd_oct(val, str, len, term) * unsigned long checksum */ -#ifdef __STDC__ static u_long tar_chksm(register char *blk, register int len) -#else -static u_long -tar_chksm(blk, len) - register char *blk; - register int len; -#endif { register char *stop; register char *pt; @@ -348,15 +305,8 @@ tar_chksm(blk, len) * 0 if a tar header, -1 otherwise */ -#ifdef __STDC__ int tar_id(register char *blk, int size) -#else -int -tar_id(blk, size) - register char *blk; - int size; -#endif { register HD_TAR *hd; register HD_USTAR *uhd; @@ -389,13 +339,8 @@ tar_id(blk, size) * 0 if ok -1 otherwise */ -#ifdef __STDC__ int tar_opt(void) -#else -int -tar_opt() -#endif { OPLIST *opt; @@ -431,15 +376,8 @@ tar_opt() * 0 */ -#ifdef __STDC__ int tar_rd(register ARCHD *arcn, register char *buf) -#else -int -tar_rd(arcn, buf) - register ARCHD *arcn; - register char *buf; -#endif { register HD_TAR *hd; register char *pt; @@ -565,14 +503,8 @@ tar_rd(arcn, buf) * data to write after the header, -1 if archive write failed */ -#ifdef __STDC__ int tar_wr(register ARCHD *arcn) -#else -int -tar_wr(arcn) - register ARCHD *arcn; -#endif { register HD_TAR *hd; int len; @@ -728,13 +660,8 @@ tar_wr(arcn) * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int ustar_strd(void) -#else -int -ustar_strd() -#endif { if ((usrtb_start() < 0) || (grptb_start() < 0)) return(-1); @@ -748,13 +675,8 @@ ustar_strd() * 0 if ok, -1 otherwise */ -#ifdef __STDC__ int ustar_stwr(void) -#else -int -ustar_stwr() -#endif { if ((uidtb_start() < 0) || (gidtb_start() < 0)) return(-1); @@ -769,15 +691,8 @@ ustar_stwr() * 0 if a ustar header, -1 otherwise */ -#ifdef __STDC__ int ustar_id(char *blk, int size) -#else -int -ustar_id(blk, size) - char *blk; - int size; -#endif { register HD_USTAR *hd; @@ -808,15 +723,8 @@ ustar_id(blk, size) * 0 */ -#ifdef __STDC__ int ustar_rd(register ARCHD *arcn, register char *buf) -#else -int -ustar_rd(arcn, buf) - register ARCHD *arcn; - register char *buf; -#endif { register HD_USTAR *hd; register char *dest; @@ -969,14 +877,8 @@ ustar_rd(arcn, buf) * data to write after the header, -1 if archive write failed */ -#ifdef __STDC__ int ustar_wr(register ARCHD *arcn) -#else -int -ustar_wr(arcn) - register ARCHD *arcn; -#endif { register HD_USTAR *hd; register char *pt; @@ -1147,15 +1049,8 @@ ustar_wr(arcn) * the file name is too long */ -#ifdef __STDC__ static char * name_split(register char *name, register int len) -#else -static char * -name_split(name, len) - register char *name; - register int len; -#endif { register char *start; diff --git a/bin/pax/tty_subs.c b/bin/pax/tty_subs.c index 7e3b2d88e18..859cdfb013d 100644 --- a/bin/pax/tty_subs.c +++ b/bin/pax/tty_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_subs.c,v 1.7 2001/09/05 22:32:27 deraadt Exp $ */ +/* $OpenBSD: tty_subs.c,v 1.8 2002/02/19 19:39:35 millert Exp $ */ /* $NetBSD: tty_subs.c,v 1.5 1995/03/21 09:07:52 cgd Exp $ */ /*- @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)tty_subs.c 8.2 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: tty_subs.c,v 1.7 2001/09/05 22:32:27 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: tty_subs.c,v 1.8 2002/02/19 19:39:35 millert Exp $"; #endif #endif /* not lint */ @@ -58,11 +58,7 @@ static char rcsid[] = "$OpenBSD: tty_subs.c,v 1.7 2001/09/05 22:32:27 deraadt Ex #include <string.h> #include "pax.h" #include "extern.h" -#ifdef __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif /* * routines that deal with I/O to and from the user @@ -78,13 +74,8 @@ static FILE *ttyinf = NULL; /* input pointing at control tty */ * open fails, future ops that require user input will get an EOF */ -#ifdef __STDC__ int tty_init(void) -#else -int -tty_init() -#endif { int ttyfd; @@ -110,22 +101,12 @@ tty_init() * if there is no controlling terminal, just return. */ -#ifdef __STDC__ void tty_prnt(char *fmt, ...) -#else -void -tty_prnt(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; -# ifdef __STDC__ + va_start(ap, fmt); -# else - va_start(ap); -# endif if (ttyoutf == NULL) { va_end(ap); return; @@ -143,15 +124,8 @@ tty_prnt(fmt, va_alist) * 0 if data was read, -1 otherwise. */ -#ifdef __STDC__ int tty_read(char *str, int len) -#else -int -tty_read(str, len) - char *str; - int len; -#endif { register char *pt; @@ -173,23 +147,12 @@ tty_read(str, len) * will be non-zero. */ -#ifdef __STDC__ void paxwarn(int set, char *fmt, ...) -#else -void -paxwarn(set, fmt, va_alist) - int set; - char *fmt; - va_dcl -#endif { va_list ap; -# ifdef __STDC__ + va_start(ap, fmt); -# else - va_start(ap); -# endif if (set) exit_val = 1; /* @@ -213,24 +176,12 @@ paxwarn(set, fmt, va_alist) * will be non-zero. */ -#ifdef __STDC__ void syswarn(int set, int errnum, char *fmt, ...) -#else -void -syswarn(set, errnum, fmt, va_alist) - int set; - int errnum; - char *fmt; - va_dcl -#endif { va_list ap; -# ifdef __STDC__ + va_start(ap, fmt); -# else - va_start(ap); -# endif if (set) exit_val = 1; /* |