1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517
|
/* This file is specific to libplot, rather than libplotter. It defines
the `old' (i.e. non-thread-safe) C API. The old C API consists of
wrappers around the methods that may be applied to any Plotter object.
The old API also contains pl_newpl/pl_selectpl/pl_deletepl, which
construct and destroy Plotter instances, and maintain the global
variable `_old_api_plotter'. This is a pointer to a `currently
selected' Plotter instance. It is positioned by calling pl_selectpl.
Because of this global variable, the old C API is not thread-safe. In
the new C API, which is thread-safe, each function in the API is passed
a pointer to a Plotter as first argument. Even in the absence of
multithreading, this is a cleaner approach.
By convention, _old_api_plotter is initialized to point to a Plotter
instance that sends output in metafile format to standard output.
Initialization takes place when the first function in the old API is
invoked. This convention is for compatibility with pre-GNU versions of
libplot, which did not support pl_newpl/pl_select/pl_deletepl.
The old C API also contains the pl_parampl function. This function is
held in common with the old (non-thread-safe) C++ API, in which it is
simply called parampl. It is defined in apioldcc.c.
pl_parampl sets parameters in a global PlotterParams struct, a pointer
to which is kept in the global variable
`_old_api_global_plotter_params'. (See its definition and
initialization in g_defplot.c.) This PlotterParams is used when any
Plotter is created by pl_newpl. The presence of this global state is
another reason why the old C API is not thread-safe. */
#include "sys-defines.h"
#include "extern.h"
#include "plot.h" /* header file for C API's */
/* Sparse array of pointers to the old API's Plotter instances, and the
array size; also a distinguished Plotter pointer, through which the old
API will act. */
static Plotter **_old_api_plotters = NULL;
static int _old_api_plotters_len = 0;
static Plotter *_old_api_plotter = NULL;
/* initial size of _old_api_plotters[] */
#define INITIAL_PLOTTERS_LEN 4
/* default Plotter type (see list of supported types in the file devoted to
the new C API) */
#ifndef DEFAULT_PLOTTER_TYPE
#define DEFAULT_PLOTTER_TYPE "meta"
#endif
/* forward references */
static void _api_warning ____P((const char *msg));
static void _create_and_select_default_plotter ____P((void));
/* Expand the local array of Plotters to include a single Plotter, of
default type; also, select that Plotter. When this is invoked, the
array has zero size. */
static void
#ifdef _HAVE_PROTOS
_create_and_select_default_plotter (void)
#else
_create_and_select_default_plotter ()
#endif
{
int i;
Plotter *default_plotter;
/* create the default Plotter by invoking function in new API (make sure
global PlotterParams struct, used by the old API, is set up first) */
if (_old_api_global_plotter_params == NULL)
_old_api_global_plotter_params = pl_newplparams();
default_plotter = pl_newpl_r (DEFAULT_PLOTTER_TYPE, stdin, stdout, stderr,
_old_api_global_plotter_params);
/* initialize local array of Plotters */
_old_api_plotters = (Plotter **)_plot_xmalloc (INITIAL_PLOTTERS_LEN * sizeof(Plotter *));
for (i = 0; i < INITIAL_PLOTTERS_LEN; i++)
_old_api_plotters[i] = (Plotter *)NULL;
_old_api_plotters_len = INITIAL_PLOTTERS_LEN;
/* place default Plotter in local array, and select it */
_old_api_plotters[0] = default_plotter;
_old_api_plotter = default_plotter;
}
/* These are the 3 user-callable functions that are specific to the old C
binding: newpl, selectpl, deletepl. */
/* user-callable */
int
#ifdef _HAVE_PROTOS
pl_newpl (const char *type, FILE *infile, FILE *outfile, FILE *errfile)
#else
pl_newpl (type, infile, outfile, errfile)
const char *type;
FILE *infile, *outfile, *errfile;
#endif
{
Plotter *new_plotter;
bool open_slot;
int i, j;
if (_old_api_plotters_len == 0)
/* initialize local array of Plotters, and install default Plotter as
Plotter #0 */
_create_and_select_default_plotter ();
/* create the default Plotter by invoking function in new API (make sure
global PlotterParams struct, used by the old API, is set up first) */
if (_old_api_global_plotter_params == NULL)
_old_api_global_plotter_params = pl_newplparams();
new_plotter = pl_newpl_r (type, infile, outfile, errfile,
_old_api_global_plotter_params);
/* ensure local array has an open slot (slot i) */
open_slot = false;
for (i = 0; i < _old_api_plotters_len; i++)
if (_old_api_plotters[i] == NULL)
{
open_slot = true;
break;
}
if (!open_slot)
/* expand array, clearing upper half */
{
i = _old_api_plotters_len;
_old_api_plotters =
(Plotter **)_plot_xrealloc (_old_api_plotters,
2 * _old_api_plotters_len * sizeof (Plotter *));
for (j = _old_api_plotters_len; j < 2 * _old_api_plotters_len; j++)
_old_api_plotters[j] = (Plotter *)NULL;
_old_api_plotters_len *= 2;
}
/* place newly created Plotter in open slot */
_old_api_plotters[i] = new_plotter;
/* return index of newly created Plotter */
return i;
}
/* user-callable, alters selected Plotter and returns index of the one that
was previously selected */
int
#ifdef _HAVE_PROTOS
pl_selectpl (int handle)
#else
pl_selectpl (handle)
int handle;
#endif
{
int i;
if (handle < 0 || handle >= _old_api_plotters_len
|| _old_api_plotters[handle] == NULL)
{
_api_warning ("ignoring request to select a nonexistent plotter");
return -1;
}
/* determine index of currently selected Plotter in _old_api_plotters[] */
for (i = 0; i < _old_api_plotters_len; i++)
if (_old_api_plotters[i] == _old_api_plotter)
break;
/* select specified Plotter: alter value of the _old_api_plotter pointer */
_old_api_plotter = _old_api_plotters[handle];
/* return index of previously selected Plotter */
return i;
}
/* user-callable */
int
#ifdef _HAVE_PROTOS
pl_deletepl (int handle)
#else
pl_deletepl (handle)
int handle;
#endif
{
if (handle < 0 || handle >= _old_api_plotters_len
|| _old_api_plotters[handle] == NULL)
{
_api_warning ("ignoring request to delete a nonexistent plotter");
return -1;
}
if (_old_api_plotters[handle] == _old_api_plotter)
{
_api_warning ("ignoring request to delete currently selected plotter");
return -1;
}
/* delete Plotter by invoking function in new API */
pl_deletepl_r (_old_api_plotters[handle]);
/* remove now-invalid pointer from local array */
_old_api_plotters[handle] = NULL;
return 0;
}
/* function used in this file to print warning messages */
static void
#ifdef _HAVE_PROTOS
_api_warning (const char *msg)
#else
_api_warning (msg)
const char *msg;
#endif
{
if (libplot_warning_handler != NULL)
(*libplot_warning_handler)(msg);
else
fprintf (stderr, "libplot: %s\n", msg);
}
/* The following are the C wrappers around the public functions in the
Plotter class. Together with the three functions above (pl_newpl,
pl_selectpl, pl_deletepl), and pl_parampl, they make up the old
(non-thread-safe) libplot C API.
Each binding tests whether _old_api_plotter is non-NULL, which determines
whether the array of Plotter instances has been initialized. That is
because it makes no sense to call these functions before the
_old_api_plotter pointer points to a Plotter object.
In fact, of the below functions, it really only makes sense to call
openpl, havecap, or outfile [deprecated] before the Plotter array is
initialized. Calling any other of the below functions before the
Plotter array is initialized will generate an error message because even
though the call to _create_and_select_default_plotter will initialize
the Plotter array and select a default Plotter instance, the Plotter
will not be open. No operation in the Plotter class, with the exception
of the just-mentioned ones, may be invoked unless the Plotter that is
being acted on is open. */
int
#ifdef _HAVE_PROTOS
pl_alabel (int x_justify, int y_justify, const char *s)
#else
pl_alabel (x_justify, y_justify, s)
int x_justify, y_justify;
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_alabel (_old_api_plotter, x_justify, y_justify, s);
}
int
#ifdef _HAVE_PROTOS
pl_arc (int xc, int yc, int x0, int y0, int x1, int y1)
#else
pl_arc (xc, yc, x0, y0, x1, y1)
int xc, yc, x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_arc (_old_api_plotter, xc, yc, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_arcrel (int xc, int yc, int x0, int y0, int x1, int y1)
#else
pl_arcrel (xc, yc, x0, y0, x1, y1)
int xc, yc, x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_arcrel (_old_api_plotter, xc, yc, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_bezier2 (int xc, int yc, int x0, int y0, int x1, int y1)
#else
pl_bezier2 (xc, yc, x0, y0, x1, y1)
int xc, yc, x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_bezier2 (_old_api_plotter, xc, yc, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_bezier2rel (int xc, int yc, int x0, int y0, int x1, int y1)
#else
pl_bezier2rel (xc, yc, x0, y0, x1, y1)
int xc, yc, x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_bezier2rel (_old_api_plotter, xc, yc, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_bezier3 (int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3)
#else
pl_bezier3 (x0, y0, x1, y1, x2, y2, x3, y3)
int x0, y0, x1, y1, x2, y2, x3, y3;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_bezier3 (_old_api_plotter, x0, y0, x1, y1, x2, y2, x3, y3);
}
int
#ifdef _HAVE_PROTOS
pl_bezier3rel (int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3)
#else
pl_bezier3rel (x0, y0, x1, y1, x2, y2, x3, y3)
int x0, y0, x1, y1, x2, y2, x3, y3;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_bezier3rel (_old_api_plotter, x0, y0, x1, y1, x2, y2, x3, y3);
}
int
#ifdef _HAVE_PROTOS
pl_bgcolor (int red, int green, int blue)
#else
pl_bgcolor (red, green, blue)
int red, green, blue;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_bgcolor (_old_api_plotter, red, green, blue);
}
int
#ifdef _HAVE_PROTOS
pl_bgcolorname (const char *s)
#else
pl_bgcolorname (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_bgcolorname (_old_api_plotter, s);
}
int
#ifdef _HAVE_PROTOS
pl_box (int x0, int y0, int x1, int y1)
#else
pl_box (x0, y0, x1, y1)
int x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_box (_old_api_plotter, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_boxrel (int x0, int y0, int x1, int y1)
#else
pl_boxrel (x0, y0, x1, y1)
int x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_boxrel (_old_api_plotter, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_capmod (const char *s)
#else
pl_capmod (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_capmod (_old_api_plotter, s);
}
int
#ifdef _HAVE_PROTOS
pl_circle (int x, int y, int r)
#else
pl_circle (x, y, r)
int x, y, r;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_circle (_old_api_plotter, x, y, r);
}
int
#ifdef _HAVE_PROTOS
pl_circlerel (int x, int y, int r)
#else
pl_circlerel (x, y, r)
int x, y, r;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_circlerel (_old_api_plotter, x, y, r);
}
int
#ifdef _HAVE_PROTOS
pl_closepath (void)
#else
pl_closepath ()
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_closepath (_old_api_plotter);
}
int
#ifdef _HAVE_PROTOS
pl_closepl (void)
#else
pl_closepl ()
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_closepl (_old_api_plotter);
}
int
#ifdef _HAVE_PROTOS
pl_color (int red, int green, int blue)
#else
pl_color (red, green, blue)
int red, green, blue;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_color (_old_api_plotter, red, green, blue);
}
int
#ifdef _HAVE_PROTOS
pl_colorname (const char *s)
#else
pl_colorname (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_colorname (_old_api_plotter, s);
}
int
#ifdef _HAVE_PROTOS
pl_cont (int x, int y)
#else
pl_cont (x, y)
int x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_cont (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_contrel (int x, int y)
#else
pl_contrel (x, y)
int x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_contrel (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_ellarc (int xc, int yc, int x0, int y0, int x1, int y1)
#else
pl_ellarc (xc, yc, x0, y0, x1, y1)
int xc, yc, x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_ellarc (_old_api_plotter, xc, yc, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_ellarcrel (int xc, int yc, int x0, int y0, int x1, int y1)
#else
pl_ellarcrel (xc, yc, x0, y0, x1, y1)
int xc, yc, x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_ellarcrel (_old_api_plotter, xc, yc, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_ellipse (int x, int y, int rx, int ry, int angle)
#else
pl_ellipse (x, y, rx, ry, angle)
int x, y, rx, ry, angle;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_ellipse (_old_api_plotter, x, y, rx, ry, angle);
}
int
#ifdef _HAVE_PROTOS
pl_ellipserel (int x, int y, int rx, int ry, int angle)
#else
pl_ellipserel (x, y, rx, ry, angle)
int x, y, rx, ry, angle;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_ellipserel (_old_api_plotter, x, y, rx, ry, angle);
}
int
#ifdef _HAVE_PROTOS
pl_endpath (void)
#else
pl_endpath ()
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_endpath (_old_api_plotter);
}
int
#ifdef _HAVE_PROTOS
pl_endsubpath (void)
#else
pl_endsubpath ()
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_endsubpath (_old_api_plotter);
}
int
#ifdef _HAVE_PROTOS
pl_erase (void)
#else
pl_erase ()
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_erase (_old_api_plotter);
}
int
#ifdef _HAVE_PROTOS
pl_farc (double xc, double yc, double x0, double y0, double x1, double y1)
#else
pl_farc (xc, yc, x0, y0, x1, y1)
double xc, yc, x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_farc (_old_api_plotter, xc, yc, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_farcrel (double xc, double yc, double x0, double y0, double x1, double y1)
#else
pl_farcrel (xc, yc, x0, y0, x1, y1)
double xc, yc, x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_farcrel (_old_api_plotter, xc, yc, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_fbezier2 (double xc, double yc, double x0, double y0, double x1, double y1)
#else
pl_fbezier2 (xc, yc, x0, y0, x1, y1)
double xc, yc, x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fbezier2 (_old_api_plotter, xc, yc, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_fbezier2rel (double xc, double yc, double x0, double y0, double x1, double y1)
#else
pl_fbezier2rel (xc, yc, x0, y0, x1, y1)
double xc, yc, x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fbezier2rel (_old_api_plotter, xc, yc, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_fbezier3 (double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3)
#else
pl_fbezier3 (x0, y0, x1, y1, x2, y2, x3, y3)
double x0, y0, x1, y1, x2, y2, x3, y3;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fbezier3 (_old_api_plotter, x0, y0, x1, y1, x2, y2, x3, y3);
}
int
#ifdef _HAVE_PROTOS
pl_fbezier3rel (double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3)
#else
pl_fbezier3rel (x0, y0, x1, y1, x2, y2, x3, y3)
double x0, y0, x1, y1, x2, y2, x3, y3;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fbezier3rel (_old_api_plotter, x0, y0, x1, y1, x2, y2, x3, y3);
}
int
#ifdef _HAVE_PROTOS
pl_fbox (double x0, double y0, double x1, double y1)
#else
pl_fbox (x0, y0, x1, y1)
double x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fbox (_old_api_plotter, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_fboxrel (double x0, double y0, double x1, double y1)
#else
pl_fboxrel (x0, y0, x1, y1)
double x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fboxrel (_old_api_plotter, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_fcircle (double x, double y, double r)
#else
pl_fcircle (x, y, r)
double x, y, r;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fcircle (_old_api_plotter, x, y, r);
}
int
#ifdef _HAVE_PROTOS
pl_fcirclerel (double x, double y, double r)
#else
pl_fcirclerel (x, y, r)
double x, y, r;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fcirclerel (_old_api_plotter, x, y, r);
}
int
#ifdef _HAVE_PROTOS
pl_fconcat (double m0, double m1, double m2, double m3, double m4, double m5)
#else
pl_fconcat (m0, m1, m2, m3, m4, m5)
double m0, m1, m2, m3, m4, m5;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fconcat (_old_api_plotter, m0, m1, m2, m3, m4, m5);
}
int
#ifdef _HAVE_PROTOS
pl_fcont (double x, double y)
#else
pl_fcont (x, y)
double x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fcont (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_fcontrel (double x, double y)
#else
pl_fcontrel (x, y)
double x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fcontrel (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_fellarc (double xc, double yc, double x0, double y0, double x1, double y1)
#else
pl_fellarc (xc, yc, x0, y0, x1, y1)
double xc, yc, x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fellarc (_old_api_plotter, xc, yc, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_fellarcrel (double xc, double yc, double x0, double y0, double x1, double y1)
#else
pl_fellarcrel (xc, yc, x0, y0, x1, y1)
double xc, yc, x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fellarcrel (_old_api_plotter, xc, yc, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_fellipse (double x, double y, double rx, double ry, double angle)
#else
pl_fellipse (x, y, rx, ry, angle)
double x, y, rx, ry, angle;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fellipse (_old_api_plotter, x, y, rx, ry, angle);
}
int
#ifdef _HAVE_PROTOS
pl_fellipserel (double x, double y, double rx, double ry, double angle)
#else
pl_fellipserel (x, y, rx, ry, angle)
double x, y, rx, ry, angle;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fellipserel (_old_api_plotter, x, y, rx, ry, angle);
}
double
#ifdef _HAVE_PROTOS
pl_ffontname (const char *s)
#else
pl_ffontname (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_ffontname (_old_api_plotter, s);
}
double
#ifdef _HAVE_PROTOS
pl_ffontsize (double size)
#else
pl_ffontsize (size)
double size;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_ffontsize (_old_api_plotter, size);
}
int
#ifdef _HAVE_PROTOS
pl_fillcolor (int red, int green, int blue)
#else
pl_fillcolor (red, green, blue)
int red, green, blue;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fillcolor (_old_api_plotter, red, green, blue);
}
int
#ifdef _HAVE_PROTOS
pl_fillcolorname (const char *s)
#else
pl_fillcolorname (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fillcolorname (_old_api_plotter, s);
}
int
#ifdef _HAVE_PROTOS
pl_fillmod (const char *s)
#else
pl_fillmod (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fillmod (_old_api_plotter, s);
}
int
#ifdef _HAVE_PROTOS
pl_filltype (int level)
#else
pl_filltype (level)
int level;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_filltype (_old_api_plotter, level);
}
double
#ifdef _HAVE_PROTOS
pl_flabelwidth (const char *s)
#else
pl_flabelwidth (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_flabelwidth (_old_api_plotter, s);
}
int
#ifdef _HAVE_PROTOS
pl_fline (double x0, double y0, double x1, double y1)
#else
pl_fline (x0, y0, x1, y1)
double x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fline (_old_api_plotter, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_flinedash (int n, const double *dashes, double offset)
#else
pl_flinedash (n, dashes, offset)
int n;
const double *dashes;
double offset;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_flinedash (_old_api_plotter, n, dashes, offset);
}
int
#ifdef _HAVE_PROTOS
pl_flinerel (double x0, double y0, double x1, double y1)
#else
pl_flinerel (x0, y0, x1, y1)
double x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_flinerel (_old_api_plotter, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_flinewidth (double size)
#else
pl_flinewidth (size)
double size;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_flinewidth (_old_api_plotter, size);
}
int
#ifdef _HAVE_PROTOS
pl_flushpl (void)
#else
pl_flushpl ()
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_flushpl (_old_api_plotter);
}
int
#ifdef _HAVE_PROTOS
pl_fmarker (double x, double y, int type, double size)
#else
pl_fmarker (x, y, type, size)
double x, y;
int type;
double size;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fmarker (_old_api_plotter, x, y, type, size);
}
int
#ifdef _HAVE_PROTOS
pl_fmarkerrel (double x, double y, int type, double size)
#else
pl_fmarkerrel (x, y, type, size)
double x, y;
int type;
double size;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fmarkerrel (_old_api_plotter, x, y, type, size);
}
int
#ifdef _HAVE_PROTOS
pl_fmiterlimit (double limit)
#else
pl_fmiterlimit (limit)
double limit;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fmiterlimit (_old_api_plotter, limit);
}
int
#ifdef _HAVE_PROTOS
pl_fmove (double x, double y)
#else
pl_fmove (x, y)
double x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fmove (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_fmoverel (double x, double y)
#else
pl_fmoverel (x, y)
double x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fmoverel (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_fontname (const char *s)
#else
pl_fontname (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fontname (_old_api_plotter, s);
}
int
#ifdef _HAVE_PROTOS
pl_fontsize (int size)
#else
pl_fontsize (size)
int size;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fontsize (_old_api_plotter, size);
}
int
#ifdef _HAVE_PROTOS
pl_fpoint (double x, double y)
#else
pl_fpoint (x, y)
double x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fpoint (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_fpointrel (double x, double y)
#else
pl_fpointrel (x, y)
double x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fpointrel (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_frotate (double theta)
#else
pl_frotate (theta)
double theta;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_frotate (_old_api_plotter, theta);
}
int
#ifdef _HAVE_PROTOS
pl_fscale (double x, double y)
#else
pl_fscale (x, y)
double x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fscale (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_fsetmatrix (double m0, double m1, double m2, double m3, double m4, double m5)
#else
pl_fsetmatrix (m0, m1, m2, m3, m4, m5)
double m0, m1, m2, m3, m4, m5;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fsetmatrix (_old_api_plotter, m0, m1, m2, m3, m4, m5);
}
int
#ifdef _HAVE_PROTOS
pl_fspace (double x0, double y0, double x1, double y1)
#else
pl_fspace (x0, y0, x1, y1)
double x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fspace (_old_api_plotter, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_fspace2 (double x0, double y0, double x1, double y1, double x2, double y2)
#else
pl_fspace2 (x0, y0, x1, y1, x2, y2)
double x0, y0, x1, y1, x2, y2;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_fspace2 (_old_api_plotter, x0, y0, x1, y1, x2, y2);
}
double
#ifdef _HAVE_PROTOS
pl_ftextangle (double angle)
#else
pl_ftextangle (angle)
double angle;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_ftextangle (_old_api_plotter, angle);
}
int
#ifdef _HAVE_PROTOS
pl_ftranslate (double x, double y)
#else
pl_ftranslate (x, y)
double x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_ftranslate (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_havecap (const char *s)
#else
pl_havecap (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_havecap (_old_api_plotter, s);
}
int
#ifdef _HAVE_PROTOS
pl_joinmod (const char *s)
#else
pl_joinmod (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_joinmod (_old_api_plotter, s);
}
int
#ifdef _HAVE_PROTOS
pl_label (const char *s)
#else
pl_label (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_label (_old_api_plotter, s);
}
int
#ifdef _HAVE_PROTOS
pl_labelwidth (const char *s)
#else
pl_labelwidth (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_labelwidth (_old_api_plotter, s);
}
int
#ifdef _HAVE_PROTOS
pl_line (int x0, int y0, int x1, int y1)
#else
pl_line (x0, y0, x1, y1)
int x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_line (_old_api_plotter, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_linerel (int x0, int y0, int x1, int y1)
#else
pl_linerel (x0, y0, x1, y1)
int x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_linerel (_old_api_plotter, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_linewidth (int size)
#else
pl_linewidth (size)
int size;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_linewidth (_old_api_plotter, size);
}
int
#ifdef _HAVE_PROTOS
pl_linedash (int n, const int *dashes, int offset)
#else
pl_linedash (n, dashes, offset)
int n;
const int *dashes;
int offset;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_linedash (_old_api_plotter, n, dashes, offset);
}
int
#ifdef _HAVE_PROTOS
pl_linemod (const char *s)
#else
pl_linemod (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_linemod (_old_api_plotter, s);
}
int
#ifdef _HAVE_PROTOS
pl_marker (int x, int y, int type, int size)
#else
pl_marker (x, y, type, size)
int x, y, type, size;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_marker (_old_api_plotter, x, y, type, size);
}
int
#ifdef _HAVE_PROTOS
pl_markerrel (int x, int y, int type, int size)
#else
pl_markerrel (x, y, type, size)
int x, y, type, size;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_markerrel (_old_api_plotter, x, y, type, size);
}
int
#ifdef _HAVE_PROTOS
pl_move (int x, int y)
#else
pl_move (x, y)
int x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_move (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_moverel (int x, int y)
#else
pl_moverel (x, y)
int x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_moverel (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_openpl (void)
#else
pl_openpl ()
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_openpl (_old_api_plotter);
}
int
#ifdef _HAVE_PROTOS
pl_orientation (int direction)
#else
pl_orientation (direction)
int direction;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_orientation (_old_api_plotter, direction);
}
FILE *
#ifdef _HAVE_PROTOS
pl_outfile (FILE *outfile)
#else
pl_outfile (outfile)
FILE *outfile;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_outfile (_old_api_plotter, outfile);
}
int
#ifdef _HAVE_PROTOS
pl_pencolor (int red, int green, int blue)
#else
pl_pencolor (red, green, blue)
int red, green, blue;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_pencolor (_old_api_plotter, red, green, blue);
}
int
#ifdef _HAVE_PROTOS
pl_pencolorname (const char *s)
#else
pl_pencolorname (s)
const char *s;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_pencolorname (_old_api_plotter, s);
}
int
#ifdef _HAVE_PROTOS
pl_pentype (int level)
#else
pl_pentype (level)
int level;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_pentype (_old_api_plotter, level);
}
int
#ifdef _HAVE_PROTOS
pl_point (int x, int y)
#else
pl_point (x, y)
int x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_point (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_pointrel (int x, int y)
#else
pl_pointrel (x, y)
int x, y;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_pointrel (_old_api_plotter, x, y);
}
int
#ifdef _HAVE_PROTOS
pl_restorestate (void)
#else
pl_restorestate ()
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_restorestate (_old_api_plotter);
}
int
#ifdef _HAVE_PROTOS
pl_savestate (void)
#else
pl_savestate ()
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_savestate (_old_api_plotter);
}
int
#ifdef _HAVE_PROTOS
pl_space (int x0, int y0, int x1, int y1)
#else
pl_space (x0, y0, x1, y1)
int x0, y0, x1, y1;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_space (_old_api_plotter, x0, y0, x1, y1);
}
int
#ifdef _HAVE_PROTOS
pl_space2 (int x0, int y0, int x1, int y1, int x2, int y2)
#else
pl_space2 (x0, y0, x1, y1, x2, y2)
int x0, y0, x1, y1, x2, y2;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_space2 (_old_api_plotter, x0, y0, x1, y1, x2, y2);
}
int
#ifdef _HAVE_PROTOS
pl_textangle (int angle)
#else
pl_textangle (angle)
int angle;
#endif
{
if (_old_api_plotters_len == 0)
_create_and_select_default_plotter ();
return _API_textangle (_old_api_plotter, angle);
}
/* END OF WRAPPERS */
|