/* Copyright (c) 1979 Regents of the University of California */
static char sccsid
[] = "@(#)RESET.c 1.1 10/29/80";
RESET(filep
, name
, maxnamlen
, datasize
)
register struct iorec
*filep
;
if (name
== NULL
&& filep
== INPUT
&& filep
->fname
[0] == '\0') {
if (rewind(filep
->fbuf
)) {
ERROR(ESEEK
, 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
);
ERROR(EOPEN
, filep
->pfname
);
filep
->funit
|= (SYNC
| FREAD
);
if (filep
->fblk
> PREDEF
) {
setbuf(filep
->fbuf
, &filep
->buf
[0]);