/* Copyright (c) 1979 Regents of the University of California */
static char sccsid
[] = "@(#)RESET.c 1.4 %G%";
RESET(filep
, name
, maxnamlen
, datasize
)
register struct iorec
*filep
;
if (name
== NULL
&& filep
== INPUT
&& filep
->fname
[0] == '\0') {
if (fseek(filep
->fbuf
, (long)0, 0)) {
PERROR("Could not reset ", filep
->pfname
);
filep
->funit
&= ~(EOFF
| EOLN
);
filep
= GETNAME(filep
, name
, maxnamlen
, datasize
);
filep
->fbuf
= fopen(filep
->fname
, "r");
if (filep
->fbuf
== NULL
) {
if (filep
->funit
& TEMP
) {
filep
->funit
|= (EOFF
| SYNC
| FREAD
);
PERROR("Could not open ", filep
->pfname
);
filep
->funit
|= (SYNC
| FREAD
);
if (filep
->fblk
> PREDEF
) {
setbuf(filep
->fbuf
, &filep
->buf
[0]);