dtinfo: Change to ANSI function definitions

This commit is contained in:
Peter Howkins
2018-06-28 04:15:16 +01:00
parent e239c31702
commit 4cf746f177
25 changed files with 203 additions and 660 deletions

View File

@@ -228,8 +228,7 @@ WidgetClass pannerWidgetClass = (WidgetClass) &pannerClassRec;
* *
*****************************************************************************/
static void reset_shadow_gc (pw) /* used when resources change */
PannerWidget pw;
static void reset_shadow_gc (PannerWidget pw) /* used when resources change */
{
XtGCMask valuemask = GCForeground;
XGCValues values;
@@ -270,8 +269,7 @@ static void reset_shadow_gc (pw) /* used when resources change */
pw->panner.shadow_gc = XtGetGC ((Widget) pw, valuemask, &values);
}
static void reset_slider_gc (pw) /* used when resources change */
PannerWidget pw;
static void reset_slider_gc (PannerWidget pw) /* used when resources change */
{
XtGCMask valuemask = GCForeground;
XGCValues values;
@@ -283,8 +281,7 @@ static void reset_slider_gc (pw) /* used when resources change */
pw->panner.slider_gc = XtGetGC ((Widget) pw, valuemask, &values);
}
static void reset_xor_gc (pw) /* used when resources change */
PannerWidget pw;
static void reset_xor_gc (PannerWidget pw) /* used when resources change */
{
if (pw->panner.xor_gc) XtReleaseGC ((Widget) pw, pw->panner.xor_gc);
@@ -308,9 +305,7 @@ static void reset_xor_gc (pw) /* used when resources change */
}
static void check_knob (pw, knob)
register PannerWidget pw;
Boolean knob;
static void check_knob (register PannerWidget pw, Boolean knob)
{
Position pad = pw->panner.internal_border * 2;
Position maxx = (((Position) pw->core.width) - pad -
@@ -340,8 +335,7 @@ static void check_knob (pw, knob)
}
static void move_shadow (pw)
register PannerWidget pw;
static void move_shadow (register PannerWidget pw)
{
if (pw->panner.shadow_thickness > 0) {
int lw = pw->panner.shadow_thickness + pw->panner.line_width * 2;
@@ -366,9 +360,7 @@ static void move_shadow (pw)
pw->panner.shadow_valid = FALSE;
}
static void scale_knob (pw, location, size) /* set knob size and/or loc */
PannerWidget pw;
Boolean location, size;
static void scale_knob (PannerWidget pw, Boolean location, Boolean size) /* set knob size and/or loc */
{
if (location) {
pw->panner.knob_x = (Position) PANNER_HSCALE (pw, pw->panner.slider_x);
@@ -393,8 +385,7 @@ static void scale_knob (pw, location, size) /* set knob size and/or loc */
move_shadow (pw);
}
static void rescale (pw)
PannerWidget pw;
static void rescale (PannerWidget pw)
{
int hpad = pw->panner.internal_border * 2;
int vpad = hpad;
@@ -415,19 +406,14 @@ static void rescale (pw)
}
static void get_default_size (pw, wp, hp)
PannerWidget pw;
Dimension *wp, *hp;
static void get_default_size (PannerWidget pw, Dimension *wp, Dimension *hp)
{
Dimension pad = pw->panner.internal_border * 2;
*wp = PANNER_DSCALE (pw, pw->panner.canvas_width) + pad;
*hp = PANNER_DSCALE (pw, pw->panner.canvas_height) + pad;
}
static Boolean get_event_xy (pw, event, x, y)
PannerWidget pw;
XEvent *event;
int *x, *y;
static Boolean get_event_xy (PannerWidget pw, XEvent *event, int *x, int *y)
{
int pad = pw->panner.internal_border;
@@ -459,10 +445,7 @@ static Boolean get_event_xy (pw, event, x, y)
return FALSE;
}
static int parse_page_string (s, pagesize, canvassize, relative)
register char *s;
int pagesize, canvassize;
Boolean *relative;
static int parse_page_string (register char *s, int pagesize, int canvassize, Boolean *relative)
{
char *cp;
double val = 1.0;
@@ -540,8 +523,7 @@ static int parse_page_string (s, pagesize, canvassize, relative)
*****************************************************************************/
static void Initialize (greq, gnew)
Widget greq, gnew;
static void Initialize (Widget greq, Widget gnew)
{
PannerWidget req = (PannerWidget) greq, new = (PannerWidget) gnew;
Dimension defwidth, defheight;
@@ -579,10 +561,7 @@ static void Initialize (greq, gnew)
}
static void Realize (gw, valuemaskp, attr)
Widget gw;
XtValueMask *valuemaskp;
XSetWindowAttributes *attr;
static void Realize (Widget gw, XtValueMask *valuemaskp, XSetWindowAttributes *attr)
{
PannerWidget pw = (PannerWidget) gw;
Pixmap pm = XtUnspecifiedPixmap;
@@ -605,8 +584,7 @@ static void Realize (gw, valuemaskp, attr)
}
static void Destroy (gw)
Widget gw;
static void Destroy (Widget gw)
{
PannerWidget pw = (PannerWidget) gw;
@@ -615,18 +593,14 @@ static void Destroy (gw)
XtReleaseGC (gw, pw->panner.xor_gc);
}
static void Resize (gw)
Widget gw;
static void Resize (Widget gw)
{
rescale ((PannerWidget) gw);
}
/* ARGSUSED */
static void Redisplay (gw, event, region)
Widget gw;
XEvent *event;
Region region;
static void Redisplay (Widget gw, XEvent *event, Region region)
{
PannerWidget pw = (PannerWidget) gw;
Display *dpy = XtDisplay(gw);
@@ -710,8 +684,7 @@ static void Redisplay (gw, event, region)
/* ARGSUSED */
static Boolean SetValues (gcur, greq, gnew)
Widget gcur, greq, gnew;
static Boolean SetValues (Widget gcur, Widget greq, Widget gnew)
{
PannerWidget cur = (PannerWidget) gcur;
PannerWidget new = (PannerWidget) gnew;
@@ -787,9 +760,7 @@ static Boolean SetValues (gcur, greq, gnew)
return redisplay;
}
static void SetValuesAlmost (gold, gnew, req, reply)
Widget gold, gnew;
XtWidgetGeometry *req, *reply;
static void SetValuesAlmost (Widget gold, Widget gnew, XtWidgetGeometry *req, XtWidgetGeometry *reply)
{
if (reply->request_mode == 0) { /* got turned down, so cope */
Resize (gnew);
@@ -798,9 +769,7 @@ static void SetValuesAlmost (gold, gnew, req, reply)
(gold, gnew, req, reply);
}
static XtGeometryResult QueryGeometry (gw, intended, pref)
Widget gw;
XtWidgetGeometry *intended, *pref;
static XtGeometryResult QueryGeometry (Widget gw, XtWidgetGeometry *intended, XtWidgetGeometry *pref)
{
PannerWidget pw = (PannerWidget) gw;
@@ -826,11 +795,7 @@ static XtGeometryResult QueryGeometry (gw, intended, pref)
*****************************************************************************/
/* ARGSUSED */
static void ActionStart (gw, event, params, num_params)
Widget gw;
XEvent *event;
String *params; /* unused */
Cardinal *num_params; /* unused */
static void ActionStart (Widget gw, XEvent *event, String *params /* unused */, Cardinal *num_params /* unused */)
{
PannerWidget pw = (PannerWidget) gw;
int x, y;
@@ -851,11 +816,7 @@ static void ActionStart (gw, event, params, num_params)
}
/* ARGSUSED */
static void ActionStop (gw, event, params, num_params)
Widget gw;
XEvent *event;
String *params; /* unused */
Cardinal *num_params; /* unused */
static void ActionStop (Widget gw, XEvent *event, String *params /* unused */, Cardinal *num_params /* unused */)
{
PannerWidget pw = (PannerWidget) gw;
int x, y;
@@ -870,11 +831,7 @@ static void ActionStop (gw, event, params, num_params)
}
/* ARGSUSED */
static void ActionAbort (gw, event, params, num_params)
Widget gw;
XEvent *event;
String *params; /* unused */
Cardinal *num_params; /* unused */
static void ActionAbort (Widget gw, XEvent *event, String *params /* unused */, Cardinal *num_params /* unused */)
{
PannerWidget pw = (PannerWidget) gw;
@@ -892,11 +849,7 @@ static void ActionAbort (gw, event, params, num_params)
/* ARGSUSED */
static void ActionMove (gw, event, params, num_params)
Widget gw;
XEvent *event; /* must be a motion event */
String *params; /* unused */
Cardinal *num_params; /* unused */
static void ActionMove (Widget gw, XEvent *event /* must be a motion event */, String *params /* unused */, Cardinal *num_params /* unused */)
{
PannerWidget pw = (PannerWidget) gw;
int x, y;
@@ -922,11 +875,7 @@ static void ActionMove (gw, event, params, num_params)
/* ARGSUSED */
static void ActionPage (gw, event, params, num_params)
Widget gw;
XEvent *event; /* unused */
String *params;
Cardinal *num_params; /* unused */
static void ActionPage (Widget gw, XEvent *event /* unused */, String *params, Cardinal *num_params /* unused */)
{
PannerWidget pw = (PannerWidget) gw;
Cardinal zero = 0;
@@ -965,11 +914,7 @@ static void ActionPage (gw, event, params, num_params)
/* ARGSUSED */
static void ActionNotify (gw, event, params, num_params)
Widget gw;
XEvent *event; /* unused */
String *params; /* unused */
Cardinal *num_params; /* unused */
static void ActionNotify (Widget gw, XEvent *event /* unused */, String *params /* unused */, Cardinal *num_params /* unused */)
{
PannerWidget pw = (PannerWidget) gw;
@@ -1016,11 +961,7 @@ static void ActionNotify (gw, event, params, num_params)
}
/* ARGSUSED */
static void ActionSet (gw, event, params, num_params)
Widget gw;
XEvent *event; /* unused */
String *params;
Cardinal *num_params;
static void ActionSet (Widget gw, XEvent *event /* unused */, String *params, Cardinal *num_params)
{
PannerWidget pw = (PannerWidget) gw;
Boolean rb;

View File

@@ -98,10 +98,7 @@ PixmapClassRec pixmapClassRec = {
WidgetClass pixmapWidgetClass = (WidgetClass)&pixmapClassRec;
static void
Initialize(req, new, args, nargs )
PixmapWidget req, new ;
ArgList args ;
Cardinal *nargs ;
Initialize(PixmapWidget req, PixmapWidget new, ArgList args, Cardinal *nargs)
{
XtGCMask value_mask ;
XGCValues values ;
@@ -136,16 +133,14 @@ Cardinal *nargs ;
}
static void
Resize(w)
PixmapWidget w ;
Resize(PixmapWidget w)
{
ON_DEBUG(fprintf(stderr, "PixmapWidget: RESIZE (%d, %d)\n",
w->core.width, w->core.height));
}
static void
Destroy(w)
PixmapWidget w;
Destroy(PixmapWidget w)
{
if (w->pixmap.pixmap != 0)
{
@@ -154,10 +149,7 @@ PixmapWidget w;
}
static Boolean
SetValues(current, request, new, args, num_args)
PixmapWidget current, request, new ;
ArgList args ;
Cardinal *num_args ;
SetValues(PixmapWidget current, PixmapWidget request, PixmapWidget new, ArgList args, Cardinal *num_args)
{
Window root ;
int x, y ;
@@ -191,9 +183,7 @@ Cardinal *num_args ;
static XtGeometryResult
QueryGeometry(w, proposed, answer)
PixmapWidget w ;
XtWidgetGeometry *proposed, *answer;
QueryGeometry(PixmapWidget w, XtWidgetGeometry *proposed, XtWidgetGeometry *answer)
{
ON_DEBUG(fprintf(stderr, "PixmapWidget:\tQueryGeometry()\n"));
#ifdef DEBUG
@@ -218,9 +208,7 @@ XtWidgetGeometry *proposed, *answer;
#endif
static void
ReDisplay(w, event)
PixmapWidget w ;
XExposeEvent *event ;
ReDisplay(PixmapWidget w, XExposeEvent *event)
{
ON_DEBUG(fprintf(stderr, "PixmapWidget: EXPOSE\n"));

View File

@@ -166,8 +166,7 @@ WidgetClass portholeWidgetClass = (WidgetClass) &portholeClassRec;
* *
*****************************************************************************/
static Widget find_child (pw)
register PortholeWidget pw;
static Widget find_child (register PortholeWidget pw)
{
register Widget *children;
register int i;
@@ -184,9 +183,7 @@ static Widget find_child (pw)
return (Widget) NULL;
}
static void SendReport (pw, changed)
PortholeWidget pw;
unsigned int changed;
static void SendReport (PortholeWidget pw, unsigned int changed)
{
Widget child = find_child (pw);
@@ -206,12 +203,10 @@ static void SendReport (pw, changed)
}
static void layout_child (pw, child, geomp, xp, yp, widthp, heightp)
PortholeWidget pw;
Widget child;
XtWidgetGeometry *geomp;
Position *xp, *yp;
Dimension *widthp, *heightp;
static void layout_child (PortholeWidget pw, Widget child,
XtWidgetGeometry *geomp,
Position *xp, Position *yp,
Dimension *widthp, Dimension *heightp)
{
Position minx, miny;
@@ -256,10 +251,7 @@ static void layout_child (pw, child, geomp, xp, yp, widthp, heightp)
*****************************************************************************/
static void Realize (gw, valueMask, attributes)
register Widget gw;
Mask *valueMask;
XSetWindowAttributes *attributes;
static void Realize (register Widget gw, Mask *valueMask, XSetWindowAttributes *attributes)
{
attributes->bit_gravity = NorthWestGravity;
*valueMask |= CWBitGravity;
@@ -271,8 +263,7 @@ static void Realize (gw, valueMask, attributes)
}
static void Resize (gw)
Widget gw;
static void Resize (Widget gw)
{
PortholeWidget pw = (PortholeWidget) gw;
Widget child = find_child (pw);
@@ -293,9 +284,7 @@ static void Resize (gw)
}
static XtGeometryResult QueryGeometry (gw, intended, preferred)
Widget gw;
XtWidgetGeometry *intended, *preferred;
static XtGeometryResult QueryGeometry (Widget gw, XtWidgetGeometry *intended, XtWidgetGeometry *preferred)
{
register PortholeWidget pw = (PortholeWidget) gw;
Widget child = find_child (pw);
@@ -321,9 +310,7 @@ static XtGeometryResult QueryGeometry (gw, intended, preferred)
}
static XtGeometryResult GeometryManager (w, req, reply)
Widget w;
XtWidgetGeometry *req, *reply;
static XtGeometryResult GeometryManager (Widget w, XtWidgetGeometry *req, XtWidgetGeometry *reply)
{
PortholeWidget pw = (PortholeWidget) w->core.parent;
Widget child = find_child (pw);
@@ -385,8 +372,7 @@ static XtGeometryResult GeometryManager (w, req, reply)
}
static void ChangeManaged (gw)
Widget gw;
static void ChangeManaged (Widget gw)
{
PortholeWidget pw = (PortholeWidget) gw;
Widget child = find_child (pw); /* ignore extra children */
@@ -420,7 +406,7 @@ static void ChangeManaged (gw)
#if XmVersion == 1002
static void
ClassInitialize ()
ClassInitialize (void)
{
/* set up base class extension quark */
portholeClassExtRec.record_type = XmQmotif;

View File

@@ -139,7 +139,7 @@ SimpleClassRec simpleClassRec = {
WidgetClass simpleWidgetClass = (WidgetClass)&simpleClassRec;
static void ClassInitialize()
static void ClassInitialize(void)
{
static XtConvertArgRec convertArg[] = {
{XtWidgetBaseOffset, (XtPointer) XtOffsetOf(WidgetRec, core.screen),
@@ -157,8 +157,7 @@ static void ClassInitialize()
XtCacheByDisplay, NULL);
}
static void ClassPartInitialize(class)
WidgetClass class;
static void ClassPartInitialize(WidgetClass class)
{
register SimpleWidgetClass c = (SimpleWidgetClass)class;
register SimpleWidgetClass super = (SimpleWidgetClass)
@@ -178,10 +177,7 @@ static void ClassPartInitialize(class)
c->simple_class.change_sensitive = super->simple_class.change_sensitive;
}
static void Realize(w, valueMask, attributes)
register Widget w;
Mask *valueMask;
XSetWindowAttributes *attributes;
static void Realize(register Widget w, Mask *valueMask, XSetWindowAttributes *attributes)
{
Pixmap border_pixmap = 0;
@@ -221,8 +217,7 @@ static void Realize(w, valueMask, attributes)
*/
static void
ConvertCursor(w)
Widget w;
ConvertCursor(Widget w)
{
SimpleWidget simple = (SimpleWidget) w;
XrmValue from, to;
@@ -251,8 +246,7 @@ Widget w;
/* ARGSUSED */
static Boolean SetValues(current, request, new)
Widget current, request, new;
static Boolean SetValues(Widget current, Widget request, Widget new)
{
SimpleWidget s_old = (SimpleWidget) current;
SimpleWidget s_new = (SimpleWidget) new;
@@ -284,8 +278,7 @@ static Boolean SetValues(current, request, new)
}
static Boolean ChangeSensitive(w)
register Widget w;
static Boolean ChangeSensitive(register Widget w)
{
if (XtIsRealized(w)) {
if (XtIsSensitive(w))

View File

@@ -210,10 +210,7 @@ WidgetClass treeWidgetClass = (WidgetClass) &treeClassRec;
* *
*****************************************************************************/
static void initialize_dimensions (listp, sizep, n)
Dimension **listp;
int *sizep;
int n;
static void initialize_dimensions (Dimension **listp, int *sizep, int n)
{
register int i;
register Dimension *l;
@@ -237,8 +234,7 @@ static void initialize_dimensions (listp, sizep, n)
return;
}
static GC get_tree_gc (w)
TreeWidget w;
static GC get_tree_gc (TreeWidget w)
{
XtGCMask valuemask = GCBackground | GCForeground;
XGCValues values;
@@ -253,8 +249,7 @@ static GC get_tree_gc (w)
return XtGetGC ((Widget) w, valuemask, &values);
}
static void insert_node (parent, node)
Widget parent, node;
static void insert_node (Widget parent, Widget node)
{
TreeConstraints pc;
TreeConstraints nc = TREE_CONSTRAINT(node);
@@ -287,8 +282,7 @@ static void insert_node (parent, node)
pc->tree.n_children++;
}
static void delete_node (parent, node)
Widget parent, node;
static void delete_node (Widget parent, Widget node)
{
TreeConstraints pc;
int pos, i;
@@ -323,9 +317,7 @@ static void delete_node (parent, node)
pc->tree.children[pc->tree.n_children]=0;
}
static void check_gravity (tw, grav)
TreeWidget tw;
XtGravity grav;
static void check_gravity (TreeWidget tw, XtGravity grav)
{
switch (tw->tree.gravity) {
case WestGravity: case NorthGravity: case EastGravity: case SouthGravity:
@@ -343,7 +335,7 @@ static void check_gravity (tw, grav)
* *
*****************************************************************************/
static void ClassInitialize ()
static void ClassInitialize (void)
{
XawInitializeWidgetSet();
XtAddConverter (XtRString, XtRGravity, XmuCvtStringToGravity,
@@ -351,8 +343,7 @@ static void ClassInitialize ()
}
static void Initialize (grequest, gnew)
Widget grequest, gnew;
static void Initialize (Widget grequest, Widget gnew)
{
TreeWidget request = (TreeWidget) grequest, new = (TreeWidget) gnew;
Arg args[2];
@@ -406,8 +397,7 @@ static void Initialize (grequest, gnew)
/* ARGSUSED */
static void ConstraintInitialize (request, new)
Widget request, new;
static void ConstraintInitialize (Widget request, Widget new)
{
TreeConstraints tc = TREE_CONSTRAINT(new);
TreeWidget tw = (TreeWidget) new->core.parent;
@@ -436,8 +426,7 @@ static void ConstraintInitialize (request, new)
/* ARGSUSED */
static Boolean SetValues (gcurrent, grequest, gnew)
Widget gcurrent, grequest, gnew;
static Boolean SetValues (Widget gcurrent, Widget grequest, Widget gnew)
{
TreeWidget current = (TreeWidget) gcurrent, new = (TreeWidget) gnew;
Boolean redraw = FALSE;
@@ -482,10 +471,7 @@ static Boolean SetValues (gcurrent, grequest, gnew)
/* ARGSUSED */
static Boolean ConstraintSetValues (current, request, new, args, num_args)
Widget current, request, new;
ArgList args;
Cardinal *num_args;
static Boolean ConstraintSetValues (Widget current, Widget request, Widget new, ArgList args, Cardinal *num_args)
{
TreeConstraints newc = TREE_CONSTRAINT(new);
TreeConstraints curc = TREE_CONSTRAINT(current);
@@ -513,8 +499,7 @@ static Boolean ConstraintSetValues (current, request, new, args, num_args)
}
static void ConstraintDestroy (w)
Widget w;
static void ConstraintDestroy (Widget w)
{
TreeConstraints tc = TREE_CONSTRAINT(w);
TreeWidget tw = (TreeWidget) XtParent(w);
@@ -540,10 +525,7 @@ static void ConstraintDestroy (w)
}
/* ARGSUSED */
static XtGeometryResult GeometryManager (w, request, reply)
Widget w;
XtWidgetGeometry *request;
XtWidgetGeometry *reply;
static XtGeometryResult GeometryManager (Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply)
{
TreeWidget tw = (TreeWidget) w->core.parent;
@@ -570,15 +552,13 @@ static XtGeometryResult GeometryManager (w, request, reply)
return (XtGeometryYes);
}
static void ChangeManaged (gw)
Widget gw;
static void ChangeManaged (Widget gw)
{
layout_tree ((TreeWidget) gw, FALSE);
}
static void Destroy (gw)
Widget gw;
static void Destroy (Widget gw)
{
TreeWidget w = (TreeWidget) gw;
@@ -588,10 +568,7 @@ static void Destroy (gw)
/* ARGSUSED */
static void Redisplay (tw, event, region)
TreeWidget tw;
XEvent *event;
Region region;
static void Redisplay (TreeWidget tw, XEvent *event, Region region)
{
/*
* If the Tree widget is visible, visit each managed child.
@@ -683,9 +660,7 @@ static void Redisplay (tw, event, region)
}
}
static XtGeometryResult QueryGeometry (w, intended, preferred)
Widget w;
XtWidgetGeometry *intended, *preferred;
static XtGeometryResult QueryGeometry (Widget w, XtWidgetGeometry *intended, XtWidgetGeometry *preferred)
{
register TreeWidget tw = (TreeWidget) w;
@@ -717,10 +692,7 @@ static XtGeometryResult QueryGeometry (w, intended, preferred)
* *
*****************************************************************************/
static void compute_bounding_box_subtree (tree, w, depth)
TreeWidget tree;
Widget w;
int depth;
static void compute_bounding_box_subtree (TreeWidget tree, Widget w, int depth)
{
TreeConstraints tc = TREE_CONSTRAINT(w); /* info attached to all kids */
register int i;
@@ -790,10 +762,7 @@ static void compute_bounding_box_subtree (tree, w, depth)
}
static void set_positions (tw, w, level)
TreeWidget tw;
Widget w;
int level;
static void set_positions (TreeWidget tw, Widget w, int level)
{
int i;
@@ -831,11 +800,7 @@ static void set_positions (tw, w, level)
}
static void arrange_subtree (tree, w, depth, x, y)
TreeWidget tree;
Widget w;
int depth;
Position x, y;
static void arrange_subtree (TreeWidget tree, Widget w, int depth, Position x, Position y)
{
TreeConstraints tc = TREE_CONSTRAINT(w); /* info attached to all kids */
TreeConstraints firstcc, lastcc;
@@ -938,10 +903,7 @@ static void arrange_subtree (tree, w, depth, x, y)
}
}
static void set_tree_size (tw, insetvalues, width, height)
TreeWidget tw;
Boolean insetvalues;
Dimension width, height;
static void set_tree_size (TreeWidget tw, Boolean insetvalues, Dimension width, Dimension height)
{
if (insetvalues) {
tw->core.width = width;

View File

@@ -103,9 +103,9 @@ static int b_str(unsigned char **in_ptr, char **out_ptr)
}
/* now the integers */
/* unsigned CGM integer at arbitrary legal precision */
static unsigned int b_guint(in_ptr, bits_p)
unsigned char **in_ptr; /* pointer to the input data pointer */
int bits_p; /* no. of bits precision */
/* in_ptr, pointer to the input data pointer */
/* bits_p, no. of bits precision */
static unsigned int b_guint(unsigned char **in_ptr, int bits_p)
{
int i;
unsigned int val;
@@ -117,9 +117,9 @@ static unsigned int b_guint(in_ptr, bits_p)
return(val);
}
/* signed CGM integer at arbitrary legal precision */
static int b_gsint(in_ptr, bits_p)
unsigned char **in_ptr; /* pointer to the input data pointer */
int bits_p; /* no. of bits precision */
/* in_ptr, pointer to the input data pointer */
/* bits_p, no. of bits precision */
static int b_gsint(unsigned char **in_ptr, int bits_p)
{
int i, val;
/* have to worry about sign extension, may not have signed char */
@@ -132,9 +132,7 @@ static int b_gsint(in_ptr, bits_p)
}
/* now the reals */
/* the fixed point real */
static double b_fixed(dat_ptr, prec)
unsigned char **dat_ptr;
rp_type *prec;
static double b_fixed(unsigned char **dat_ptr, rp_type *prec)
{
double ret;
/* do it in two parts; the big (first) part and fractional (second) part */
@@ -145,9 +143,7 @@ static double b_fixed(dat_ptr, prec)
return(ret);
}
/* the IEEE floating point */
static double b_ieee(dat_ptr, prec)
unsigned char **dat_ptr;
rp_type *prec;
static double b_ieee(unsigned char **dat_ptr, rp_type *prec)
{
#define TABLESIZE 128
static double shift_table[TABLESIZE];
@@ -227,9 +223,7 @@ static double b_ieee(dat_ptr, prec)
#undef TABLESIZE
}
/* the general real */
static double b_real(dat_ptr, rprec)
unsigned char **dat_ptr;
rp_type *rprec;
static double b_real(unsigned char **dat_ptr, rp_type *rprec)
{
if (rprec->fixed == 0) { /* floating point */
return(b_ieee(dat_ptr, rprec));
@@ -566,28 +560,19 @@ static int epic(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr,
}
/* Metafile Descriptors */
/* Metafile Version */
static int mfversion(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int mfversion(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
/* nothing for now */
return 1;
}
/* Metafile Descriptor */
static int mfdescrip(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int mfdescrip(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
/* nothing for now */
return 1;
}
/* VDC type */
static int vdctype(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int vdctype(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
/* 0=>integer, 1=>real */
@@ -596,19 +581,13 @@ static int vdctype(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Integer Precision */
static int intprec(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int intprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->intprec = b_gsint(&dat_ptr, cgm_s->intprec);
return 1;
}
/* Real Precision */
static int realprec(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int realprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->realprec.fixed = b_gsint(&dat_ptr, cgm_s->intprec);
cgm_s->realprec.exp = b_gsint(&dat_ptr, cgm_s->intprec);
@@ -617,46 +596,31 @@ static int realprec(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Index Precision */
static int indexprec(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int indexprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->indexprec = b_gsint(&dat_ptr, cgm_s->intprec);
return 1;
}
/* Colour Precision */
static int colprec(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int colprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->colprec = b_gsint(&dat_ptr, cgm_s->intprec);
return 1;
}
/* Colour Index Precision */
static int cindprec(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int cindprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->cindprec = b_gsint(&dat_ptr, cgm_s->intprec);
return 1;
}
/* Maximum Colour Index */
static int maxcind(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int maxcind(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->maxcind = b_guint(&dat_ptr, cgm_s->cindprec);
return 1;
}
/* Colour Value Extent */
static int cvextent(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int cvextent(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i;
for (i=0; i<6; ++i)
@@ -671,10 +635,7 @@ static int cvextent(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Metafile Element List */
static int mfellist(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int mfellist(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i;
cgm_s->mfellist_s = b_gsint(&dat_ptr, cgm_s->intprec);
@@ -688,10 +649,7 @@ static int mfellist(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Metafile Defaults Replacement, a complex element */
static int mfdefrep(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int mfdefrep(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
struct cmd_info_s new_cmd; /* for the new commands */
int i, new_len, b_to_move, data_left;
@@ -761,10 +719,7 @@ static int mfdefrep(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Font List, store the data, but ignored for now */
static int fontlist(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int fontlist(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i;
unsigned char *my_ptr = NULL;
@@ -783,10 +738,7 @@ static int fontlist(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Character Set List, stored but ignored */
static int charlist(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int charlist(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i;
unsigned char *my_ptr = NULL;
@@ -808,20 +760,14 @@ static int charlist(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Character Announcer */
static int charannounce(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int charannounce(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->charannounce = b_gsint(&dat_ptr, 16);
return 1;
}
/* Picture Descriptors */
/* Scaling Mode */
static int scalmode(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int scalmode(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->scalmode = b_gsint(&dat_ptr, 16);
@@ -831,47 +777,32 @@ static int scalmode(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Colour Selection Mode */
static int colselmode(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int colselmode(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->colselmode = b_gsint(&dat_ptr, 16);
return 1;
}
/* Line Width Specification Mode */
static int lwidspecmode(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int lwidspecmode(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->lwidspecmode = b_gsint(&dat_ptr, 16);
return 1;
}
/* Marker Size Specification Mode */
static int marksizspecmode(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int marksizspecmode(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->marksizspecmode = b_gsint(&dat_ptr, 16);
return 1;
}
/* Edge Width Specification Mode */
static int edwidspecmode(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int edwidspecmode(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->edwidspecmode = b_gsint(&dat_ptr, 16);
return 1;
}
/* VDC Extent */
static int vdcextent(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int vdcextent(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i;
@@ -886,10 +817,7 @@ static int vdcextent(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Background Colour */
static int backcolr(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int backcolr(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i;
for (i=0; i<3; ++i)
@@ -899,19 +827,13 @@ static int backcolr(dat_ptr, cmd_ptr, cgm_s)
}
/* Control Elements */
/* VDC Integer Precision */
static int vdcintprec(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int vdcintprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->vdcintprec = b_gsint(&dat_ptr, cgm_s->intprec);
return 1;
}
/* VDC Real Precision */
static int vdcrprec(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int vdcrprec(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->vdcrprec.fixed = b_gsint(&dat_ptr, cgm_s->intprec);
cgm_s->vdcrprec.exp = b_gsint(&dat_ptr, cgm_s->intprec);
@@ -920,10 +842,7 @@ static int vdcrprec(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Auxiliary Colour */
static int auxcolr(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int auxcolr(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i;
switch(cgm_s->colselmode) {
@@ -936,10 +855,7 @@ static int auxcolr(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Transparency */
static int transp(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int transp(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->transp = b_gsint(&dat_ptr, 16);
return 1;
@@ -1061,10 +977,7 @@ unsigned int getXSegments(unsigned char *dat_ptr,
return noSegments;
}
/* Polyline */
static int polyline(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int polyline(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int noPts;
XPoint *myPtr = NULL;
@@ -1074,10 +987,7 @@ static int polyline(dat_ptr, cmd_ptr, cgm_s)
return(1);
}
/* Disjoint Polyline, on/off segments */
static int dispoly(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int dispoly(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int noSegments;
XSegment *myPtr = NULL;
@@ -1089,10 +999,7 @@ cgm_s_type *cgm_s;
return(1);
}
/* Polymarker */
static int polymarker(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int polymarker(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int noPts, i, x, y, size, asize;
/* figure out the number of points */
@@ -1158,10 +1065,7 @@ void doText(cgm_s_type *cgm_s)
textX = textY = textW = textH = 0;
}
/* Regular Text */
static int text(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int text(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int final_flag;
partialText *newPtr, *myPtr;
@@ -1198,10 +1102,7 @@ static int text(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Restricted Text */
static int restext(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int restext(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int final_flag;
partialText *newPtr, *myPtr;
@@ -1238,10 +1139,7 @@ static int restext(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Appended Text */
static int apptext(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int apptext(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
partialText *newPtr, *myPtr;
if (!textPtr) return 0; /* can't append if there's nothing started ! */
@@ -1267,10 +1165,7 @@ static int apptext(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Polygon */
static int polygon(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int polygon(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int noPts;
XPoint *myPtr = NULL;
@@ -1288,10 +1183,7 @@ static int polygon(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Polyset */
static int polyset(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int polyset(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i, noPts, *vPtr, lastFill;
XPoint *myPtr;
@@ -1491,10 +1383,7 @@ static Pixel *getPixels(unsigned char *dat_ptr, cgm_s_type *cgm_s,
return retPtr;
}
/* actually get the cellarray command */
static int cellarray(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int cellarray(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i, x[3], y[3], nx, ny, local_prec, rep_mode, xSize, ySize;
int Qx, Qy, Rx, Ry, det, xMin, xMax, yMin, yMax, newX, newY, ix, iy,
@@ -1575,10 +1464,7 @@ static int cellarray(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Rectangle */
static int rectangle(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int rectangle(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i, xPts[2], yPts[2], x, y, old_style;
unsigned int w, h;
@@ -1622,10 +1508,7 @@ static int rectangle(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Circle */
static int circle(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int circle(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int x, y, r;
/* get the center position and radius */
@@ -1705,10 +1588,7 @@ static int getArc(float inX[3], float inY[3], int *outXC, int *outYC,
return r;
}
/* Circular Arc, set by 3 points */
static int circ3(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int circ3(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int xc, yc, r, i;
double theta0, dtheta;
@@ -1738,10 +1618,7 @@ static int circ3(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Circular Arc, set by 3 points, close */
static int circ3close(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int circ3close(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int xc, yc, r, i, close_type, x0, y0, x2, y2;
float det1, x[3], y[3]; /* use floats since we must manipulate them */
@@ -1806,10 +1683,7 @@ static double getAngles(int xc, int yc, float dxy[4], double *outTheta0)
return dtheta;
}
/* Circular Arc, set by center */
static int circcentre(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int circcentre(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i, xc, yc, r;
double theta0, dtheta;
@@ -1834,10 +1708,7 @@ static int circcentre(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Circular Arc, set by center, close */
static int circcclose(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int circcclose(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i, xc, yc, r, close_type, x0, y0, x1, y1;
double theta0, dtheta;
@@ -1994,10 +1865,7 @@ static int getEllipseXPoints(int x1, int y1, int x2, int y2,
return nSteps;
}
/* Ellipse */
static int ellipse(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int ellipse(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int xc, yc, cdx0, cdy0, cdx1, cdy1, noPts, i;
XPoint *myPtr = NULL;
@@ -2032,10 +1900,7 @@ static int ellipse(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Elliptical arc */
static int elarc(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int elarc(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int xc, yc, cdx0, cdy0, cdx1, cdy1, i, noPts;
float dxy[4];
@@ -2068,10 +1933,7 @@ static int elarc(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Elliptical arc, close */
static int elarcclose(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int elarcclose(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int xc, yc, cdx0, cdy0, cdx1, cdy1, i, close_type, noPts;
float dxy[4];
@@ -2153,20 +2015,14 @@ static int setLineType(int inType, GC inGC)
return 1;
}
/* Line Type */
static int ltype(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int ltype(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
/* get the line type */
cgm_s->ltype = b_gsint(&dat_ptr, cgm_s->indexprec);
return setLineType(cgm_s->ltype, lineGC);
}
/* Line Width */
static int lwidth(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int lwidth(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
switch (cgm_s->lwidspecmode) {
case ABSOLUTE:
@@ -2188,10 +2044,7 @@ static int lwidth(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Line Colour */
static int lcolr(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int lcolr(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i;
@@ -2209,10 +2062,7 @@ static int lcolr(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Marker Type */
static int mtype(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int mtype(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
/* get the line type */
cgm_s->mtype = b_gsint(&dat_ptr, cgm_s->indexprec);
@@ -2220,10 +2070,7 @@ static int mtype(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Marker Size */
static int msize(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int msize(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
switch (cgm_s->marksizspecmode) {
case ABSOLUTE:
@@ -2241,10 +2088,7 @@ static int msize(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Marker Colour */
static int mcolr(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int mcolr(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i;
/* may be in direct colour mode or indexed colour mode */
@@ -2365,30 +2209,21 @@ static int talign(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr,
return 1;
}
/* Character Set Index */
static int csetindex(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int csetindex(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->csetindex = b_gsint(&dat_ptr, cgm_s->indexprec);
return 1;
}
/* Alternate Character Set Index */
static int altcsetindex(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int altcsetindex(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->altcsetindex = b_gsint(&dat_ptr, cgm_s->indexprec);
return 1;
}
/* Interior Style */
static int intstyle(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int intstyle(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->intstyle = b_gsint(&dat_ptr, 16);
switch (cgm_s->intstyle) {
@@ -2409,10 +2244,7 @@ static int intstyle(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Fill Colour */
static int fillcolr(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int fillcolr(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i;
@@ -2430,39 +2262,27 @@ static int fillcolr(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Hatch Index */
static int hatchindex(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int hatchindex(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->hatchindex = b_gsint(&dat_ptr, cgm_s->indexprec);
return 1;
}
/* Pattern Index */
static int patindex(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int patindex(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->patindex = b_gsint(&dat_ptr, cgm_s->indexprec);
return 1;
}
/* Edge Type */
static int etype(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int etype(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->etype = b_gsint(&dat_ptr, cgm_s->indexprec);
return setLineType(cgm_s->etype, edgeGC);
}
/* Edge Width */
static int ewidth(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int ewidth(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
switch (cgm_s->edwidspecmode) {
case ABSOLUTE:
@@ -2484,10 +2304,7 @@ static int ewidth(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Edge Colour */
static int ecolr(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int ecolr(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i;
@@ -2505,10 +2322,7 @@ static int ecolr(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Edge Visibility */
static int evis(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int evis(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
cgm_s->evis = b_gsint(&dat_ptr, 16);
if (cgm_s->evis) { /* visible edge */
@@ -2519,10 +2333,7 @@ static int evis(dat_ptr, cmd_ptr, cgm_s)
return 1;
}
/* Colour Table */
static int coltab(dat_ptr, cmd_ptr, cgm_s)
unsigned char *dat_ptr;
struct cmd_info_s *cmd_ptr;
cgm_s_type *cgm_s;
static int coltab(unsigned char *dat_ptr, struct cmd_info_s *cmd_ptr, cgm_s_type *cgm_s)
{
int i, j, first_index, no_entries, iColrs[3];