diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-07-17 02:14:34 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-07-17 02:14:34 +0000 |
commit | 777e443a4907c980d426ece9a6f7cdb21fea4f1b (patch) | |
tree | c7899405ab91d9f045012553ebfb1b8f7300f21b /sbin/fsck_msdos/dir.c | |
parent | 5757b9a265e6ab7af9c725d74bf16cbf90747d02 (diff) |
some ansi; khalek@linuxgamers.net
Diffstat (limited to 'sbin/fsck_msdos/dir.c')
-rw-r--r-- | sbin/fsck_msdos/dir.c | 77 |
1 files changed, 21 insertions, 56 deletions
diff --git a/sbin/fsck_msdos/dir.c b/sbin/fsck_msdos/dir.c index b3a48146c68..589dfddd212 100644 --- a/sbin/fsck_msdos/dir.c +++ b/sbin/fsck_msdos/dir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dir.c,v 1.18 2003/07/29 18:38:35 deraadt Exp $ */ +/* $OpenBSD: dir.c,v 1.19 2004/07/17 02:14:33 deraadt Exp $ */ /* $NetBSD: dir.c,v 1.11 1997/10/17 11:19:35 ws Exp $ */ /* @@ -37,7 +37,7 @@ #ifndef lint -static char rcsid[] = "$OpenBSD: dir.c,v 1.18 2003/07/29 18:38:35 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: dir.c,v 1.19 2004/07/17 02:14:33 deraadt Exp $"; #endif /* not lint */ #include <stdio.h> @@ -112,7 +112,7 @@ static int readDosDirSection(int, struct bootblock *, struct fatEntry *, static struct dosDirEntry *freede; static struct dosDirEntry * -newDosDirEntry() +newDosDirEntry(void) { struct dosDirEntry *de; @@ -125,8 +125,7 @@ newDosDirEntry() } static void -freeDosDirEntry(de) - struct dosDirEntry *de; +freeDosDirEntry(struct dosDirEntry *de) { de->next = freede; freede = de; @@ -138,7 +137,7 @@ freeDosDirEntry(de) static struct dirTodoNode *freedt; static struct dirTodoNode * -newDirTodo() +newDirTodo(void) { struct dirTodoNode *dt; @@ -151,8 +150,7 @@ newDirTodo() } static void -freeDirTodo(dt) - struct dirTodoNode *dt; +freeDirTodo(struct dirTodoNode *dt) { dt->next = freedt; freedt = dt; @@ -167,8 +165,7 @@ struct dirTodoNode *pendingDirectories = NULL; * Return the full pathname for a directory entry. */ static char * -fullpath(dir) - struct dosDirEntry *dir; +fullpath(struct dosDirEntry *dir) { static char namebuf[MAXPATHLEN + 1]; char *cp, *np; @@ -198,8 +195,7 @@ fullpath(dir) * Calculate a checksum over an 8.3 alias name */ static u_char -calcShortSum(p) - u_char *p; +calcShortSum(u_char *p) { u_char sum = 0; int i; @@ -226,9 +222,7 @@ static struct dosDirEntry *lostDir; * Init internal state for a new directory scan. */ int -resetDosDirSection(boot, fat) - struct bootblock *boot; - struct fatEntry *fat; +resetDosDirSection(struct bootblock *boot, struct fatEntry *fat) { int b1, b2; cl_t cl; @@ -281,7 +275,7 @@ resetDosDirSection(boot, fat) * Cleanup after a directory scan */ void -finishDosDirSection() +finishDosDirSection(void) { struct dirTodoNode *p, *np; struct dosDirEntry *d, *nd; @@ -311,15 +305,8 @@ finishDosDirSection() * Delete directory entries between startcl, startoff and endcl, endoff. */ static int -delete(f, boot, fat, startcl, startoff, endcl, endoff, notlast) - int f; - struct bootblock *boot; - struct fatEntry *fat; - cl_t startcl; - int startoff; - cl_t endcl; - int endoff; - int notlast; +delete(int f, struct bootblock *boot, struct fatEntry *fat, cl_t startcl, + int startoff, cl_t endcl, int endoff, int notlast) { u_char *s, *e; off_t off; @@ -358,17 +345,8 @@ delete(f, boot, fat, startcl, startoff, endcl, endoff, notlast) } static int -removede(f, boot, fat, start, end, startcl, endcl, curcl, path, type) - int f; - struct bootblock *boot; - struct fatEntry *fat; - u_char *start; - u_char *end; - cl_t startcl; - cl_t endcl; - cl_t curcl; - char *path; - int type; +removede(int f, struct bootblock *boot, struct fatEntry *fat, u_char *start, + u_char *end, cl_t startcl, cl_t endcl, cl_t curcl, char *path, int type) { switch (type) { case 0: @@ -402,11 +380,8 @@ removede(f, boot, fat, start, end, startcl, endcl, curcl, path, type) * Check an in-memory file entry */ static int -checksize(boot, fat, p, dir) - struct bootblock *boot; - struct fatEntry *fat; - u_char *p; - struct dosDirEntry *dir; +checksize(struct bootblock *boot, struct fatEntry *fat, u_char *p, + struct dosDirEntry *dir) { /* * Check size on ordinary files @@ -457,11 +432,8 @@ checksize(boot, fat, p, dir) * - push directories onto the todo-stack */ static int -readDosDirSection(f, boot, fat, dir) - int f; - struct bootblock *boot; - struct fatEntry *fat; - struct dosDirEntry *dir; +readDosDirSection(int f, struct bootblock *boot, struct fatEntry *fat, + struct dosDirEntry *dir) { struct dosDirEntry dirent, *d; u_char *p, *vallfn, *invlfn, *empty; @@ -880,10 +852,7 @@ readDosDirSection(f, boot, fat, dir) } int -handleDirTree(dosfs, boot, fat) - int dosfs; - struct bootblock *boot; - struct fatEntry *fat; +handleDirTree(int dosfs, struct bootblock *boot, struct fatEntry *fat) { int mod; @@ -937,11 +906,7 @@ static cl_t lfcl; static off_t lfoff; int -reconnect(dosfs, boot, fat, head) - int dosfs; - struct bootblock *boot; - struct fatEntry *fat; - cl_t head; +reconnect(int dosfs, struct bootblock *boot, struct fatEntry *fat, cl_t head) { struct dosDirEntry d; u_char *p; @@ -1023,7 +988,7 @@ reconnect(dosfs, boot, fat, head) } void -finishlf() +finishlf(void) { if (lfbuf) free(lfbuf); |