#ifndef lint
static char *RCSid = "$Header: /sequent2/empire/EMP/lib/gen/RCS/queue.c,v 1.3 89/09/18 00:13:00 mr-frog Exp $";
#endif

/*
 * queue.c
 *
 * insque, remque, initque
 *
 */

#include "queue.h"

insque(elem, queue)
	struct	qelem *elem;
	struct	qelem *queue;
{
	struct	qelem *next;

	next = queue->q_forw;
	queue->q_forw = elem;
	elem->q_forw = next;
	elem->q_back = queue;
	next->q_back = elem;
}

remque(elem)
	register struct qelem *elem;
{
	elem->q_forw->q_back = elem->q_back;
	elem->q_back->q_forw = elem->q_forw;
}

initque(elem)
	struct	qelem *elem;
{
	elem->q_forw = elem;
	elem->q_back = elem;
}
