From: Ralph Campbell Date: Tue, 9 Oct 1984 07:29:20 +0000 (-0800) Subject: date and time created 84/10/08 15:29:20 by ralph X-Git-Tag: BSD-4_3-Snapshot-Development~9441 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/95d6cf23c9bd4d919f14e47d35dbce31b0d1111f date and time created 84/10/08 15:29:20 by ralph SCCS-vsn: local/ditroff/ditroff.old.okeeffe/grn/hpoint.c 1.1 --- diff --git a/usr/src/local/ditroff/ditroff.old.okeeffe/grn/hpoint.c b/usr/src/local/ditroff/ditroff.old.okeeffe/grn/hpoint.c new file mode 100644 index 0000000000..c7f843e8db --- /dev/null +++ b/usr/src/local/ditroff/ditroff.old.okeeffe/grn/hpoint.c @@ -0,0 +1,50 @@ +/* hpoint.c 1.1 84/10/08 */ +/* + * This file contains routines for manipulating the point data + * structures for the gremlin picture editor. + */ + +#include "gprint.h" + +/* imports from C */ + +extern char *malloc(); + + +/* + * Return pointer to empty point list. + */ +POINT * +PTInit() +{ + return((POINT *) NULL); +} + + +/* + * This routine creates a new point with coordinates x and y and + * links it into the pointlist. + */ +POINT * +PTMakePoint(x, y, pplist) +float x, y; +POINT **pplist; +{ + register POINT *point; + + if (Nullpoint(point = *pplist)) { /* empty list */ + *pplist = (POINT *) malloc(sizeof(POINT)); + point = *pplist; + } + else { + while (!Nullpoint(point->nextpt)) + point = point->nextpt; + point->nextpt = (POINT *) malloc(sizeof(POINT)); + point = point->nextpt; + } + + point->x = x; + point->y = y; + point->nextpt = PTInit(); + return(point); +} /* end PTMakePoint */