OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [stdio/] [clearerr.c] - Diff between revs 207 and 345

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
/*
/*
 * Copyright (c) 1990 The Regents of the University of California.
 * Copyright (c) 1990 The Regents of the University of California.
 * All rights reserved.
 * All rights reserved.
 *
 *
 * Redistribution and use in source and binary forms are permitted
 * Redistribution and use in source and binary forms are permitted
 * provided that the above copyright notice and this paragraph are
 * provided that the above copyright notice and this paragraph are
 * duplicated in all such forms and that any documentation,
 * duplicated in all such forms and that any documentation,
 * advertising materials, and other materials related to such
 * advertising materials, and other materials related to such
 * distribution and use acknowledge that the software was developed
 * distribution and use acknowledge that the software was developed
 * by the University of California, Berkeley.  The name of the
 * by the University of California, Berkeley.  The name of the
 * University may not be used to endorse or promote products derived
 * University may not be used to endorse or promote products derived
 * from this software without specific prior written permission.
 * from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */
 */
 
 
/*
/*
FUNCTION
FUNCTION
<<clearerr>>---clear file or stream error indicator
<<clearerr>>---clear file or stream error indicator
 
 
INDEX
INDEX
        clearerr
        clearerr
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <stdio.h>
        #include <stdio.h>
        void clearerr(FILE *<[fp]>);
        void clearerr(FILE *<[fp]>);
 
 
TRAD_SYNOPSIS
TRAD_SYNOPSIS
        #include <stdio.h>
        #include <stdio.h>
        void clearerr(<[fp]>)
        void clearerr(<[fp]>)
        FILE *<[fp]>;
        FILE *<[fp]>;
 
 
DESCRIPTION
DESCRIPTION
The <<stdio>> functions maintain an error indicator with each file
The <<stdio>> functions maintain an error indicator with each file
pointer <[fp]>, to record whether any read or write errors have
pointer <[fp]>, to record whether any read or write errors have
occurred on the associated file or stream.  Similarly, it maintains an
occurred on the associated file or stream.  Similarly, it maintains an
end-of-file indicator to record whether there is no more data in the
end-of-file indicator to record whether there is no more data in the
file.
file.
 
 
Use <<clearerr>> to reset both of these indicators.
Use <<clearerr>> to reset both of these indicators.
 
 
See <<ferror>> and <<feof>> to query the two indicators.
See <<ferror>> and <<feof>> to query the two indicators.
 
 
 
 
RETURNS
RETURNS
<<clearerr>> does not return a result.
<<clearerr>> does not return a result.
 
 
PORTABILITY
PORTABILITY
ANSI C requires <<clearerr>>.
ANSI C requires <<clearerr>>.
 
 
No supporting OS subroutines are required.
No supporting OS subroutines are required.
*/
*/
 
 
#include <_ansi.h>
#include <_ansi.h>
#include <stdio.h>
#include <stdio.h>
#include "local.h"
#include "local.h"
 
 
/* A subroutine version of the macro clearerr.  */
/* A subroutine version of the macro clearerr.  */
 
 
#undef  clearerr
#undef  clearerr
 
 
_VOID
_VOID
_DEFUN(clearerr, (fp),
_DEFUN(clearerr, (fp),
       FILE * fp)
       FILE * fp)
{
{
  CHECK_INIT(_REENT, fp);
  CHECK_INIT(_REENT, fp);
  _flockfile (fp);
  _flockfile (fp);
  __sclearerr (fp);
  __sclearerr (fp);
  _funlockfile (fp);
  _funlockfile (fp);
}
}
 
 

powered by: WebSVN 2.1.0

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