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) 12 static char sccsid[] = "@(#)fwalk.c 5.1 (Berkeley) 01/20/91"; 13 #endif /* LIBC_SCCS and not lint */ 14 15 #include <stdio.h> 16 #include <stdlib.h> 17 #include <errno.h> 18 #include "local.h" 19 #include "glue.h" 20 21 _fwalk(function) 22 register int (*function)(); 23 { 24 register FILE *fp; 25 register int n, ret; 26 register struct glue *g; 27 28 ret = 0; 29 for (g = &__sglue; g != NULL; g = g->next) 30 for (fp = g->iobs, n = g->niobs; --n >= 0; fp++) 31 if (fp->_flags != 0) 32 ret |= (*function)(fp); 33 return (ret); 34 } 35