os/ossrv/genericopenlibs/cstdlib/LSTDIO/CLEARERR.C
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /* CLEARERR.C
     2  * 
     3  * Portions Copyright (c) 1990-1999 Nokia Corporation and/or its subsidiary(-ies).
     4  * All rights reserved.
     5  */
     6 
     7 /*
     8  * Copyright (c) 1990 The Regents of the University of California.
     9  * All rights reserved.
    10  *
    11  * Redistribution and use in source and binary forms are permitted
    12  * provided that the above copyright notice and this paragraph are
    13  * duplicated in all such forms and that any documentation,
    14  * advertising materials, and other materials related to such
    15  * distribution and use acknowledge that the software was developed
    16  * by the University of California, Berkeley.  The name of the
    17  * University may not be used to endorse or promote products derived
    18  * from this software without specific prior written permission.
    19  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
    20  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
    21  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    22  */
    23 
    24 /*
    25 FUNCTION
    26 <<clearerr>>---clear file or stream error indicator
    27 
    28 INDEX
    29 	clearerr
    30 
    31 ANSI_SYNOPSIS
    32 	#include <stdio.h>
    33 	void clearerr(FILE *<[fp]>);
    34 
    35 TRAD_SYNOPSIS
    36 	#include <stdio.h>
    37 	void clearerr(<[fp]>)
    38 	FILE *<[fp]>;
    39 
    40 DESCRIPTION
    41 The <<stdio>> functions maintain an error indicator with each file
    42 pointer <[fp]>, to record whether any read or write errors have
    43 occurred on the associated file or stream.  Similarly, it maintains an
    44 end-of-file indicator to record whether there is no more data in the
    45 file.
    46 
    47 Use <<clearerr>> to reset both of these indicators.
    48 
    49 See <<ferror>> and <<feof>> to query the two indicators.
    50 
    51 
    52 RETURNS
    53 <<clearerr>> does not return a result.
    54 
    55 PORTABILITY
    56 ANSI C requires <<clearerr>>.
    57 
    58 No supporting OS subroutines are required.
    59 */
    60 
    61 #include <stdio.h>
    62 #include "LOCAL.H"
    63 #undef	clearerr
    64 
    65 /**
    66 Reset error indicators.
    67 Reset error and EOF indicators of the given stream.
    68 @param fp pointer to an open file.
    69 */
    70 EXPORT_C void
    71 clearerr (FILE * fp)
    72 {
    73   __sclearerr (fp);
    74 }