#ifndef lint
static char *RCSid = "$Header: initfiles.c,v 1.5 90/03/19 10:40:43 mr-frog Exp $";
#endif

/*
 * initfiles.c
 *
 * Dave Pare, 1989
 */

#include "misc.h"
#include "nat.h"
#include "file.h"
#include <fcntl.h>

initfiles()
{
	struct	natstr *np;
	int	i;

	if (ef_open(EF_NATION, O_RDWR, EFF_MEM) < 0) {
		logerror("nation file");
		cleanup(1);
	}
	/*
	 * set logins of everybody to zero
	 */
	for (i=0; np = getnatp(i); i++)
		np->nat_login = 0;
	if (ef_close(EF_NATION) < 0) {
		logerror("nation file initial write");
		cleanup(1);
	}
	(void) ef_open(EF_NATION, O_RDWR, EFF_MEM);
	if (ef_open(EF_NEWS, O_RDWR, 0) < 0) {
		logerror("news file initial open");
		cleanup(1);
	}
}
