# include	"llist.h"

static char	err_msg1[] = "\nll_magic: null pointer\n";
static char	err_msg2[] = "\nll_magic: bad magic number\n";

void
ll_hmagic(hp)
Head_p	hp;
{
	if (hp == 0) {
		write(2, err_msg1, strlen(err_msg1));
		abort();
		}
	if (hp->ll_magic != LL_HEAD) {
		write(2, err_msg2, strlen(err_msg2));
		abort();
		}
}
void
ll_magic(lp)
List_p	lp;
{
	if (lp == 0) {
		write(2, err_msg1, strlen(err_msg1));
		abort();
		}
	if (lp->ll_magic != LL_LIST) {
		write(2, err_msg2, strlen(err_msg2));
		abort();
		}
}
