man.bsd.lv manual page server

Manual Page Search Parameters

GREMLINLIB(8) System Manager's Manual GREMLINLIB(8)

gr_open, gr_close, gr_vector, gr_curve, gr_arc, gr_circle, gr_polygon, gr_text - Gremlin file creation routines

#include <local/gremlin.h>
FILE *gr_open(gremlinfile, device, orientation, x, y)
char *gremlinfile;
int device, orientation;
float x, y;
gr_close(fp)
FILE *fp;
gr_vector(fp, npoints, list, brush)
FILE *fp;
int npoints, brush;
float list[][2];
gr_curve(fp, npoints, list, brush)
FILE *fp;
int npoints, brush;
float list[][2];
gr_arc(fp, cx, cy, sx, sy, angle, brush)
FILE *fp;
float cx, cy, sx, sy, angle;
int brush;
gr_circle(fp, cx, cy, radius, brush)
FILE *fp;
float cx, cy, radius;
int brush;
gr_polygon(fp, npoints, list, border, stipple)
FILE *fp;
int npoints, border, stipple;
float list[][2];
gr_text(fp, text, x, y, font, size, justification)
FILE *fp;
char *text;
float x, y;
int font, size, justification;

These functions are used to generate files suitable for input to Gremlin running on either the AED or a SUN Workstation. Gr_open returns the result of a fopen() call which must be used as an argument (fp) to all other routines. The other routines return either a status of GR_ERROR or GR_OK.

Gr_open opens gremlinfile for writing using the file format for device (SUN_GREMLIN or AED_GREMLIN). Orientation (HORZ_ORIENT or VERT_ORIENT) must be specified, but is ignored on the SUNs. X and y indicate a position to be used when reading the file into another Gremlin picture (on startup (0, 0) is in the lower-left corner). Gr_close will close the Gremlin file, writing a terminator to it.

Gr_vector writes a vector object to the file referenced by fp. Npoints indicates the number of coordinates in list, an array of (x, y) pairs. Brush may be either DOTTED, DOTDASHED, THICK, DASHED, NARROW or MEDIUM.

Gr_curve writes a curve object to the file referenced by fp in the same manner as gr_vector.

Gr_arc writes an arc object to the file referenced by fp. Cx and cy are the coordinates of the arc's center. Sx and sy are the coordinates of one endpoint of the arc. Angle is the number of counter-clockwise degrees in the angle, and brush is as above.

Gr_circle writes a circle object to the file referenced by fp. Cx and cy are the coordinates of the circle's center, and brush is as above.

Gr_polygon writes a polygon object to the file referenced by fp. Npoints indicates the number of coordinates in list, an array of (x, y) pairs of vertices. The polygon's border can have the same styles as a vector's brush. In addition, a zero for this argument means no border. The stipple must be between one and eight.

Gr_text writes a text object to the file referenced by fp containing the string text. The text is placed relative to the position indicated by x and y, using the justification (BOTLEFT, CENTLEFT, TOPLEFT, BOTCENT, CENTCENT, TOPCENT, BOTRIGHT, CENTRIGHT, or TOPRIGHT). The text will be displayed using font (1 - 4) and size (1 - 4).

To use the library, include /usr/include/local/gremlin.h in your source program. Since the library uses math routines, you will need to compile using a sequence such as this:
cc prog.c -lgremlin -lm

Mark Opperman

December 1984 4th Berkeley Distribution