/*static char *SCCSID = "@(#)insfirst.c	6.1 90/11/18";*/
/*static char *SCCSID = "@(#)insfirst.c	13.2 90/01/25";*/
#include <os2.h>
#include "const.h"
#include "misc.h"
#include "chain.h"
#include "buf.h"
#include "dir.h"
#include "storage.h"

#include "volume.h"

#include "tables.h"

#include "pr_MISC.h"


/*
 ***	InsFirst - inserts the node in question to the beginning of the
 *		sibling chain.  The actual result is that the node to
 *		move is inserted in the chain before the head pointer.
 *
 *	ENTRY	psbdHead - pointer to 1st node.
 *		psbdToIns - pointer to the sibling that is in the chain.
 *
 *	EXIT	None
 */

void
InsFirst (pdcpHead, pdcpToIns)
PDOUBLYCHAINEDPTRS pdcpHead;	/* parent subdir struct */
PDOUBLYCHAINEDPTRS pdcpToIns;	/* kid to move to front of chain */
{
	/* put node before head */
	((PDOUBLYCHAINEDPTRS) (pdcpHead -> pBak)) -> pFwd = pdcpToIns;
	pdcpToIns -> pBak = pdcpHead -> pBak;
	pdcpToIns -> pFwd = pdcpHead;
	pdcpHead -> pBak = pdcpToIns;
}
