#include "border.c"
/* $Header: /usr/local/dev/postgres/mastertree/newconf/RCS/test_border.c,v 1.3 1989/09/05 16:54:05 mao Version_2 $ */
static
stack_print(sp)
	stack *sp;
{
	for (;sp!=NULL;sp=sp->next)
		printf(" -> %d",sp->datum);
	putchar('\n');
}

static
bw_print()
{
	int i;
	for (i=0;i<NDBUFS;i++) {
		printf("[ %d ]", i);
		stack_print(adjlist[i]);
	}
	putchar('\n');
}

elog()
{
	printf("ERROR\n");
}

main()
{
	struct dbufc	**order;
	int		i;
	static struct dbufc	*data[][2] = {
		1, 2,
		2, 3,
		4,3,
		3,5,
		6,3,
		1,7,
		-1, -1
		};
	
	bwinit();
	for (i = 0; data[i][0]!=(struct dbufc *)(-1) && data[i][1]!=(struct dbufc *)(-1); i++) {
		bworder(data[i][0], data[i][1]);
		bw_print();
	}
	order = bwsort(datlist[2]);
	for (i = 0; i < NDBUFS; i++)
		printf("%d ", order[i]);
	putchar('\n');
}
