/*static char *SCCSID = "@(#)initdl.c	6.1 90/11/18";*/
/*static char *SCCSID = "@(#)initdl.c 13.2 90/01/25";*/
#define INIT1 INIT1
#define INCL_DOSERRORS
#include <os2def.h>
#include <bse.h>
#include <fsd.h>
#include "chain.h"
#include "const.h"
#include "misc.h"
#include "buf.h"
#include "dir.h"
#include "storage.h"
#include "fnode.h"
#include "volume.h"
#include "tables.h"
#include "pb_ifs.h"
#include "superb.h"
#include "lw.h"
#include "frame.h"
#include "fsdata.h"
#include "pr_FSINI.h"
#include "pr_debug.h"

void near
InitLookAside ()
{
	ULONG i;		/* counter */

	/*
	 * For each node, initialize the pointer fields, set the checksum
	 * field to 0 and NULL out the pointer to the directory name
	 * and the pointer to the subdir record.
	 */
	for (i = 0; i < DLCNT; i++) {
		memset (&(adlSpace [i]), 0, sizeof (DIRLOOK));
		adlSpace [i].dcpLinks.pBak = &(adlSpace [i - 1]);
		adlSpace [i].dcpLinks.pFwd = &(adlSpace [i + 1]);
		adlSpace [i].cks = (CHECKSUM) 0;
		adlSpace [i].pcpName = (PCRACKEDPATH) NULL;
		adlSpace [i].psbdDir = (PCHAR) NULL;
	}

	/*  Now fix-up the back pointer of the first and the fwd
	 *  pointer of the last and make sure the head links them all in
	 */
	adlSpace [0].dcpLinks.pBak = &dcpDLHead;
	adlSpace [DLCNT - 1].dcpLinks.pFwd = &dcpDLHead;
	dcpDLHead.pFwd = adlSpace + 0;
	dcpDLHead.pBak = adlSpace + DLCNT - 1;
}
