Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / groff / src / preproc / grn / hpoint.cpp
blobc40cf9f01fc6a6868a847ff035fa17582c2acc14
1 /* $NetBSD$ */
3 /* Last non-groff version: hpoint.c 1.1 84/10/08 */
5 /*
6 * This file contains routines for manipulating the point data structures
7 * for the gremlin picture editor.
8 */
10 #include <stdlib.h>
11 #include "gprint.h"
15 * Return pointer to empty point list.
17 POINT *
18 PTInit()
20 return ((POINT *) NULL);
25 * This routine creates a new point with coordinates x and y and links it
26 * into the pointlist.
28 POINT *
29 PTMakePoint(double x,
30 double y,
31 POINT **pplist)
33 register POINT *pt;
35 if (Nullpoint(pt = *pplist)) { /* empty list */
36 *pplist = (POINT *) malloc(sizeof(POINT));
37 pt = *pplist;
38 } else {
39 while (!Nullpoint(pt->nextpt))
40 pt = pt->nextpt;
41 pt->nextpt = (POINT *) malloc(sizeof(POINT));
42 pt = pt->nextpt;
45 pt->x = x;
46 pt->y = y;
47 pt->nextpt = PTInit();
48 return (pt);
49 } /* end PTMakePoint */
51 /* EOF */