diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-03 22:32:35 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-03 22:32:35 +0000 |
commit | a9a4354fed4cec65ca359fe04095a7a7d4823a8a (patch) | |
tree | 0fedc69061ae9a279d3db23f185ff0b038a706d9 /sbin/ncheck_ffs | |
parent | 4c287e033bc1d7be66ec3f6c6735246a781a9e08 (diff) |
ansi
Diffstat (limited to 'sbin/ncheck_ffs')
-rw-r--r-- | sbin/ncheck_ffs/ncheck_ffs.c | 63 |
1 files changed, 20 insertions, 43 deletions
diff --git a/sbin/ncheck_ffs/ncheck_ffs.c b/sbin/ncheck_ffs/ncheck_ffs.c index a6a236b4a74..f814ce68d0e 100644 --- a/sbin/ncheck_ffs/ncheck_ffs.c +++ b/sbin/ncheck_ffs/ncheck_ffs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ncheck_ffs.c,v 1.11 2002/05/22 08:21:02 deraadt Exp $ */ +/* $OpenBSD: ncheck_ffs.c,v 1.12 2002/07/03 22:32:33 deraadt Exp $ */ /*- * Copyright (c) 1995, 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> @@ -31,7 +31,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: ncheck_ffs.c,v 1.11 2002/05/22 08:21:02 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: ncheck_ffs.c,v 1.12 2002/07/03 22:32:33 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -91,8 +91,7 @@ char *rawname(char *); * Check to see if the indicated inodes are the same */ int -matchino(key, val) - const void *key, *val; +matchino(const void *key, const void *val) { ino_t k = *(ino_t *)key; ino_t v = *(ino_t *)val; @@ -107,8 +106,7 @@ matchino(key, val) /* * Check if the indicated inode match the entry in the cache */ -int matchcache(key, val) - const void *key, *val; +int matchcache(const void *key, const void *val) { ino_t ino = *(ino_t *)key; struct icache_s *ic = (struct icache_s *)val; @@ -124,9 +122,7 @@ int matchcache(key, val) * Add an inode to the cached entries */ void -cacheino(ino, ip) - ino_t ino; - struct dinode *ip; +cacheino(ino_t ino, struct dinode *ip) { if (nicache) icache = realloc(icache, (nicache + 1) * sizeof(struct icache_s)); @@ -140,12 +136,12 @@ cacheino(ino, ip) * Get a cached inode */ struct dinode * -cached(ino) - ino_t ino; +cached(ino_t ino) { struct icache_s *ic; - ic = (struct icache_s *)bsearch(&ino, icache, nicache, sizeof(struct icache_s), matchcache); + ic = (struct icache_s *)bsearch(&ino, icache, nicache, + sizeof(struct icache_s), matchcache); return ic ? &ic->di : NULL; } @@ -155,8 +151,7 @@ cached(ino) * inodes pointing to directories */ void -findinodes(maxino) - ino_t maxino; +findinodes(ino_t maxino) { ino_t ino; struct dinode *dp; @@ -183,8 +178,7 @@ findinodes(maxino) * per cylinder group */ struct dinode * -getino(inum) - ino_t inum; +getino(ino_t inum) { static struct dinode *itab = NULL; static daddr_t iblk = -1; @@ -214,10 +208,7 @@ int breaderrors = 0; #define BREADEMAX 32 void -bread(blkno, buf, size) - daddr_t blkno; - char *buf; - int size; +bread(daddr_t blkno, char *buf, int size) { int cnt, i; @@ -271,8 +262,7 @@ loop: * Add an inode to the in-memory list of inodes to dump */ void -addinode(ino) - ino_t ino; +addinode(ino_t ino) { if (ninodes) ilist = realloc(ilist, sizeof(ino_t) * (ninodes + 1)); @@ -288,9 +278,7 @@ addinode(ino) * Scan the directory pointer at by ino */ void -scanonedir(ino, path) - ino_t ino; - const char *path; +scanonedir(ino_t ino, const char *path) { struct dinode *dp; long filesize; @@ -317,12 +305,8 @@ scanonedir(ino, path) * require the directory to be dumped. */ void -dirindir(ino, blkno, ind_level, filesize, path) - ino_t ino; - daddr_t blkno; - int ind_level; - long *filesize; - const char *path; +dirindir(ino_t ino, daddr_t blkno, int ind_level, long *filesize, + const char *path) { daddr_t idblk[MAXBSIZE / sizeof(daddr_t)]; int i; @@ -352,12 +336,8 @@ dirindir(ino, blkno, ind_level, filesize, path) * Pass inodes pointing to directories back to scanonedir(). */ void -searchdir(ino, blkno, size, filesize, path) - ino_t ino; - daddr_t blkno; - long size; - long filesize; - const char *path; +searchdir(ino_t ino, daddr_t blkno, long size, long filesize, + const char *path) { char dblk[MAXBSIZE]; struct direct *dp; @@ -411,8 +391,7 @@ searchdir(ino, blkno, size, filesize, path) } char * -rawname(name) - char *name; +rawname(char *name) { static char newname[MAXPATHLEN]; char *p; @@ -428,16 +407,14 @@ rawname(name) } void -usage() +usage(void) { fprintf(stderr, "Usage: ncheck_ffs [-i numbers] [-ams] filesystem\n"); exit(3); } int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { struct stat stblock; struct fstab *fsp; |