175584Sru// -*- C -*-
2151497Sru/* Copyright (C) 1994, 2000, 2001, 2003, 2004, 2005
3151497Sru   Free Software Foundation, Inc.
475584Sru     Written by Francisco Andr�s Verd� <pandres@dragonet.es>
575584Sru
675584Srugroff is free software; you can redistribute it and/or modify it under
775584Sruthe terms of the GNU General Public License as published by the Free
875584SruSoftware Foundation; either version 2, or (at your option) any later
975584Sruversion.
1075584Sru
1175584Srugroff is distributed in the hope that it will be useful, but WITHOUT ANY
1275584SruWARRANTY; without even the implied warranty of MERCHANTABILITY or
1375584SruFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1475584Srufor more details.
1575584Sru
1675584SruYou should have received a copy of the GNU General Public License along
1775584Sruwith groff; see the file COPYING.  If not, write to the Free Software
18151497SruFoundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
1975584Sru
2075584Sru/*  This file contains a set of utility functions to use canon CAPSL printers
2175584Sru *  (lbp-4 and lbp-8 series printers) */
2275584Sru
2375584Sru#ifndef LBP_H
2475584Sru#define LBP_H
2575584Sru
2675584Sru#include <stdio.h>
2775584Sru#include <stdarg.h>
2875584Sru
2975584Srustatic FILE *lbpoutput = NULL;
3075584Srustatic FILE *vdmoutput = NULL;
3175584Sru
32151497Sru
3375584Srustatic inline void
3475584Srulbpinit(FILE *outfile)
3575584Sru{
3675584Sru	lbpoutput = outfile;
37151497Sru}
3875584Sru
3975584Sru
40151497Srustatic void
4179543Srulbpprintf(const char *format, ... )
4275584Sru{ /* Taken from cjet */
4375584Sru  va_list stuff;
4475584Sru
4575584Sru  va_start(stuff, format);
4675584Sru  vfprintf(lbpoutput, format, stuff);
4775584Sru  va_end(stuff);
48151497Sru}
4975584Sru
50151497Sru
5175584Srustatic inline void
5279543Srulbpputs(const char *data)
5375584Sru{
5475584Sru	fputs(data,lbpoutput);
55151497Sru}
5675584Sru
57151497Sru
5875584Srustatic inline void
59114402Srulbpputc(unsigned char c)
6075584Sru{
6175584Sru	fputc(c,lbpoutput);
62151497Sru}
6375584Sru
6475584Sru
6575584Srustatic inline void
66151497Srulbpsavestatus(int idx )
6775584Sru{
68151497Sru	fprintf(lbpoutput,"\033[%d%%y",idx);
69151497Sru}
7075584Sru
71151497Sru
7275584Srustatic inline void
73151497Srulbprestorestatus(int idx )
7475584Sru{
75151497Sru	fprintf(lbpoutput,"\033[%d%cz",idx ,'%');
76151497Sru}
7775584Sru
78151497Sru
7975584Srustatic inline void
80151497Srulbpsavepos(int idx)
8175584Sru{
82151497Sru	fprintf(lbpoutput,"\033[1;%d;0x",idx);
83151497Sru}
8475584Sru
85151497Sru
8675584Srustatic inline void
87151497Srulbprestorepos(int idx)
8875584Sru{
89151497Sru	fprintf(lbpoutput,"\033[0;%d;0x",idx);
90151497Sru}
9175584Sru
92151497Sru
9375584Srustatic inline void
94151497Srulbprestoreposx(int idx)
9575584Sru{
96151497Sru	fprintf(lbpoutput,"\033[0;%d;1x",idx);
97151497Sru}
9875584Sru
99151497Sru
10075584Srustatic inline void
10175584Srulbpmoverel(int despl, char direction)
10275584Sru{
10375584Sru	fprintf(lbpoutput,"\033[%d%c",despl,direction);
104151497Sru}
10575584Sru
106151497Sru
10775584Srustatic inline void
10875584Srulbplinerel(int width,int despl,char direction )
10975584Sru{
11075584Sru	fprintf(lbpoutput,"\033[%d;0;9{\033[%d%c\033[9}",width,despl,direction);
111151497Sru}
11275584Sru
113151497Sru
11475584Srustatic inline void
11575584Srulbpmoveabs(int x, int y)
11675584Sru{
11775584Sru	fprintf(lbpoutput,"\033[%d;%df",y,x);
118151497Sru}
11975584Sru
120151497Sru
12175584Srustatic inline void
12275584Srulbplineto(int x,int y, int width )
12375584Sru{
12475584Sru	fprintf(lbpoutput,"\033[%d;0;9{",width);
12575584Sru	lbpmoveabs(x,y);
12675584Sru	fprintf(lbpoutput,"\033[9}\n");
127151497Sru}
12875584Sru
129151497Sru
13075584Srustatic inline void
13175584Srulbpruleabs(int x, int y, int hsize, int vsize)
13275584Sru{
13375584Sru	lbpmoveabs(x,y);
13475584Sru	fprintf(lbpoutput,"\033[0;9;000s");
13575584Sru	lbpmoveabs(x+hsize,y+vsize);
13675584Sru	fprintf(lbpoutput,"\033[9r");
137151497Sru}
13875584Sru
13975584Sru
140151497Srustatic void vdmprintf(const char *format, ... );
141151497Sru
142151497Sru
14375584Srustatic inline char *
14475584Sruvdmnum(int num,char *result)
14575584Sru{
14675584Sru  char b1,b2,b3;
14775584Sru  char *p = result;
14875584Sru  int nm;
14975584Sru
15075584Sru  nm = abs(num);
15175584Sru  /* First byte 1024 - 32768 */
15275584Sru  b1 = ((nm >> 10) & 0x3F);
15375584Sru  if (b1) *p++ = b1 | 0x40;
15475584Sru
15575584Sru  /* Second Byte 16 - 1024 */
15675584Sru  b2 = ((nm >> 4) & 0x3F);
15775584Sru  if ( b1 || b2) *p++= b2 | 0x40;
15875584Sru
15975584Sru  /* Third byte 0 - 15 */
16075584Sru  b3 = ((nm & 0x0F) | 32);
16175584Sru  if (num >= 0) b3 |= 16;
16275584Sru  *p++ = b3;
16375584Sru  *p = 0x00; /* End of the resulting string */
16475584Sru  return result;
165151497Sru}
16675584Sru
167151497Sru
16875584Srustatic inline void
16975584Sruvdmorigin(int newx, int newy)
17075584Sru{
17175584Sru   char nx[4],ny[4];
17275584Sru
17375584Sru	vdmprintf("}\"%s%s\x1e",vdmnum(newx,nx),vdmnum(newy,ny));
174151497Sru}
17575584Sru
17675584Sru
17775584Srustatic inline FILE *
17875584Sruvdminit(FILE *vdmfile)
17975584Sru{
18075584Sru  char scale[4],size[4],lineend[4];
18175584Sru
18275584Sru/*  vdmoutput = tmpfile();*/
18375584Sru  vdmoutput = vdmfile;
18475584Sru  /* Initialize the VDM mode */
18575584Sru  vdmprintf("\033[0&}#GROLBP\x1e!0%s%s\x1e$\x1e}F%s\x1e",\
18675584Sru		  vdmnum(-3,scale),vdmnum(1,size),vdmnum(1,lineend));
18775584Sru  return vdmoutput;
18875584Sru
189151497Sru}
19075584Sru
191151497Sru
19275584Srustatic inline void
19375584Sruvdmend()
19475584Sru{
19575584Sru	vdmprintf("}p\x1e");
196151497Sru}
19775584Sru
198151497Sru
199151497Srustatic void
20079543Sruvdmprintf(const char *format, ... )
20175584Sru{ /* Taken from cjet */
20275584Sru  va_list stuff;
20375584Sru
20475584Sru  if (vdmoutput == NULL)  vdminit(tmpfile());
20575584Sru  va_start(stuff, format);
20675584Sru  vfprintf(vdmoutput, format, stuff);
20775584Sru  va_end(stuff);
208151497Sru}
20975584Sru
210151497Sru
21175584Srustatic inline void
21275584Sruvdmsetfillmode(int pattern,int perimeter, int inverted)
21375584Sru{
21475584Sru   char patt[4],perim[4],
21575584Sru   	rot[4], /* rotation */
21675584Sru	espejo[4], /* espejo */
21775584Sru	inv[4]; /* Inverted */
21875584Sru
21975584Sru   	vdmprintf("I%s%s%s%s%s\x1e",vdmnum(pattern,patt),\
22075584Sru		vdmnum(perimeter,perim),vdmnum(0,rot),
22175584Sru		vdmnum(0,espejo),vdmnum(inverted,inv));
222151497Sru}
22375584Sru
224151497Sru
22575584Srustatic inline void
22675584Sruvdmcircle(int centerx, int centery, int radius)
22775584Sru{
22875584Sru  char x[4],y[4],rad[4];
22975584Sru
23075584Sru	vdmprintf("5%s%s%s\x1e",vdmnum(centerx,x),vdmnum(centery,y),\
23175584Sru			vdmnum(radius,rad));
232151497Sru}
23375584Sru
234151497Sru
23575584Srustatic inline void
23675584Sruvdmaarc(int centerx, int centery, int radius,int startangle,int angle,int style,int arcopen)
23775584Sru{
23875584Sru  char x[4],y[4],rad[4],stx[4],sty[4],styl[4],op[4];
23975584Sru
24075584Sru	vdmprintf("}6%s%s%s%s%s%s%s\x1e",vdmnum(arcopen,op),\
24175584Sru		vdmnum(centerx,x),vdmnum(centery,y),\
24275584Sru		vdmnum(radius,rad),vdmnum(startangle,stx),vdmnum(angle,sty),\
24375584Sru		vdmnum(style,styl));
244151497Sru}
24575584Sru
246151497Sru
24775584Srustatic inline void
24875584Sruvdmvarc(int centerx, int centery,int radius, int startx, int starty, int endx, int endy,\
24975584Sru	int style,int arcopen)
25075584Sru{
25175584Sru  char x[4],y[4],rad[4],stx[4],sty[4],enx[4],eny[4],styl[4],op[4];
25275584Sru
253151497Sru	vdmprintf("}6%s%s%s%s%s%s%s%s%s\x1e",vdmnum(arcopen,op),\
25475584Sru		vdmnum(centerx,x),vdmnum(centery,y),\
25575584Sru		vdmnum(radius,rad),vdmnum(startx,stx),vdmnum(starty,sty),\
25675584Sru		vdmnum(endx,enx),vdmnum(endy,eny),vdmnum(style,styl));
257151497Sru}
25875584Sru
259151497Sru
26075584Srustatic inline void
26175584Sruvdmellipse(int centerx, int centery, int radiusx, int radiusy,int rotation)
26275584Sru{
26375584Sru  char x[4],y[4],radx[4],rady[4],rotat[4];
26475584Sru
26575584Sru	vdmprintf("}7%s%s%s%s%s\x1e\n",vdmnum(centerx,x),vdmnum(centery,y),\
26675584Sru			vdmnum(radiusx,radx),vdmnum(radiusy,rady),\
26775584Sru			vdmnum(rotation,rotat));
268151497Sru}
26975584Sru
270151497Sru
27175584Srustatic inline void
27275584Sruvdmsetlinetype(int lintype)
27375584Sru{
27475584Sru  char ltyp[4], expfact[4];
27575584Sru
27675584Sru  vdmprintf("E1%s%s\x1e",vdmnum(lintype,ltyp),vdmnum(1,expfact));
27775584Sru
278151497Sru}
27975584Sru
280151497Sru
28175584Srustatic inline void
28275584Sruvdmsetlinestyle(int lintype, int pattern,int unionstyle)
28375584Sru{
28475584Sru   char patt[4],ltip[4],
28575584Sru   	rot[4], /* rotation */
28675584Sru	espejo[4], /* espejo */
28775584Sru	in[4]; /* Inverted */
28875584Sru
28975584Sru   	vdmprintf("}G%s%s%s%s%s\x1e",vdmnum(lintype,ltip),\
29075584Sru		vdmnum(pattern,patt),vdmnum(0,rot),
29175584Sru		vdmnum(0,espejo),vdmnum(0,in));
29275584Sru	vdmprintf("}F%s",vdmnum(unionstyle,rot));
293151497Sru}
29475584Sru
295151497Sru
29675584Srustatic inline void
29775584Sruvdmlinewidth(int width)
29875584Sru{
29975584Sru  char wh[4];
30075584Sru
30175584Sru  	vdmprintf("F1%s\x1e",vdmnum(width,wh));
302151497Sru}
30375584Sru
304151497Sru
30575584Srustatic inline void
30675584Sruvdmrectangle(int origx, int origy,int dstx, int dsty)
30775584Sru{
30875584Sru  char xcoord[4],ycoord[4],sdstx[4],sdsty[4];
30975584Sru
31075584Sru  vdmprintf("}:%s%s%s%s\x1e\n",vdmnum(origx,xcoord),vdmnum(dstx,sdstx),\
31175584Sru		  vdmnum(origy,ycoord),vdmnum(dsty,sdsty));
312151497Sru}
31375584Sru
314151497Sru
31575584Srustatic inline void
31675584Sruvdmpolyline(int numpoints, int *points)
31775584Sru{
31875584Sru  int i,*p = points;
31975584Sru  char xcoord[4],ycoord[4];
32075584Sru
32175584Sru  if (numpoints < 2) return;
32275584Sru  vdmprintf("1%s%s",vdmnum(*p,xcoord),vdmnum(*(p+1),ycoord));
32375584Sru  p += 2;
32475584Sru  for (i = 1; i < numpoints ; i++) {
32575584Sru	  vdmprintf("%s%s",vdmnum(*p,xcoord),vdmnum(*(p+1),ycoord));
32675584Sru	  p += 2;
327151497Sru  } /* for */
32875584Sru  vdmprintf("\x1e\n");
329151497Sru}
33075584Sru
331151497Sru
33275584Srustatic inline void
33375584Sruvdmpolygon(int numpoints, int *points)
33475584Sru{
33575584Sru  int i,*p = points;
33675584Sru  char xcoord[4],ycoord[4];
33775584Sru
33875584Sru  if (numpoints < 2) return;
33975584Sru  vdmprintf("2%s%s",vdmnum(*p,xcoord),vdmnum(*(p+1),ycoord));
34075584Sru  p += 2;
34175584Sru  for (i = 1; i < numpoints ; i++) {
34275584Sru	  vdmprintf("%s%s",vdmnum(*p,xcoord),vdmnum(*(p+1),ycoord));
34375584Sru	  p += 2;
344151497Sru  } /* for */
34575584Sru  vdmprintf("\x1e\n");
34675584Sru
347151497Sru}
34875584Sru
34975584Sru
35075584Sru/************************************************************************
35175584Sru *		Highter level auxiliary functions			*
35275584Sru ************************************************************************/
35375584Srustatic inline int
35475584Sruvdminited()
35575584Sru{
35675584Sru	return (vdmoutput != NULL);
357151497Sru}
35875584Sru
35975584Sru
36075584Srustatic inline void
36175584Sruvdmline(int startx, int starty, int sizex, int sizey)
36275584Sru{
36375584Sru  int points[4];
36475584Sru
36575584Sru  points[0] = startx;
36675584Sru  points[1] = starty;
36775584Sru  points[2] = sizex;
36875584Sru  points[3] = sizey;
36975584Sru
37075584Sru  vdmpolyline(2,points);
37175584Sru
372151497Sru}
37375584Sru
374151497Sru
37575584Sru/*#define         THRESHOLD       .05    */ /* inch */
37675584Sru#define         THRESHOLD       1     /* points (1/300 inch) */
37775584Srustatic inline void
37875584Srusplinerel(double px,double py,int flush)
37975584Sru{
38075584Sru  static int lx = 0 ,ly = 0;
381151497Sru  static double pend = 0.0;
38275584Sru  static int dy = 0, despx = 0, despy = 0, sigpend = 0;
383151497Sru  int dxnew = 0, dynew = 0, sg;
38475584Sru  char xcoord[4],ycoord[4];
385151497Sru  double npend ;
38675584Sru
387151497Sru  if (flush == -1) {lx = (int)px; ly = (int)py; return;}
38875584Sru
38975584Sru  if (flush == 0) {
39075584Sru  dxnew = (int)px -lx;
39175584Sru  dynew = (int)py -ly;
39275584Sru  if ((dxnew == 0) && (dynew == 0)) return;
39375584Sru  sg = (dxnew < 0)? -1 : 0;
39475584Sru/*  fprintf(stderr,"s (%d,%d) (%d,%d)\n",dxnew,dynew,despx,despy);*/
39575584Sru  if (dynew == 0) {
39675584Sru	  despx = dxnew;
39775584Sru	  if ((sg == sigpend) && (dy == 0)){
39875584Sru		  return;
399151497Sru	  }
40075584Sru	dy = 0;
40175584Sru  }
40275584Sru  else {
40375584Sru	  dy = 1;
40475584Sru	npend = (1.0*dxnew)/dynew;
40575584Sru  	if (( npend == pend) && (sigpend == sg))
40675584Sru  	{ despy = dynew; despx = dxnew; return; }
40775584Sru  	else
40875584Sru  	{ sigpend = sg;
40975584Sru    	pend = npend;
410151497Sru  	} /* else (( npend == pend) && ... */
411151497Sru  } /* else (if (dynew == 0)) */
412151497Sru  } /* if (!flush ) */
41375584Sru
41475584Sru  /* if we've changed direction we must draw the line */
41575584Sru/*  fprintf(stderr," (%d) %.2f,%.2f\n",flush,(float)px,(float)py);*/
41675584Sru  if ((despx != 0) || (despy != 0)) vdmprintf("%s%s",vdmnum(despx,xcoord),\
41775584Sru		vdmnum(despy,ycoord));
41875584Sru  /*if ((despx != 0) || (despy != 0)) fprintf(stderr,"2
41975584Sru   *%d,%d\n",despx,despy);*/
42075584Sru  if (flush) {
42175584Sru  	dxnew = dy = despx = despy = 0;
42275584Sru	return;
423151497Sru  } /* if (flush) */
42475584Sru  dxnew -= despx;
42575584Sru  dynew -= despy;
42675584Sru  if ((dxnew != 0) || (dynew != 0)) vdmprintf("%s%s",vdmnum(dxnew,xcoord),\
42775584Sru		vdmnum(dynew,ycoord));
42875584Sru
42975584Sru/*  if ((dxnew != 0) || (dynew != 0)) fprintf(stderr,"3
43075584Sru *  %d,%d\n",dxnew,dynew);*/
43175584Sru  lx = (int)px; ly = (int)py;
43275584Sru  dxnew = dy = despx = despy = 0;
43375584Sru
434151497Sru}
43575584Sru
436151497Sru
43775584Sru/**********************************************************************
43875584Sru *  The following code to draw splines is adapted from the transfig package
43975584Sru */
44075584Srustatic void
441151497Sruquadratic_spline(double a_1, double b_1, double a_2, double b_2, \
442151497Sru		 double a_3, double b_3, double a_4, double b_4)
44375584Sru{
444151497Sru	double	x_1, y_1, x_4, y_4;
445151497Sru	double	x_mid, y_mid;
44675584Sru
447151497Sru	x_1	 = a_1; y_1 = b_1;
448151497Sru	x_4	 = a_4; y_4 = b_4;
449151497Sru	x_mid	 = (a_2 + a_3)/2.0;
450151497Sru	y_mid	 = (b_2 + b_3)/2.0;
451151497Sru	if ((fabs(x_1 - x_mid) < THRESHOLD)
452151497Sru	    && (fabs(y_1 - y_mid) < THRESHOLD)) {
453151497Sru        	splinerel(x_mid, y_mid, 0);
454151497Sru/*	    fprintf(tfp, "PA%.4f,%.4f;\n", x_mid, y_mid);*/
45575584Sru	}
45675584Sru	else {
457151497Sru	    quadratic_spline(x_1, y_1, ((x_1+a_2)/2.0), ((y_1+b_2)/2.0),
458151497Sru		((3.0*a_2+a_3)/4.0), ((3.0*b_2+b_3)/4.0), x_mid, y_mid);
459151497Sru	}
46075584Sru
461151497Sru	if ((fabs(x_mid - x_4) < THRESHOLD)
462151497Sru	    && (fabs(y_mid - y_4) < THRESHOLD)) {
463151497Sru		splinerel(x_4, y_4, 0);
464151497Sru/*	    fprintf(tfp, "PA%.4f,%.4f;\n", x_4, y_4);*/
46575584Sru	}
46675584Sru	else {
467151497Sru	    quadratic_spline(x_mid, y_mid,
468151497Sru			     ((a_2+3.0*a_3)/4.0), ((b_2+3.0*b_3)/4.0),
469151497Sru			     ((a_3+x_4)/2.0), ((b_3+y_4)/2.0), x_4, y_4);
470151497Sru	}
471151497Sru}
47275584Sru
473151497Sru
47475584Sru#define XCOORD(i) numbers[(2*i)]
47575584Sru#define YCOORD(i) numbers[(2*i)+1]
47675584Srustatic void
477151497Sruvdmspline(int numpoints, int o_x, int o_y, int *numbers)
47875584Sru{
479151497Sru	double	cx_1, cy_1, cx_2, cy_2, cx_3, cy_3, cx_4, cy_4;
480151497Sru	double	x_1, y_1, x_2, y_2;
48175584Sru	char xcoord[4],ycoord[4];
48275584Sru	int i;
48375584Sru
48475584Sru	/*p	 = s->points;
485151497Sru	x_1	 = p->x/ppi;*/
486151497Sru	x_1	 = o_x;
487151497Sru	y_1	 = o_y;
48875584Sru/*	p	 = p->next;
489151497Sru	x_2	 = p->x/ppi;
490151497Sru	y_2	 = p->y/ppi;*/
491151497Sru	x_2	 = o_x + XCOORD(0);
492151497Sru	y_2	 = o_y + YCOORD(0);
493151497Sru	cx_1	 = (x_1 + x_2)/2.0;
494151497Sru	cy_1	 = (y_1 + y_2)/2.0;
495151497Sru	cx_2	 = (x_1 + 3.0*x_2)/4.0;
496151497Sru	cy_2	 = (y_1 + 3.0*y_2)/4.0;
49775584Sru
498151497Sru/*	fprintf(stderr,"Spline %d (%d,%d)\n",numpoints,(int)x_1,(int)y_1);*/
499151497Sru    	vdmprintf("1%s%s",vdmnum((int)x_1,xcoord),vdmnum((int)y_1,ycoord));
500151497Sru	splinerel(x_1,y_1,-1);
501151497Sru	splinerel(cx_1,cy_1,0);
50275584Sru/*	    fprintf(tfp, "PA%.4f,%.4f;PD%.4f,%.4f;\n",
503151497Sru		    x_1, y_1, cx_1, cy_1);*/
50475584Sru
50575584Sru	/*for (p = p->next; p != NULL; p = p->next) {*/
50675584Sru	for (i = 1; i < (numpoints); i++) {
507151497Sru	    x_1	 = x_2;
508151497Sru	    y_1	 = y_2;
509151497Sru/*	    x_2	 = p->x/ppi;
510151497Sru	    y_2	 = p->y/ppi;*/
511151497Sru            x_2	 = x_1 + XCOORD(i);
512151497Sru            y_2	 = y_1 + YCOORD(i);
513151497Sru	    cx_3 = (3.0*x_1 + x_2)/4.0;
514151497Sru	    cy_3 = (3.0*y_1 + y_2)/4.0;
515151497Sru	    cx_4 = (x_1 + x_2)/2.0;
516151497Sru	    cy_4 = (y_1 + y_2)/2.0;
517151497Sru	    /* fprintf(stderr,"Point (%d,%d) - (%d,%d)\n",(int)x_1,(int)(y_1),(int)x_2,(int)y_2);*/
518151497Sru	    quadratic_spline(cx_1, cy_1, cx_2, cy_2, cx_3, cy_3, cx_4, cy_4);
519151497Sru	    cx_1 = cx_4;
520151497Sru	    cy_1 = cy_4;
521151497Sru	    cx_2 = (x_1 + 3.0*x_2)/4.0;
522151497Sru	    cy_2 = (y_1 + 3.0*y_2)/4.0;
523151497Sru	}
524151497Sru	x_1	= x_2;
525151497Sru	y_1	= y_2;
526151497Sru/*	p	= s->points->next;
527151497Sru	x_2	= p->x/ppi;
528151497Sru	y_2	= p->y/ppi;*/
529151497Sru        x_2     = o_x + XCOORD(0);
530151497Sru        y_2     = o_y + YCOORD(0);
531151497Sru	cx_3	= (3.0*x_1 + x_2)/4.0;
532151497Sru	cy_3	= (3.0*y_1 + y_2)/4.0;
533151497Sru	cx_4	= (x_1 + x_2)/2.0;
534151497Sru	cy_4	= (y_1 + y_2)/2.0;
535151497Sru	splinerel(x_1, y_1, 0);
536151497Sru	splinerel(x_1, y_1, 1);
537151497Sru       	/*vdmprintf("%s%s",vdmnum((int)(x_1-lx),xcoord),\
538151497Sru			vdmnum((int)(y_1-ly),ycoord));*/
53975584Sru        vdmprintf("\x1e\n");
540151497Sru/*	    fprintf(tfp, "PA%.4f,%.4f;PU;\n", x_1, y_1);*/
54175584Sru
54275584Sru
543151497Sru}
54475584Sru
54575584Sru
54675584Sru#endif
547