new copyright; att/bsd/shared
[unix-history] / usr / src / lib / libc / stdio / fwalk.c
CommitLineData
c9be6cfe
KB
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Chris Torek.
7 *
8 * %sccs.include.redist.c%
9 */
10
11#if defined(LIBC_SCCS) && !defined(lint)
cb631443 12static char sccsid[] = "@(#)fwalk.c 5.2 (Berkeley) %G%";
c9be6cfe
KB
13#endif /* LIBC_SCCS and not lint */
14
c9be6cfe 15#include <errno.h>
cb631443 16#include <stdio.h>
c9be6cfe
KB
17#include "local.h"
18#include "glue.h"
19
20_fwalk(function)
21 register int (*function)();
22{
23 register FILE *fp;
24 register int n, ret;
25 register struct glue *g;
26
27 ret = 0;
28 for (g = &__sglue; g != NULL; g = g->next)
29 for (fp = g->iobs, n = g->niobs; --n >= 0; fp++)
30 if (fp->_flags != 0)
31 ret |= (*function)(fp);
32 return (ret);
33}