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/] [rewind.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
<<rewind>>---reinitialize a file or stream
<<rewind>>---reinitialize a file or stream
 
 
INDEX
INDEX
        rewind
        rewind
INDEX
INDEX
        _rewind_r
        _rewind_r
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <stdio.h>
        #include <stdio.h>
        void rewind(FILE *<[fp]>);
        void rewind(FILE *<[fp]>);
        void _rewind_r(struct _reent *<[ptr]>, FILE *<[fp]>);
        void _rewind_r(struct _reent *<[ptr]>, FILE *<[fp]>);
 
 
TRAD_SYNOPSIS
TRAD_SYNOPSIS
        #include <stdio.h>
        #include <stdio.h>
        void rewind(<[fp]>)
        void rewind(<[fp]>)
        FILE *<[fp]>;
        FILE *<[fp]>;
 
 
        void _rewind_r(<[ptr]>, <[fp]>)
        void _rewind_r(<[ptr]>, <[fp]>)
        struct _reent *<[ptr]>;
        struct _reent *<[ptr]>;
        FILE *<[fp]>;
        FILE *<[fp]>;
 
 
DESCRIPTION
DESCRIPTION
<<rewind>> returns the file position indicator (if any) for the file
<<rewind>> returns the file position indicator (if any) for the file
or stream identified by <[fp]> to the beginning of the file.  It also
or stream identified by <[fp]> to the beginning of the file.  It also
clears any error indicator and flushes any pending output.
clears any error indicator and flushes any pending output.
 
 
RETURNS
RETURNS
<<rewind>> does not return a result.
<<rewind>> does not return a result.
 
 
PORTABILITY
PORTABILITY
ANSI C requires <<rewind>>.
ANSI C requires <<rewind>>.
 
 
No supporting OS subroutines are required.
No supporting OS subroutines are required.
*/
*/
 
 
#if defined(LIBC_SCCS) && !defined(lint)
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "%W% (Berkeley) %G%";
static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
#endif /* LIBC_SCCS and not lint */
 
 
#include <_ansi.h>
#include <_ansi.h>
#include <reent.h>
#include <reent.h>
#include <stdio.h>
#include <stdio.h>
 
 
_VOID
_VOID
_DEFUN(_rewind_r, (ptr, fp),
_DEFUN(_rewind_r, (ptr, fp),
       struct _reent * ptr _AND
       struct _reent * ptr _AND
       register FILE * fp)
       register FILE * fp)
{
{
  _CAST_VOID _fseek_r (ptr, fp, 0L, SEEK_SET);
  _CAST_VOID _fseek_r (ptr, fp, 0L, SEEK_SET);
  clearerr (fp);
  clearerr (fp);
}
}
 
 
#ifndef _REENT_ONLY
#ifndef _REENT_ONLY
 
 
_VOID
_VOID
_DEFUN(rewind, (fp),
_DEFUN(rewind, (fp),
       register FILE * fp)
       register FILE * fp)
{
{
  _rewind_r (_REENT, fp);
  _rewind_r (_REENT, fp);
}
}
 
 
#endif /* !_REENT_ONLY */
#endif /* !_REENT_ONLY */
 
 

powered by: WebSVN 2.1.0

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