1 
2 /*
3    PGPLOT.xs
4 
5    This file contains the routines provide the glue which
6    allow perl to call C and hence f77/pgplot via the CPGPLOT
7    library.
8 
9 */
10 
11 #define PERL_POLLUTE
12 
13 #include "EXTERN.h"   /* std perl include */
14 #include "perl.h"     /* std perl include */
15 #include "XSUB.h"     /* XSUB include */
16 #include "cpgplot.h"  /* CPGPLOT prototypes */
17 
18 #include "pgfun.c"    /* Function callback code */
19 #include "arrays.h"   /* Pack functions decs */
20 #include "arrays.c"   /* Pack functions defs */
21 
22 typedef int   int2D;    /* So 2D arrays are handled automagically */
23 typedef float float2D;  /* by typemap */
24 
25 /* Buffers for routines that return strings  */
26 
27 static char strbuff[256];
28 static char strbuff2[256];
29 #define SIZEOF(X) sizeof(strbuff)
30 
MAIN__()31 void MAIN__ () {
32    /* Cheat to define MAIN__ symbol */
33    croak("This should never happen");
34 }
35 
36 /* New struct stuff */
37 
38 /* Create structure to hold pointers to PGPLOT functions */
39 
40 struct PGPLOT_function_handle {
41    I32 binversion;
42    void (*cpgmove) (float x, float y);
43    void (*cpgdraw) (float x, float y);
44    void (*cpgqcir) (int *icilo, int *icihi);
45    void (*cpgsci)  (int ci);
46    void (*cpgpt1)  (float x, float y, int sym);
47 };
48 
49 typedef struct PGPLOT_function_handle PGPLOT_function_handle;
50 
51 /* Now create an instance of this */
52 
53 PGPLOT_function_handle myPGPLOT_handle;
54 
55 /* See BOOT section for the rest of the struct stuff */
56 
57 
58 MODULE = PGPLOT     PACKAGE = PGPLOT
59 
60 void
61 pgarro(x1,y1,x2,y2)
62   float	x1
63   float	y1
64   float	x2
65   float	y2
66   CODE:
67     cpgarro(x1,y1,x2,y2);
68 
69 
70 void
71 pgask(flag)
72   Logical	flag
73   CODE:
74     cpgask(flag);
75 
76 void
77 pgaxis(opt,x1,y1,x2,y2,v1,v2,step,nsub,dmajl,dmajr,fmin,disp,orient)
78   char *	opt
79   float	x1
80   float	y1
81   float	x2
82   float	y2
83   float	v1
84   float	v2
85   float	step
86   int	nsub
87   float	dmajl
88   float	dmajr
89   float	fmin
90   float	disp
91   float	orient
92   CODE:
93     cpgaxis(opt,x1,y1,x2,y2,v1,v2,step,nsub,dmajl,dmajr,fmin,disp,orient);
94 
95 
96 
97 int
98 pgband(mode,posn,xref,yref,x,y,ch)
99   int	mode
100   int	posn
101   float	xref
102   float	yref
103   float	x
104   float	y
105   char	ch = NO_INIT
106   CODE:
107     RETVAL = cpgband(mode,posn,xref,yref,&x,&y,&ch);
108   OUTPUT:
109   x
110   y
111   ch
112   RETVAL
113 
114 
115 void
116 pgbbuf()
117   CODE:
118     cpgbbuf();
119 
120 
121 int
122 pgbeg(unit,file,nxsub,nysub)
123   int	unit
124   char *	file
125   int	nxsub
126   int	nysub
127   CODE:
128     RETVAL = cpgbeg(unit,file,nxsub,nysub);
129   OUTPUT:
130   RETVAL
131 
132 
133 int
134 pgbegin(unit,file,nxsub,nysub)
135   int	unit
136   char *	file
137   int	nxsub
138   int	nysub
139   CODE:
140     RETVAL = cpgbeg(unit,file,nxsub,nysub);
141   OUTPUT:
142   RETVAL
143 
144 
145 void
146 pgbin(nbin,x,data,center)
147   int	nbin
148   float *	x
149   float *	data
150   Logical	center
151   CODE:
152     cpgbin(nbin,x,data,center);
153 
154 
155 void
156 pgbox(xopt,xtick,nxsub,yopt,ytick,nysub)
157   char *	xopt
158   float	xtick
159   int	nxsub
160   char *	yopt
161   float	ytick
162   int	nysub
163   CODE:
164     cpgbox(xopt,xtick,nxsub,yopt,ytick,nysub);
165 
166 
167 void
168 pgcirc(xcent,ycent,radius)
169   float	xcent
170   float	ycent
171   float	radius
172   CODE:
173     cpgcirc(xcent,ycent,radius);
174 
175 
176 void
177 pgclos()
178   CODE:
179     cpgclos();
180 
181 void
182 pgconb(a,idim,jdim,i1,i2,j1,j2,c,nc,tr,blank)
183   float2D *	a
184   int	idim
185   int	jdim
186   int	i1
187   int	i2
188   int	j1
189   int	j2
190   float *	c
191   int	nc
192   float *	tr
193   float	blank
194   CODE:
195     cpgconb(a,idim,jdim,i1,i2,j1,j2,c,nc,tr,blank);
196 
197 
198 void
199 pgconf(a,idim,jdim,i1,i2,j1,j2,c1,c2,tr)
200   float2D *	a
201   int	idim
202   int	jdim
203   int	i1
204   int	i2
205   int	j1
206   int	j2
207   float	c1
208   float	c2
209   float *	tr
210   CODE:
211     cpgconf(a,idim,jdim,i1,i2,j1,j2,c1,c2,tr);
212 
213 void
214 pgconl(a,idim,jdim,i1,i2,j1,j2,c,tr,label,intval,minint)
215   float2D *	a
216   int	idim
217   int	jdim
218   int	i1
219   int	i2
220   int	j1
221   int	j2
222   float	c
223   float *	tr
224   char *	label
225   int	intval
226   int	minint
227   CODE:
228     cpgconl(a,idim,jdim,i1,i2,j1,j2,c,tr,label,intval,minint);
229 
230 
231 void
232 pgcons(a,idim,jdim,i1,i2,j1,j2,c,nc,tr)
233   float2D *	a
234   int	idim
235   int	jdim
236   int	i1
237   int	i2
238   int	j1
239   int	j2
240   float *	c
241   int	nc
242   float *	tr
243   CODE:
244     cpgcons(a,idim,jdim,i1,i2,j1,j2,c,nc,tr);
245 
246 
247 void
248 pgcont(a,idim,jdim,i1,i2,j1,j2,c,nc,tr)
249   float2D *	a
250   int	idim
251   int	jdim
252   int	i1
253   int	i2
254   int	j1
255   int	j2
256   float *	c
257   int	nc
258   float *	tr
259   CODE:
260     cpgcont(a,idim,jdim,i1,i2,j1,j2,c,nc,tr);
261 
262 
263 void
264 pgconx(a,idim,jdim,i1,i2,j1,j2,c,nc,plot)
265   float2D *	a
266   int	idim
267   int	jdim
268   int	i1
269   int	i2
270   int	j1
271   int	j2
272   float *	c
273   int	nc
274   SV*	plot
275   CODE:
276     pgfunname[0] = plot;
277     cpgconx(a,idim,jdim,i1,i2,j1,j2,c,nc,pgfunplot);
278 
279 
280 void
281 pgctab(l,r,g,b,nc,contra,bright)
282   float *	l
283   float *	r
284   float *	g
285   float *	b
286   int	nc
287   float	contra
288   float	bright
289   CODE:
290     cpgctab(l,r,g,b,nc,contra,bright);
291 
292 
293 int
294 pgcurs(x,y,ch)
295   float	x
296   float	y
297   char	ch = NO_INIT
298   CODE:
299     RETVAL = cpgcurs(&x,&y,&ch);
300   OUTPUT:
301   x
302   y
303   ch
304   RETVAL
305 
306 
307 int
308 pgcurse(x,y,ch)
309   float	x
310   float	y
311   char	ch = NO_INIT
312   CODE:
313     RETVAL = cpgcurs(&x,&y,&ch);
314   OUTPUT:
315   x
316   y
317   ch
318   RETVAL
319 
320 
321 void
322 pgdraw(x,y)
323   float	x
324   float	y
325   CODE:
326     cpgdraw(x,y);
327 
328 
329 void
330 pgebuf()
331   CODE:
332     cpgebuf();
333 
334 
335 void
336 pgend()
337   CODE:
338     cpgend();
339 
340 
341 void
342 pgenv(xmin,xmax,ymin,ymax,just,axis)
343   float	xmin
344   float	xmax
345   float	ymin
346   float	ymax
347   int	just
348   int	axis
349   CODE:
350     cpgenv(xmin,xmax,ymin,ymax,just,axis);
351 
352 
353 void
354 pgeras()
355   CODE:
356     cpgeras();
357 
358 void
359 pgerrb(dir,n,x,y,e,t)
360   int	dir
361   int	n
362   float *	x
363   float *	y
364   float *	e
365   float	t
366   CODE:
367     cpgerrb(dir,n,x,y,e,t);
368 
369 void
370 pgerr1(dir,x,y,e,t)
371   int	dir
372   float	x
373   float	y
374   float	e
375   float	t
376   CODE:
377     cpgerr1(dir,x,y,e,t);
378 
379 
380 void
381 pgerrx(n,x1,x2,y,t)
382   int	n
383   float *	x1
384   float *	x2
385   float *	y
386   float	t
387   CODE:
388     cpgerrx(n,x1,x2,y,t);
389 
390 
391 void
392 pgerry(n,x,y1,y2,t)
393   int	n
394   float *	x
395   float *	y1
396   float *	y2
397   float	t
398   CODE:
399     cpgerry(n,x,y1,y2,t);
400 
401 
402 void
403 pgetxt()
404   CODE:
405     cpgetxt();
406 
407 
408 void
409 pgfunt(fx,fy,n,tmin,tmax,pgflag)
410   SV*	fx
411   SV*	fy
412   int	n
413   float	tmin
414   float	tmax
415   int	pgflag
416   CODE:
417     pgfunname[0] = fx;
418     pgfunname[1] = fy;
419     cpgfunt(pgfun1,pgfun2,n,tmin,tmax,pgflag);
420 
421 
422 void
423 pgfunx(fy,n,xmin,xmax,pgflag)
424   SV*	fy
425   int	n
426   float	xmin
427   float	xmax
428   int	pgflag
429   CODE:
430     pgfunname[0] = fy;
431     cpgfunx(pgfun1,n,xmin,xmax,pgflag);
432 
433 
434 void
435 pgfuny(fx,n,ymin,ymax,pgflag)
436   SV*	fx
437   int	n
438   float	ymin
439   float	ymax
440   int	pgflag
441   CODE:
442     pgfunname[0] = fx;
443     cpgfuny(pgfun1,n,ymin,ymax,pgflag);
444 
445 
446 void
447 pggray(a,idim,jdim,i1,i2,j1,j2,fg,bg,tr)
448   float2D *	a
449   int	idim
450   int	jdim
451   int	i1
452   int	i2
453   int	j1
454   int	j2
455   float	fg
456   float	bg
457   float *	tr
458   CODE:
459     cpggray(a,idim,jdim,i1,i2,j1,j2,fg,bg,tr);
460 
461 
462 void
463 pghi2d(data,nxv,nyv,ix1,ix2,iy1,iy2,x,ioff,bias,center,ylims)
464   float2D *	data
465   int	nxv
466   int	nyv
467   int	ix1
468   int	ix2
469   int	iy1
470   int	iy2
471   float *	x
472   int	ioff
473   float	bias
474   Logical	center
475   float *	ylims
476   CODE:
477     cpghi2d(data,nxv,nyv,ix1,ix2,iy1,iy2,x,ioff,bias,center,ylims);
478 
479 
480 void
481 pghist(n,data,datmin,datmax,nbin,pgflag)
482   int	n
483   float *	data
484   float	datmin
485   float	datmax
486   int	nbin
487   int	pgflag
488   CODE:
489     cpghist(n,data,datmin,datmax,nbin,pgflag);
490 
491 
492 void
493 pgiden()
494   CODE:
495     cpgiden();
496 
497 
498 void
499 pgimag(a,idim,jdim,i1,i2,j1,j2,a1,a2,tr)
500   float2D *	a
501   int	idim
502   int	jdim
503   int	i1
504   int	i2
505   int	j1
506   int	j2
507   float	a1
508   float	a2
509   float *	tr
510   CODE:
511     cpgimag(a,idim,jdim,i1,i2,j1,j2,a1,a2,tr);
512 
513 
514 void
515 pglab(xlbl,ylbl,toplbl)
516   char *	xlbl
517   char *	ylbl
518   char *	toplbl
519   CODE:
520     cpglab(xlbl,ylbl,toplbl);
521 
522 
523 void
524 pglabel(xlbl,ylbl,toplbl)
525   char *	xlbl
526   char *	ylbl
527   char *	toplbl
528   CODE:
529     cpglab(xlbl,ylbl,toplbl);
530 
531 
532 void
533 pglcur(maxpt,npt,x,y)
534   int	maxpt
535   int	npt
536   float *	x = NO_INIT
537   float *	y = NO_INIT
538   CODE:
539     coerce1D( (SV*)ST(2), maxpt );  /* Make sure arrays are big enough */
540     coerce1D( (SV*)ST(3), maxpt );
541     x = (float *) pack1D( (SV*)ST(2), 'f' );  /* Pack arrays */
542     y = (float *) pack1D( (SV*)ST(3), 'f' );
543     cpglcur(maxpt,&npt,x,y);
544     unpack1D( (SV*)ST(2),  (void *)x, 'f', 0);
545     unpack1D( (SV*)ST(3),  (void *)y, 'f', 0);
546   OUTPUT:
547   npt
548 
549 
550 void
551 pgldev()
552   CODE:
553     cpgldev();
554 
555 
556 void
557 pglen(units,string,xl,yl)
558   int	units
559   char *	string
560   float	xl = NO_INIT
561   float	yl = NO_INIT
562   CODE:
563     cpglen(units,string,&xl,&yl);
564   OUTPUT:
565   xl
566   yl
567 
568 
569 void
570 pgline(n,xpts,ypts)
571   int	n
572   float *	xpts
573   float *	ypts
574   CODE:
575     cpgline(n,xpts,ypts);
576 
577 
578 void
579 pgmove(x,y)
580   float	x
581   float	y
582   CODE:
583     cpgmove(x,y);
584 
585 
586 void
587 pgmtxt(side,disp,coord,fjust,text)
588   char *	side
589   float	disp
590   float	coord
591   float	fjust
592   char *	text
593   CODE:
594     cpgmtxt(side,disp,coord,fjust,text);
595 
596 
597 void
598 pgmtext(side,disp,coord,fjust,text)
599   char *	side
600   float	disp
601   float	coord
602   float	fjust
603   char *	text
604   CODE:
605     cpgmtxt(side,disp,coord,fjust,text);
606 
607 
608 void
609 pgncur(maxpt,npt,x,y,symbol)
610   int	maxpt
611   int	npt
612   float *	x = NO_INIT
613   float *	y = NO_INIT
614   int	symbol
615   CODE:
616     coerce1D( (SV*)ST(2), maxpt );  /* Make sure arrays are big enough */
617     coerce1D( (SV*)ST(3), maxpt );
618     x = (float *) pack1D( (SV*)ST(2), 'f' );  /* Pack arrays */
619     y = (float *) pack1D( (SV*)ST(3), 'f' );
620     cpgncur(maxpt,&npt,x,y,symbol);
621     unpack1D( (SV*)ST(2),  (void *)x, 'f', 0);
622     unpack1D( (SV*)ST(3),  (void *)y, 'f', 0);
623   OUTPUT:
624   npt
625 
626 
627 void
628 pgncurse(maxpt,npt,x,y,symbol)
629   int	maxpt
630   int	npt
631   float *	x = NO_INIT
632   float *	y = NO_INIT
633   int	symbol
634   CODE:
635     coerce1D( (SV*)ST(2), maxpt );  /* Make sure arrays are big enough */
636     coerce1D( (SV*)ST(3), maxpt );
637     x = (float *) pack1D( (SV*)ST(2), 'f' );  /* Pack arrays */
638     y = (float *) pack1D( (SV*)ST(3), 'f' );
639     cpgncur(maxpt,&npt,x,y,symbol);
640     unpack1D( (SV*)ST(2),  (void *)x, 'f', 0);
641     unpack1D( (SV*)ST(3),  (void *)y, 'f', 0);
642   OUTPUT:
643   npt
644 
645 
646 void
647 pgnumb(mm,pp,form,string,nc)
648   int	mm
649   int	pp
650   int	form
651   char *	string = NO_INIT
652   int	nc = NO_INIT
653   CODE:
654     string = strbuff;
655            nc     = SIZEOF(string);
656     cpgnumb(mm,pp,form,string,&nc);
657   OUTPUT:
658   string
659   nc
660 
661 
662 void
663 pgolin(maxpt,npt,x,y,symbol)
664   int	maxpt
665   int	npt
666   float *	x = NO_INIT
667   float *	y = NO_INIT
668   int	symbol
669   CODE:
670     coerce1D( (SV*)ST(2), maxpt );  /* Make sure arrays are big enough */
671     coerce1D( (SV*)ST(3), maxpt );
672     x = (float *) pack1D( (SV*)ST(2), 'f' );  /* Pack arrays */
673     y = (float *) pack1D( (SV*)ST(3), 'f' );
674     cpgolin(maxpt,&npt,x,y,symbol);
675     unpack1D( (SV*)ST(2),  (void *)x, 'f', 0);
676     unpack1D( (SV*)ST(3),  (void *)y, 'f', 0);
677   OUTPUT:
678   npt
679 
680 
681 int
682 pgopen(device)
683   char *	device
684   CODE:
685     RETVAL = cpgopen(device);
686   OUTPUT:
687   RETVAL
688 
689 void
690 pgpage()
691   CODE:
692     cpgpage();
693 
694 
695 void
696 pgadvance()
697   CODE:
698     cpgpage();
699 
700 
701 void
702 pgpanl(ix,iy)
703   int	ix
704   int	iy
705   CODE:
706     cpgpanl(ix,iy);
707 
708 
709 void
710 pgpap(width,aspect)
711   float	width
712   float	aspect
713   CODE:
714     cpgpap(width,aspect);
715 
716 
717 void
718 pgpaper(width,aspect)
719   float	width
720   float	aspect
721   CODE:
722     cpgpap(width,aspect);
723 
724 
725 void
726 pgpixl(ia,idim,jdim,i1,i2,j1,j2,x1,x2,y1,y2)
727   int2D *	ia
728   int	idim
729   int	jdim
730   int	i1
731   int	i2
732   int	j1
733   int	j2
734   float	x1
735   float	x2
736   float	y1
737   float	y2
738   CODE:
739     cpgpixl(ia,idim,jdim,i1,i2,j1,j2,x1,x2,y1,y2);
740 
741 
742 void
743 pgpnts(n,x,y,symbol,ns)
744   int	n
745   float *	x
746   float *	y
747   int *	symbol
748   int	ns
749   CODE:
750     cpgpnts(n,x,y,symbol,ns);
751 
752 void
753 pgpoly(n,xpts,ypts)
754   int	n
755   float *	xpts
756   float *	ypts
757   CODE:
758     cpgpoly(n,xpts,ypts);
759 
760 
761 void
762 pgpt(n,xpts,ypts,symbol)
763   int	n
764   float *	xpts
765   float *	ypts
766   int	symbol
767   CODE:
768     cpgpt(n,xpts,ypts,symbol);
769 
770 void
771 pgpt1(xpt,ypt,symbol)
772   float	xpt
773   float	ypt
774   int	symbol
775   CODE:
776     cpgpt1(xpt,ypt,symbol);
777 
778 void
779 pgpoint(n,xpts,ypts,symbol)
780   int	n
781   float *	xpts
782   float *	ypts
783   int	symbol
784   CODE:
785     cpgpt(n,xpts,ypts,symbol);
786 
787 
788 void
789 pgptxt(x,y,angle,fjust,text)
790   float	x
791   float	y
792   float	angle
793   float	fjust
794   char *	text
795   CODE:
796     cpgptxt(x,y,angle,fjust,text);
797 
798 
799 void
800 pgptext(x,y,angle,fjust,text)
801   float	x
802   float	y
803   float	angle
804   float	fjust
805   char *	text
806   CODE:
807     cpgptxt(x,y,angle,fjust,text);
808 
809 
810 void
811 pgqah(fs,angle,vent)
812   int	fs = NO_INIT
813   float	angle = NO_INIT
814   float	vent = NO_INIT
815   CODE:
816     cpgqah(&fs,&angle,&vent);
817   OUTPUT:
818   fs
819   angle
820   vent
821 
822 
823 void
824 pgqcf(font)
825   int	font = NO_INIT
826   CODE:
827     cpgqcf(&font);
828   OUTPUT:
829   font
830 
831 
832 void
833 pgqch(size)
834   float	size = NO_INIT
835   CODE:
836     cpgqch(&size);
837   OUTPUT:
838   size
839 
840 
841 void
842 pgqci(ci)
843   int	ci = NO_INIT
844   CODE:
845     cpgqci(&ci);
846   OUTPUT:
847   ci
848 
849 
850 void
851 pgqcir(icilo,icihi)
852   int	icilo = NO_INIT
853   int	icihi = NO_INIT
854   CODE:
855     cpgqcir(&icilo,&icihi);
856   OUTPUT:
857   icilo
858   icihi
859 
860 
861 void
862 pgqclp(state)
863   int	state = NO_INIT
864   CODE:
865     cpgqclp(&state);
866   OUTPUT:
867   state
868 
869 void
870 pgqcol(ci1,ci2)
871   int	ci1 = NO_INIT
872   int	ci2 = NO_INIT
873   CODE:
874     cpgqcol(&ci1,&ci2);
875   OUTPUT:
876   ci1
877   ci2
878 
879 void
880 pgqcr(ci,cr,cg,cb)
881   int	ci
882   float	cr = NO_INIT
883   float	cg = NO_INIT
884   float	cb = NO_INIT
885   CODE:
886     cpgqcr(ci,&cr,&cg,&cb);
887   OUTPUT:
888   cr
889   cg
890   cb
891 
892 
893 void
894 pgqcs(units,xch,ych)
895   int	units
896   float	xch = NO_INIT
897   float	ych = NO_INIT
898   CODE:
899     cpgqcs(units,&xch,&ych);
900   OUTPUT:
901   xch
902   ych
903 
904 void
905 pgqdt(n,type,tlen,descr,dlen,inter)
906   int	n
907   char *	type = NO_INIT
908   int	tlen = NO_INIT
909   char *	descr = NO_INIT
910   int	dlen = NO_INIT
911   int	inter = NO_INIT
912   CODE:
913     type = strbuff;
914     tlen = SIZEOF(type);
915     descr = strbuff2;
916     dlen = SIZEOF(descr);
917     cpgqdt(n,type,&tlen,descr,&dlen,&inter);
918   OUTPUT:
919     type
920     tlen
921     descr
922     dlen
923     inter
924 
925 void
926 pgqfs(fs)
927   int	fs = NO_INIT
928   CODE:
929     cpgqfs(&fs);
930   OUTPUT:
931   fs
932 
933 
934 void
935 pgqhs(angle,sepn,phase)
936   float	angle = NO_INIT
937   float	sepn = NO_INIT
938   float	phase = NO_INIT
939   CODE:
940     cpgqhs(&angle,&sepn,&phase);
941   OUTPUT:
942   angle
943   sepn
944   phase
945 
946 void
947 pgqid(id)
948   int	id = NO_INIT
949   CODE:
950     cpgqid(&id);
951   OUTPUT:
952   id
953 
954 void
955 pgqinf(item,value,length)
956   char *	item
957   char *	value = NO_INIT
958   int	length = NO_INIT
959   CODE:
960     value = strbuff;
961     length = SIZEOF(value);
962     cpgqinf(item,value,&length);
963   OUTPUT:
964   value
965   length
966 
967 
968 void
969 pgqitf(itf)
970   int	itf = NO_INIT
971   CODE:
972     cpgqitf(&itf);
973   OUTPUT:
974   itf
975 
976 
977 void
978 pgqls(ls)
979   int	ls = NO_INIT
980   CODE:
981     cpgqls(&ls);
982   OUTPUT:
983   ls
984 
985 
986 void
987 pgqlw(lw)
988   int	lw = NO_INIT
989   CODE:
990     cpgqlw(&lw);
991   OUTPUT:
992   lw
993 
994 void
995 pgqndt(n)
996   int	n = NO_INIT
997   CODE:
998     cpgqndt(&n);
999   OUTPUT:
1000   n
1001 
1002 void
1003 pgqpos(x,y)
1004   float	x = NO_INIT
1005   float	y = NO_INIT
1006   CODE:
1007     cpgqpos(&x,&y);
1008   OUTPUT:
1009   x
1010   y
1011 
1012 
1013 void
1014 pgqtbg(tbci)
1015   int	tbci = NO_INIT
1016   CODE:
1017     cpgqtbg(&tbci);
1018   OUTPUT:
1019   tbci
1020 
1021 
1022 void
1023 pgqtxt(x,y,angle,fjust,text,xbox,ybox)
1024   float	x
1025   float	y
1026   float	angle
1027   float	fjust
1028   char *	text
1029   float *	xbox = NO_INIT
1030   float *	ybox = NO_INIT
1031   CODE:
1032     xbox = get_mortalspace(4,'f');
1033     ybox = get_mortalspace(4,'f');
1034     cpgqtxt(x,y,angle,fjust,text,xbox,ybox);
1035     unpack1D( (SV*)ST(5),  (void *)xbox, 'f', 4);
1036     unpack1D( (SV*)ST(6),  (void *)ybox, 'f', 4);
1037 
1038 void
1039 pgqvp(units,x1,x2,y1,y2)
1040   int	units
1041   float	x1 = NO_INIT
1042   float	x2 = NO_INIT
1043   float	y1 = NO_INIT
1044   float	y2 = NO_INIT
1045   CODE:
1046     cpgqvp(units,&x1,&x2,&y1,&y2);
1047   OUTPUT:
1048   x1
1049   x2
1050   y1
1051   y2
1052 
1053 
1054 void
1055 pgqvsz(units,x1,x2,y1,y2)
1056   int	units
1057   float	x1 = NO_INIT
1058   float	x2 = NO_INIT
1059   float	y1 = NO_INIT
1060   float	y2 = NO_INIT
1061   CODE:
1062     cpgqvsz(units,&x1,&x2,&y1,&y2);
1063   OUTPUT:
1064   x1
1065   x2
1066   y1
1067   y2
1068 
1069 
1070 void
1071 pgqwin(x1,x2,y1,y2)
1072   float	x1 = NO_INIT
1073   float	x2 = NO_INIT
1074   float	y1 = NO_INIT
1075   float	y2 = NO_INIT
1076   CODE:
1077     cpgqwin(&x1,&x2,&y1,&y2);
1078   OUTPUT:
1079   x1
1080   x2
1081   y1
1082   y2
1083 
1084 
1085 void
1086 pgrect(x1,x2,y1,y2)
1087   float	x1
1088   float	x2
1089   float	y1
1090   float	y2
1091   CODE:
1092     cpgrect(x1,x2,y1,y2);
1093 
1094 
1095 float
1096 pgrnd(x,nsub)
1097   float	x
1098   int	nsub = NO_INIT
1099   CODE:
1100     RETVAL = cpgrnd(x,&nsub);
1101   OUTPUT:
1102   nsub
1103   RETVAL
1104 
1105 
1106 void
1107 pgrnge(x1,x2,xlo,xhi)
1108   float	x1
1109   float	x2
1110   float	xlo = NO_INIT
1111   float	xhi = NO_INIT
1112   CODE:
1113     cpgrnge(x1,x2,&xlo,&xhi);
1114   OUTPUT:
1115   xlo
1116   xhi
1117 
1118 
1119 void
1120 pgsah(fs,angle,vent)
1121   int	fs
1122   float	angle
1123   float	vent
1124   CODE:
1125     cpgsah(fs,angle,vent);
1126 
1127 
1128 void
1129 pgsave()
1130   CODE:
1131     cpgsave();
1132 
1133 
1134 void
1135 pgunsa()
1136   CODE:
1137     cpgunsa();
1138 
1139 
1140 void
1141 pgscf(font)
1142   int	font
1143   CODE:
1144     cpgscf(font);
1145 
1146 
1147 void
1148 pgsch(size)
1149   float	size
1150   CODE:
1151     cpgsch(size);
1152 
1153 
1154 void
1155 pgsci(ci)
1156   int	ci
1157   CODE:
1158     cpgsci(ci);
1159 
1160 
1161 void
1162 pgscir(icilo,icihi)
1163   int	icilo
1164   int	icihi
1165   CODE:
1166     cpgscir(icilo,icihi);
1167 
1168 void
1169 pgsclp(state)
1170   int	state
1171   CODE:
1172     cpgsclp(state);
1173 
1174 void
1175 pgscr(ci,cr,cg,cb)
1176   int	ci
1177   float	cr
1178   float	cg
1179   float	cb
1180   CODE:
1181     cpgscr(ci,cr,cg,cb);
1182 
1183 void
1184 pgscrl(dx,dy)
1185   float	dx
1186   float	dy
1187   CODE:
1188     cpgscrl(dx,dy);
1189 
1190 void
1191 pgscrn(ci,name,ier)
1192   int	ci
1193   char *	name
1194   int	ier = NO_INIT
1195   CODE:
1196     cpgscrn(ci,name,&ier);
1197   OUTPUT:
1198   ier
1199 
1200 
1201 void
1202 pgsfs(fs)
1203   int	fs
1204   CODE:
1205     cpgsfs(fs);
1206 
1207 
1208 void
1209 pgshls(ci,ch,cl,cs)
1210   int	ci
1211   float	ch
1212   float	cl
1213   float	cs
1214   CODE:
1215     cpgshls(ci,ch,cl,cs);
1216 
1217 
1218 void
1219 pgshs(angle,sepn,phase)
1220   float	angle
1221   float	sepn
1222   float	phase
1223   CODE:
1224     cpgshs(angle,sepn,phase);
1225 
1226 
1227 void
1228 pgsitf(itf)
1229   int	itf
1230   CODE:
1231     cpgsitf(itf);
1232 
1233 void
1234 pgslct(id)
1235   int	id
1236   CODE:
1237     cpgslct(id);
1238 
1239 void
1240 pgsls(ls)
1241   int	ls
1242   CODE:
1243     cpgsls(ls);
1244 
1245 
1246 void
1247 pgslw(lw)
1248   int	lw
1249   CODE:
1250     cpgslw(lw);
1251 
1252 
1253 void
1254 pgstbg(tbci)
1255   int	tbci
1256   CODE:
1257     cpgstbg(tbci);
1258 
1259 
1260 void
1261 pgsubp(nxsub,nysub)
1262   int	nxsub
1263   int	nysub
1264   CODE:
1265     cpgsubp(nxsub,nysub);
1266 
1267 
1268 void
1269 pgsvp(xleft,xright,ybot,ytop)
1270   float	xleft
1271   float	xright
1272   float	ybot
1273   float	ytop
1274   CODE:
1275     cpgsvp(xleft,xright,ybot,ytop);
1276 
1277 
1278 void
1279 pgvport(xleft,xright,ybot,ytop)
1280   float	xleft
1281   float	xright
1282   float	ybot
1283   float	ytop
1284   CODE:
1285     cpgsvp(xleft,xright,ybot,ytop);
1286 
1287 
1288 void
1289 pgswin(x1,x2,y1,y2)
1290   float	x1
1291   float	x2
1292   float	y1
1293   float	y2
1294   CODE:
1295     cpgswin(x1,x2,y1,y2);
1296 
1297 
1298 void
1299 pgwindow(x1,x2,y1,y2)
1300   float	x1
1301   float	x2
1302   float	y1
1303   float	y2
1304   CODE:
1305     cpgswin(x1,x2,y1,y2);
1306 
1307 
1308 void
1309 pgtbox(xopt,xtick,nxsub,yopt,ytick,nysub)
1310   char *	xopt
1311   float	xtick
1312   int	nxsub
1313   char *	yopt
1314   float	ytick
1315   int	nysub
1316   CODE:
1317     cpgtbox(xopt,xtick,nxsub,yopt,ytick,nysub);
1318 
1319 void
1320 pgtick(x1,y1,x2,y2,v,tikl,tikr,disp,orient,str)
1321   float	x1
1322   float	y1
1323   float	x2
1324   float	y2
1325   float	v
1326   float	tikl
1327   float	tikr
1328   float	disp
1329   float	orient
1330   char *	str
1331   CODE:
1332     cpgtick(x1,y1,x2,y2,v,tikl,tikr,disp,orient,str);
1333 
1334 void
1335 pgtext(x,y,text)
1336   float	x
1337   float	y
1338   char *	text
1339   CODE:
1340     cpgtext(x,y,text);
1341 
1342 
1343 void
1344 pgupdt()
1345   CODE:
1346     cpgupdt();
1347 
1348 
1349 void
1350 pgvect(a,b,idim,jdim,i1,i2,j1,j2,c,nc,tr,blank)
1351   float2D *	a
1352   float2D *	b
1353   int	idim
1354   int	jdim
1355   int	i1
1356   int	i2
1357   int	j1
1358   int	j2
1359   float	c
1360   int	nc
1361   float *	tr
1362   float	blank
1363   CODE:
1364     cpgvect(a,b,idim,jdim,i1,i2,j1,j2,c,nc,tr,blank);
1365 
1366 
1367 void
1368 pgvsiz(xleft,xright,ybot,ytop)
1369   float	xleft
1370   float	xright
1371   float	ybot
1372   float	ytop
1373   CODE:
1374     cpgvsiz(xleft,xright,ybot,ytop);
1375 
1376 
1377 void
1378 pgvsize(xleft,xright,ybot,ytop)
1379   float	xleft
1380   float	xright
1381   float	ybot
1382   float	ytop
1383   CODE:
1384     cpgvsiz(xleft,xright,ybot,ytop);
1385 
1386 
1387 void
1388 pgvstd()
1389   CODE:
1390     cpgvstd();
1391 
1392 
1393 void
1394 pgvstand()
1395   CODE:
1396     cpgvstd();
1397 
1398 
1399 void
1400 pgwedg(side,disp,width,fg,bg,label)
1401   char *	side
1402   float	disp
1403   float	width
1404   float	fg
1405   float	bg
1406   char *	label
1407   CODE:
1408     cpgwedg(side,disp,width,fg,bg,label);
1409 
1410 
1411 void
1412 pgwnad(x1,x2,y1,y2)
1413   float	x1
1414   float	x2
1415   float	y1
1416   float	y2
1417   CODE:
1418     cpgwnad(x1,x2,y1,y2);
1419 
1420 BOOT:
1421    /* New struct stuff */
1422 
1423    /* Initialise structure of pointers to core C routines */
1424 
1425    myPGPLOT_handle.binversion  = 20001129; /* Date structure redefined */
1426    myPGPLOT_handle.cpgdraw     = cpgdraw;
1427    myPGPLOT_handle.cpgmove     = cpgmove;
1428    myPGPLOT_handle.cpgqcir     = cpgqcir;
1429    myPGPLOT_handle.cpgsci      = cpgsci;
1430    myPGPLOT_handle.cpgpt1      = cpgpt1;
1431 
1432    /*
1433       "Publish" pointer to this structure in perl variable for use
1434        by other modules
1435    */
1436 
1437    sv_setiv(perl_get_sv("PGPLOT::HANDLE",TRUE|GV_ADDMULTI), (IV) (void*) &myPGPLOT_handle);
1438 
1439 
1440