DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T c

⟦70fff713f⟧ TextFile

    Length: 1509 (0x5e5)
    Types: TextFile
    Names: »closex.BSD4_n.c«

Derivation

└─⟦060c9c824⟧ Bits:30007080 DKUUG TeX 2/12/89
    └─⟦this⟧ »./tex82/Unsupported/MFpxl/mflib/closex.BSD4_n.c« 
└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12
    └─⟦beba6c409⟧ »unix3.0/Unsupported.tar.Z« 
        └─⟦25c524ae4⟧ 
            └─⟦this⟧ »Unsupported/MFpxl/mflib/closex.BSD4_n.c« 

TextFile

#ifndef lint
static char RCSid[] = "$Header: closex.c,v 1.0 86/01/31 20:56:49 richards Released $";
#endif

/*
** CLOSEX.C: external routines
**	procedure closea(var f: text)		-- close an ascii (text) file
**	procedure closew(var f: wordfile)	-- close a word file
*/

#include "h00vars.h"
#include "mftypes.h"

closea(f)
	text	f;
{
	mf_close((struct iorec *)f);		/* use common close code */
}

closew(f)
	wordfile f;
{
	mf_close((struct iorec *)f);		/* use common close code */
}

/*
**  mf_close(filep)
**	mf_close does the proper things to pc's runtime system
**	file data structure to close a file
*/
mf_close(filep)
register struct iorec *filep;
{
        register struct iorec *next;
        
	if (filep->fbuf != NULL) {
		if ((filep->funit & FDEF) == 0) {
                        next = (struct iorec *) &_fchain;
                        while (next->fchain != FILNIL
                                                  &&  next->fchain != filep)
                                next = next->fchain;
                        if (next->fchain != FILNIL)
                                next->fchain = next->fchain->fchain;
        
			if (filep->fblk > PREDEF) {
				fflush(filep->fbuf);
				setbuf(filep->fbuf, NULL);
			}
			fclose(filep->fbuf);
			if (ferror(filep->fbuf)) {
				ERROR("%s: Close failed\n",
					filep->pfname);
				return;
			}
			filep->fbuf=NULL;
		}
		if ((filep->funit & TEMP) != 0 &&
		    unlink(filep->pfname)) {
			PERROR("Could not remove ", filep->pfname);
			return;
		}
	}
}