# include	"llist.h"

List_p
ll_hook(hp, lp)
Head_p	hp;
List_p	lp;
{	register List_p lp1;

	LIST_INCR(ll_hook);
	ll_hmagic(hp);
	ll_magic(lp);

	if (hp->ll_next == NULL) {
		hp->ll_next = lp;
		return lp;
		}

	for (lp1 = hp->ll_next; lp1->ll_next; )
		lp1 = lp1->ll_next;

	lp1->ll_next = lp;
	lp->ll_prev = lp1;

	return lp;
}
