OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [stdio/] [fwalk.c] - Blame information for rev 1773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1010 ivang
/* No user fns here.  Pesch 15apr92. */
2
 
3
/*
4
 * Copyright (c) 1990 The Regents of the University of California.
5
 * All rights reserved.
6
 *
7
 * Redistribution and use in source and binary forms are permitted
8
 * provided that the above copyright notice and this paragraph are
9
 * duplicated in all such forms and that any documentation,
10
 * advertising materials, and other materials related to such
11
 * distribution and use acknowledge that the software was developed
12
 * by the University of California, Berkeley.  The name of the
13
 * University may not be used to endorse or promote products derived
14
 * from this software without specific prior written permission.
15
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18
 */
19
 
20
#if defined(LIBC_SCCS) && !defined(lint)
21
static char sccsid[] = "%W% (Berkeley) %G%";
22
#endif /* LIBC_SCCS and not lint */
23
 
24
#include <stdio.h>
25
#include <stdlib.h>
26
#include <errno.h>
27
#include "local.h"
28
 
29
int
30
_fwalk (ptr, function)
31
     struct _reent *ptr;
32
     register int (*function) ();
33
{
34
  register FILE *fp;
35
  register int n, ret = 0;
36
  register struct _glue *g;
37
 
38
  for (g = &ptr->__sglue; g != NULL; g = g->_next)
39
    for (fp = g->_iobs, n = g->_niobs; --n >= 0; fp++)
40
      if (fp->_flags != 0)
41
        ret |= (*function) (fp);
42
  return ret;
43
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.