PLplot  5.11.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
scstubs.c
Go to the documentation of this file.
1 // C stub routines.
2 //
3 // Copyright (C) 2004-2014 Alan W. Irwin
4 //
5 // This file is part of PLplot.
6 //
7 // PLplot is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU Library General Public License as published
9 // by the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // PLplot is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Library General Public License for more details.
16 //
17 // You should have received a copy of the GNU Library General Public License
18 // along with PLplot; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 //
21 //
22 // The stubs contained here are the ones that are relatively simple,
23 // i.e. involving only a call convention change or integer-to-string
24 // conversion. Exceptions are plparseopts and plstripc which have
25 // a few more complications in them.
26 //
27 
28 #include "plstubs.h"
29 
30 #ifdef CVF
31 #define STDCALL __stdcall
32 #else
33 #define STDCALL
34 #endif
35 static void ( STDCALL *plmapform )( PLINT *, PLFLT *, PLFLT * ); // Note: slightly different prototype than
36  // (*mapform)!
37 // Slightly different to (*label_func) as we don't support PLPointer for
38 // additional data in f95.
39 // Note the hidden argument!
40 static void ( STDCALL *pllabelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT );
41 
42 // Slightly different to C version as we don't support PLPointer for additional data
43 static void ( STDCALL *pltransform )( PLFLT *, PLFLT *, PLFLT *, PLFLT * );
44 
45 
46 static char **pllegend_text;
47 static char **pllegend_symbols;
48 static char **plcolorbar_labels;
49 static char **plcolorbar_axisopts;
50 
51 // Function prototypes
52 static void pltransformf2c( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer data );
53 void PL_SETCONTLABELFORMAT( PLINT *lexp, PLINT *sigdig );
54 void PL_SETCONTLABELFORMATa( PLINT *lexp, PLINT *sigdig );
55 void PL_SETCONTLABELPARAM( PLFLT *offset, PLFLT *size, PLFLT *spacing, PLINT *active );
56 void PL_SETCONTLABELPARAMa( PLFLT *offset, PLFLT *size, PLFLT *spacing, PLINT *active );
57 void PLABORT7( const char *text );
58 void PLADV( PLINT *sub );
59 void PLARC( PLFLT *x, PLFLT *y, PLFLT *a, PLFLT *b, PLFLT *angle1, PLFLT *angle2, PLFLT *rotate, PLBOOL *fill );
60 void PLAXES7( PLFLT *x0, PLFLT *y0, const char *xopt, PLFLT *xtick,
61  PLINT *nxsub, const char *yopt, PLFLT *ytick, PLINT *nysub );
62 void PLBIN( PLINT *nbin, PLFLT *x, PLFLT *y, PLINT *center );
63 void PLBTIME( PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT *ctime );
64 void PLBOP( void );
65 void PLBOX7( const char *xopt, PLFLT *xtick, PLINT *nxsub,
66  const char *yopt, PLFLT *ytick, PLINT *nysub );
67 void PLBOX37( const char *xopt, const char *xlabel, PLFLT *xtick, PLINT *nxsub,
68  const char *yopt, const char *ylabel, PLFLT *ytick, PLINT *nysub,
69  const char *zopt, const char *zlabel, PLFLT *ztick, PLINT *nzsub );
70 void PLCALC_WORLD( PLFLT *rx, PLFLT *ry, PLFLT *wx, PLFLT *wy, PLINT *window );
71 void PLCALC_WORLDa( PLFLT *rx, PLFLT *ry, PLFLT *wx, PLFLT *wy, PLINT *window );
72 void PLCLEAR( void );
73 void PLCOL0( PLINT *icol );
74 void PLCOL1( PLFLT *col );
75 void PLCOLORBAR( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height,
76  PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y,
77  PLFLT *x_length, PLFLT *y_length,
78  PLINT *bg_color, PLINT *bb_color, PLINT *bb_style,
79  PLFLT *low_cap_color, PLFLT *high_cap_color,
80  PLINT *cont_color, PLFLT *cont_width,
81  PLINT *n_labels, const PLINT *label_opts,
82  PLINT *n_axes,
83  const PLFLT *ticks, const PLINT *sub_ticks,
84  const PLINT *n_values, const PLFLT *values );
85 void PLCONFIGTIME( PLFLT *scale, PLFLT *offset1, PLFLT *offset2, PLINT *ccontrol, PLBOOL *ifbtime_offset, PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec );
86 void PLCPSTRM( PLINT *iplsr, PLBOOL *flags );
87 void PLCTIME( PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT *ctime );
88 void PLEND( void );
89 void PLEND1( void );
90 void PLENV( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLINT *just, PLINT *axis );
91 void PLENV0( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLINT *just, PLINT *axis );
92 void PLEOP( void );
93 void PLERRX( PLINT *n, PLFLT *xmin, PLFLT *xmax, PLFLT *y );
94 void PLERRY( PLINT *n, PLFLT *x, PLFLT *ymin, PLFLT *ymax );
95 void PLFAMADV( void );
96 void PLFILL( PLINT *n, PLFLT *x, PLFLT *y );
97 void PLFILL3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z );
98 void PLFLUSH( void );
99 void PLFONT( PLINT *font );
100 void PLFONTLD( PLINT *charset );
101 void PLGCHR( PLFLT *chrdef, PLFLT *chrht );
102 void PLGCOL0( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b );
103 void PLGCOL0A( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b, PLFLT *a );
104 void PLGCOLBG( PLINT *r, PLINT *g, PLINT *b );
105 void PLGCOLBGA( PLINT *r, PLINT *g, PLINT *b, PLFLT *a );
106 void PLGCOMPRESSION( PLINT *compression );
107 void PLGCMAP1_RANGE( PLFLT *min_color, PLFLT *max_color );
108 void PLGDEV7( char *dev, int length );
109 void PLGDIDEV( PLFLT *p_mar, PLFLT *p_aspect, PLFLT *p_jx, PLFLT *p_jy );
110 void PLGDIORI( PLFLT *p_rot );
111 void PLGDIPLT( PLFLT *p_xmin, PLFLT *p_ymin, PLFLT *p_xmax, PLFLT *p_ymax );
112 void PLGETCURSOR( PLGraphicsIn *gin );
113 void PLGFAM( PLINT *fam, PLINT *num, PLINT *bmax );
114 void PLGFCI( PLUNICODE *pfci );
115 void PLGFNAM7( char *fnam, int length );
116 void PLGFONT( PLINT *family, PLINT *style, PLINT *weight );
117 void PLGLEVEL( PLINT *level );
118 void PLGPAGE( PLFLT *xpmm, PLFLT *ypmm, PLINT *xwid, PLINT *ywid, PLINT *xoff, PLINT *yoff );
119 void PLGRA( void );
120 void PLGRADIENT( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *angle );
121 void PLGSPA( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax );
122 void PLGSTRM( PLINT *strm );
123 void PLGVER7( char *ver );
124 void PLGVPD( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax );
125 void PLGVPW( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax );
126 void PLGXAX( PLINT *digmax, PLINT *digits );
127 void PLGYAX( PLINT *digmax, PLINT *digits );
128 void PLGZAX( PLINT *digmax, PLINT *digits );
129 void PLHIST( PLINT *n, PLFLT *data, PLFLT *datmin, PLFLT *datmax, PLINT *nbin, PLINT *oldwin );
130 void PLHLS( PLFLT *hue, PLFLT *light, PLFLT *sat );
131 void PLHLSRGB( PLFLT *h, PLFLT *l, PLFLT *s, PLFLT *r, PLFLT *g, PLFLT *b );
132 void PLIMAGEFR( PLFLT *idata, PLINT *nx, PLINT *ny,
133  PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLFLT *zmin, PLFLT *zmax,
134  PLFLT *Dxmin, PLFLT *Dxmax, PLFLT *Dymin, PLFLT *Dymax,
135  PLFLT *valuemin, PLFLT *valuemax );
136 void PLIMAGE( PLFLT *idata, PLINT *nx, PLINT *ny,
137  PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLFLT *zmin, PLFLT *zmax,
138  PLFLT *Dxmin, PLFLT *Dxmax, PLFLT *Dymin, PLFLT *Dymax );
139 void PLINIT( void );
140 void PLJOIN( PLFLT *x1, PLFLT *y1, PLFLT *x2, PLFLT *y2 );
141 void PLLAB7( const char *xlab, const char *ylab, const char *title );
142 void PLLEGEND_CNV_TEXT( PLINT *id, PLINT *number, char *string, PLINT length );
143 void PLLEGEND( PLFLT *p_legend_width, PLFLT *p_legend_height,
144  PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y, PLFLT *plot_width,
145  PLINT *bg_color, PLINT *bb_color, PLINT *bb_style,
146  PLINT *nrow, PLINT *ncolumn,
147  PLINT *nlegend, const PLINT *opt_array,
148  PLFLT *text_offset, PLFLT *text_scale, PLFLT *text_spacing,
149  PLFLT *text_justification,
150  const PLINT *text_colors,
151  const PLINT *box_colors, const PLINT *box_patterns,
152  const PLFLT *box_scales, const PLFLT *box_line_widths,
153  const PLINT *line_colors, const PLINT *line_styles,
154  const PLFLT *line_widths,
155  const PLINT *symbol_colors, const PLFLT *symbol_scales,
156  const PLINT *symbol_numbers );
157 void PLLIGHTSOURCE( PLFLT *x, PLFLT *y, PLFLT *z );
158 void PLLINE( PLINT *n, PLFLT *x, PLFLT *y );
159 void PLLINE3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z );
160 void PLLSTY( PLINT *lin );
161 void PLMAP7( const char *type,
162  PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat );
163 void PLMAPFILL7( const char *type,
164  PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat, PLINT *plotentries, PLINT *nplotentries );
165 void PLMAPLINE7( const char *type,
166  PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat, PLINT *plotentries, PLINT *nplotentries );
167 void PLMAPSTRING7( const char *type, const char *string,
168  PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat, PLINT *plotentries, PLINT *nplotentries );
169 void PLMAPTEX7( const char *type, PLFLT *dx, PLFLT *dy, PLFLT *just, const char *text,
170  PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat, PLINT *plotentry );
171 void PLMERIDIANS7( PLFLT *dlong, PLFLT *dlat,
172  PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat );
173 void PLMKSTRM( PLINT *p_strm );
174 void PLMTEX7( const char *side, PLFLT *disp, PLFLT *pos, PLFLT *just, const char *text );
175 void PLMTEX37( const char *side, PLFLT *disp, PLFLT *pos, PLFLT *just, const char *text );
176 void PLPARSEOPTS7( int *numargs, const char *iargs, PLINT *mode, PLINT *maxindex );
177 void PLPAT( PLINT *nlin, PLINT *inc, PLINT *del );
178 void PLPATH( PLINT *n, PLFLT *x1, PLFLT *y1, PLFLT *x2, PLFLT *y2 );
179 void PLPOIN( PLINT *n, PLFLT *x, PLFLT *y, PLINT *code );
180 void PLPOIN3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT *code );
181 void PLPOLY3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, PLBOOL *draw, PLBOOL *ifcc );
182 void PLPREC( PLINT *setp, PLINT *prec );
183 void PLPSTY( PLINT *patt );
184 void PLPTEX7( PLFLT *x, PLFLT *y, PLFLT *dx, PLFLT *dy, PLFLT *just, const char *text );
185 void PLPTEX37( PLFLT *x, PLFLT *y, PLFLT *z,
186  PLFLT *dx, PLFLT *dy, PLFLT *dz,
187  PLFLT *sx, PLFLT *sy, PLFLT *sz,
188  PLFLT *just, const char *text );
189 PLFLT PLRANDD( void );
190 void PLREPLOT( void );
191 void PLRGB( PLFLT *red, PLFLT *green, PLFLT *blue );
192 void PLRGB1( PLINT *r, PLINT *g, PLINT *b );
193 void PLRGBHLS( PLFLT *r, PLFLT *g, PLFLT *b, PLFLT *h, PLFLT *l, PLFLT *s );
194 void PLSCHR( PLFLT *def, PLFLT *scale );
195 void PLSCMAP0( PLINT *r, PLINT *g, PLINT *b, PLINT *ncol0 );
196 void PLSCMAP0A( PLINT *r, PLINT *g, PLINT *b, PLFLT *a, PLINT *ncol0 );
197 void PLSCMAP0N( PLINT *n );
198 void PLSCMAP1( PLINT *r, PLINT *g, PLINT *b, PLINT *ncol1 );
199 void PLSCMAP1A( PLINT *r, PLINT *g, PLINT *b, PLFLT *a, PLINT *ncol1 );
200 void PLSCMAP1L( PLBOOL *itype, PLINT *npts, PLFLT *intensity,
201  PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *alt_hue_path );
202 void PLSCMAP1L2( PLBOOL *itype, PLINT *npts, PLFLT *intensity,
203  PLFLT *coord1, PLFLT *coord2, PLFLT *coord3 );
204 void PLSCMAP1LA( PLBOOL *itype, PLINT *npts, PLFLT *intensity,
205  PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLBOOL *alt_hue_path );
206 void PLSCMAP1LA2( PLBOOL *itype, PLINT *npts, PLFLT *intensity,
207  PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a );
208 void PLSCMAP1N( PLINT *n );
209 void PLSCMAP1_RANGE( PLFLT *min_color, PLFLT *max_color );
210 void PLSCOL0( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b );
211 void PLSCOL0A( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b, PLFLT *a );
212 void PLSCOLBG( PLINT *r, PLINT *g, PLINT *b );
213 void PLSCOLBGA( PLINT *r, PLINT *g, PLINT *b, PLFLT *a );
214 void PLSCOLOR( PLINT *color );
215 void PLSCOMPRESSION( PLINT *compression );
216 void PLSDEV7( const char *dev );
217 void PLSDIDEV( PLFLT *mar, PLFLT *aspect, PLFLT *jx, PLFLT *jy );
218 void PLSDIMAP( PLINT *dimxmin, PLINT *dimxmax, PLINT *dimymin, PLINT *dimymax,
219  PLFLT *dimxpmm, PLFLT *dimypmm );
220 void PLSDIORI( PLFLT *rot );
221 void PLSDIPLT( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax );
222 void PLSDIPLZ( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax );
223 void PLSEED( unsigned int *s );
224 void PLSESC( PLINT *esc );
225 void PLSETOPT7( const char *opt, const char *optarg );
226 void PLSFAM( PLINT *fam, PLINT *num, PLINT *bmax );
227 void PLSFCI( PLUNICODE *fci );
228 void PLSFNAM7( const char *fnam );
229 void PLSFONT( PLINT *family, PLINT *style, PLINT *weight );
230 void PLSLABELFUNC_ON( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ) );
231 void PLSLABELFUNC_ONa( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ) );
232 void PLSLABELFUNC_OFF( PLINT *dummy );
233 void PLSLABELFUNC_OFFa( PLINT *dummy );
234 void PLSLABELFUNC_NONE( void );
235 void PLSLABELFUNC_NONEa( void );
236 void PLSMAJ( PLFLT *def, PLFLT *scale );
237 void PLSMEM( PLINT *maxx, PLINT *maxy, void *plotmem );
238 void PLSMEMA( PLINT *maxx, PLINT *maxy, void *plotmem );
239 void PLSMIN( PLFLT *def, PLFLT *scale );
240 void PLSORI( PLINT *ori );
241 void PLSPAGE( PLFLT *xpmm, PLFLT *ypmm,
242  PLINT *xwid, PLINT *ywid, PLINT *xoff, PLINT *yoff );
243 void PLSPAL07( const char *filename );
244 void PLSPAL17( const char *filename, PLBOOL *interpolate );
245 void PLSPAUSE( PLBOOL *pause );
246 void PLSSTRM( PLINT *strm );
247 void PLSSUB( PLINT *nx, PLINT *ny );
248 void PLSSYM( PLFLT *def, PLFLT *scale );
249 void PLSTAR( PLINT *nx, PLINT *ny );
250 void PLSTART7( const char *devname, PLINT *nx, PLINT *ny );
251 void PLSTRANSFORM1( void ( STDCALL *transformfunc )( PLFLT *, PLFLT *, PLFLT *, PLFLT * ) );
252 void PLSTRANSFORM2( PLINT *dummy );
253 void PLSTRANSFORM3( void );
254 void PLSTRING7( PLINT *n, PLFLT *x, PLFLT *y, const char *string );
255 void PLSTRING37( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, const char *string );
256 void PLSTRIPA( PLINT *id, PLINT *pen, PLFLT *x, PLFLT *y );
257 void PLSTRIPC( PLINT *id, const char *xspec, const char *yspec,
258  PLFLT *xmin, PLFLT *xmax, PLFLT *xjump, PLFLT *ymin, PLFLT *ymax,
259  PLFLT *xlpos, PLFLT *ylpos,
260  PLBOOL *y_ascl, PLBOOL *acc,
261  PLINT *colbox, PLINT *collab,
262  PLINT *colline, PLINT *styline,
263  const char *legline0, const char *legline1,
264  const char *legline2, const char *legline3,
265  const char *labx, const char *laby, const char *labtop );
266 void PLSTRIPD( PLINT *id );
267 void PLSTYL( PLINT *n, PLINT *mark, PLINT *space );
268 void PLSVECT1( PLFLT *arrowx, PLFLT *arrowy, PLINT *npts, PLBOOL *fill );
269 void PLSVECT2( void );
270 void PLSVPA( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax );
271 void PLSXAX( PLINT *digmax, PLINT *digits );
272 void PLSYAX( PLINT *digmax, PLINT *digits );
273 void PLSYM( PLINT *n, PLFLT *x, PLFLT *y, PLINT *code );
274 void PLSZAX( PLINT *digmax, PLINT *digits );
275 void PLTEXT( void );
276 void PLTIMEFMT7( const char *fmt );
277 void PLVASP( PLFLT *aspect );
278 void PLVPAS( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLFLT *aspect );
279 void PLVPOR( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax );
280 void PLVSTA( void );
281 void PLW3D( PLFLT *basex, PLFLT *basey, PLFLT *height,
283  PLFLT *zmin, PLFLT *zmax,
284  PLFLT *alt, PLFLT *az );
285 void PLWIDTH( PLFLT *width );
286 void PLWIND( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax );
287 void PLXORMOD( PLBOOL *mode, PLBOOL *status );
288 
289 static void
291 {
292  ( *pltransform )( &x, &y, tx, ty );
293 }
294 
295 void
297 {
298  c_pl_setcontlabelformat( *lexp, *sigdig );
299 }
300 
301 void
303 {
304  c_pl_setcontlabelformat( *lexp, *sigdig );
305 }
306 
307 void
308 PL_SETCONTLABELPARAM( PLFLT *offset, PLFLT *size, PLFLT *spacing, PLINT *active )
309 {
310  c_pl_setcontlabelparam( *offset, *size, *spacing, *active );
311 }
312 
313 void
314 PL_SETCONTLABELPARAMa( PLFLT *offset, PLFLT *size, PLFLT *spacing, PLINT *active )
315 {
316  c_pl_setcontlabelparam( *offset, *size, *spacing, *active );
317 }
318 
319 void
320 PLABORT7( const char *text )
321 {
322  plabort( text );
323 }
324 
325 void
326 PLADV( PLINT *sub )
327 {
328  c_pladv( *sub );
329 }
330 
331 void
332 PLARC( PLFLT *x, PLFLT *y, PLFLT *a, PLFLT *b, PLFLT *angle1, PLFLT *angle2, PLFLT *rotate, PLBOOL *fill )
333 {
334  c_plarc( *x, *y, *a, *b, *angle1, *angle2, *rotate, *fill );
335 }
336 
337 void
338 PLAXES7( PLFLT *x0, PLFLT *y0, const char *xopt, PLFLT *xtick,
339  PLINT *nxsub, const char *yopt, PLFLT *ytick, PLINT *nysub )
340 {
341  c_plaxes( *x0, *y0, xopt, *xtick, *nxsub, yopt, *ytick, *nysub );
342 }
343 
344 void
345 PLBIN( PLINT *nbin, PLFLT *x, PLFLT *y, PLINT *center )
346 {
347  c_plbin( *nbin, x, y, *center );
348 }
349 
350 void
351 PLBTIME( PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT *ctime )
352 {
353  c_plbtime( year, month, day, hour, min, sec, *ctime );
354 }
355 
356 void
357 PLBOP( void )
358 {
359  c_plbop();
360 }
361 
362 void
363 PLBOX7( const char *xopt, PLFLT *xtick, PLINT *nxsub,
364  const char *yopt, PLFLT *ytick, PLINT *nysub )
365 {
366  c_plbox( xopt, *xtick, *nxsub, yopt, *ytick, *nysub );
367 }
368 
369 void
370 PLBOX37( const char *xopt, const char *xlabel, PLFLT *xtick, PLINT *nxsub,
371  const char *yopt, const char *ylabel, PLFLT *ytick, PLINT *nysub,
372  const char *zopt, const char *zlabel, PLFLT *ztick, PLINT *nzsub )
373 {
374  c_plbox3( xopt, xlabel, *xtick, *nxsub,
375  yopt, ylabel, *ytick, *nysub,
376  zopt, zlabel, *ztick, *nzsub );
377 }
378 
379 void
380 PLCALC_WORLD( PLFLT *rx, PLFLT *ry, PLFLT *wx, PLFLT *wy, PLINT *window )
381 {
382  c_plcalc_world( *rx, *ry, wx, wy, window );
383 }
384 
385 void
386 PLCALC_WORLDa( PLFLT *rx, PLFLT *ry, PLFLT *wx, PLFLT *wy, PLINT *window )
387 {
388  c_plcalc_world( *rx, *ry, wx, wy, window );
389 }
390 
391 void
392 PLCLEAR( void )
393 {
394  c_plclear();
395 }
396 
397 void
398 PLCOL0( PLINT *icol )
399 {
400  c_plcol0( *icol );
401 }
402 
403 void
404 PLCOL1( PLFLT *col )
405 {
406  c_plcol1( *col );
407 }
408 
409 void
410 PLCOLORBAR( PLFLT *p_colorbar_width, PLFLT *p_colorbar_height,
411  PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y,
412  PLFLT *x_length, PLFLT *y_length,
413  PLINT *bg_color, PLINT *bb_color, PLINT *bb_style,
414  PLFLT *low_cap_color, PLFLT *high_cap_color,
415  PLINT *cont_color, PLFLT *cont_width,
416  PLINT *n_labels, const PLINT *label_opts,
417  PLINT *n_axes,
418  const PLFLT *ticks, const PLINT *sub_ticks,
419  const PLINT *n_values, const PLFLT *values )
420 {
421  // Need to allocate 2d C array for values
422  PLFLT **a;
423  int i, j;
424 
425  a = (PLFLT **) malloc( sizeof ( PLFLT * ) * (size_t) ( *n_axes ) );
426  for ( i = 0; i < *n_axes; i++ )
427  {
428  a[i] = (PLFLT *) malloc( sizeof ( PLFLT ) * (size_t) n_values[i] );
429  for ( j = 0; j < n_values[i]; j++ )
430  {
431  a[i][j] = values[i + j * ( *n_axes )];
432  }
433  }
434 
435  c_plcolorbar( p_colorbar_width, p_colorbar_height,
436  *opt, *position, *x, *y,
437  *x_length, *y_length,
438  *bg_color, *bb_color, *bb_style,
439  *low_cap_color, *high_cap_color,
440  *cont_color, *cont_width,
441  *n_labels, label_opts, (const char * const *) plcolorbar_labels,
442  *n_axes, (const char * const *) plcolorbar_axisopts,
443  ticks, sub_ticks,
444  n_values, (const PLFLT * const *) a );
445  free( *plcolorbar_labels );
446  free( plcolorbar_labels );
447  free( *plcolorbar_axisopts );
448  free( plcolorbar_axisopts );
449  for ( i = 0; i < *n_axes; i++ )
450  {
451  free( a[i] );
452  }
453  free( a );
454 }
455 
456 void
457 PLCONFIGTIME( PLFLT *scale, PLFLT *offset1, PLFLT *offset2, PLINT *ccontrol, PLBOOL *ifbtime_offset, PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec )
458 {
459  c_plconfigtime( *scale, *offset1, *offset2, *ccontrol, *ifbtime_offset, *year, *month, *day, *hour, *min, *sec );
460 }
461 
462 void
463 PLCPSTRM( PLINT *iplsr, PLBOOL *flags )
464 {
465  c_plcpstrm( *iplsr, *flags );
466 }
467 
468 void
469 PLCTIME( PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT *ctime )
470 {
471  c_plctime( *year, *month, *day, *hour, *min, *sec, ctime );
472 }
473 
474 void
475 PLEND( void )
476 {
477  c_plend();
478 }
479 
480 void
481 PLEND1( void )
482 {
483  c_plend1();
484 }
485 
486 void
488  PLINT *just, PLINT *axis )
489 {
490  c_plenv( *xmin, *xmax, *ymin, *ymax, *just, *axis );
491 }
492 
493 void
495  PLINT *just, PLINT *axis )
496 {
497  c_plenv0( *xmin, *xmax, *ymin, *ymax, *just, *axis );
498 }
499 
500 void
501 PLEOP( void )
502 {
503  c_pleop();
504 }
505 
506 void
508 {
509  c_plerrx( *n, xmin, xmax, y );
510 }
511 
512 void
514 {
515  c_plerry( *n, x, ymin, ymax );
516 }
517 
518 void
519 PLFAMADV( void )
520 {
521  c_plfamadv();
522 }
523 
524 void
525 PLFILL( PLINT *n, PLFLT *x, PLFLT *y )
526 {
527  c_plfill( *n, x, y );
528 }
529 
530 void
531 PLFILL3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z )
532 {
533  c_plfill3( *n, x, y, z );
534 }
535 
536 void
537 PLFLUSH( void )
538 {
539  c_plflush();
540 }
541 
542 void
543 PLFONT( PLINT *font )
544 {
545  c_plfont( *font );
546 }
547 
548 void
549 PLFONTLD( PLINT *charset )
550 {
551  c_plfontld( *charset );
552 }
553 
554 void
555 PLGCHR( PLFLT *chrdef, PLFLT *chrht )
556 {
557  c_plgchr( chrdef, chrht );
558 }
559 
560 void
561 PLGCMAP1_RANGE( PLFLT *min_color, PLFLT *max_color )
562 {
563  c_plgcmap1_range( min_color, max_color );
564 }
565 
566 void
567 PLGCOL0( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b )
568 {
569  c_plgcol0( *icol0, r, g, b );
570 }
571 
572 void
573 PLGCOL0A( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b, PLFLT *a )
574 {
575  c_plgcol0a( *icol0, r, g, b, a );
576 }
577 
578 void
579 PLGCOLBG( PLINT *r, PLINT *g, PLINT *b )
580 {
581  c_plgcolbg( r, g, b );
582 }
583 
584 void
585 PLGCOLBGA( PLINT *r, PLINT *g, PLINT *b, PLFLT *a )
586 {
587  c_plgcolbga( r, g, b, a );
588 }
589 
590 void
591 PLGCOMPRESSION( PLINT *compression )
592 {
593  c_plgcompression( compression );
594 }
595 
596 void
597 PLGDEV7( char *dev, int PL_UNUSED( length ) )
598 {
599  c_plgdev( dev );
600 }
601 
602 void
603 PLGDIDEV( PLFLT *p_mar, PLFLT *p_aspect, PLFLT *p_jx, PLFLT *p_jy )
604 {
605  c_plgdidev( p_mar, p_aspect, p_jx, p_jy );
606 }
607 
608 void
609 PLGDIORI( PLFLT *p_rot )
610 {
611  c_plgdiori( p_rot );
612 }
613 
614 void
615 PLGDIPLT( PLFLT *p_xmin, PLFLT *p_ymin, PLFLT *p_xmax, PLFLT *p_ymax )
616 {
617  c_plgdiplt( p_xmin, p_ymin, p_xmax, p_ymax );
618 }
619 
620 void
622 {
623  plGetCursor( gin );
624 }
625 
626 void
627 PLGFAM( PLINT *fam, PLINT *num, PLINT *bmax )
628 {
629  c_plgfam( fam, num, bmax );
630 }
631 
632 // Note: Fortran does not distinguish between unsigned and signed integers
633 // so the 32-bit PLUNICODE can be mapped to 4-byte Fortran integer outside
634 // this routine.
635 void
636 PLGFCI( PLUNICODE *pfci )
637 {
638  c_plgfci( pfci );
639 }
640 
641 void
642 PLGFNAM7( char *fnam, int PL_UNUSED( length ) )
643 {
644  c_plgfnam( fnam );
645 }
646 
647 void
648 PLGFONT( PLINT *family, PLINT *style, PLINT *weight )
649 {
650  c_plgfont( family, style, weight );
651 }
652 
653 void
654 PLGLEVEL( PLINT *level )
655 {
656  c_plglevel( level );
657 }
658 
659 void
660 PLGPAGE( PLFLT *xpmm, PLFLT *ypmm, PLINT *xwid, PLINT *ywid,
661  PLINT *xoff, PLINT *yoff )
662 {
663  c_plgpage( xpmm, ypmm, xwid, ywid, xoff, yoff );
664 }
665 
666 void
667 PLGRA( void )
668 {
669  c_plgra();
670 }
671 
672 void
673 PLGRADIENT( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *angle )
674 {
675  c_plgradient( *n, x, y, *angle );
676 }
677 
678 // AM - removed: also defined, and better in sccont.c
679 // void
680 // PLGRIDDATA(PLFLT *x, PLFLT *y, PLFLT *z, PLINT *npts,
681 // PLFLT *xg, PLINT *nptsx, PLFLT *yg, PLINT *nptsy,
682 // PLFLT **zg, PLINT *type, PLFLT *data)
683 // {
684 // c_plgriddata(x, y, z, *npts,
685 // xg, *nptsx, yg, *nptsy,
686 // zg, *type, *data);
687 // }
688 //
689 
690 void
692 {
693  c_plgspa( xmin, xmax, ymin, ymax );
694 }
695 
696 void
697 PLGSTRM( PLINT *strm )
698 {
699  c_plgstrm( strm );
700 }
701 
702 void
703 PLGVER7( char *ver )
704 {
705  c_plgver( ver );
706 }
707 
708 void
709 PLGVPD( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax )
710 {
711  c_plgvpd( p_xmin, p_xmax, p_ymin, p_ymax );
712 }
713 
714 void
715 PLGVPW( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax )
716 {
717  c_plgvpw( p_xmin, p_xmax, p_ymin, p_ymax );
718 }
719 
720 void
721 PLGXAX( PLINT *digmax, PLINT *digits )
722 {
723  c_plgxax( digmax, digits );
724 }
725 
726 void
727 PLGYAX( PLINT *digmax, PLINT *digits )
728 {
729  c_plgyax( digmax, digits );
730 }
731 
732 void
733 PLGZAX( PLINT *digmax, PLINT *digits )
734 {
735  c_plgzax( digmax, digits );
736 }
737 
738 void
739 PLHIST( PLINT *n, PLFLT *data, PLFLT *datmin, PLFLT *datmax,
740  PLINT *nbin, PLINT *oldwin )
741 {
742  c_plhist( *n, data, *datmin, *datmax, *nbin, *oldwin );
743 }
744 
745 #ifdef PL_DEPRECATED
746 void
747 PLHLS( PLFLT *hue, PLFLT *light, PLFLT *sat )
748 {
749  c_plhls( *hue, *light, *sat );
750 }
751 #endif // PL_DEPRECATED
752 
753 void
754 PLHLSRGB( PLFLT *h, PLFLT *l, PLFLT *s, PLFLT *r, PLFLT *g, PLFLT *b )
755 {
756  c_plhlsrgb( *h, *l, *s, r, g, b );
757 }
758 
759 #if 0
760 void
761 PLIMAGEFR( PLFLT *idata, PLINT *nx, PLINT *ny,
762  PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLFLT *zmin, PLFLT *zmax,
763  PLFLT *Dxmin, PLFLT *Dxmax, PLFLT *Dymin, PLFLT *Dymax,
764  PLFLT *valuemin, PLFLT *valuemax )
765 {
766  int i, j;
767  PLFLT **pidata;
768 
769  plAlloc2dGrid( &pidata, *nx, *ny );
770 
771  for ( i = 0; i < *nx; i++ )
772  {
773  for ( j = 0; j < *ny; j++ )
774  {
775  pidata[i][j] = idata[i + j * ( *nx )];
776  }
777  }
778 
779  c_plimagefr( (const PLFLT * const *) pidata, *nx, *ny,
780  *xmin, *xmax, *ymin, *ymax, *zmin, *zmax,
781  *Dxmin, *Dxmax, *Dymin, *Dymax,
782  *valuemin, *valuemax );
783 
784  plFree2dGrid( pidata, *nx, *ny );
785 }
786 #endif
787 
788 void
789 PLIMAGE( PLFLT *idata, PLINT *nx, PLINT *ny,
790  PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLFLT *zmin, PLFLT *zmax,
791  PLFLT *Dxmin, PLFLT *Dxmax, PLFLT *Dymin, PLFLT *Dymax )
792 {
793  int i, j;
794  PLFLT **pidata;
795 
796  plAlloc2dGrid( &pidata, *nx, *ny );
797 
798  for ( i = 0; i < *nx; i++ )
799  {
800  for ( j = 0; j < *ny; j++ )
801  {
802  pidata[i][j] = idata[i + j * ( *nx )];
803  }
804  }
805 
806  c_plimage( (const PLFLT * const *) pidata, *nx, *ny,
807  *xmin, *xmax, *ymin, *ymax, *zmin, *zmax,
808  *Dxmin, *Dxmax, *Dymin, *Dymax );
809 
810  plFree2dGrid( pidata, *nx, *ny );
811 }
812 
813 void
814 PLINIT( void )
815 {
816  c_plinit();
817 }
818 
819 void
820 PLJOIN( PLFLT *x1, PLFLT *y1, PLFLT *x2, PLFLT *y2 )
821 {
822  c_pljoin( *x1, *y1, *x2, *y2 );
823 }
824 
825 void
826 PLLAB7( const char *xlab, const char *ylab, const char *title )
827 {
828  c_pllab( xlab, ylab, title );
829 }
830 
831 static void
832 pllabelfuncf2c( PLINT axis, PLFLT value, char *label, PLINT length, PLPointer PL_UNUSED( data ) )
833 {
834  int i;
835 
836  // (AM) Note the hidden argument "length" - it ensures that the string "label"
837  // is recognised to have that length
838  //
839  ( *pllabelfunc )( &axis, &value, label, &length, length );
840 
841  // Ensure string is null terminated
842  i = length - 1;
843  while ( ( i >= 0 ) && ( label[i] == ' ' ) )
844  i--;
845  label[i + 1] = '\0';
846 }
847 
848 // Auxiliary function to create a C-compatible string array
849 // Note the hidden argument
850 void
851 PLLEGEND_CNV_TEXT( PLINT *id, PLINT *number, char *string, PLINT length )
852 {
853  int j;
854  int i;
855  char **p_string;
856  char *data;
857 
858  // Ensure the strings are null terminated
859 
860  p_string = (char **) malloc( sizeof ( char * ) * (size_t) ( *number ) );
861  data = (char *) malloc( sizeof ( char * ) * (size_t) ( ( *number ) * ( length + 1 ) ) );
862 
863  for ( j = 0; j < ( *number ); j++ )
864  {
865  p_string[j] = data + j * ( length + 1 );
866  memcpy( p_string[j], &string[j * length], (size_t) length );
867  p_string[j][length] = '\0';
868  i = length - 1;
869  while ( ( i >= 0 ) && ( p_string[j][i] == ' ' ) )
870  i--;
871  p_string[j][i + 1] = '\0';
872  }
873 
874  switch ( *id )
875  {
876  case 1:
877  pllegend_text = p_string;
878  break;
879  case 2:
880  pllegend_symbols = p_string;
881  break;
882  case 3:
883  plcolorbar_labels = p_string;
884  break;
885  case 4:
886  plcolorbar_axisopts = p_string;
887  break;
888  default:
889  // Unknown
890  free( data );
891  free( p_string );
892  break;
893  }
894 }
895 
896 void PLLEGEND(
897  PLFLT *p_legend_width, PLFLT *p_legend_height,
898  PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y, PLFLT *plot_width,
899  PLINT *bg_color, PLINT *bb_color, PLINT *bb_style,
900  PLINT *nrow, PLINT *ncolumn,
901  PLINT *nlegend, const PLINT *opt_array,
902  PLFLT *text_offset, PLFLT *text_scale, PLFLT *text_spacing,
903  PLFLT *text_justification,
904  const PLINT *text_colors,
905  const PLINT *box_colors, const PLINT *box_patterns,
906  const PLFLT *box_scales, const PLFLT *box_line_widths,
907  const PLINT *line_colors, const PLINT *line_styles,
908  const PLFLT *line_widths,
909  const PLINT *symbol_colors, const PLFLT *symbol_scales,
910  const PLINT *symbol_numbers )
911 {
912  c_pllegend( p_legend_width, p_legend_height,
913  *opt, *position, *x, *y, *plot_width,
914  *bg_color, *bb_color, *bb_style,
915  *nrow, *ncolumn,
916  *nlegend, opt_array,
917  *text_offset, *text_scale, *text_spacing,
918  *text_justification,
919  text_colors, (const char * const *) pllegend_text,
920  box_colors, box_patterns,
921  box_scales, box_line_widths,
922  line_colors, line_styles,
923  line_widths,
924  symbol_colors, symbol_scales,
925  symbol_numbers, (const char * const *) pllegend_symbols );
926 
927  free( *pllegend_text );
928  free( pllegend_text );
929  free( *pllegend_symbols );
930  free( pllegend_symbols );
931 }
932 
933 void
934 PLLIGHTSOURCE( PLFLT *x, PLFLT *y, PLFLT *z )
935 {
936  c_pllightsource( *x, *y, *z );
937 }
938 
939 void
940 PLLINE( PLINT *n, PLFLT *x, PLFLT *y )
941 {
942  c_plline( *n, x, y );
943 }
944 
945 void
946 PLLINE3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z )
947 {
948  c_plline3( *n, x, y, z );
949 }
950 
951 void
952 PLLSTY( PLINT *lin )
953 {
954  c_pllsty( *lin );
955 }
956 
957 static void
958 plmapf2c( PLINT n, PLFLT *x, PLFLT *y )
959 {
960  ( *plmapform )( &n, x, y );
961 }
962 
963 void
964 PLMAP7( const char *type,
965  PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat )
966 
967 {
968  if ( plmapform )
969  c_plmap( plmapf2c, type, *minlong, *maxlong, *minlat, *maxlat );
970  else
971  c_plmap( NULL, type, *minlong, *maxlong, *minlat, *maxlat );
972 }
973 
974 void
975 PLMAPFILL7( const char *type,
976  PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat, PLINT *plotentries, PLINT *nplotentries )
977 
978 {
979  PLINT *pplotentries = plotentries;
980  if ( *nplotentries == 0 )
981  pplotentries = NULL;
982  if ( plmapform )
983  c_plmapfill( plmapf2c, type, *minlong, *maxlong, *minlat, *maxlat, pplotentries, *nplotentries );
984  else
985  c_plmapfill( NULL, type, *minlong, *maxlong, *minlat, *maxlat, pplotentries, *nplotentries );
986 }
987 
988 void
989 PLMAPLINE7( const char *type,
990  PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat, PLINT *plotentries, PLINT *nplotentries )
991 
992 {
993  PLINT *pplotentries = plotentries;
994  if ( *nplotentries == 0 )
995  pplotentries = NULL;
996  if ( plmapform )
997  c_plmapline( plmapf2c, type, *minlong, *maxlong, *minlat, *maxlat, pplotentries, *nplotentries );
998  else
999  c_plmapline( NULL, type, *minlong, *maxlong, *minlat, *maxlat, pplotentries, *nplotentries );
1000 }
1001 
1002 void
1003 PLMAPSTRING7( const char *type, const char *string,
1004  PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat, PLINT *plotentries, PLINT *nplotentries )
1005 
1006 {
1007  PLINT *pplotentries = plotentries;
1008  if ( *nplotentries == 0 )
1009  pplotentries = NULL;
1010  if ( plmapform )
1011  c_plmapstring( plmapf2c, type, string, *minlong, *maxlong, *minlat, *maxlat, pplotentries, *nplotentries );
1012  else
1013  c_plmapstring( NULL, type, string, *minlong, *maxlong, *minlat, *maxlat, pplotentries, *nplotentries );
1014 }
1015 
1016 void
1017 PLMAPTEX7( const char *type, PLFLT *dx, PLFLT *dy, PLFLT *just, const char *text,
1018  PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat, PLINT *plotentry )
1019 
1020 {
1021  if ( plmapform )
1022  c_plmaptex( plmapf2c, type, *dx, *dy, *just, text, *minlong, *maxlong, *minlat, *maxlat, *plotentry );
1023  else
1024  c_plmaptex( NULL, type, *dx, *dy, *just, text, *minlong, *maxlong, *minlat, *maxlat, *plotentry );
1025 }
1026 
1027 void
1028 PLMERIDIANS7( PLFLT *dlong, PLFLT *dlat,
1029  PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat )
1030 {
1031  if ( plmapform )
1032  c_plmeridians( plmapf2c, *dlong, *dlat, *minlong, *maxlong, *minlat, *maxlat );
1033  else
1034  c_plmeridians( NULL, *dlong, *dlat, *minlong, *maxlong, *minlat, *maxlat );
1035 }
1036 
1037 void
1038 PLMKSTRM( PLINT *p_strm )
1039 {
1040  c_plmkstrm( p_strm );
1041 }
1042 
1043 void
1044 PLMTEX7( const char *side, PLFLT *disp, PLFLT *pos, PLFLT *just, const char *text )
1045 {
1046  c_plmtex( side, *disp, *pos, *just, text );
1047 }
1048 
1049 void
1050 PLMTEX37( const char *side, PLFLT *disp, PLFLT *pos, PLFLT *just, const char *text )
1051 {
1052  c_plmtex3( side, *disp, *pos, *just, text );
1053 }
1054 
1055 void
1056 PLPARSEOPTS7( int *numargs, const char *iargs, PLINT *mode, PLINT *maxindex )
1057 {
1058 // Same as in plparseopts fortran subroutine that calls this one.
1059 #define MAXARGS 20
1060  if ( *numargs <= MAXARGS )
1061  {
1062  const char *argv[MAXARGS];
1063  int i;
1064  for ( i = 0; i < *numargs; i++ )
1065  {
1066  argv[i] = iargs + ( i * *maxindex );
1067 // fprintf(stderr, "%d - %s\n", i, argv[i]);
1068  }
1069  c_plparseopts( numargs, argv, *mode );
1070  }
1071  else
1072  fprintf( stderr, "plparseopts7: numargs too large\n" );
1073 }
1074 
1075 void
1076 PLPAT( PLINT *nlin, PLINT *inc, PLINT *del )
1077 {
1078  c_plpat( *nlin, inc, del );
1079 }
1080 
1081 void
1082 PLPATH( PLINT *n, PLFLT *x1, PLFLT *y1, PLFLT *x2, PLFLT *y2 )
1083 {
1084  c_plpath( *n, *x1, *y1, *x2, *y2 );
1085 }
1086 
1087 void
1088 PLPOIN( PLINT *n, PLFLT *x, PLFLT *y, PLINT *code )
1089 {
1090  c_plpoin( *n, x, y, *code );
1091 }
1092 
1093 void
1094 PLPOIN3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT *code )
1095 {
1096  c_plpoin3( *n, x, y, z, *code );
1097 }
1098 
1099 void
1100 PLPOLY3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, PLBOOL *draw, PLBOOL *ifcc )
1101 {
1102  c_plpoly3( *n, x, y, z, draw, *ifcc );
1103 }
1104 
1105 void
1106 PLPREC( PLINT *setp, PLINT *prec )
1107 {
1108  c_plprec( *setp, *prec );
1109 }
1110 
1111 void
1112 PLPSTY( PLINT *patt )
1113 {
1114  c_plpsty( *patt );
1115 }
1116 
1117 void
1118 PLPTEX7( PLFLT *x, PLFLT *y, PLFLT *dx, PLFLT *dy, PLFLT *just, const char *text )
1119 {
1120  c_plptex( *x, *y, *dx, *dy, *just, text );
1121 }
1122 
1123 void
1124 PLPTEX37(
1125  PLFLT *x, PLFLT *y, PLFLT *z,
1126  PLFLT *dx, PLFLT *dy, PLFLT *dz,
1127  PLFLT *sx, PLFLT *sy, PLFLT *sz,
1128  PLFLT *just, const char *text )
1129 {
1130  c_plptex3( *x, *y, *z, *dx, *dy, *dz, *sx, *sy, *sz, *just, text );
1131 }
1132 
1133 PLFLT
1134 PLRANDD()
1135 {
1136  return c_plrandd();
1137 }
1138 
1139 void
1140 PLREPLOT( void )
1141 {
1142  c_plreplot();
1143 }
1144 
1145 #ifdef PL_DEPRECATED
1146 void
1147 PLRGB( PLFLT *red, PLFLT *green, PLFLT *blue )
1148 {
1149  c_plrgb( *red, *green, *blue );
1150 }
1151 #endif // PL_DEPRECATED
1152 
1153 #ifdef PL_DEPRECATED
1154 void
1155 PLRGB1( PLINT *r, PLINT *g, PLINT *b )
1156 {
1157  c_plrgb1( *r, *g, *b );
1158 }
1159 #endif // PL_DEPRECATED
1160 
1161 void
1162 PLRGBHLS( PLFLT *r, PLFLT *g, PLFLT *b, PLFLT *h, PLFLT *l, PLFLT *s )
1163 {
1164  c_plrgbhls( *r, *g, *b, h, l, s );
1165 }
1166 
1167 void
1168 PLSCHR( PLFLT *def, PLFLT *scale )
1169 {
1170  c_plschr( *def, *scale );
1171 }
1172 
1173 void
1174 PLSCMAP0( PLINT *r, PLINT *g, PLINT *b, PLINT *ncol0 )
1175 {
1176  c_plscmap0( r, g, b, *ncol0 );
1177 }
1178 
1179 void
1180 PLSCMAP0A( PLINT *r, PLINT *g, PLINT *b, PLFLT *a, PLINT *ncol0 )
1181 {
1182  c_plscmap0a( r, g, b, a, *ncol0 );
1183 }
1184 
1185 void
1186 PLSCMAP0N( PLINT *n )
1187 {
1188  c_plscmap0n( *n );
1189 }
1190 
1191 void
1192 PLSCMAP1( PLINT *r, PLINT *g, PLINT *b, PLINT *ncol1 )
1193 {
1194  c_plscmap1( r, g, b, *ncol1 );
1195 }
1196 
1197 void
1198 PLSCMAP1A( PLINT *r, PLINT *g, PLINT *b, PLFLT *a, PLINT *ncol1 )
1199 {
1200  c_plscmap1a( r, g, b, a, *ncol1 );
1201 }
1202 
1203 void
1204 PLSCMAP1L( PLBOOL *itype, PLINT *npts, PLFLT *intensity,
1205  PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *alt_hue_path )
1206 {
1207  c_plscmap1l( *itype, *npts, intensity, coord1, coord2, coord3, alt_hue_path );
1208 }
1209 
1210 void
1211 PLSCMAP1L2( PLBOOL *itype, PLINT *npts, PLFLT *intensity,
1212  PLFLT *coord1, PLFLT *coord2, PLFLT *coord3 )
1213 {
1214  c_plscmap1l( *itype, *npts, intensity, coord1, coord2, coord3, NULL );
1215 }
1216 
1217 void
1218 PLSCMAP1LA( PLBOOL *itype, PLINT *npts, PLFLT *intensity,
1219  PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLBOOL *alt_hue_path )
1220 {
1221  c_plscmap1la( *itype, *npts, intensity, coord1, coord2, coord3, a, alt_hue_path );
1222 }
1223 
1224 void
1225 PLSCMAP1LA2( PLBOOL *itype, PLINT *npts, PLFLT *intensity,
1226  PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a )
1227 {
1228  c_plscmap1la( *itype, *npts, intensity, coord1, coord2, coord3, a, NULL );
1229 }
1230 
1231 void
1232 PLSCMAP1N( PLINT *n )
1233 {
1234  c_plscmap1n( *n );
1235 }
1236 
1237 void
1238 PLSCMAP1_RANGE( PLFLT *min_color, PLFLT *max_color )
1239 {
1240  c_plscmap1_range( *min_color, *max_color );
1241 }
1242 
1243 void
1244 PLSCOL0( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b )
1245 {
1246  c_plscol0( *icol0, *r, *g, *b );
1247 }
1248 
1249 void
1250 PLSCOL0A( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b, PLFLT *a )
1251 {
1252  c_plscol0a( *icol0, *r, *g, *b, *a );
1253 }
1254 
1255 void
1256 PLSCOLBG( PLINT *r, PLINT *g, PLINT *b )
1257 {
1258  c_plscolbg( *r, *g, *b );
1259 }
1260 
1261 void
1262 PLSCOLBGA( PLINT *r, PLINT *g, PLINT *b, PLFLT *a )
1263 {
1264  c_plscolbga( *r, *g, *b, *a );
1265 }
1266 
1267 void
1268 PLSCOLOR( PLINT *color )
1269 {
1270  c_plscolor( *color );
1271 }
1272 
1273 void
1274 PLSCOMPRESSION( PLINT *compression )
1275 {
1276  c_plscompression( *compression );
1277 }
1278 
1279 void
1280 PLSDEV7( const char *dev )
1281 {
1282  c_plsdev( dev );
1283 }
1284 
1285 void
1286 PLSDIDEV( PLFLT *mar, PLFLT *aspect, PLFLT *jx, PLFLT *jy )
1287 {
1288  c_plsdidev( *mar, *aspect, *jx, *jy );
1289 }
1290 
1291 void
1292 PLSDIMAP( PLINT *dimxmin, PLINT *dimxmax, PLINT *dimymin, PLINT *dimymax,
1293  PLFLT *dimxpmm, PLFLT *dimypmm )
1294 {
1295  c_plsdimap( *dimxmin, *dimxmax, *dimymin, *dimymax,
1296  *dimxpmm, *dimypmm );
1297 }
1298 
1299 void
1300 PLSDIORI( PLFLT *rot )
1301 {
1302  c_plsdiori( *rot );
1303 }
1304 
1305 void
1306 PLSDIPLT( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax )
1307 {
1308  c_plsdiplt( *xmin, *ymin, *xmax, *ymax );
1309 }
1310 
1311 void
1312 PLSDIPLZ( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax )
1313 {
1314  c_plsdiplz( *xmin, *ymin, *xmax, *ymax );
1315 }
1316 
1317 void
1318 PLSEED( unsigned int *s )
1319 {
1320  c_plseed( *s );
1321 }
1322 
1323 void
1324 PLSESC( PLINT *esc )
1325 {
1326  c_plsesc( (char) *esc );
1327 }
1328 
1329 // Auxiliary routine - not to be used publicly
1330 //
1331 #define PLSETMAPFORMC FNAME( PLSETMAPFORMC, plsetmapformc )
1332 #define PLCLEARMAPFORMC FNAME( PLCLEARMAPFORMC, plclearmapformc )
1333 void PLSETMAPFORMC( void ( STDCALL *mapform )( PLINT *, PLFLT *, PLFLT * ) );
1334 void PLCLEARMAPFORMC( void );
1335 
1336 void
1337 PLSETMAPFORMC( void ( STDCALL *mapform )( PLINT *, PLFLT *, PLFLT * ) )
1338 {
1339  plmapform = mapform;
1340 }
1341 void
1343 {
1344  plmapform = NULL;
1345 }
1346 
1347 void
1348 PLSETOPT7( const char *opt, const char *oarg )
1349 {
1350  c_plsetopt( opt, oarg );
1351 }
1352 
1353 void
1354 PLSFAM( PLINT *fam, PLINT *num, PLINT *bmax )
1355 {
1356  c_plsfam( *fam, *num, *bmax );
1357 }
1358 
1359 // Note: Fortran does not distinguish between unsigned and signed integers
1360 // so the 32-bit PLUNICODE can be mapped to 4-byte Fortran integer outside
1361 // this routine.
1362 void
1364 {
1365  c_plsfci( *fci );
1366 }
1367 
1368 void
1369 PLSFNAM7( const char *fnam )
1370 {
1371  c_plsfnam( fnam );
1372 }
1373 
1374 void
1375 PLSFONT( PLINT *family, PLINT *style, PLINT *weight )
1376 {
1377  c_plsfont( *family, *style, *weight );
1378 }
1379 
1380 void
1381 PLSLABELFUNC_ON( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ) )
1382 {
1383  pllabelfunc = labelfunc;
1384  // N.B. neglect pointer to additional data for f95
1385  c_plslabelfunc( pllabelfuncf2c, NULL );
1386 }
1387 
1388 void
1389 PLSLABELFUNC_ONa( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ) )
1390 {
1391  pllabelfunc = labelfunc;
1392  // N.B. neglect pointer to additional data for f95
1393  c_plslabelfunc( pllabelfuncf2c, NULL );
1394 }
1395 
1396 void
1397 PLSLABELFUNC_OFF( PLINT * PL_UNUSED( dummy ) )
1398 {
1399  pllabelfunc = NULL;
1400  c_plslabelfunc( NULL, NULL );
1401 }
1402 
1403 void
1404 PLSLABELFUNC_OFFa( PLINT * PL_UNUSED( dummy ) )
1405 {
1406  pllabelfunc = NULL;
1407  c_plslabelfunc( NULL, NULL );
1408 }
1409 
1410 void
1411 PLSLABELFUNC_NONE( void )
1412 {
1413  pllabelfunc = NULL;
1414  c_plslabelfunc( NULL, NULL );
1415 }
1416 void
1417 PLSLABELFUNC_NONEa( void )
1418 {
1419  pllabelfunc = NULL;
1420  c_plslabelfunc( NULL, NULL );
1421 }
1422 
1423 void
1424 PLSMAJ( PLFLT *def, PLFLT *scale )
1425 {
1426  c_plsmaj( *def, *scale );
1427 }
1428 
1429 void
1430 PLSMEM( PLINT *maxx, PLINT *maxy, void *plotmem )
1431 {
1432  c_plsmem( *maxx, *maxy, plotmem );
1433 }
1434 
1435 void
1436 PLSMEMA( PLINT *maxx, PLINT *maxy, void *plotmem )
1437 {
1438  c_plsmema( *maxx, *maxy, plotmem );
1439 }
1440 
1441 void
1442 PLSMIN( PLFLT *def, PLFLT *scale )
1443 {
1444  c_plsmin( *def, *scale );
1445 }
1446 
1447 void
1448 PLSORI( PLINT *ori )
1449 {
1450  c_plsori( *ori );
1451 }
1452 
1453 void
1454 PLSPAGE( PLFLT *xpmm, PLFLT *ypmm,
1455  PLINT *xwid, PLINT *ywid, PLINT *xoff, PLINT *yoff )
1456 {
1457  c_plspage( *xpmm, *ypmm, *xwid, *ywid, *xoff, *yoff );
1458 }
1459 
1460 void
1461 PLSPAL07( const char *filename )
1462 {
1463  c_plspal0( filename );
1464 }
1465 
1466 void
1467 PLSPAL17( const char *filename, PLBOOL *interpolate )
1468 {
1469  c_plspal1( filename, *interpolate );
1470 }
1471 
1472 void
1473 PLSPAUSE( PLBOOL *ipause )
1474 {
1475  c_plspause( *ipause );
1476 }
1477 
1478 void
1479 PLSSTRM( PLINT *strm )
1480 {
1481  c_plsstrm( *strm );
1482 }
1483 
1484 void
1485 PLSSUB( PLINT *nx, PLINT *ny )
1486 {
1487  c_plssub( *nx, *ny );
1488 }
1489 
1490 void
1491 PLSSYM( PLFLT *def, PLFLT *scale )
1492 {
1493  c_plssym( *def, *scale );
1494 }
1495 
1496 void
1497 PLSTAR( PLINT *nx, PLINT *ny )
1498 {
1499  c_plstar( *nx, *ny );
1500 }
1501 
1502 void
1503 PLSTART7( const char *devname, PLINT *nx, PLINT *ny )
1504 {
1505  c_plstart( devname, *nx, *ny );
1506 }
1507 
1508 void
1509 PLSTRANSFORM1( void ( STDCALL *transformfunc )( PLFLT *, PLFLT *, PLFLT *, PLFLT * ) )
1510 {
1511  pltransform = transformfunc;
1512 
1513  c_plstransform( pltransformf2c, NULL );
1514 }
1515 
1516 void
1517 PLSTRANSFORM2( PLINT * PL_UNUSED( dummy ) )
1518 {
1519  pltransform = NULL;
1520 
1521  c_plstransform( NULL, NULL );
1522 }
1523 
1524 void
1525 PLSTRANSFORM3( void )
1526 {
1527  pltransform = NULL;
1528 
1529  c_plstransform( NULL, NULL );
1530 }
1531 
1532 void
1533 PLSTRING7( PLINT *n, PLFLT *x, PLFLT *y, const char *string )
1534 {
1535  c_plstring( *n, x, y, string );
1536 }
1537 
1538 void
1539 PLSTRING37( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, const char *string )
1540 {
1541  c_plstring3( *n, x, y, z, string );
1542 }
1543 
1544 void
1545 PLSTRIPA( PLINT *id, PLINT *pen, PLFLT *x, PLFLT *y )
1546 {
1547  c_plstripa( *id, *pen, *x, *y );
1548 }
1549 
1550 void
1551 PLSTRIPC( PLINT *id, const char *xspec, const char *yspec,
1552  PLFLT *xmin, PLFLT *xmax, PLFLT *xjump, PLFLT *ymin, PLFLT *ymax,
1553  PLFLT *xlpos, PLFLT *ylpos,
1554  PLBOOL *y_ascl, PLBOOL *acc,
1555  PLINT *colbox, PLINT *collab,
1556  PLINT *colline, PLINT *styline,
1557  const char *legline0, const char *legline1,
1558  const char *legline2, const char *legline3,
1559  const char *labx, const char *laby, const char *labtop )
1560 {
1561  const char* legline[4];
1562  legline[0] = legline0;
1563  legline[1] = legline1;
1564  legline[2] = legline2;
1565  legline[3] = legline3;
1566 
1567  c_plstripc( id, xspec, yspec,
1568  *xmin, *xmax, *xjump, *ymin, *ymax,
1569  *xlpos, *ylpos,
1570  *y_ascl, *acc,
1571  *colbox, *collab,
1572  colline, styline, legline,
1573  labx, laby, labtop );
1574 }
1575 
1576 void
1577 PLSTRIPD( PLINT *id )
1578 {
1579  c_plstripd( *id );
1580 }
1581 
1582 void
1583 PLSTYL( PLINT *n, PLINT *mark, PLINT *space )
1584 {
1585  c_plstyl( *n, mark, space );
1586 }
1587 
1588 void
1589 PLSVECT1( PLFLT *arrowx, PLFLT *arrowy, PLINT *npts, PLBOOL *fill )
1590 {
1591  c_plsvect( arrowx, arrowy, *npts, *fill );
1592 }
1593 
1594 void
1595 PLSVECT2( void )
1596 {
1597  c_plsvect( NULL, NULL, 0, 0 );
1598 }
1599 
1600 void
1601 PLSVPA( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax )
1602 {
1603  c_plsvpa( *xmin, *xmax, *ymin, *ymax );
1604 }
1605 
1606 void
1607 PLSXAX( PLINT *digmax, PLINT *digits )
1608 {
1609  c_plsxax( *digmax, *digits );
1610 }
1611 
1612 void
1613 PLSYAX( PLINT *digmax, PLINT *digits )
1614 {
1615  c_plsyax( *digmax, *digits );
1616 }
1617 
1618 void
1619 PLSYM( PLINT *n, PLFLT *x, PLFLT *y, PLINT *code )
1620 {
1621  c_plsym( *n, x, y, *code );
1622 }
1623 
1624 void
1625 PLSZAX( PLINT *digmax, PLINT *digits )
1626 {
1627  c_plszax( *digmax, *digits );
1628 }
1629 
1630 void
1631 PLTEXT( void )
1632 {
1633  c_pltext();
1634 }
1635 
1636 void
1637 PLTIMEFMT7( const char *fmt )
1638 {
1639  c_pltimefmt( fmt );
1640 }
1641 
1642 void
1643 PLVASP( PLFLT *aspect )
1644 {
1645  c_plvasp( *aspect );
1646 }
1647 
1648 void
1649 PLVPAS( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLFLT *aspect )
1650 {
1651  c_plvpas( *xmin, *xmax, *ymin, *ymax, *aspect );
1652 }
1653 
1654 void
1655 PLVPOR( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax )
1656 {
1657  c_plvpor( *xmin, *xmax, *ymin, *ymax );
1658 }
1659 
1660 void
1661 PLVSTA( void )
1662 {
1663  c_plvsta();
1664 }
1665 
1666 void
1667 PLW3D( PLFLT *basex, PLFLT *basey, PLFLT *height,
1668  PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
1669  PLFLT *zmin, PLFLT *zmax,
1670  PLFLT *alt, PLFLT *az )
1671 {
1672  c_plw3d( *basex, *basey, *height,
1673  *xmin, *xmax, *ymin, *ymax, *zmin, *zmax, *alt, *az );
1674 }
1675 
1676 void
1677 PLWIDTH( PLFLT *width )
1678 {
1679  c_plwidth( *width );
1680 }
1681 
1682 void
1683 PLWIND( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax )
1684 {
1685  c_plwind( *xmin, *xmax, *ymin, *ymax );
1686 }
1687 
1688 void
1689 PLXORMOD( PLBOOL *mode, PLBOOL *status )
1690 {
1691  c_plxormod( *mode, status );
1692 }