summaryrefslogtreecommitdiff
path: root/lib/libc/gen/fts.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-11 21:03:11 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-11 21:03:11 +0000
commit4dba6a5e639357ec5b17c397ad648b7c98e3ba12 (patch)
tree108501f056c58743e71328f45cbc63154295e75a /lib/libc/gen/fts.c
parente9c67dcf958b38635d2c444765b8d17227635cc5 (diff)
ansification; checked by pval
Diffstat (limited to 'lib/libc/gen/fts.c')
-rw-r--r--lib/libc/gen/fts.c68
1 files changed, 18 insertions, 50 deletions
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index a64b3fa15a6..a65dd4c5b4b 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fts.c,v 1.33 2003/06/02 20:18:34 millert Exp $ */
+/* $OpenBSD: fts.c,v 1.34 2003/06/11 21:03:10 deraadt Exp $ */
/*-
* Copyright (c) 1990, 1993, 1994
@@ -33,7 +33,7 @@
#if 0
static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
#else
-static char rcsid[] = "$OpenBSD: fts.c,v 1.33 2003/06/02 20:18:34 millert Exp $";
+static char rcsid[] = "$OpenBSD: fts.c,v 1.34 2003/06/11 21:03:10 deraadt Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -73,10 +73,8 @@ static int fts_safe_changedir(FTS *, FTSENT *, int, char *);
#define BREAD 3 /* fts_read */
FTS *
-fts_open(argv, options, compar)
- char * const *argv;
- int options;
- int (*compar)(const FTSENT **, const FTSENT **);
+fts_open(char * const *argv, int options,
+ int (*compar)(const FTSENT **, const FTSENT **))
{
FTS *sp;
FTSENT *p, *root;
@@ -182,9 +180,7 @@ mem1: free(sp);
}
static void
-fts_load(sp, p)
- FTS *sp;
- FTSENT *p;
+fts_load(FTS *sp, FTSENT *p)
{
size_t len;
char *cp;
@@ -208,8 +204,7 @@ fts_load(sp, p)
}
int
-fts_close(sp)
- FTS *sp;
+fts_close(FTS *sp)
{
FTSENT *freep, *p;
int saved_errno = 0;
@@ -263,8 +258,7 @@ fts_close(sp)
? p->fts_pathlen - 1 : p->fts_pathlen)
FTSENT *
-fts_read(sp)
- FTS *sp;
+fts_read(FTS *sp)
{
FTSENT *p, *tmp;
int instr;
@@ -459,10 +453,7 @@ name: t = sp->fts_path + NAPPEND(p->fts_parent);
*/
/* ARGSUSED */
int
-fts_set(sp, p, instr)
- FTS *sp;
- FTSENT *p;
- int instr;
+fts_set(FTS *sp, FTSENT *p, int instr)
{
if (instr && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
instr != FTS_NOINSTR && instr != FTS_SKIP) {
@@ -474,9 +465,7 @@ fts_set(sp, p, instr)
}
FTSENT *
-fts_children(sp, instr)
- FTS *sp;
- int instr;
+fts_children(FTS *sp, int instr)
{
FTSENT *p;
int fd;
@@ -556,9 +545,7 @@ fts_children(sp, instr)
* been found, cutting the stat calls by about 2/3.
*/
static FTSENT *
-fts_build(sp, type)
- FTS *sp;
- int type;
+fts_build(FTS *sp, int type)
{
struct dirent *dp;
FTSENT *p, *head;
@@ -812,10 +799,7 @@ mem1: saved_errno = errno;
}
static u_short
-fts_stat(sp, p, follow)
- FTS *sp;
- FTSENT *p;
- int follow;
+fts_stat(FTS *sp, FTSENT *p, int follow)
{
FTSENT *t;
dev_t dev;
@@ -895,10 +879,7 @@ err: memset(sbp, 0, sizeof(struct stat));
}
static FTSENT *
-fts_sort(sp, head, nitems)
- FTS *sp;
- FTSENT *head;
- int nitems;
+fts_sort(FTS *sp, FTSENT *head, int nitems)
{
FTSENT **ap, *p;
@@ -933,10 +914,7 @@ fts_sort(sp, head, nitems)
}
static FTSENT *
-fts_alloc(sp, name, namelen)
- FTS *sp;
- char *name;
- size_t namelen;
+fts_alloc(FTS *sp, char *name, size_t namelen)
{
FTSENT *p;
size_t len;
@@ -967,8 +945,7 @@ fts_alloc(sp, name, namelen)
}
static void
-fts_lfree(head)
- FTSENT *head;
+fts_lfree(FTSENT *head)
{
FTSENT *p;
@@ -986,9 +963,7 @@ fts_lfree(head)
* plus 256 bytes so don't realloc the path 2 bytes at a time.
*/
static int
-fts_palloc(sp, more)
- FTS *sp;
- size_t more;
+fts_palloc(FTS *sp, size_t more)
{
char *p;
@@ -1020,9 +995,7 @@ fts_palloc(sp, more)
* already returned.
*/
static void
-fts_padjust(sp, head)
- FTS *sp;
- FTSENT *head;
+fts_padjust(FTS *sp, FTSENT *head)
{
FTSENT *p;
char *addr = sp->fts_path;
@@ -1046,8 +1019,7 @@ fts_padjust(sp, head)
}
static size_t
-fts_maxarglen(argv)
- char * const *argv;
+fts_maxarglen(char * const *argv)
{
size_t len, max;
@@ -1063,11 +1035,7 @@ fts_maxarglen(argv)
* Assumes p->fts_dev and p->fts_ino are filled in.
*/
static int
-fts_safe_changedir(sp, p, fd, path)
- FTS *sp;
- FTSENT *p;
- int fd;
- char *path;
+fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path)
{
int ret, oerrno, newfd;
struct stat sb;