/* Copyright (c) 1982 Regents of the University of California */
static char sccsid
[] = "@(#)PFCLOSE.c 1.3 (Berkeley) %G%";
* Close a Pascal file deallocating resources as appropriate.
register struct iorec
*filep
;
if ((filep
->funit
& FDEF
) == 0 && filep
->fbuf
!= NULL
) {
* Have a previous buffer, close associated file.
if (filep
->fblk
> PREDEF
) {
setbuf(filep
->fbuf
, NULL
);
if (ferror(filep
->fbuf
)) {
ERROR("%s: Close failed\n", filep
->pfname
);
* Temporary files are discarded.
if ((filep
->funit
& TEMP
) != 0 && lastuse
&&
PERROR("Could not remove ", filep
->pfname
);
_actfile
[filep
->fblk
] = FILNIL
;