示例#1
0
/*
 *  Initialize and sort the name and code tables. Allocate space for the
 *  value tables.
 */
static void
inittables(void)
{
	unsigned int i;

	for (i = 0; boolnames [i]; i++)
		;
	boolval[0] = (char *)malloc(i * sizeof (char));
	boolval[1] = (char *)malloc(i * sizeof (char));
	boolcount = i;
	sorttable(boolnames, boolcodes);

	for (i = 0; numcodes [i]; i++)
		;
	numval[0] = (short *)malloc(i * sizeof (short));
	numval[1] = (short *)malloc(i * sizeof (short));
	numcount = i;
	sorttable(numnames, numcodes);

	for (i = 0; strcodes [i]; i++)
		;
	strval[0] = (char **)malloc(i * sizeof (char *));
	strval[1] = (char **)malloc(i * sizeof (char *));
	strcount = i;
	sorttable(strnames, strcodes);
}
示例#2
0
void polyfill::fillpol()
{
//	clrscr();
	int temp,i;
	getch();
	clearviewport();
 //	int edge[20][4];
	cout<<"y1 \t y2 \tx1 \t x2\n";
	for(i=0;i<2*n;i=i+2)
	{
		edge[i][0] = poly[i+1];
		edge[i][1] = poly[i+3];
		edge[i][2] = poly[i];
		edge[i][3] = poly[i+2];
		cout<<edge[i][0]<<"\t"<<edge[i][1]<<"\t"<<edge[i][2]<<"\t"<<edge[i][3]<<"\n";
	}
	cout<<"===========================\n";

       //	clearviewport();
	sorttable();
}