abermud/DATA/
head     1.1;
access   ;
symbols  ;
locks    ; strict;
comment  @ * @;


1.1
date     89.03.13.09.37.25;  author rsalz;  state Exp;
branches ;
next     ;


desc
@@




1.1
log
@Initial revision
@
text
@/* Fast File Controller v0.1 */
#include "kernel.h"
#ifdef	RCSID
static char RCS[] =
	"$Header$";
#endif	/* RCSID */


closeworld()
{
    if (spawned || filrf == NULL)
	return;
    sec_write(filrf, objinfo, 400, 4 * numobs);
    sec_write(filrf, ublock, 350, 16 * 64);
    sec_write(filrf, (int*)shimge, 390, 16);
    sec_write(filrf, (int*)globaldata, 391, 128 * sizeof (short) / sizeof (int));
    closelock(filrf);
    filrf = NULL;
}

FILE *
openworld()
{
    if (spawned)
	return NULL;
    if (filrf != NULL)
	return filrf;
    if ((filrf = openlock(UNIVERSE, "r+")) == NULL)
	crapup("Cannot find World file");
    sec_read(filrf, objinfo, 400, 4 * numobs);
    sec_read(filrf, ublock, 350, 16 * 64);
    sec_read(filrf, (int*)globaldata, 391, 128 * sizeof (short) / sizeof (int));
    sec_read(filrf, (int*)shimge, 390, 16);
    return filrf;
}
@