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