1 /* hpoint.c 1.4 83/07/09 2 * 3 * Copyright -C- 1982 Barry S. Roitblat 4 * 5 * This file contains routines for manipulating the point data 6 * structures for the hard copy programs of the gremlin picture editor. 7 */ 8 9 #include "gprint.h" 10 11 /* imports from c */ 12 13 extern char *malloc(); 14 15 POINT *PTInit() 16 /* 17 * This routine creates a null point and returns a pointer 18 * to it. 19 */ 20 21 { 22 register POINT *pt; 23 24 pt = (POINT *) malloc(sizeof(POINT)); 25 pt->x = nullpt; 26 pt->y = nullpt; 27 return(pt); 28 } /* end PTInit */ 29 30 POINT *PTMakePoint(x, y, pointlist) 31 float x; 32 float y; 33 POINT *(*pointlist); 34 /* 35 * This routine creates a new point with coordinates x and y and 36 * links it into the pointlist. 37 */ 38 39 { 40 register POINT *pt1; 41 42 pt1 = *pointlist; 43 while ( !Nullpoint(pt1) ) { 44 pt1 = pt1->nextpt; 45 } 46 pt1->x = x; 47 pt1->y = y; 48 pt1->nextpt = PTInit(); 49 return(pt1); 50 } /* end MakePoint */ 51 52