summaryrefslogtreecommitdiff
path: root/sbin/restore/tape.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-07-17 02:14:34 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-07-17 02:14:34 +0000
commit777e443a4907c980d426ece9a6f7cdb21fea4f1b (patch)
treec7899405ab91d9f045012553ebfb1b8f7300f21b /sbin/restore/tape.c
parent5757b9a265e6ab7af9c725d74bf16cbf90747d02 (diff)
some ansi; khalek@linuxgamers.net
Diffstat (limited to 'sbin/restore/tape.c')
-rw-r--r--sbin/restore/tape.c93
1 files changed, 31 insertions, 62 deletions
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c
index cc06ec02573..3d993e0197c 100644
--- a/sbin/restore/tape.c
+++ b/sbin/restore/tape.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tape.c,v 1.28 2004/04/13 21:51:18 henning Exp $ */
+/* $OpenBSD: tape.c,v 1.29 2004/07/17 02:14:33 deraadt Exp $ */
/* $NetBSD: tape.c,v 1.26 1997/04/15 07:12:25 lukem Exp $ */
/*
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)tape.c 8.6 (Berkeley) 9/13/94";
#else
-static const char rcsid[] = "$OpenBSD: tape.c,v 1.28 2004/04/13 21:51:18 henning Exp $";
+static const char rcsid[] = "$OpenBSD: tape.c,v 1.29 2004/07/17 02:14:33 deraadt Exp $";
#endif
#endif /* not lint */
@@ -111,8 +111,7 @@ static void xtrskip(char *, size_t);
* Set up an input source
*/
void
-setinput(source)
- char *source;
+setinput(char *source)
{
FLUSHTAPEBUF();
if (bflag)
@@ -148,8 +147,7 @@ setinput(source)
}
void
-newtapebuf(size)
- long size;
+newtapebuf(long size)
{
static long tapebufsize = -1;
@@ -169,7 +167,7 @@ newtapebuf(size)
* that it actually is a dump tape.
*/
void
-setup()
+setup(void)
{
int i, j, *ip;
struct stat stbuf;
@@ -265,8 +263,7 @@ setup()
* the user when only extracting a subset of the files.
*/
void
-getvol(nextvol)
- long nextvol;
+getvol(long nextvol)
{
long newvol = 0, savecnt, wantnext, i;
union u_spcl tmpspcl;
@@ -432,7 +429,7 @@ gethdr:
* Handle unexpected EOF.
*/
static void
-terminateinput()
+terminateinput(void)
{
if (gettingfile && curfile.action == USING) {
@@ -454,7 +451,7 @@ terminateinput()
* appropriate one.
*/
static void
-setdumpnum()
+setdumpnum(void)
{
struct mtop tcom;
@@ -474,7 +471,7 @@ setdumpnum()
}
void
-printdumpinfo()
+printdumpinfo(void)
{
fprintf(stdout, "Dump date: %s", ctime(&spcl.c_date));
fprintf(stdout, "Dumped from: %s",
@@ -487,8 +484,7 @@ printdumpinfo()
}
int
-extractfile(name)
- char *name;
+extractfile(char *name)
{
u_int flags;
mode_t mode;
@@ -610,7 +606,7 @@ extractfile(name)
* skip over bit maps on the tape
*/
void
-skipmaps()
+skipmaps(void)
{
while (spcl.c_type == TS_BITS || spcl.c_type == TS_CLRI)
@@ -621,7 +617,7 @@ skipmaps()
* skip over a file on the tape
*/
void
-skipfile()
+skipfile(void)
{
curfile.action = SKIP;
@@ -638,9 +634,7 @@ skipfile()
* and no blocks should be skipped.
*/
void
-getfile(fill, skip)
- void (*fill)(char *, size_t);
- void (*skip)(char *, size_t);
+getfile(void (*fill)(char *, size_t), void (*skip)(char *, size_t))
{
int i;
volatile int curblk = 0;
@@ -701,9 +695,7 @@ loop:
* Write out the next block of a file.
*/
static void
-xtrfile(buf, size)
- char *buf;
- size_t size;
+xtrfile(char *buf, size_t size)
{
if (Nflag)
@@ -718,9 +710,7 @@ xtrfile(buf, size)
*/
/* ARGSUSED */
static void
-xtrskip(buf, size)
- char *buf;
- size_t size;
+xtrskip(char *buf, size_t size)
{
if (lseek(ofile, (off_t)size, SEEK_CUR) == -1)
@@ -732,9 +722,7 @@ xtrskip(buf, size)
* Collect the next block of a symbolic link.
*/
static void
-xtrlnkfile(buf, size)
- char *buf;
- size_t size;
+xtrlnkfile(char *buf, size_t size)
{
pathlen += size;
@@ -749,9 +737,7 @@ xtrlnkfile(buf, size)
*/
/* ARGSUSED */
static void
-xtrlnkskip(buf, size)
- char *buf;
- size_t size;
+xtrlnkskip(char *buf, size_t size)
{
errx(1, "unallocated block in symbolic link %s", curfile.name);
@@ -761,9 +747,7 @@ xtrlnkskip(buf, size)
* Collect the next block of a bit map.
*/
static void
-xtrmap(buf, size)
- char *buf;
- size_t size;
+xtrmap(char *buf, size_t size)
{
memcpy(map, buf, size);
@@ -775,9 +759,7 @@ xtrmap(buf, size)
*/
/* ARGSUSED */
static void
-xtrmapskip(buf, size)
- char *buf;
- size_t size;
+xtrmapskip(char *buf, size_t size)
{
panic("hole in map\n");
@@ -789,9 +771,7 @@ xtrmapskip(buf, size)
*/
/* ARGSUSED */
void
-xtrnull(buf, size)
- char *buf;
- size_t size;
+xtrnull(char *buf, size_t size)
{
return;
@@ -802,8 +782,7 @@ xtrnull(buf, size)
* Handle read errors, and end of media.
*/
static void
-readtape(buf)
- char *buf;
+readtape(char *buf)
{
long rd, newvol, i;
int cnt, seek_failed;
@@ -918,7 +897,7 @@ getmore:
}
static void
-findtapeblksize()
+findtapeblksize(void)
{
long i;
@@ -945,7 +924,7 @@ findtapeblksize()
}
void
-closemt()
+closemt(void)
{
if (mt < 0)
@@ -965,8 +944,7 @@ closemt()
* If it is not any valid header, return an error.
*/
static int
-gethead(buf)
- struct s_spcl *buf;
+gethead(struct s_spcl *buf)
{
long i;
union {
@@ -1104,8 +1082,7 @@ good:
* Check that a header is where it belongs and predict the next header
*/
static void
-accthdr(header)
- struct s_spcl *header;
+accthdr(struct s_spcl *header)
{
static ino_t previno = 0x7fffffff;
static int prevtype;
@@ -1173,8 +1150,7 @@ newcalc:
* Complain if had to skip, and complain is set.
*/
static void
-findinode(header)
- struct s_spcl *header;
+findinode(struct s_spcl *header)
{
static long skipcnt = 0;
long i;
@@ -1238,8 +1214,7 @@ findinode(header)
}
static int
-checksum(buf)
- int *buf;
+checksum(int *buf)
{
int i, j;
@@ -1280,9 +1255,7 @@ msg(const char *fmt, ...)
#endif /* RRESTORE */
static u_char *
-swabshort(sp, n)
- u_char *sp;
- int n;
+swabshort(u_char *sp, int n)
{
char c;
@@ -1294,9 +1267,7 @@ swabshort(sp, n)
}
static u_char *
-swablong(sp, n)
- u_char *sp;
- int n;
+swablong(u_char *sp, int n)
{
char c;
@@ -1309,8 +1280,7 @@ swablong(sp, n)
}
void
-swabst(cp, sp)
- u_char *cp, *sp;
+swabst(u_char *cp, u_char *sp)
{
int n = 0;
@@ -1345,8 +1315,7 @@ swabst(cp, sp)
}
static u_long
-swabl(x)
- u_long x;
+swabl(u_long x)
{
swabst((u_char *)"l", (u_char *)&x);
return (x);