• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

scstubs.c

Go to the documentation of this file.
00001 // $Id: scstubs.c 11915 2011-09-07 11:45:29Z andrewross $
00002 //
00003 //      C stub routines.
00004 //
00005 // Copyright (C) 2004  Alan W. Irwin
00006 //
00007 // This file is part of PLplot.
00008 //
00009 // PLplot is free software; you can redistribute it and/or modify
00010 // it under the terms of the GNU Library General Public License as published
00011 // by the Free Software Foundation; either version 2 of the License, or
00012 // (at your option) any later version.
00013 //
00014 // PLplot is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU Library General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU Library General Public License
00020 // along with PLplot; if not, write to the Free Software
00021 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00022 //
00023 //
00024 //      The stubs contained here are the ones that are relatively simple,
00025 //      i.e. involving only a call convention change or integer-to-string
00026 //      conversion.  Exceptions are plparseopts and  plstripc  which have
00027 //      a few more complications in them.
00028 //
00029 
00030 #include "plstubs.h"
00031 
00032 #ifdef CVF
00033 #define STDCALL    __stdcall
00034 #else
00035 #define STDCALL
00036 #endif
00037 static void ( STDCALL *plmapform )( PLINT *, PLFLT *, PLFLT * ); // Note: slightly different prototype than
00038                                                                  // (*mapform)!
00039 // Slightly different to (*label_func) as we don't support PLPointer for
00040 // additional data in f77.
00041 // Note the hidden argument!
00042 static void ( STDCALL *pllabelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT );
00043 
00044 // Slightly different to C version as we don't support PLPointer  for additional data
00045 static void ( STDCALL *pltransform )( PLFLT *, PLFLT *, PLFLT *, PLFLT * );
00046 
00047 
00048 static char **pllegend_text;
00049 static char **pllegend_symbols;
00050 
00051 static void
00052 pltransformf2c( PLFLT x, PLFLT y, PLFLT *tx, PLFLT *ty, PLPointer data )
00053 {
00054     ( *pltransform )( &x, &y, tx, ty );
00055 }
00056 
00057 void
00058 PL_SETCONTLABELFORMAT( PLINT *lexp, PLINT *sigdig )
00059 {
00060     c_pl_setcontlabelformat( *lexp, *sigdig );
00061 }
00062 
00063 void
00064 PL_SETCONTLABELFORMATa( PLINT *lexp, PLINT *sigdig )
00065 {
00066     c_pl_setcontlabelformat( *lexp, *sigdig );
00067 }
00068 
00069 void
00070 PL_SETCONTLABELPARAM( PLFLT *offset, PLFLT *size, PLFLT *spacing, PLINT *active )
00071 {
00072     c_pl_setcontlabelparam( *offset, *size, *spacing, *active );
00073 }
00074 
00075 void
00076 PL_SETCONTLABELPARAMa( PLFLT *offset, PLFLT *size, PLFLT *spacing, PLINT *active )
00077 {
00078     c_pl_setcontlabelparam( *offset, *size, *spacing, *active );
00079 }
00080 
00081 void
00082 PLABORT7( const char *text )
00083 {
00084     plabort( text );
00085 }
00086 
00087 void
00088 PLADV( PLINT *sub )
00089 {
00090     c_pladv( *sub );
00091 }
00092 
00093 void
00094 PLARC( PLFLT *x, PLFLT *y, PLFLT *a, PLFLT *b, PLFLT *angle1, PLFLT *angle2, PLFLT *rotate, PLBOOL *fill )
00095 {
00096     c_plarc( *x, *y, *a, *b, *angle1, *angle2, *rotate, *fill );
00097 }
00098 
00099 void
00100 PLAXES7( PLFLT *x0, PLFLT *y0, const char *xopt, PLFLT *xtick,
00101          PLINT *nxsub, const char *yopt, PLFLT *ytick, PLINT *nysub )
00102 {
00103     c_plaxes( *x0, *y0, xopt, *xtick, *nxsub, yopt, *ytick, *nysub );
00104 }
00105 
00106 void
00107 PLBIN( PLINT *nbin, PLFLT *x, PLFLT *y, PLINT *center )
00108 {
00109     c_plbin( *nbin, x, y, *center );
00110 }
00111 
00112 void
00113 PLBTIME( PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT *ctime )
00114 {
00115     c_plbtime( year, month, day, hour, min, sec, *ctime );
00116 }
00117 
00118 void
00119 PLBOP( void )
00120 {
00121     c_plbop();
00122 }
00123 
00124 void
00125 PLBOX7( const char *xopt, PLFLT *xtick, PLINT *nxsub,
00126         const char *yopt, PLFLT *ytick, PLINT *nysub )
00127 {
00128     c_plbox( xopt, *xtick, *nxsub, yopt, *ytick, *nysub );
00129 }
00130 
00131 void
00132 PLBOX37( const char *xopt, const char *xlabel, PLFLT *xtick, PLINT *nxsub,
00133          const char *yopt, const char *ylabel, PLFLT *ytick, PLINT *nysub,
00134          const char *zopt, const char *zlabel, PLFLT *ztick, PLINT *nzsub )
00135 {
00136     c_plbox3( xopt, xlabel, *xtick, *nxsub,
00137         yopt, ylabel, *ytick, *nysub,
00138         zopt, zlabel, *ztick, *nzsub );
00139 }
00140 
00141 void
00142 PLCALC_WORLD( PLFLT *rx, PLFLT *ry, PLFLT *wx, PLFLT *wy, PLINT *window )
00143 {
00144     c_plcalc_world( *rx, *ry, wx, wy, window );
00145 }
00146 
00147 void
00148 PLCALC_WORLDa( PLFLT *rx, PLFLT *ry, PLFLT *wx, PLFLT *wy, PLINT *window )
00149 {
00150     c_plcalc_world( *rx, *ry, wx, wy, window );
00151 }
00152 
00153 void
00154 PLCLEAR( void )
00155 {
00156     c_plclear();
00157 }
00158 
00159 void
00160 PLCOL0( PLINT *icol )
00161 {
00162     c_plcol0( *icol );
00163 }
00164 
00165 void
00166 PLCOL1( PLFLT *col )
00167 {
00168     c_plcol1( *col );
00169 }
00170 
00171 void
00172 PLCONFIGTIME( PLFLT *scale, PLFLT *offset1, PLFLT *offset2, PLINT *ccontrol, PLBOOL *ifbtime_offset, PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec )
00173 {
00174     c_plconfigtime( *scale, *offset1, *offset2, *ccontrol, *ifbtime_offset, *year, *month, *day, *hour, *min, *sec );
00175 }
00176 
00177 void
00178 PLCPSTRM( PLINT *iplsr, PLBOOL *flags )
00179 {
00180     c_plcpstrm( *iplsr, *flags );
00181 }
00182 
00183 void
00184 PLCTIME( PLINT *year, PLINT *month, PLINT *day, PLINT *hour, PLINT *min, PLFLT *sec, PLFLT *ctime )
00185 {
00186     c_plctime( *year, *month, *day, *hour, *min, *sec, ctime );
00187 }
00188 
00189 void
00190 PLEND( void )
00191 {
00192     c_plend();
00193 }
00194 
00195 void
00196 PLEND1( void )
00197 {
00198     c_plend1();
00199 }
00200 
00201 void
00202 PLENV( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00203        PLINT *just, PLINT *axis )
00204 {
00205     c_plenv( *xmin, *xmax, *ymin, *ymax, *just, *axis );
00206 }
00207 
00208 void
00209 PLENV0( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
00210         PLINT *just, PLINT *axis )
00211 {
00212     c_plenv0( *xmin, *xmax, *ymin, *ymax, *just, *axis );
00213 }
00214 
00215 void
00216 PLEOP( void )
00217 {
00218     c_pleop();
00219 }
00220 
00221 void
00222 PLERRX( PLINT *n, PLFLT *xmin, PLFLT *xmax, PLFLT *y )
00223 {
00224     c_plerrx( *n, xmin, xmax, y );
00225 }
00226 
00227 void
00228 PLERRY( PLINT *n, PLFLT *x, PLFLT *ymin, PLFLT *ymax )
00229 {
00230     c_plerry( *n, x, ymin, ymax );
00231 }
00232 
00233 void
00234 PLFAMADV( void )
00235 {
00236     c_plfamadv();
00237 }
00238 
00239 void
00240 PLFILL( PLINT *n, PLFLT *x, PLFLT *y )
00241 {
00242     c_plfill( *n, x, y );
00243 }
00244 
00245 void
00246 PLFILL3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z )
00247 {
00248     c_plfill3( *n, x, y, z );
00249 }
00250 
00251 void
00252 PLFLUSH( void )
00253 {
00254     c_plflush();
00255 }
00256 
00257 void
00258 PLFONT( PLINT *font )
00259 {
00260     c_plfont( *font );
00261 }
00262 
00263 void
00264 PLFONTLD( PLINT *charset )
00265 {
00266     c_plfontld( *charset );
00267 }
00268 
00269 void
00270 PLGCHR( PLFLT *chrdef, PLFLT *chrht )
00271 {
00272     c_plgchr( chrdef, chrht );
00273 }
00274 
00275 void
00276 PLGCOL0( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b )
00277 {
00278     c_plgcol0( *icol0, r, g, b );
00279 }
00280 
00281 void
00282 PLGCOL0A( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b, PLFLT *a )
00283 {
00284     c_plgcol0a( *icol0, r, g, b, a );
00285 }
00286 
00287 void
00288 PLGCOLBG( PLINT *r, PLINT *g, PLINT *b )
00289 {
00290     c_plgcolbg( r, g, b );
00291 }
00292 
00293 void
00294 PLGCOLBGA( PLINT *r, PLINT *g, PLINT *b, PLFLT *a )
00295 {
00296     c_plgcolbga( r, g, b, a );
00297 }
00298 
00299 void
00300 PLGCOMPRESSION( PLINT *compression )
00301 {
00302     c_plgcompression( compression );
00303 }
00304 
00305 void
00306 PLGDEV7( char *dev, int length )
00307 {
00308     c_plgdev( dev );
00309 }
00310 
00311 void
00312 PLGDIDEV( PLFLT *p_mar, PLFLT *p_aspect, PLFLT *p_jx, PLFLT *p_jy )
00313 {
00314     c_plgdidev( p_mar, p_aspect, p_jx, p_jy );
00315 }
00316 
00317 void
00318 PLGDIORI( PLFLT *p_rot )
00319 {
00320     c_plgdiori( p_rot );
00321 }
00322 
00323 void
00324 PLGDIPLT( PLFLT *p_xmin, PLFLT *p_ymin, PLFLT *p_xmax, PLFLT *p_ymax )
00325 {
00326     c_plgdiplt( p_xmin, p_ymin, p_xmax, p_ymax );
00327 }
00328 
00329 void
00330 PLGETCURSOR( PLGraphicsIn *gin )
00331 {
00332     plGetCursor( gin );
00333 }
00334 
00335 void
00336 PLGFAM( PLINT *fam, PLINT *num, PLINT *bmax )
00337 {
00338     c_plgfam( fam, num, bmax );
00339 }
00340 
00341 // Note: Fortran does not distinguish between unsigned and signed integers
00342 // so the 32-bit PLUNICODE can be mapped to 4-byte Fortran integer outside
00343 // this routine.
00344 void
00345 PLGFCI( PLUNICODE *pfci )
00346 {
00347     c_plgfci( pfci );
00348 }
00349 
00350 void
00351 PLGFNAM7( char *fnam, int length )
00352 {
00353     c_plgfnam( fnam );
00354 }
00355 
00356 void
00357 PLGFONT( PLINT *family, PLINT *style, PLINT *weight )
00358 {
00359     c_plgfont( family, style, weight );
00360 }
00361 
00362 void
00363 PLGLEVEL( PLINT *level )
00364 {
00365     c_plglevel( level );
00366 }
00367 
00368 void
00369 PLGPAGE( PLFLT *xpmm, PLFLT *ypmm, PLINT *xwid, PLINT *ywid,
00370          PLINT *xoff, PLINT *yoff )
00371 {
00372     c_plgpage( xpmm, ypmm, xwid, ywid, xoff, yoff );
00373 }
00374 
00375 void
00376 PLGRA( void )
00377 {
00378     c_plgra();
00379 }
00380 
00381 void
00382 PLGRADIENT( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *angle )
00383 {
00384     c_plgradient( *n, x, y, *angle );
00385 }
00386 
00387 // AM - removed: also defined, and better in sccont.c
00388 // void
00389 // PLGRIDDATA(PLFLT *x, PLFLT *y, PLFLT *z, PLINT *npts,
00390 //         PLFLT *xg, PLINT *nptsx, PLFLT *yg,  PLINT *nptsy,
00391 //         PLFLT **zg, PLINT *type, PLFLT *data)
00392 // {
00393 //  c_plgriddata(x, y, z, *npts,
00394 //               xg, *nptsx, yg, *nptsy,
00395 //               zg, *type, *data);
00396 // }
00397 //
00398 
00399 void
00400 PLGSPA( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax )
00401 {
00402     c_plgspa( xmin, xmax, ymin, ymax );
00403 }
00404 
00405 void
00406 PLGSTRM( PLINT *strm )
00407 {
00408     c_plgstrm( strm );
00409 }
00410 
00411 void
00412 PLGVER7( char *ver )
00413 {
00414     c_plgver( ver );
00415 }
00416 
00417 void
00418 PLGVPD( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax )
00419 {
00420     c_plgvpd( p_xmin, p_xmax, p_ymin, p_ymax );
00421 }
00422 
00423 void
00424 PLGVPW( PLFLT *p_xmin, PLFLT *p_xmax, PLFLT *p_ymin, PLFLT *p_ymax )
00425 {
00426     c_plgvpw( p_xmin, p_xmax, p_ymin, p_ymax );
00427 }
00428 
00429 void
00430 PLGXAX( PLINT *digmax, PLINT *digits )
00431 {
00432     c_plgxax( digmax, digits );
00433 }
00434 
00435 void
00436 PLGYAX( PLINT *digmax, PLINT *digits )
00437 {
00438     c_plgyax( digmax, digits );
00439 }
00440 
00441 void
00442 PLGZAX( PLINT *digmax, PLINT *digits )
00443 {
00444     c_plgzax( digmax, digits );
00445 }
00446 
00447 void
00448 PLHIST( PLINT *n, PLFLT *data, PLFLT *datmin, PLFLT *datmax,
00449         PLINT *nbin, PLINT *oldwin )
00450 {
00451     c_plhist( *n, data, *datmin, *datmax, *nbin, *oldwin );
00452 }
00453 
00454 #ifdef PL_DEPRECATED
00455 void
00456 PLHLS( PLFLT *hue, PLFLT *light, PLFLT *sat )
00457 {
00458     c_plhls( *hue, *light, *sat );
00459 }
00460 #endif // PL_DEPRECATED
00461 
00462 void
00463 PLHLSRGB( PLFLT *h, PLFLT *l, PLFLT *s, PLFLT *r, PLFLT *g, PLFLT *b )
00464 {
00465     c_plhlsrgb( *h, *l, *s, r, g, b );
00466 }
00467 
00468 #if 0
00469 void
00470 PLIMAGEFR( PLFLT *idata, PLINT *nx, PLINT *ny,
00471            PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLFLT *zmin, PLFLT *zmax,
00472            PLFLT *Dxmin, PLFLT *Dxmax, PLFLT *Dymin, PLFLT *Dymax,
00473            PLFLT *valuemin, PLFLT *valuemax )
00474 {
00475     int   i, j;
00476     PLFLT **pidata;
00477 
00478     plAlloc2dGrid( &pidata, *nx, *ny );
00479 
00480     for ( i = 0; i < *nx; i++ )
00481     {
00482         for ( j = 0; j < *ny; j++ )
00483         {
00484             pidata[i][j] = idata[i + j * ( *nx )];
00485         }
00486     }
00487 
00488     c_plimagefr( (const PLFLT **) pidata, *nx, *ny,
00489         *xmin, *xmax, *ymin, *ymax, *zmin, *zmax,
00490         *Dxmin, *Dxmax, *Dymin, *Dymax,
00491         *valuemin, *valuemax );
00492 
00493     plFree2dGrid( pidata, *nx, *ny );
00494 }
00495 #endif
00496 
00497 void
00498 PLIMAGE( PLFLT *idata, PLINT *nx, PLINT *ny,
00499          PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLFLT *zmin, PLFLT *zmax,
00500          PLFLT *Dxmin, PLFLT *Dxmax, PLFLT *Dymin, PLFLT *Dymax )
00501 {
00502     int   i, j;
00503     PLFLT **pidata;
00504 
00505     plAlloc2dGrid( &pidata, *nx, *ny );
00506 
00507     for ( i = 0; i < *nx; i++ )
00508     {
00509         for ( j = 0; j < *ny; j++ )
00510         {
00511             pidata[i][j] = idata[i + j * ( *nx )];
00512         }
00513     }
00514 
00515     c_plimage( (const PLFLT **) pidata, *nx, *ny,
00516         *xmin, *xmax, *ymin, *ymax, *zmin, *zmax,
00517         *Dxmin, *Dxmax, *Dymin, *Dymax );
00518 
00519     plFree2dGrid( pidata, *nx, *ny );
00520 }
00521 
00522 void
00523 PLINIT( void )
00524 {
00525     c_plinit();
00526 }
00527 
00528 void
00529 PLJOIN( PLFLT *x1, PLFLT *y1, PLFLT *x2, PLFLT *y2 )
00530 {
00531     c_pljoin( *x1, *y1, *x2, *y2 );
00532 }
00533 
00534 void
00535 PLLAB7( const char *xlab, const char *ylab, const char *title )
00536 {
00537     c_pllab( xlab, ylab, title );
00538 }
00539 
00540 static void
00541 pllabelfuncf2c( PLINT axis, PLFLT value, char *label, PLINT length, PLPointer data )
00542 {
00543     int i;
00544 
00545     // (AM) Note the hidden argument "length" - it ensures that the string "label"
00546     // is recognised to have that length
00547     //
00548     ( *pllabelfunc )( &axis, &value, label, &length, length );
00549 
00550     // Ensure string is null terminated
00551     i = length - 1;
00552     while ( ( i >= 0 ) && ( label[i] == ' ' ) )
00553         i--;
00554     label[i + 1] = '\0';
00555 }
00556 
00557 // Auxiliary function to create a C-compatible string array
00558 // Note the hidden argument
00559 void
00560 PLLEGEND_CNV_TEXT( PLINT *id, PLINT *number, char *string, PLINT length )
00561 {
00562     int  j;
00563     int  i;
00564     char **p_string;
00565     char *data;
00566 
00567     // Ensure the strings are null terminated
00568 
00569     p_string = (char **) malloc( sizeof ( char * ) * ( *number ) );
00570     data     = (char *) malloc( sizeof ( char * ) * ( *number ) * ( length + 1 ) );
00571 
00572     for ( j = 0; j < ( *number ); j++ )
00573     {
00574         p_string[j] = data + j * ( length + 1 );
00575         memcpy( p_string[j], &string[j * length], length );
00576         p_string[j][length] = '\0';
00577         i = length - 1;
00578         while ( ( i >= 0 ) && ( p_string[j][i] == ' ' ) )
00579             i--;
00580         p_string[j][i + 1] = '\0';
00581     }
00582 
00583     if ( *id == 1 )
00584     {
00585         pllegend_text = p_string;
00586     }
00587     else
00588     {
00589         pllegend_symbols = p_string;
00590     }
00591 }
00592 
00593 void PLLEGEND(
00594     PLFLT *p_legend_width, PLFLT *p_legend_height,
00595     PLINT *opt, PLINT *position, PLFLT *x, PLFLT *y, PLFLT *plot_width,
00596     PLINT *bg_color, PLINT *bb_color, PLINT *bb_style,
00597     PLINT *nrow, PLINT *ncolumn,
00598     PLINT *nlegend, const PLINT *opt_array,
00599     PLFLT *text_offset, PLFLT *text_scale, PLFLT *text_spacing,
00600     PLFLT *text_justification,
00601     const PLINT *text_colors,
00602     const PLINT *box_colors, const PLINT *box_patterns,
00603     const PLFLT *box_scales, const PLINT *box_line_widths,
00604     const PLINT *line_colors, const PLINT *line_styles,
00605     const PLINT *line_widths,
00606     const PLINT *symbol_colors, const PLFLT *symbol_scales,
00607     const PLINT *symbol_numbers )
00608 {
00609     c_pllegend( p_legend_width, p_legend_height,
00610         *opt, *position, *x, *y, *plot_width,
00611         *bg_color, *bb_color, *bb_style,
00612         *nrow, *ncolumn,
00613         *nlegend, opt_array,
00614         *text_offset, *text_scale, *text_spacing,
00615         *text_justification,
00616         text_colors, (const char **) pllegend_text,
00617         box_colors, box_patterns,
00618         box_scales, box_line_widths,
00619         line_colors, line_styles,
00620         line_widths,
00621         symbol_colors, symbol_scales,
00622         symbol_numbers, (const char **) pllegend_symbols );
00623 
00624     free( *pllegend_text );
00625     free( pllegend_text );
00626     free( *pllegend_symbols );
00627     free( pllegend_symbols );
00628 }
00629 
00630 void
00631 PLLIGHTSOURCE( PLFLT *x, PLFLT *y, PLFLT *z )
00632 {
00633     c_pllightsource( *x, *y, *z );
00634 }
00635 
00636 void
00637 PLLINE( PLINT *n, PLFLT *x, PLFLT *y )
00638 {
00639     c_plline( *n, x, y );
00640 }
00641 
00642 void
00643 PLLINE3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z )
00644 {
00645     c_plline3( *n, x, y, z );
00646 }
00647 
00648 void
00649 PLLSTY( PLINT *lin )
00650 {
00651     c_pllsty( *lin );
00652 }
00653 
00654 static void
00655 plmapf2c( PLINT n, PLFLT *x, PLFLT *y )
00656 {
00657     ( *plmapform )( &n, x, y );
00658 }
00659 
00660 void
00661 PLMAP7( const char *type,
00662         PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat )
00663 
00664 {
00665     if ( plmapform )
00666         c_plmap( plmapf2c, type, *minlong, *maxlong, *minlat, *maxlat );
00667     else
00668         c_plmap( NULL, type, *minlong, *maxlong, *minlat, *maxlat );
00669 }
00670 
00671 
00672 void
00673 PLMERIDIANS7( PLFLT *dlong, PLFLT *dlat,
00674               PLFLT *minlong, PLFLT *maxlong, PLFLT *minlat, PLFLT *maxlat )
00675 {
00676     if ( plmapform )
00677         c_plmeridians( plmapf2c, *dlong, *dlat, *minlong, *maxlong, *minlat, *maxlat );
00678     else
00679         c_plmeridians( NULL, *dlong, *dlat, *minlong, *maxlong, *minlat, *maxlat );
00680 }
00681 
00682 void
00683 PLMKSTRM( PLINT *p_strm )
00684 {
00685     c_plmkstrm( p_strm );
00686 }
00687 
00688 void
00689 PLMTEX7( const char *side, PLFLT *disp, PLFLT *pos, PLFLT *just, const char *text )
00690 {
00691     c_plmtex( side, *disp, *pos, *just, text );
00692 }
00693 
00694 void
00695 PLMTEX37( const char *side, PLFLT *disp, PLFLT *pos, PLFLT *just, const char *text )
00696 {
00697     c_plmtex3( side, *disp, *pos, *just, text );
00698 }
00699 
00700 void
00701 PLPARSEOPTS7( int *numargs, const char *iargs, PLINT *mode, PLINT *maxindex )
00702 {
00703 // Same as in plparseopts fortran subroutine that calls this one.
00704 #define MAXARGS    20
00705     if ( *numargs <= MAXARGS )
00706     {
00707         const char *argv[MAXARGS];
00708         int        i;
00709         for ( i = 0; i < *numargs; i++ )
00710         {
00711             argv[i] = iargs + ( i * *maxindex );
00712 //       fprintf(stderr, "%d - %s\n", i, argv[i]);
00713         }
00714         c_plparseopts( numargs, argv, *mode );
00715     }
00716     else
00717         fprintf( stderr, "plparseopts7: numargs too large\n" );
00718 }
00719 
00720 void
00721 PLPAT( PLINT *nlin, PLINT *inc, PLINT *del )
00722 {
00723     c_plpat( *nlin, inc, del );
00724 }
00725 
00726 void
00727 PLPOIN( PLINT *n, PLFLT *x, PLFLT *y, PLINT *code )
00728 {
00729     c_plpoin( *n, x, y, *code );
00730 }
00731 
00732 void
00733 PLPOIN3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, PLINT *code )
00734 {
00735     c_plpoin3( *n, x, y, z, *code );
00736 }
00737 
00738 void
00739 PLPOLY3( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, PLBOOL *draw, PLBOOL *ifcc )
00740 {
00741     c_plpoly3( *n, x, y, z, draw, *ifcc );
00742 }
00743 
00744 void
00745 PLPREC( PLINT *setp, PLINT *prec )
00746 {
00747     c_plprec( *setp, *prec );
00748 }
00749 
00750 void
00751 PLPSTY( PLINT *patt )
00752 {
00753     c_plpsty( *patt );
00754 }
00755 
00756 void
00757 PLPTEX7( PLFLT *x, PLFLT *y, PLFLT *dx, PLFLT *dy, PLFLT *just, const char *text )
00758 {
00759     c_plptex( *x, *y, *dx, *dy, *just, text );
00760 }
00761 
00762 void
00763 PLPTEX37(
00764     PLFLT *x, PLFLT *y, PLFLT *z,
00765     PLFLT *dx, PLFLT *dy, PLFLT *dz,
00766     PLFLT *sx, PLFLT *sy, PLFLT *sz,
00767     PLFLT *just, const char *text )
00768 {
00769     c_plptex3( *x, *y, *z, *dx, *dy, *dz, *sx, *sy, *sz, *just, text );
00770 }
00771 
00772 PLFLT
00773 PLRANDD()
00774 {
00775     return c_plrandd();
00776 }
00777 
00778 void
00779 PLREPLOT( void )
00780 {
00781     c_plreplot();
00782 }
00783 
00784 #ifdef PL_DEPRECATED
00785 void
00786 PLRGB( PLFLT *red, PLFLT *green, PLFLT *blue )
00787 {
00788     c_plrgb( *red, *green, *blue );
00789 }
00790 #endif // PL_DEPRECATED
00791 
00792 #ifdef PL_DEPRECATED
00793 void
00794 PLRGB1( PLINT *r, PLINT *g, PLINT *b )
00795 {
00796     c_plrgb1( *r, *g, *b );
00797 }
00798 #endif // PL_DEPRECATED
00799 
00800 void
00801 PLRGBHLS( PLFLT *r, PLFLT *g, PLFLT *b, PLFLT *h, PLFLT *l, PLFLT *s )
00802 {
00803     c_plrgbhls( *r, *g, *b, h, l, s );
00804 }
00805 
00806 void
00807 PLSCHR( PLFLT *def, PLFLT *scale )
00808 {
00809     c_plschr( *def, *scale );
00810 }
00811 
00812 void
00813 PLSCMAP0( PLINT *r, PLINT *g, PLINT *b, PLINT *ncol0 )
00814 {
00815     c_plscmap0( r, g, b, *ncol0 );
00816 }
00817 
00818 void
00819 PLSCMAP0A( PLINT *r, PLINT *g, PLINT *b, PLFLT *a, PLINT *ncol0 )
00820 {
00821     c_plscmap0a( r, g, b, a, *ncol0 );
00822 }
00823 
00824 void
00825 PLSCMAP0N( PLINT *n )
00826 {
00827     c_plscmap0n( *n );
00828 }
00829 
00830 void
00831 PLSCMAP1( PLINT *r, PLINT *g, PLINT *b, PLINT *ncol1 )
00832 {
00833     c_plscmap1( r, g, b, *ncol1 );
00834 }
00835 
00836 void
00837 PLSCMAP1A( PLINT *r, PLINT *g, PLINT *b, PLFLT *a, PLINT *ncol1 )
00838 {
00839     c_plscmap1a( r, g, b, a, *ncol1 );
00840 }
00841 
00842 void
00843 PLSCMAP1L( PLBOOL *itype, PLINT *npts, PLFLT *intensity,
00844            PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLBOOL *rev )
00845 {
00846     c_plscmap1l( *itype, *npts, intensity, coord1, coord2, coord3, rev );
00847 }
00848 
00849 void
00850 PLSCMAP1L2( PLBOOL *itype, PLINT *npts, PLFLT *intensity,
00851             PLFLT *coord1, PLFLT *coord2, PLFLT *coord3 )
00852 {
00853     c_plscmap1l( *itype, *npts, intensity, coord1, coord2, coord3, NULL );
00854 }
00855 
00856 void
00857 PLSCMAP1LA( PLBOOL *itype, PLINT *npts, PLFLT *intensity,
00858             PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a, PLBOOL *rev )
00859 {
00860     c_plscmap1la( *itype, *npts, intensity, coord1, coord2, coord3, a, rev );
00861 }
00862 
00863 void
00864 PLSCMAP1LA2( PLBOOL *itype, PLINT *npts, PLFLT *intensity,
00865              PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLFLT *a )
00866 {
00867     c_plscmap1la( *itype, *npts, intensity, coord1, coord2, coord3, a, NULL );
00868 }
00869 
00870 void
00871 PLSCMAP1N( PLINT *n )
00872 {
00873     c_plscmap1n( *n );
00874 }
00875 
00876 void
00877 PLSCOL0( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b )
00878 {
00879     c_plscol0( *icol0, *r, *g, *b );
00880 }
00881 
00882 void
00883 PLSCOL0A( PLINT *icol0, PLINT *r, PLINT *g, PLINT *b, PLFLT *a )
00884 {
00885     c_plscol0a( *icol0, *r, *g, *b, *a );
00886 }
00887 
00888 void
00889 PLSCOLBG( PLINT *r, PLINT *g, PLINT *b )
00890 {
00891     c_plscolbg( *r, *g, *b );
00892 }
00893 
00894 void
00895 PLSCOLBGA( PLINT *r, PLINT *g, PLINT *b, PLFLT *a )
00896 {
00897     c_plscolbga( *r, *g, *b, *a );
00898 }
00899 
00900 void
00901 PLSCOLOR( PLINT *color )
00902 {
00903     c_plscolor( *color );
00904 }
00905 
00906 void
00907 PLSCOMPRESSION( PLINT *compression )
00908 {
00909     c_plscompression( *compression );
00910 }
00911 
00912 void
00913 PLSDEV7( const char *dev )
00914 {
00915     c_plsdev( dev );
00916 }
00917 
00918 void
00919 PLSDIDEV( PLFLT *mar, PLFLT *aspect, PLFLT *jx, PLFLT *jy )
00920 {
00921     c_plsdidev( *mar, *aspect, *jx, *jy );
00922 }
00923 
00924 void
00925 PLSDIMAP( PLINT *dimxmin, PLINT *dimxmax, PLINT *dimymin, PLINT *dimymax,
00926           PLFLT *dimxpmm, PLFLT *dimypmm )
00927 {
00928     c_plsdimap( *dimxmin, *dimxmax, *dimymin, *dimymax,
00929         *dimxpmm, *dimypmm );
00930 }
00931 
00932 void
00933 PLSDIORI( PLFLT *rot )
00934 {
00935     c_plsdiori( *rot );
00936 }
00937 
00938 void
00939 PLSDIPLT( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax )
00940 {
00941     c_plsdiplt( *xmin, *ymin, *xmax, *ymax );
00942 }
00943 
00944 void
00945 PLSDIPLZ( PLFLT *xmin, PLFLT *ymin, PLFLT *xmax, PLFLT *ymax )
00946 {
00947     c_plsdiplz( *xmin, *ymin, *xmax, *ymax );
00948 }
00949 
00950 void
00951 PLSEED( unsigned int *s )
00952 {
00953     c_plseed( *s );
00954 }
00955 
00956 void
00957 PLSESC( PLINT *esc )
00958 {
00959     c_plsesc( (char) *esc );
00960 }
00961 
00962 // Auxiliary routine - not to be used publicly
00963 //
00964 #define    PLSETMAPFORMC      FNAME( PLSETMAPFORMC, plsetmapformc )
00965 #define    PLCLEARMAPFORMC    FNAME( PLCLEARMAPFORMC, plclearmapformc )
00966 void
00967 PLSETMAPFORMC( void ( STDCALL *mapform )( PLINT *, PLFLT *, PLFLT * ) )
00968 {
00969     plmapform = mapform;
00970 }
00971 void
00972 PLCLEARMAPFORMC(  )
00973 {
00974     plmapform = NULL;
00975 }
00976 
00977 void
00978 PLSETOPT7( const char *opt, const char *optarg )
00979 {
00980     c_plsetopt( opt, optarg );
00981 }
00982 
00983 void
00984 PLSFAM( PLINT *fam, PLINT *num, PLINT *bmax )
00985 {
00986     c_plsfam( *fam, *num, *bmax );
00987 }
00988 
00989 // Note: Fortran does not distinguish between unsigned and signed integers
00990 // so the 32-bit PLUNICODE can be mapped to 4-byte Fortran integer outside
00991 // this routine.
00992 void
00993 PLSFCI( PLUNICODE *fci )
00994 {
00995     c_plsfci( *fci );
00996 }
00997 
00998 void
00999 PLSFNAM7( const char *fnam )
01000 {
01001     c_plsfnam( fnam );
01002 }
01003 
01004 void
01005 PLSFONT( PLINT *family, PLINT *style, PLINT *weight )
01006 {
01007     c_plsfont( *family, *style, *weight );
01008 }
01009 
01010 void
01011 PLSLABELFUNC_ON( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ) )
01012 {
01013     pllabelfunc = labelfunc;
01014     // N.B. neglect pointer to additional data for f95
01015     c_plslabelfunc( pllabelfuncf2c, NULL );
01016 }
01017 
01018 void
01019 PLSLABELFUNC_ONa( void ( STDCALL *labelfunc )( PLINT *, PLFLT *, char *, PLINT *, PLINT ) )
01020 {
01021     pllabelfunc = labelfunc;
01022     // N.B. neglect pointer to additional data for f95
01023     c_plslabelfunc( pllabelfuncf2c, NULL );
01024 }
01025 
01026 void
01027 PLSLABELFUNC_OFF( PLINT *dummy )
01028 {
01029     pllabelfunc = NULL;
01030     c_plslabelfunc( NULL, NULL );
01031 }
01032 
01033 void
01034 PLSLABELFUNC_OFFa( PLINT *dummy )
01035 {
01036     pllabelfunc = NULL;
01037     c_plslabelfunc( NULL, NULL );
01038 }
01039 
01040 // Provided for symmetry with FORTRAN 77
01041 void
01042 PLSLABELFUNC_NONE( void )
01043 {
01044     pllabelfunc = NULL;
01045     c_plslabelfunc( NULL, NULL );
01046 }
01047 void
01048 PLSLABELFUNC_NONEa( void )
01049 {
01050     pllabelfunc = NULL;
01051     c_plslabelfunc( NULL, NULL );
01052 }
01053 
01054 void
01055 PLSMAJ( PLFLT *def, PLFLT *scale )
01056 {
01057     c_plsmaj( *def, *scale );
01058 }
01059 
01060 void
01061 PLSMEM( PLINT *maxx, PLINT *maxy, void *plotmem )
01062 {
01063     c_plsmem( *maxx, *maxy, plotmem );
01064 }
01065 
01066 void
01067 PLSMEMA( PLINT *maxx, PLINT *maxy, void *plotmem )
01068 {
01069     c_plsmema( *maxx, *maxy, plotmem );
01070 }
01071 
01072 void
01073 PLSMIN( PLFLT *def, PLFLT *scale )
01074 {
01075     c_plsmin( *def, *scale );
01076 }
01077 
01078 void
01079 PLSORI( PLINT *ori )
01080 {
01081     c_plsori( *ori );
01082 }
01083 
01084 void
01085 PLSPAGE( PLFLT *xpmm, PLFLT *ypmm,
01086          PLINT *xwid, PLINT *ywid, PLINT *xoff, PLINT *yoff )
01087 {
01088     c_plspage( *xpmm, *ypmm, *xwid, *ywid, *xoff, *yoff );
01089 }
01090 
01091 void
01092 PLSPAL07( const char *filename )
01093 {
01094     c_plspal0( filename );
01095 }
01096 
01097 void
01098 PLSPAL17( const char *filename, PLBOOL *interpolate )
01099 {
01100     c_plspal1( filename, *interpolate );
01101 }
01102 
01103 void
01104 PLSPAUSE( PLBOOL *pause )
01105 {
01106     c_plspause( *pause );
01107 }
01108 
01109 void
01110 PLSSTRM( PLINT *strm )
01111 {
01112     c_plsstrm( *strm );
01113 }
01114 
01115 void
01116 PLSSUB( PLINT *nx, PLINT *ny )
01117 {
01118     c_plssub( *nx, *ny );
01119 }
01120 
01121 void
01122 PLSSYM( PLFLT *def, PLFLT *scale )
01123 {
01124     c_plssym( *def, *scale );
01125 }
01126 
01127 void
01128 PLSTAR( PLINT *nx, PLINT *ny )
01129 {
01130     c_plstar( *nx, *ny );
01131 }
01132 
01133 void
01134 PLSTART7( const char *devname, PLINT *nx, PLINT *ny )
01135 {
01136     c_plstart( devname, *nx, *ny );
01137 }
01138 
01139 void
01140 PLSTRANSFORM1( void ( STDCALL *transformfunc )( PLFLT *, PLFLT *, PLFLT *, PLFLT * ) )
01141 {
01142     pltransform = transformfunc;
01143 
01144     c_plstransform( pltransformf2c, NULL );
01145 }
01146 
01147 void
01148 PLSTRANSFORM2( PLINT *dummy )
01149 {
01150     pltransform = NULL;
01151 
01152     c_plstransform( NULL, NULL );
01153 }
01154 
01155 // Provided for symmetry with FORTRAN 77
01156 void
01157 PLSTRANSFORM3( void )
01158 {
01159     pltransform = NULL;
01160 
01161     c_plstransform( NULL, NULL );
01162 }
01163 
01164 void
01165 PLSTRING7( PLINT *n, PLFLT *x, PLFLT *y, const char *string )
01166 {
01167     c_plstring( *n, x, y, string );
01168 }
01169 
01170 void
01171 PLSTRING37( PLINT *n, PLFLT *x, PLFLT *y, PLFLT *z, const char *string )
01172 {
01173     c_plstring3( *n, x, y, z, string );
01174 }
01175 
01176 void
01177 PLSTRIPA( PLINT *id, PLINT *pen, PLFLT *x, PLFLT *y )
01178 {
01179     c_plstripa( *id, *pen, *x, *y );
01180 }
01181 
01182 void
01183 PLSTRIPC( PLINT *id, const char *xspec, const char *yspec,
01184           PLFLT *xmin, PLFLT *xmax, PLFLT *xjump, PLFLT *ymin, PLFLT *ymax,
01185           PLFLT *xlpos, PLFLT *ylpos,
01186           PLBOOL *y_ascl, PLBOOL *acc,
01187           PLINT *colbox, PLINT *collab,
01188           PLINT *colline, PLINT *styline,
01189           const char *legline0, const char *legline1,
01190           const char *legline2, const char *legline3,
01191           const char *labx, const char *laby, const char *labtop )
01192 {
01193     const char* legline[4];
01194     legline[0] = legline0;
01195     legline[1] = legline1;
01196     legline[2] = legline2;
01197     legline[3] = legline3;
01198 
01199     c_plstripc( id, xspec, yspec,
01200         *xmin, *xmax, *xjump, *ymin, *ymax,
01201         *xlpos, *ylpos,
01202         *y_ascl, *acc,
01203         *colbox, *collab,
01204         colline, styline, legline,
01205         labx, laby, labtop );
01206 }
01207 
01208 void
01209 PLSTRIPD( PLINT *id )
01210 {
01211     c_plstripd( *id );
01212 }
01213 
01214 void
01215 PLSTYL( PLINT *n, PLINT *mark, PLINT *space )
01216 {
01217     c_plstyl( *n, mark, space );
01218 }
01219 
01220 void
01221 PLSVECT( PLFLT *arrowx, PLFLT *arrowy, PLINT *npts, PLBOOL *fill )
01222 {
01223     c_plsvect( arrowx, arrowy, *npts, *fill );
01224 }
01225 
01226 void
01227 PLSVPA( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax )
01228 {
01229     c_plsvpa( *xmin, *xmax, *ymin, *ymax );
01230 }
01231 
01232 void
01233 PLSXAX( PLINT *digmax, PLINT *digits )
01234 {
01235     c_plsxax( *digmax, *digits );
01236 }
01237 
01238 void
01239 PLSYAX( PLINT *digmax, PLINT *digits )
01240 {
01241     c_plsyax( *digmax, *digits );
01242 }
01243 
01244 void
01245 PLSYM( PLINT *n, PLFLT *x, PLFLT *y, PLINT *code )
01246 {
01247     c_plsym( *n, x, y, *code );
01248 }
01249 
01250 void
01251 PLSZAX( PLINT *digmax, PLINT *digits )
01252 {
01253     c_plszax( *digmax, *digits );
01254 }
01255 
01256 void
01257 PLTEXT( void )
01258 {
01259     c_pltext();
01260 }
01261 
01262 void
01263 PLTIMEFMT7( const char *fmt )
01264 {
01265     c_pltimefmt( fmt );
01266 }
01267 
01268 void
01269 PLVASP( PLFLT *aspect )
01270 {
01271     c_plvasp( *aspect );
01272 }
01273 
01274 void
01275 PLVPAS( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax, PLFLT *aspect )
01276 {
01277     c_plvpas( *xmin, *xmax, *ymin, *ymax, *aspect );
01278 }
01279 
01280 void
01281 PLVPOR( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax )
01282 {
01283     c_plvpor( *xmin, *xmax, *ymin, *ymax );
01284 }
01285 
01286 void
01287 PLVSTA( void )
01288 {
01289     c_plvsta();
01290 }
01291 
01292 void
01293 PLW3D( PLFLT *basex, PLFLT *basey, PLFLT *height,
01294        PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax,
01295        PLFLT *zmin, PLFLT *zmax,
01296        PLFLT *alt, PLFLT *az )
01297 {
01298     c_plw3d( *basex, *basey, *height,
01299         *xmin, *xmax, *ymin, *ymax, *zmin, *zmax, *alt, *az );
01300 }
01301 
01302 void
01303 PLWID( PLINT *width )
01304 {
01305     c_plwid( *width );
01306 }
01307 
01308 void
01309 PLWIND( PLFLT *xmin, PLFLT *xmax, PLFLT *ymin, PLFLT *ymax )
01310 {
01311     c_plwind( *xmin, *xmax, *ymin, *ymax );
01312 }
01313 
01314 void
01315 PLXORMOD( PLBOOL *mode, PLBOOL *status )
01316 {
01317     c_plxormod( *mode, status );
01318 }

Generated on Wed Oct 12 2011 20:42:23 for PLplot by  doxygen 1.7.1