gcc/libf2c/libI77/rewind.c
Toon Moene 7e29b2612a Makefile.in: Update config.h dependencies.
2001-07-07  Toon Moene  <toon@moene.indiv.nluug.nl>

	* libI77/Makefile.in: Update config.h dependencies.
	* libI77/configure.in: Define _XOPEN_SOURCE and
	_FILE_OFFSET_BITS unconditionally.
	* libI77/configure: Rebuilt.
	* libI77/config.h.in: Rebuilt.
	* libI77/endfile.c (t_runc): Replace rewind by FSEEK.
	* libI77/err.c (f__nowwriting): The type of `loc' is off_t.
	* libI77/open.c (f_open): Replace rewind by FSEEK.
	* libI77/rewind.c: Include config.h.  (f_rew): Replace
	rewind by FSEEK.
	* libI77/sfe.c: Include config.h.
	* libI77/wsfe.c: Ditto.
	* libU77/configure.in: Define _XOPEN_SOURCE and
	_FILE_OFFSET_BITS unconditionally.
	* libU77/configure: Rebuilt.
	* libU77/config.hin: Rebuilt.

From-SVN: r43841
2001-07-07 18:51:58 +00:00

28 lines
494 B
C

#include "config.h"
#include "f2c.h"
#include "fio.h"
#ifdef KR_headers
integer f_rew(a) alist *a;
#else
integer f_rew(alist *a)
#endif
{
unit *b;
if (f__init & 2)
f__fatal (131, "I/O recursion");
if(a->aunit>=MXUNIT || a->aunit<0)
err(a->aerr,101,"rewind");
b = &f__units[a->aunit];
if(b->ufd == NULL || b->uwrt == 3)
return(0);
if(!b->useek)
err(a->aerr,106,"rewind");
if(b->uwrt) {
(void) t_runc(a);
b->uwrt = 3;
}
FSEEK(b->ufd, 0, SEEK_SET);
b->uend=0;
return(0);
}