PLplot  5.11.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
tclgen.c
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------*\
2  * pl_setcontlabelformatCmd
3  *
4  * Processes pl_setcontlabelformat Tcl command.
5 \*--------------------------------------------------------------------------*/
6 
7 static int
8 pl_setcontlabelformatCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
9 {
10  PLINT lexp;
11  PLINT sigprec;
12 
13  pl_errcode = 0; errmsg[0] = '\0';
14 
15  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
16  Tcl_AppendResult( interp, "command syntax: \"",
17  "pl_setcontlabelformat lexp sigprec", "\"",
18  (char *) NULL);
19  return TCL_ERROR;
20  }
21 
22  if ( (!0 && 0 && (argc < (1 + 2 - 0))) ||
23  (!0 && !0 && (argc != (2 + 1))) ||
24  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
25  Tcl_AppendResult( interp, "wrong # args: should be \"",
26  "pl_setcontlabelformat lexp sigprec", "\"",
27  (char *) NULL);
28  return TCL_ERROR;
29  }
30 
31  lexp = atoi(argv[1+0]);
32  sigprec = atoi(argv[1+1]);
33 
34  pl_setcontlabelformat ( lexp, sigprec );
35 
36 
37  if (pl_errcode != 0) {
38  Tcl_AppendResult(interp, errmsg, (char *) NULL);
39  return TCL_ERROR;
40  }
41 
42  plflush();
43  return TCL_OK;
44 }
45 
46 /*--------------------------------------------------------------------------*\
47  * pl_setcontlabelparamCmd
48  *
49  * Processes pl_setcontlabelparam Tcl command.
50 \*--------------------------------------------------------------------------*/
51 
52 static int
53 pl_setcontlabelparamCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
54 {
55  PLFLT offset;
56  PLFLT size;
57  PLFLT spacing;
58  PLINT active;
59 
60  pl_errcode = 0; errmsg[0] = '\0';
61 
62  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
63  Tcl_AppendResult( interp, "command syntax: \"",
64  "pl_setcontlabelparam offset size spacing active", "\"",
65  (char *) NULL);
66  return TCL_ERROR;
67  }
68 
69  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
70  (!0 && !0 && (argc != (4 + 1))) ||
71  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
72  Tcl_AppendResult( interp, "wrong # args: should be \"",
73  "pl_setcontlabelparam offset size spacing active", "\"",
74  (char *) NULL);
75  return TCL_ERROR;
76  }
77 
78  offset = atof(argv[1+0]);
79  size = atof(argv[1+1]);
80  spacing = atof(argv[1+2]);
81  active = atoi(argv[1+3]);
82 
83  pl_setcontlabelparam ( offset, size, spacing, active );
84 
85 
86  if (pl_errcode != 0) {
87  Tcl_AppendResult(interp, errmsg, (char *) NULL);
88  return TCL_ERROR;
89  }
90 
91  plflush();
92  return TCL_OK;
93 }
94 
95 /*--------------------------------------------------------------------------*\
96  * pladvCmd
97  *
98  * Processes pladv Tcl command.
99 \*--------------------------------------------------------------------------*/
100 
101 static int
102 pladvCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
103 {
104  PLINT page = 0;
105 
106  pl_errcode = 0; errmsg[0] = '\0';
107 
108  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
109  Tcl_AppendResult( interp, "command syntax: \"",
110  "pladv page", "\"",
111  (char *) NULL);
112  return TCL_ERROR;
113  }
114 
115  if ( (!0 && 1 && (argc < (1 + 1 - 1))) ||
116  (!0 && !1 && (argc != (1 + 1))) ||
117  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
118  Tcl_AppendResult( interp, "wrong # args: should be \"",
119  "pladv page", "\"",
120  (char *) NULL);
121  return TCL_ERROR;
122  }
123 
124  if (argc > 0+1) {
125  page = atoi(argv[1+0]);
126  }
127 
128  pladv ( page );
129 
130 
131  if (pl_errcode != 0) {
132  Tcl_AppendResult(interp, errmsg, (char *) NULL);
133  return TCL_ERROR;
134  }
135 
136  plflush();
137  return TCL_OK;
138 }
139 
140 /*--------------------------------------------------------------------------*\
141  * plarcCmd
142  *
143  * Processes plarc Tcl command.
144 \*--------------------------------------------------------------------------*/
145 
146 static int
147 plarcCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
148 {
149  PLFLT x;
150  PLFLT y;
151  PLFLT a;
152  PLFLT b;
153  PLFLT angle1;
154  PLFLT angle2;
155  PLFLT rotate;
156  PLINT fill;
157 
158  pl_errcode = 0; errmsg[0] = '\0';
159 
160  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
161  Tcl_AppendResult( interp, "command syntax: \"",
162  "plarc x y a b angle1 angle2 rotate fill", "\"",
163  (char *) NULL);
164  return TCL_ERROR;
165  }
166 
167  if ( (!0 && 0 && (argc < (1 + 8 - 0))) ||
168  (!0 && !0 && (argc != (8 + 1))) ||
169  ( 0 && (argc != 1) && (argc != (8 + 1))) ) {
170  Tcl_AppendResult( interp, "wrong # args: should be \"",
171  "plarc x y a b angle1 angle2 rotate fill", "\"",
172  (char *) NULL);
173  return TCL_ERROR;
174  }
175 
176  x = atof(argv[1+0]);
177  y = atof(argv[1+1]);
178  a = atof(argv[1+2]);
179  b = atof(argv[1+3]);
180  angle1 = atof(argv[1+4]);
181  angle2 = atof(argv[1+5]);
182  rotate = atof(argv[1+6]);
183  fill = atoi(argv[1+7]);
184 
185  plarc ( x, y, a, b, angle1, angle2, rotate, fill );
186 
187 
188  if (pl_errcode != 0) {
189  Tcl_AppendResult(interp, errmsg, (char *) NULL);
190  return TCL_ERROR;
191  }
192 
193  plflush();
194  return TCL_OK;
195 }
196 
197 /*--------------------------------------------------------------------------*\
198  * plaxesCmd
199  *
200  * Processes plaxes Tcl command.
201 \*--------------------------------------------------------------------------*/
202 
203 static int
204 plaxesCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
205 {
206  PLFLT x0;
207  PLFLT y0;
208  const char *xopt;
209  PLFLT xtick;
210  PLINT nxsub;
211  const char *yopt;
212  PLFLT ytick;
213  PLINT nysub;
214 
215  pl_errcode = 0; errmsg[0] = '\0';
216 
217  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
218  Tcl_AppendResult( interp, "command syntax: \"",
219  "plaxes x0 y0 xopt xtick nxsub yopt ytick nysub", "\"",
220  (char *) NULL);
221  return TCL_ERROR;
222  }
223 
224  if ( (!0 && 0 && (argc < (1 + 8 - 0))) ||
225  (!0 && !0 && (argc != (8 + 1))) ||
226  ( 0 && (argc != 1) && (argc != (8 + 1))) ) {
227  Tcl_AppendResult( interp, "wrong # args: should be \"",
228  "plaxes x0 y0 xopt xtick nxsub yopt ytick nysub", "\"",
229  (char *) NULL);
230  return TCL_ERROR;
231  }
232 
233  x0 = atof(argv[1+0]);
234  y0 = atof(argv[1+1]);
235  xopt = argv[1+2];
236  xtick = atof(argv[1+3]);
237  nxsub = atoi(argv[1+4]);
238  yopt = argv[1+5];
239  ytick = atof(argv[1+6]);
240  nysub = atoi(argv[1+7]);
241 
242  plaxes ( x0, y0, xopt, xtick, nxsub, yopt, ytick, nysub );
243 
244 
245  if (pl_errcode != 0) {
246  Tcl_AppendResult(interp, errmsg, (char *) NULL);
247  return TCL_ERROR;
248  }
249 
250  plflush();
251  return TCL_OK;
252 }
253 
254 /*--------------------------------------------------------------------------*\
255  * plbinCmd
256  *
257  * Processes plbin Tcl command.
258 \*--------------------------------------------------------------------------*/
259 
260 static int
261 plbinCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
262 {
263  PLINT nbin;
264  PLFLT *x;
265  tclMatrix *matx;
266  PLFLT *y;
267  tclMatrix *maty;
268  PLINT center;
269 
270  pl_errcode = 0; errmsg[0] = '\0';
271 
272  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
273  Tcl_AppendResult( interp, "command syntax: \"",
274  "plbin nbin x y center", "\"",
275  (char *) NULL);
276  return TCL_ERROR;
277  }
278 
279  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
280  (!0 && !0 && (argc != (4 + 1))) ||
281  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
282  Tcl_AppendResult( interp, "wrong # args: should be \"",
283  "plbin nbin x y center", "\"",
284  (char *) NULL);
285  return TCL_ERROR;
286  }
287 
288  nbin = atoi(argv[1+0]);
289  matx = Tcl_GetMatrixPtr( interp, argv[1+1] );
290  if (matx == NULL) return TCL_ERROR;
291  x = matx->fdata;
292  maty = Tcl_GetMatrixPtr( interp, argv[1+2] );
293  if (maty == NULL) return TCL_ERROR;
294  y = maty->fdata;
295  center = atoi(argv[1+3]);
296 
297  plbin ( nbin, x, y, center );
298 
299 
300  if (pl_errcode != 0) {
301  Tcl_AppendResult(interp, errmsg, (char *) NULL);
302  return TCL_ERROR;
303  }
304 
305  plflush();
306  return TCL_OK;
307 }
308 
309 /*--------------------------------------------------------------------------*\
310  * plbopCmd
311  *
312  * Processes plbop Tcl command.
313 \*--------------------------------------------------------------------------*/
314 
315 static int
316 plbopCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
317 {
318 
319  pl_errcode = 0; errmsg[0] = '\0';
320 
321  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
322  Tcl_AppendResult( interp, "command syntax: \"",
323  "plbop ", "\"",
324  (char *) NULL);
325  return TCL_ERROR;
326  }
327 
328  if ( (!0 && 0 && (argc < (1 + 0 - 0))) ||
329  (!0 && !0 && (argc != (0 + 1))) ||
330  ( 0 && (argc != 1) && (argc != (0 + 1))) ) {
331  Tcl_AppendResult( interp, "wrong # args: should be \"",
332  "plbop ", "\"",
333  (char *) NULL);
334  return TCL_ERROR;
335  }
336 
337 
338  plbop ( );
339 
340 
341  if (pl_errcode != 0) {
342  Tcl_AppendResult(interp, errmsg, (char *) NULL);
343  return TCL_ERROR;
344  }
345 
346  plflush();
347  return TCL_OK;
348 }
349 
350 /*--------------------------------------------------------------------------*\
351  * plboxCmd
352  *
353  * Processes plbox Tcl command.
354 \*--------------------------------------------------------------------------*/
355 
356 static int
357 plboxCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
358 {
359  const char *xopt;
360  PLFLT xtick;
361  PLINT nxsub;
362  const char *yopt;
363  PLFLT ytick;
364  PLINT nysub;
365 
366  pl_errcode = 0; errmsg[0] = '\0';
367 
368  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
369  Tcl_AppendResult( interp, "command syntax: \"",
370  "plbox xopt xtick nxsub yopt ytick nysub", "\"",
371  (char *) NULL);
372  return TCL_ERROR;
373  }
374 
375  if ( (!0 && 0 && (argc < (1 + 6 - 0))) ||
376  (!0 && !0 && (argc != (6 + 1))) ||
377  ( 0 && (argc != 1) && (argc != (6 + 1))) ) {
378  Tcl_AppendResult( interp, "wrong # args: should be \"",
379  "plbox xopt xtick nxsub yopt ytick nysub", "\"",
380  (char *) NULL);
381  return TCL_ERROR;
382  }
383 
384  xopt = argv[1+0];
385  xtick = atof(argv[1+1]);
386  nxsub = atoi(argv[1+2]);
387  yopt = argv[1+3];
388  ytick = atof(argv[1+4]);
389  nysub = atoi(argv[1+5]);
390 
391  plbox ( xopt, xtick, nxsub, yopt, ytick, nysub );
392 
393 
394  if (pl_errcode != 0) {
395  Tcl_AppendResult(interp, errmsg, (char *) NULL);
396  return TCL_ERROR;
397  }
398 
399  plflush();
400  return TCL_OK;
401 }
402 
403 /*--------------------------------------------------------------------------*\
404  * plbox3Cmd
405  *
406  * Processes plbox3 Tcl command.
407 \*--------------------------------------------------------------------------*/
408 
409 static int
410 plbox3Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
411 {
412  const char *xopt;
413  const char *xlabel;
414  PLFLT xtick;
415  PLINT nsubx;
416  const char *yopt;
417  const char *ylabel;
418  PLFLT ytick;
419  PLINT nsuby;
420  const char *zopt;
421  const char *zlabel;
422  PLFLT ztick;
423  PLINT nsubz;
424 
425  pl_errcode = 0; errmsg[0] = '\0';
426 
427  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
428  Tcl_AppendResult( interp, "command syntax: \"",
429  "plbox3 xopt xlabel xtick nsubx yopt ylabel ytick nsuby zopt zlabel ztick nsubz", "\"",
430  (char *) NULL);
431  return TCL_ERROR;
432  }
433 
434  if ( (!0 && 0 && (argc < (1 + 12 - 0))) ||
435  (!0 && !0 && (argc != (12 + 1))) ||
436  ( 0 && (argc != 1) && (argc != (12 + 1))) ) {
437  Tcl_AppendResult( interp, "wrong # args: should be \"",
438  "plbox3 xopt xlabel xtick nsubx yopt ylabel ytick nsuby zopt zlabel ztick nsubz", "\"",
439  (char *) NULL);
440  return TCL_ERROR;
441  }
442 
443  xopt = argv[1+0];
444  xlabel = argv[1+1];
445  xtick = atof(argv[1+2]);
446  nsubx = atoi(argv[1+3]);
447  yopt = argv[1+4];
448  ylabel = argv[1+5];
449  ytick = atof(argv[1+6]);
450  nsuby = atoi(argv[1+7]);
451  zopt = argv[1+8];
452  zlabel = argv[1+9];
453  ztick = atof(argv[1+10]);
454  nsubz = atoi(argv[1+11]);
455 
456  plbox3 ( xopt, xlabel, xtick, nsubx, yopt, ylabel, ytick, nsuby, zopt, zlabel, ztick, nsubz );
457 
458 
459  if (pl_errcode != 0) {
460  Tcl_AppendResult(interp, errmsg, (char *) NULL);
461  return TCL_ERROR;
462  }
463 
464  plflush();
465  return TCL_OK;
466 }
467 
468 /*--------------------------------------------------------------------------*\
469  * plbtimeCmd
470  *
471  * Processes plbtime Tcl command.
472 \*--------------------------------------------------------------------------*/
473 
474 static int
475 plbtimeCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
476 {
477  PLINT year;
478  PLINT month;
479  PLINT day;
480  PLINT hour;
481  PLINT min;
482  PLFLT sec;
483  PLFLT ctime;
484 
485  pl_errcode = 0; errmsg[0] = '\0';
486 
487  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
488  Tcl_AppendResult( interp, "command syntax: \"",
489  "plbtime ?year month day hour min sec ctime?", "\"",
490  (char *) NULL);
491  return TCL_ERROR;
492  }
493 
494  if ( (!1 && 0 && (argc < (1 + 7 - 0))) ||
495  (!1 && !0 && (argc != (7 + 1))) ||
496  ( 1 && (argc != 1) && (argc != (7 + 1))) ) {
497  Tcl_AppendResult( interp, "wrong # args: should be \"",
498  "plbtime ?year month day hour min sec ctime?", "\"",
499  (char *) NULL);
500  return TCL_ERROR;
501  }
502 
503 /* year is for output. */
504 /* month is for output. */
505 /* day is for output. */
506 /* hour is for output. */
507 /* min is for output. */
508 /* sec is for output. */
509  ctime = atof(argv[1+6]);
510 
511  plbtime ( &year, &month, &day, &hour, &min, &sec, ctime );
512 
513  sprintf( buf, "%d", year );
514  if (argc > 1)
515  Tcl_SetVar( interp, argv[1+0], buf, 0 );
516  else
517  Tcl_AppendResult( interp, buf, (char *) NULL );
518  if (argc == 1)
519  Tcl_AppendResult( interp, " ", (char *) NULL );
520  sprintf( buf, "%d", month );
521  if (argc > 1)
522  Tcl_SetVar( interp, argv[1+1], buf, 0 );
523  else
524  Tcl_AppendResult( interp, buf, (char *) NULL );
525  if (argc == 1)
526  Tcl_AppendResult( interp, " ", (char *) NULL );
527  sprintf( buf, "%d", day );
528  if (argc > 1)
529  Tcl_SetVar( interp, argv[1+2], buf, 0 );
530  else
531  Tcl_AppendResult( interp, buf, (char *) NULL );
532  if (argc == 1)
533  Tcl_AppendResult( interp, " ", (char *) NULL );
534  sprintf( buf, "%d", hour );
535  if (argc > 1)
536  Tcl_SetVar( interp, argv[1+3], buf, 0 );
537  else
538  Tcl_AppendResult( interp, buf, (char *) NULL );
539  if (argc == 1)
540  Tcl_AppendResult( interp, " ", (char *) NULL );
541  sprintf( buf, "%d", min );
542  if (argc > 1)
543  Tcl_SetVar( interp, argv[1+4], buf, 0 );
544  else
545  Tcl_AppendResult( interp, buf, (char *) NULL );
546  if (argc == 1)
547  Tcl_AppendResult( interp, " ", (char *) NULL );
548  Tcl_PrintDouble( interp, sec, buf );
549  if (argc > 1)
550  Tcl_SetVar( interp, argv[1+5], buf, 0 );
551  else
552  Tcl_AppendResult( interp, buf, (char *) NULL );
553 
554  if (pl_errcode != 0) {
555  Tcl_AppendResult(interp, errmsg, (char *) NULL);
556  return TCL_ERROR;
557  }
558 
559  plflush();
560  return TCL_OK;
561 }
562 
563 /*--------------------------------------------------------------------------*\
564  * plcalc_worldCmd
565  *
566  * Processes plcalc_world Tcl command.
567 \*--------------------------------------------------------------------------*/
568 
569 static int
570 plcalc_worldCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
571 {
572  PLFLT rx;
573  PLFLT ry;
574  PLFLT wx;
575  PLFLT wy;
576  PLINT window;
577 
578  pl_errcode = 0; errmsg[0] = '\0';
579 
580  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
581  Tcl_AppendResult( interp, "command syntax: \"",
582  "plcalc_world ?rx ry wx wy window?", "\"",
583  (char *) NULL);
584  return TCL_ERROR;
585  }
586 
587  if ( (!1 && 0 && (argc < (1 + 5 - 0))) ||
588  (!1 && !0 && (argc != (5 + 1))) ||
589  ( 1 && (argc != 1) && (argc != (5 + 1))) ) {
590  Tcl_AppendResult( interp, "wrong # args: should be \"",
591  "plcalc_world ?rx ry wx wy window?", "\"",
592  (char *) NULL);
593  return TCL_ERROR;
594  }
595 
596  rx = atof(argv[1+0]);
597  ry = atof(argv[1+1]);
598 /* wx is for output. */
599 /* wy is for output. */
600 /* window is for output. */
601 
602  plcalc_world ( rx, ry, &wx, &wy, &window );
603 
604  if (argc == 1)
605  Tcl_AppendResult( interp, " ", (char *) NULL );
606  Tcl_PrintDouble( interp, wx, buf );
607  if (argc > 1)
608  Tcl_SetVar( interp, argv[1+2], buf, 0 );
609  else
610  Tcl_AppendResult( interp, buf, (char *) NULL );
611  if (argc == 1)
612  Tcl_AppendResult( interp, " ", (char *) NULL );
613  Tcl_PrintDouble( interp, wy, buf );
614  if (argc > 1)
615  Tcl_SetVar( interp, argv[1+3], buf, 0 );
616  else
617  Tcl_AppendResult( interp, buf, (char *) NULL );
618  if (argc == 1)
619  Tcl_AppendResult( interp, " ", (char *) NULL );
620  sprintf( buf, "%d", window );
621  if (argc > 1)
622  Tcl_SetVar( interp, argv[1+4], buf, 0 );
623  else
624  Tcl_AppendResult( interp, buf, (char *) NULL );
625 
626  if (pl_errcode != 0) {
627  Tcl_AppendResult(interp, errmsg, (char *) NULL);
628  return TCL_ERROR;
629  }
630 
631  plflush();
632  return TCL_OK;
633 }
634 
635 /*--------------------------------------------------------------------------*\
636  * plclearCmd
637  *
638  * Processes plclear Tcl command.
639 \*--------------------------------------------------------------------------*/
640 
641 static int
642 plclearCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
643 {
644 
645  pl_errcode = 0; errmsg[0] = '\0';
646 
647  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
648  Tcl_AppendResult( interp, "command syntax: \"",
649  "plclear ", "\"",
650  (char *) NULL);
651  return TCL_ERROR;
652  }
653 
654  if ( (!0 && 0 && (argc < (1 + 0 - 0))) ||
655  (!0 && !0 && (argc != (0 + 1))) ||
656  ( 0 && (argc != 1) && (argc != (0 + 1))) ) {
657  Tcl_AppendResult( interp, "wrong # args: should be \"",
658  "plclear ", "\"",
659  (char *) NULL);
660  return TCL_ERROR;
661  }
662 
663 
664  plclear ( );
665 
666 
667  if (pl_errcode != 0) {
668  Tcl_AppendResult(interp, errmsg, (char *) NULL);
669  return TCL_ERROR;
670  }
671 
672  plflush();
673  return TCL_OK;
674 }
675 
676 /*--------------------------------------------------------------------------*\
677  * plcol0Cmd
678  *
679  * Processes plcol0 Tcl command.
680 \*--------------------------------------------------------------------------*/
681 
682 static int
683 plcol0Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
684 {
685  PLINT icol0;
686 
687  pl_errcode = 0; errmsg[0] = '\0';
688 
689  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
690  Tcl_AppendResult( interp, "command syntax: \"",
691  "plcol0 icol0", "\"",
692  (char *) NULL);
693  return TCL_ERROR;
694  }
695 
696  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
697  (!0 && !0 && (argc != (1 + 1))) ||
698  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
699  Tcl_AppendResult( interp, "wrong # args: should be \"",
700  "plcol0 icol0", "\"",
701  (char *) NULL);
702  return TCL_ERROR;
703  }
704 
705  icol0 = atoi(argv[1+0]);
706 
707  plcol0 ( icol0 );
708 
709 
710  if (pl_errcode != 0) {
711  Tcl_AppendResult(interp, errmsg, (char *) NULL);
712  return TCL_ERROR;
713  }
714 
715  plflush();
716  return TCL_OK;
717 }
718 
719 /*--------------------------------------------------------------------------*\
720  * plcol1Cmd
721  *
722  * Processes plcol1 Tcl command.
723 \*--------------------------------------------------------------------------*/
724 
725 static int
726 plcol1Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
727 {
728  PLFLT col1;
729 
730  pl_errcode = 0; errmsg[0] = '\0';
731 
732  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
733  Tcl_AppendResult( interp, "command syntax: \"",
734  "plcol1 col1", "\"",
735  (char *) NULL);
736  return TCL_ERROR;
737  }
738 
739  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
740  (!0 && !0 && (argc != (1 + 1))) ||
741  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
742  Tcl_AppendResult( interp, "wrong # args: should be \"",
743  "plcol1 col1", "\"",
744  (char *) NULL);
745  return TCL_ERROR;
746  }
747 
748  col1 = atof(argv[1+0]);
749 
750  plcol1 ( col1 );
751 
752 
753  if (pl_errcode != 0) {
754  Tcl_AppendResult(interp, errmsg, (char *) NULL);
755  return TCL_ERROR;
756  }
757 
758  plflush();
759  return TCL_OK;
760 }
761 
762 /*--------------------------------------------------------------------------*\
763  * plconfigtimeCmd
764  *
765  * Processes plconfigtime Tcl command.
766 \*--------------------------------------------------------------------------*/
767 
768 static int
769 plconfigtimeCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
770 {
771  PLFLT scale;
772  PLFLT offset1;
773  PLFLT offset2;
774  PLINT ccontrol;
775  PLINT ifbtime_offset;
776  PLINT year;
777  PLINT month;
778  PLINT day;
779  PLINT hour;
780  PLINT min;
781  PLFLT sec;
782 
783  pl_errcode = 0; errmsg[0] = '\0';
784 
785  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
786  Tcl_AppendResult( interp, "command syntax: \"",
787  "plconfigtime scale offset1 offset2 ccontrol ifbtime_offset year month day hour min sec", "\"",
788  (char *) NULL);
789  return TCL_ERROR;
790  }
791 
792  if ( (!0 && 0 && (argc < (1 + 11 - 0))) ||
793  (!0 && !0 && (argc != (11 + 1))) ||
794  ( 0 && (argc != 1) && (argc != (11 + 1))) ) {
795  Tcl_AppendResult( interp, "wrong # args: should be \"",
796  "plconfigtime scale offset1 offset2 ccontrol ifbtime_offset year month day hour min sec", "\"",
797  (char *) NULL);
798  return TCL_ERROR;
799  }
800 
801  scale = atof(argv[1+0]);
802  offset1 = atof(argv[1+1]);
803  offset2 = atof(argv[1+2]);
804  ccontrol = atoi(argv[1+3]);
805  ifbtime_offset = atoi(argv[1+4]);
806  year = atoi(argv[1+5]);
807  month = atoi(argv[1+6]);
808  day = atoi(argv[1+7]);
809  hour = atoi(argv[1+8]);
810  min = atoi(argv[1+9]);
811  sec = atof(argv[1+10]);
812 
813  plconfigtime ( scale, offset1, offset2, ccontrol, ifbtime_offset, year, month, day, hour, min, sec );
814 
815 
816  if (pl_errcode != 0) {
817  Tcl_AppendResult(interp, errmsg, (char *) NULL);
818  return TCL_ERROR;
819  }
820 
821  plflush();
822  return TCL_OK;
823 }
824 
825 /*--------------------------------------------------------------------------*\
826  * plcpstrmCmd
827  *
828  * Processes plcpstrm Tcl command.
829 \*--------------------------------------------------------------------------*/
830 
831 static int
832 plcpstrmCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
833 {
834  PLINT iplsr;
835  PLINT flags;
836 
837  pl_errcode = 0; errmsg[0] = '\0';
838 
839  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
840  Tcl_AppendResult( interp, "command syntax: \"",
841  "plcpstrm iplsr flags", "\"",
842  (char *) NULL);
843  return TCL_ERROR;
844  }
845 
846  if ( (!0 && 0 && (argc < (1 + 2 - 0))) ||
847  (!0 && !0 && (argc != (2 + 1))) ||
848  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
849  Tcl_AppendResult( interp, "wrong # args: should be \"",
850  "plcpstrm iplsr flags", "\"",
851  (char *) NULL);
852  return TCL_ERROR;
853  }
854 
855  iplsr = atoi(argv[1+0]);
856  flags = atoi(argv[1+1]);
857 
858  plcpstrm ( iplsr, flags );
859 
860 
861  if (pl_errcode != 0) {
862  Tcl_AppendResult(interp, errmsg, (char *) NULL);
863  return TCL_ERROR;
864  }
865 
866  plflush();
867  return TCL_OK;
868 }
869 
870 /*--------------------------------------------------------------------------*\
871  * plctimeCmd
872  *
873  * Processes plctime Tcl command.
874 \*--------------------------------------------------------------------------*/
875 
876 static int
877 plctimeCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
878 {
879  PLINT year;
880  PLINT month;
881  PLINT day;
882  PLINT hour;
883  PLINT min;
884  PLFLT sec;
885  PLFLT ctime;
886 
887  pl_errcode = 0; errmsg[0] = '\0';
888 
889  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
890  Tcl_AppendResult( interp, "command syntax: \"",
891  "plctime ?year month day hour min sec ctime?", "\"",
892  (char *) NULL);
893  return TCL_ERROR;
894  }
895 
896  if ( (!1 && 0 && (argc < (1 + 7 - 0))) ||
897  (!1 && !0 && (argc != (7 + 1))) ||
898  ( 1 && (argc != 1) && (argc != (7 + 1))) ) {
899  Tcl_AppendResult( interp, "wrong # args: should be \"",
900  "plctime ?year month day hour min sec ctime?", "\"",
901  (char *) NULL);
902  return TCL_ERROR;
903  }
904 
905  year = atoi(argv[1+0]);
906  month = atoi(argv[1+1]);
907  day = atoi(argv[1+2]);
908  hour = atoi(argv[1+3]);
909  min = atoi(argv[1+4]);
910  sec = atof(argv[1+5]);
911 /* ctime is for output. */
912 
913  plctime ( year, month, day, hour, min, sec, &ctime );
914 
915  if (argc == 1)
916  Tcl_AppendResult( interp, " ", (char *) NULL );
917  Tcl_PrintDouble( interp, ctime, buf );
918  if (argc > 1)
919  Tcl_SetVar( interp, argv[1+6], buf, 0 );
920  else
921  Tcl_AppendResult( interp, buf, (char *) NULL );
922 
923  if (pl_errcode != 0) {
924  Tcl_AppendResult(interp, errmsg, (char *) NULL);
925  return TCL_ERROR;
926  }
927 
928  plflush();
929  return TCL_OK;
930 }
931 
932 /*--------------------------------------------------------------------------*\
933  * pldid2pcCmd
934  *
935  * Processes pldid2pc Tcl command.
936 \*--------------------------------------------------------------------------*/
937 
938 static int
939 pldid2pcCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
940 {
941  PLFLT xmin;
942  PLFLT ymin;
943  PLFLT xmax;
944  PLFLT ymax;
945 
946  pl_errcode = 0; errmsg[0] = '\0';
947 
948  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
949  Tcl_AppendResult( interp, "command syntax: \"",
950  "pldid2pc ?xmin ymin xmax ymax?", "\"",
951  (char *) NULL);
952  return TCL_ERROR;
953  }
954 
955  if ( (!1 && 0 && (argc < (1 + 4 - 0))) ||
956  (!1 && !0 && (argc != (4 + 1))) ||
957  ( 1 && (argc != 1) && (argc != (4 + 1))) ) {
958  Tcl_AppendResult( interp, "wrong # args: should be \"",
959  "pldid2pc ?xmin ymin xmax ymax?", "\"",
960  (char *) NULL);
961  return TCL_ERROR;
962  }
963 
964 /* xmin is for output. */
965 /* ymin is for output. */
966 /* xmax is for output. */
967 /* ymax is for output. */
968 
969  pldid2pc ( &xmin, &ymin, &xmax, &ymax );
970 
971  Tcl_PrintDouble( interp, xmin, buf );
972  if (argc > 1)
973  Tcl_SetVar( interp, argv[1+0], buf, 0 );
974  else
975  Tcl_AppendResult( interp, buf, (char *) NULL );
976  if (argc == 1)
977  Tcl_AppendResult( interp, " ", (char *) NULL );
978  Tcl_PrintDouble( interp, ymin, buf );
979  if (argc > 1)
980  Tcl_SetVar( interp, argv[1+1], buf, 0 );
981  else
982  Tcl_AppendResult( interp, buf, (char *) NULL );
983  if (argc == 1)
984  Tcl_AppendResult( interp, " ", (char *) NULL );
985  Tcl_PrintDouble( interp, xmax, buf );
986  if (argc > 1)
987  Tcl_SetVar( interp, argv[1+2], buf, 0 );
988  else
989  Tcl_AppendResult( interp, buf, (char *) NULL );
990  if (argc == 1)
991  Tcl_AppendResult( interp, " ", (char *) NULL );
992  Tcl_PrintDouble( interp, ymax, buf );
993  if (argc > 1)
994  Tcl_SetVar( interp, argv[1+3], buf, 0 );
995  else
996  Tcl_AppendResult( interp, buf, (char *) NULL );
997 
998  if (pl_errcode != 0) {
999  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1000  return TCL_ERROR;
1001  }
1002 
1003  plflush();
1004  return TCL_OK;
1005 }
1006 
1007 /*--------------------------------------------------------------------------*\
1008  * pldip2dcCmd
1009  *
1010  * Processes pldip2dc Tcl command.
1011 \*--------------------------------------------------------------------------*/
1012 
1013 static int
1014 pldip2dcCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1015 {
1016  PLFLT xmin;
1017  PLFLT ymin;
1018  PLFLT xmax;
1019  PLFLT ymax;
1020 
1021  pl_errcode = 0; errmsg[0] = '\0';
1022 
1023  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1024  Tcl_AppendResult( interp, "command syntax: \"",
1025  "pldip2dc ?xmin ymin xmax ymax?", "\"",
1026  (char *) NULL);
1027  return TCL_ERROR;
1028  }
1029 
1030  if ( (!1 && 0 && (argc < (1 + 4 - 0))) ||
1031  (!1 && !0 && (argc != (4 + 1))) ||
1032  ( 1 && (argc != 1) && (argc != (4 + 1))) ) {
1033  Tcl_AppendResult( interp, "wrong # args: should be \"",
1034  "pldip2dc ?xmin ymin xmax ymax?", "\"",
1035  (char *) NULL);
1036  return TCL_ERROR;
1037  }
1038 
1039 /* xmin is for output. */
1040 /* ymin is for output. */
1041 /* xmax is for output. */
1042 /* ymax is for output. */
1043 
1044  pldip2dc ( &xmin, &ymin, &xmax, &ymax );
1045 
1046  Tcl_PrintDouble( interp, xmin, buf );
1047  if (argc > 1)
1048  Tcl_SetVar( interp, argv[1+0], buf, 0 );
1049  else
1050  Tcl_AppendResult( interp, buf, (char *) NULL );
1051  if (argc == 1)
1052  Tcl_AppendResult( interp, " ", (char *) NULL );
1053  Tcl_PrintDouble( interp, ymin, buf );
1054  if (argc > 1)
1055  Tcl_SetVar( interp, argv[1+1], buf, 0 );
1056  else
1057  Tcl_AppendResult( interp, buf, (char *) NULL );
1058  if (argc == 1)
1059  Tcl_AppendResult( interp, " ", (char *) NULL );
1060  Tcl_PrintDouble( interp, xmax, buf );
1061  if (argc > 1)
1062  Tcl_SetVar( interp, argv[1+2], buf, 0 );
1063  else
1064  Tcl_AppendResult( interp, buf, (char *) NULL );
1065  if (argc == 1)
1066  Tcl_AppendResult( interp, " ", (char *) NULL );
1067  Tcl_PrintDouble( interp, ymax, buf );
1068  if (argc > 1)
1069  Tcl_SetVar( interp, argv[1+3], buf, 0 );
1070  else
1071  Tcl_AppendResult( interp, buf, (char *) NULL );
1072 
1073  if (pl_errcode != 0) {
1074  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1075  return TCL_ERROR;
1076  }
1077 
1078  plflush();
1079  return TCL_OK;
1080 }
1081 
1082 /*--------------------------------------------------------------------------*\
1083  * plendCmd
1084  *
1085  * Processes plend Tcl command.
1086 \*--------------------------------------------------------------------------*/
1087 
1088 static int
1089 plendCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1090 {
1091 
1092  pl_errcode = 0; errmsg[0] = '\0';
1093 
1094  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1095  Tcl_AppendResult( interp, "command syntax: \"",
1096  "plend ", "\"",
1097  (char *) NULL);
1098  return TCL_ERROR;
1099  }
1100 
1101  if ( (!0 && 0 && (argc < (1 + 0 - 0))) ||
1102  (!0 && !0 && (argc != (0 + 1))) ||
1103  ( 0 && (argc != 1) && (argc != (0 + 1))) ) {
1104  Tcl_AppendResult( interp, "wrong # args: should be \"",
1105  "plend ", "\"",
1106  (char *) NULL);
1107  return TCL_ERROR;
1108  }
1109 
1110 
1111  plend ( );
1112 
1113 
1114  if (pl_errcode != 0) {
1115  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1116  return TCL_ERROR;
1117  }
1118 
1119  plflush();
1120  return TCL_OK;
1121 }
1122 
1123 /*--------------------------------------------------------------------------*\
1124  * plend1Cmd
1125  *
1126  * Processes plend1 Tcl command.
1127 \*--------------------------------------------------------------------------*/
1128 
1129 static int
1130 plend1Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1131 {
1132 
1133  pl_errcode = 0; errmsg[0] = '\0';
1134 
1135  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1136  Tcl_AppendResult( interp, "command syntax: \"",
1137  "plend1 ", "\"",
1138  (char *) NULL);
1139  return TCL_ERROR;
1140  }
1141 
1142  if ( (!0 && 0 && (argc < (1 + 0 - 0))) ||
1143  (!0 && !0 && (argc != (0 + 1))) ||
1144  ( 0 && (argc != 1) && (argc != (0 + 1))) ) {
1145  Tcl_AppendResult( interp, "wrong # args: should be \"",
1146  "plend1 ", "\"",
1147  (char *) NULL);
1148  return TCL_ERROR;
1149  }
1150 
1151 
1152  plend1 ( );
1153 
1154 
1155  if (pl_errcode != 0) {
1156  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1157  return TCL_ERROR;
1158  }
1159 
1160  plflush();
1161  return TCL_OK;
1162 }
1163 
1164 /*--------------------------------------------------------------------------*\
1165  * plenvCmd
1166  *
1167  * Processes plenv Tcl command.
1168 \*--------------------------------------------------------------------------*/
1169 
1170 static int
1171 plenvCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1172 {
1173  PLFLT xmin;
1174  PLFLT xmax;
1175  PLFLT ymin;
1176  PLFLT ymax;
1177  PLINT just;
1178  PLINT axis;
1179 
1180  pl_errcode = 0; errmsg[0] = '\0';
1181 
1182  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1183  Tcl_AppendResult( interp, "command syntax: \"",
1184  "plenv xmin xmax ymin ymax just axis", "\"",
1185  (char *) NULL);
1186  return TCL_ERROR;
1187  }
1188 
1189  if ( (!0 && 0 && (argc < (1 + 6 - 0))) ||
1190  (!0 && !0 && (argc != (6 + 1))) ||
1191  ( 0 && (argc != 1) && (argc != (6 + 1))) ) {
1192  Tcl_AppendResult( interp, "wrong # args: should be \"",
1193  "plenv xmin xmax ymin ymax just axis", "\"",
1194  (char *) NULL);
1195  return TCL_ERROR;
1196  }
1197 
1198  xmin = atof(argv[1+0]);
1199  xmax = atof(argv[1+1]);
1200  ymin = atof(argv[1+2]);
1201  ymax = atof(argv[1+3]);
1202  just = atoi(argv[1+4]);
1203  axis = atoi(argv[1+5]);
1204 
1205  plenv ( xmin, xmax, ymin, ymax, just, axis );
1206 
1207 
1208  if (pl_errcode != 0) {
1209  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1210  return TCL_ERROR;
1211  }
1212 
1213  plflush();
1214  return TCL_OK;
1215 }
1216 
1217 /*--------------------------------------------------------------------------*\
1218  * plenv0Cmd
1219  *
1220  * Processes plenv0 Tcl command.
1221 \*--------------------------------------------------------------------------*/
1222 
1223 static int
1224 plenv0Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1225 {
1226  PLFLT xmin;
1227  PLFLT xmax;
1228  PLFLT ymin;
1229  PLFLT ymax;
1230  PLINT just;
1231  PLINT axis;
1232 
1233  pl_errcode = 0; errmsg[0] = '\0';
1234 
1235  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1236  Tcl_AppendResult( interp, "command syntax: \"",
1237  "plenv0 xmin xmax ymin ymax just axis", "\"",
1238  (char *) NULL);
1239  return TCL_ERROR;
1240  }
1241 
1242  if ( (!0 && 0 && (argc < (1 + 6 - 0))) ||
1243  (!0 && !0 && (argc != (6 + 1))) ||
1244  ( 0 && (argc != 1) && (argc != (6 + 1))) ) {
1245  Tcl_AppendResult( interp, "wrong # args: should be \"",
1246  "plenv0 xmin xmax ymin ymax just axis", "\"",
1247  (char *) NULL);
1248  return TCL_ERROR;
1249  }
1250 
1251  xmin = atof(argv[1+0]);
1252  xmax = atof(argv[1+1]);
1253  ymin = atof(argv[1+2]);
1254  ymax = atof(argv[1+3]);
1255  just = atoi(argv[1+4]);
1256  axis = atoi(argv[1+5]);
1257 
1258  plenv0 ( xmin, xmax, ymin, ymax, just, axis );
1259 
1260 
1261  if (pl_errcode != 0) {
1262  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1263  return TCL_ERROR;
1264  }
1265 
1266  plflush();
1267  return TCL_OK;
1268 }
1269 
1270 /*--------------------------------------------------------------------------*\
1271  * pleopCmd
1272  *
1273  * Processes pleop Tcl command.
1274 \*--------------------------------------------------------------------------*/
1275 
1276 static int
1277 pleopCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1278 {
1279 
1280  pl_errcode = 0; errmsg[0] = '\0';
1281 
1282  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1283  Tcl_AppendResult( interp, "command syntax: \"",
1284  "pleop ", "\"",
1285  (char *) NULL);
1286  return TCL_ERROR;
1287  }
1288 
1289  if ( (!0 && 0 && (argc < (1 + 0 - 0))) ||
1290  (!0 && !0 && (argc != (0 + 1))) ||
1291  ( 0 && (argc != 1) && (argc != (0 + 1))) ) {
1292  Tcl_AppendResult( interp, "wrong # args: should be \"",
1293  "pleop ", "\"",
1294  (char *) NULL);
1295  return TCL_ERROR;
1296  }
1297 
1298 
1299  pleop ( );
1300 
1301 
1302  if (pl_errcode != 0) {
1303  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1304  return TCL_ERROR;
1305  }
1306 
1307  plflush();
1308  return TCL_OK;
1309 }
1310 
1311 /*--------------------------------------------------------------------------*\
1312  * plerrxCmd
1313  *
1314  * Processes plerrx Tcl command.
1315 \*--------------------------------------------------------------------------*/
1316 
1317 static int
1318 plerrxCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1319 {
1320  PLINT n;
1321  PLFLT *xmin;
1322  tclMatrix *matxmin;
1323  PLFLT *xmax;
1324  tclMatrix *matxmax;
1325  PLFLT *y;
1326  tclMatrix *maty;
1327 
1328  pl_errcode = 0; errmsg[0] = '\0';
1329 
1330  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1331  Tcl_AppendResult( interp, "command syntax: \"",
1332  "plerrx n xmin xmax y", "\"",
1333  (char *) NULL);
1334  return TCL_ERROR;
1335  }
1336 
1337  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
1338  (!0 && !0 && (argc != (4 + 1))) ||
1339  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
1340  Tcl_AppendResult( interp, "wrong # args: should be \"",
1341  "plerrx n xmin xmax y", "\"",
1342  (char *) NULL);
1343  return TCL_ERROR;
1344  }
1345 
1346  n = atoi(argv[1+0]);
1347  matxmin = Tcl_GetMatrixPtr( interp, argv[1+1] );
1348  if (matxmin == NULL) return TCL_ERROR;
1349  xmin = matxmin->fdata;
1350  matxmax = Tcl_GetMatrixPtr( interp, argv[1+2] );
1351  if (matxmax == NULL) return TCL_ERROR;
1352  xmax = matxmax->fdata;
1353  maty = Tcl_GetMatrixPtr( interp, argv[1+3] );
1354  if (maty == NULL) return TCL_ERROR;
1355  y = maty->fdata;
1356 
1357  plerrx ( n, xmin, xmax, y );
1358 
1359 
1360  if (pl_errcode != 0) {
1361  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1362  return TCL_ERROR;
1363  }
1364 
1365  plflush();
1366  return TCL_OK;
1367 }
1368 
1369 /*--------------------------------------------------------------------------*\
1370  * plerryCmd
1371  *
1372  * Processes plerry Tcl command.
1373 \*--------------------------------------------------------------------------*/
1374 
1375 static int
1376 plerryCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1377 {
1378  PLINT n;
1379  PLFLT *x;
1380  tclMatrix *matx;
1381  PLFLT *ymin;
1382  tclMatrix *matymin;
1383  PLFLT *ymax;
1384  tclMatrix *matymax;
1385 
1386  pl_errcode = 0; errmsg[0] = '\0';
1387 
1388  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1389  Tcl_AppendResult( interp, "command syntax: \"",
1390  "plerry n x ymin ymax", "\"",
1391  (char *) NULL);
1392  return TCL_ERROR;
1393  }
1394 
1395  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
1396  (!0 && !0 && (argc != (4 + 1))) ||
1397  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
1398  Tcl_AppendResult( interp, "wrong # args: should be \"",
1399  "plerry n x ymin ymax", "\"",
1400  (char *) NULL);
1401  return TCL_ERROR;
1402  }
1403 
1404  n = atoi(argv[1+0]);
1405  matx = Tcl_GetMatrixPtr( interp, argv[1+1] );
1406  if (matx == NULL) return TCL_ERROR;
1407  x = matx->fdata;
1408  matymin = Tcl_GetMatrixPtr( interp, argv[1+2] );
1409  if (matymin == NULL) return TCL_ERROR;
1410  ymin = matymin->fdata;
1411  matymax = Tcl_GetMatrixPtr( interp, argv[1+3] );
1412  if (matymax == NULL) return TCL_ERROR;
1413  ymax = matymax->fdata;
1414 
1415  plerry ( n, x, ymin, ymax );
1416 
1417 
1418  if (pl_errcode != 0) {
1419  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1420  return TCL_ERROR;
1421  }
1422 
1423  plflush();
1424  return TCL_OK;
1425 }
1426 
1427 /*--------------------------------------------------------------------------*\
1428  * plfamadvCmd
1429  *
1430  * Processes plfamadv Tcl command.
1431 \*--------------------------------------------------------------------------*/
1432 
1433 static int
1434 plfamadvCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1435 {
1436 
1437  pl_errcode = 0; errmsg[0] = '\0';
1438 
1439  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1440  Tcl_AppendResult( interp, "command syntax: \"",
1441  "plfamadv ", "\"",
1442  (char *) NULL);
1443  return TCL_ERROR;
1444  }
1445 
1446  if ( (!0 && 0 && (argc < (1 + 0 - 0))) ||
1447  (!0 && !0 && (argc != (0 + 1))) ||
1448  ( 0 && (argc != 1) && (argc != (0 + 1))) ) {
1449  Tcl_AppendResult( interp, "wrong # args: should be \"",
1450  "plfamadv ", "\"",
1451  (char *) NULL);
1452  return TCL_ERROR;
1453  }
1454 
1455 
1456  plfamadv ( );
1457 
1458 
1459  if (pl_errcode != 0) {
1460  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1461  return TCL_ERROR;
1462  }
1463 
1464  plflush();
1465  return TCL_OK;
1466 }
1467 
1468 /*--------------------------------------------------------------------------*\
1469  * plfillCmd
1470  *
1471  * Processes plfill Tcl command.
1472 \*--------------------------------------------------------------------------*/
1473 
1474 static int
1475 plfillCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1476 {
1477  PLINT n;
1478  PLFLT *x;
1479  tclMatrix *matx;
1480  PLFLT *y;
1481  tclMatrix *maty;
1482 
1483  pl_errcode = 0; errmsg[0] = '\0';
1484 
1485  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1486  Tcl_AppendResult( interp, "command syntax: \"",
1487  "plfill n x y", "\"",
1488  (char *) NULL);
1489  return TCL_ERROR;
1490  }
1491 
1492  if ( (!0 && 0 && (argc < (1 + 3 - 0))) ||
1493  (!0 && !0 && (argc != (3 + 1))) ||
1494  ( 0 && (argc != 1) && (argc != (3 + 1))) ) {
1495  Tcl_AppendResult( interp, "wrong # args: should be \"",
1496  "plfill n x y", "\"",
1497  (char *) NULL);
1498  return TCL_ERROR;
1499  }
1500 
1501  n = atoi(argv[1+0]);
1502  matx = Tcl_GetMatrixPtr( interp, argv[1+1] );
1503  if (matx == NULL) return TCL_ERROR;
1504  x = matx->fdata;
1505  maty = Tcl_GetMatrixPtr( interp, argv[1+2] );
1506  if (maty == NULL) return TCL_ERROR;
1507  y = maty->fdata;
1508 
1509  plfill ( n, x, y );
1510 
1511 
1512  if (pl_errcode != 0) {
1513  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1514  return TCL_ERROR;
1515  }
1516 
1517  plflush();
1518  return TCL_OK;
1519 }
1520 
1521 /*--------------------------------------------------------------------------*\
1522  * plfill3Cmd
1523  *
1524  * Processes plfill3 Tcl command.
1525 \*--------------------------------------------------------------------------*/
1526 
1527 static int
1528 plfill3Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1529 {
1530  PLINT n;
1531  PLFLT *x;
1532  tclMatrix *matx;
1533  PLFLT *y;
1534  tclMatrix *maty;
1535  PLFLT *z;
1536  tclMatrix *matz;
1537 
1538  pl_errcode = 0; errmsg[0] = '\0';
1539 
1540  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1541  Tcl_AppendResult( interp, "command syntax: \"",
1542  "plfill3 n x y z", "\"",
1543  (char *) NULL);
1544  return TCL_ERROR;
1545  }
1546 
1547  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
1548  (!0 && !0 && (argc != (4 + 1))) ||
1549  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
1550  Tcl_AppendResult( interp, "wrong # args: should be \"",
1551  "plfill3 n x y z", "\"",
1552  (char *) NULL);
1553  return TCL_ERROR;
1554  }
1555 
1556  n = atoi(argv[1+0]);
1557  matx = Tcl_GetMatrixPtr( interp, argv[1+1] );
1558  if (matx == NULL) return TCL_ERROR;
1559  x = matx->fdata;
1560  maty = Tcl_GetMatrixPtr( interp, argv[1+2] );
1561  if (maty == NULL) return TCL_ERROR;
1562  y = maty->fdata;
1563  matz = Tcl_GetMatrixPtr( interp, argv[1+3] );
1564  if (matz == NULL) return TCL_ERROR;
1565  z = matz->fdata;
1566 
1567  plfill3 ( n, x, y, z );
1568 
1569 
1570  if (pl_errcode != 0) {
1571  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1572  return TCL_ERROR;
1573  }
1574 
1575  plflush();
1576  return TCL_OK;
1577 }
1578 
1579 /*--------------------------------------------------------------------------*\
1580  * plflushCmd
1581  *
1582  * Processes plflush Tcl command.
1583 \*--------------------------------------------------------------------------*/
1584 
1585 static int
1586 plflushCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1587 {
1588 
1589  pl_errcode = 0; errmsg[0] = '\0';
1590 
1591  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1592  Tcl_AppendResult( interp, "command syntax: \"",
1593  "plflush ", "\"",
1594  (char *) NULL);
1595  return TCL_ERROR;
1596  }
1597 
1598  if ( (!0 && 0 && (argc < (1 + 0 - 0))) ||
1599  (!0 && !0 && (argc != (0 + 1))) ||
1600  ( 0 && (argc != 1) && (argc != (0 + 1))) ) {
1601  Tcl_AppendResult( interp, "wrong # args: should be \"",
1602  "plflush ", "\"",
1603  (char *) NULL);
1604  return TCL_ERROR;
1605  }
1606 
1607 
1608  plflush ( );
1609 
1610 
1611  if (pl_errcode != 0) {
1612  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1613  return TCL_ERROR;
1614  }
1615 
1616  plflush();
1617  return TCL_OK;
1618 }
1619 
1620 /*--------------------------------------------------------------------------*\
1621  * plfontCmd
1622  *
1623  * Processes plfont Tcl command.
1624 \*--------------------------------------------------------------------------*/
1625 
1626 static int
1627 plfontCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1628 {
1629  PLINT ifont;
1630 
1631  pl_errcode = 0; errmsg[0] = '\0';
1632 
1633  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1634  Tcl_AppendResult( interp, "command syntax: \"",
1635  "plfont ifont", "\"",
1636  (char *) NULL);
1637  return TCL_ERROR;
1638  }
1639 
1640  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
1641  (!0 && !0 && (argc != (1 + 1))) ||
1642  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
1643  Tcl_AppendResult( interp, "wrong # args: should be \"",
1644  "plfont ifont", "\"",
1645  (char *) NULL);
1646  return TCL_ERROR;
1647  }
1648 
1649  ifont = atoi(argv[1+0]);
1650 
1651  plfont ( ifont );
1652 
1653 
1654  if (pl_errcode != 0) {
1655  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1656  return TCL_ERROR;
1657  }
1658 
1659  plflush();
1660  return TCL_OK;
1661 }
1662 
1663 /*--------------------------------------------------------------------------*\
1664  * plfontldCmd
1665  *
1666  * Processes plfontld Tcl command.
1667 \*--------------------------------------------------------------------------*/
1668 
1669 static int
1670 plfontldCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1671 {
1672  PLINT fnt;
1673 
1674  pl_errcode = 0; errmsg[0] = '\0';
1675 
1676  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1677  Tcl_AppendResult( interp, "command syntax: \"",
1678  "plfontld fnt", "\"",
1679  (char *) NULL);
1680  return TCL_ERROR;
1681  }
1682 
1683  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
1684  (!0 && !0 && (argc != (1 + 1))) ||
1685  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
1686  Tcl_AppendResult( interp, "wrong # args: should be \"",
1687  "plfontld fnt", "\"",
1688  (char *) NULL);
1689  return TCL_ERROR;
1690  }
1691 
1692  fnt = atoi(argv[1+0]);
1693 
1694  plfontld ( fnt );
1695 
1696 
1697  if (pl_errcode != 0) {
1698  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1699  return TCL_ERROR;
1700  }
1701 
1702  plflush();
1703  return TCL_OK;
1704 }
1705 
1706 /*--------------------------------------------------------------------------*\
1707  * plgchrCmd
1708  *
1709  * Processes plgchr Tcl command.
1710 \*--------------------------------------------------------------------------*/
1711 
1712 static int
1713 plgchrCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1714 {
1715  PLFLT def;
1716  PLFLT ht;
1717 
1718  pl_errcode = 0; errmsg[0] = '\0';
1719 
1720  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1721  Tcl_AppendResult( interp, "command syntax: \"",
1722  "plgchr ?def ht?", "\"",
1723  (char *) NULL);
1724  return TCL_ERROR;
1725  }
1726 
1727  if ( (!1 && 0 && (argc < (1 + 2 - 0))) ||
1728  (!1 && !0 && (argc != (2 + 1))) ||
1729  ( 1 && (argc != 1) && (argc != (2 + 1))) ) {
1730  Tcl_AppendResult( interp, "wrong # args: should be \"",
1731  "plgchr ?def ht?", "\"",
1732  (char *) NULL);
1733  return TCL_ERROR;
1734  }
1735 
1736 /* def is for output. */
1737 /* ht is for output. */
1738 
1739  plgchr ( &def, &ht );
1740 
1741  Tcl_PrintDouble( interp, def, buf );
1742  if (argc > 1)
1743  Tcl_SetVar( interp, argv[1+0], buf, 0 );
1744  else
1745  Tcl_AppendResult( interp, buf, (char *) NULL );
1746  if (argc == 1)
1747  Tcl_AppendResult( interp, " ", (char *) NULL );
1748  Tcl_PrintDouble( interp, ht, buf );
1749  if (argc > 1)
1750  Tcl_SetVar( interp, argv[1+1], buf, 0 );
1751  else
1752  Tcl_AppendResult( interp, buf, (char *) NULL );
1753 
1754  if (pl_errcode != 0) {
1755  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1756  return TCL_ERROR;
1757  }
1758 
1759  plflush();
1760  return TCL_OK;
1761 }
1762 
1763 /*--------------------------------------------------------------------------*\
1764  * plgcmap1_rangeCmd
1765  *
1766  * Processes plgcmap1_range Tcl command.
1767 \*--------------------------------------------------------------------------*/
1768 
1769 static int
1770 plgcmap1_rangeCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1771 {
1772  PLFLT min_color;
1773  PLFLT max_color;
1774 
1775  pl_errcode = 0; errmsg[0] = '\0';
1776 
1777  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1778  Tcl_AppendResult( interp, "command syntax: \"",
1779  "plgcmap1_range ?min_color max_color?", "\"",
1780  (char *) NULL);
1781  return TCL_ERROR;
1782  }
1783 
1784  if ( (!1 && 0 && (argc < (1 + 2 - 0))) ||
1785  (!1 && !0 && (argc != (2 + 1))) ||
1786  ( 1 && (argc != 1) && (argc != (2 + 1))) ) {
1787  Tcl_AppendResult( interp, "wrong # args: should be \"",
1788  "plgcmap1_range ?min_color max_color?", "\"",
1789  (char *) NULL);
1790  return TCL_ERROR;
1791  }
1792 
1793 /* min_color is for output. */
1794 /* max_color is for output. */
1795 
1796  plgcmap1_range ( &min_color, &max_color );
1797 
1798  Tcl_PrintDouble( interp, min_color, buf );
1799  if (argc > 1)
1800  Tcl_SetVar( interp, argv[1+0], buf, 0 );
1801  else
1802  Tcl_AppendResult( interp, buf, (char *) NULL );
1803  if (argc == 1)
1804  Tcl_AppendResult( interp, " ", (char *) NULL );
1805  Tcl_PrintDouble( interp, max_color, buf );
1806  if (argc > 1)
1807  Tcl_SetVar( interp, argv[1+1], buf, 0 );
1808  else
1809  Tcl_AppendResult( interp, buf, (char *) NULL );
1810 
1811  if (pl_errcode != 0) {
1812  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1813  return TCL_ERROR;
1814  }
1815 
1816  plflush();
1817  return TCL_OK;
1818 }
1819 
1820 /*--------------------------------------------------------------------------*\
1821  * plgcol0Cmd
1822  *
1823  * Processes plgcol0 Tcl command.
1824 \*--------------------------------------------------------------------------*/
1825 
1826 static int
1827 plgcol0Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1828 {
1829  PLINT icol0;
1830  PLINT r;
1831  PLINT g;
1832  PLINT b;
1833 
1834  pl_errcode = 0; errmsg[0] = '\0';
1835 
1836  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1837  Tcl_AppendResult( interp, "command syntax: \"",
1838  "plgcol0 ?icol0 r g b?", "\"",
1839  (char *) NULL);
1840  return TCL_ERROR;
1841  }
1842 
1843  if ( (!1 && 0 && (argc < (1 + 4 - 0))) ||
1844  (!1 && !0 && (argc != (4 + 1))) ||
1845  ( 1 && (argc != 1) && (argc != (4 + 1))) ) {
1846  Tcl_AppendResult( interp, "wrong # args: should be \"",
1847  "plgcol0 ?icol0 r g b?", "\"",
1848  (char *) NULL);
1849  return TCL_ERROR;
1850  }
1851 
1852  icol0 = atoi(argv[1+0]);
1853 /* r is for output. */
1854 /* g is for output. */
1855 /* b is for output. */
1856 
1857  plgcol0 ( icol0, &r, &g, &b );
1858 
1859  if (argc == 1)
1860  Tcl_AppendResult( interp, " ", (char *) NULL );
1861  sprintf( buf, "%d", r );
1862  if (argc > 1)
1863  Tcl_SetVar( interp, argv[1+1], buf, 0 );
1864  else
1865  Tcl_AppendResult( interp, buf, (char *) NULL );
1866  if (argc == 1)
1867  Tcl_AppendResult( interp, " ", (char *) NULL );
1868  sprintf( buf, "%d", g );
1869  if (argc > 1)
1870  Tcl_SetVar( interp, argv[1+2], buf, 0 );
1871  else
1872  Tcl_AppendResult( interp, buf, (char *) NULL );
1873  if (argc == 1)
1874  Tcl_AppendResult( interp, " ", (char *) NULL );
1875  sprintf( buf, "%d", b );
1876  if (argc > 1)
1877  Tcl_SetVar( interp, argv[1+3], buf, 0 );
1878  else
1879  Tcl_AppendResult( interp, buf, (char *) NULL );
1880 
1881  if (pl_errcode != 0) {
1882  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1883  return TCL_ERROR;
1884  }
1885 
1886  plflush();
1887  return TCL_OK;
1888 }
1889 
1890 /*--------------------------------------------------------------------------*\
1891  * plgcol0aCmd
1892  *
1893  * Processes plgcol0a Tcl command.
1894 \*--------------------------------------------------------------------------*/
1895 
1896 static int
1897 plgcol0aCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1898 {
1899  PLINT icol0;
1900  PLINT r;
1901  PLINT g;
1902  PLINT b;
1903  PLFLT a;
1904 
1905  pl_errcode = 0; errmsg[0] = '\0';
1906 
1907  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1908  Tcl_AppendResult( interp, "command syntax: \"",
1909  "plgcol0a ?icol0 r g b a?", "\"",
1910  (char *) NULL);
1911  return TCL_ERROR;
1912  }
1913 
1914  if ( (!1 && 0 && (argc < (1 + 5 - 0))) ||
1915  (!1 && !0 && (argc != (5 + 1))) ||
1916  ( 1 && (argc != 1) && (argc != (5 + 1))) ) {
1917  Tcl_AppendResult( interp, "wrong # args: should be \"",
1918  "plgcol0a ?icol0 r g b a?", "\"",
1919  (char *) NULL);
1920  return TCL_ERROR;
1921  }
1922 
1923  icol0 = atoi(argv[1+0]);
1924 /* r is for output. */
1925 /* g is for output. */
1926 /* b is for output. */
1927 /* a is for output. */
1928 
1929  plgcol0a ( icol0, &r, &g, &b, &a );
1930 
1931  if (argc == 1)
1932  Tcl_AppendResult( interp, " ", (char *) NULL );
1933  sprintf( buf, "%d", r );
1934  if (argc > 1)
1935  Tcl_SetVar( interp, argv[1+1], buf, 0 );
1936  else
1937  Tcl_AppendResult( interp, buf, (char *) NULL );
1938  if (argc == 1)
1939  Tcl_AppendResult( interp, " ", (char *) NULL );
1940  sprintf( buf, "%d", g );
1941  if (argc > 1)
1942  Tcl_SetVar( interp, argv[1+2], buf, 0 );
1943  else
1944  Tcl_AppendResult( interp, buf, (char *) NULL );
1945  if (argc == 1)
1946  Tcl_AppendResult( interp, " ", (char *) NULL );
1947  sprintf( buf, "%d", b );
1948  if (argc > 1)
1949  Tcl_SetVar( interp, argv[1+3], buf, 0 );
1950  else
1951  Tcl_AppendResult( interp, buf, (char *) NULL );
1952  if (argc == 1)
1953  Tcl_AppendResult( interp, " ", (char *) NULL );
1954  Tcl_PrintDouble( interp, a, buf );
1955  if (argc > 1)
1956  Tcl_SetVar( interp, argv[1+4], buf, 0 );
1957  else
1958  Tcl_AppendResult( interp, buf, (char *) NULL );
1959 
1960  if (pl_errcode != 0) {
1961  Tcl_AppendResult(interp, errmsg, (char *) NULL);
1962  return TCL_ERROR;
1963  }
1964 
1965  plflush();
1966  return TCL_OK;
1967 }
1968 
1969 /*--------------------------------------------------------------------------*\
1970  * plgcolbgCmd
1971  *
1972  * Processes plgcolbg Tcl command.
1973 \*--------------------------------------------------------------------------*/
1974 
1975 static int
1976 plgcolbgCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
1977 {
1978  PLINT r;
1979  PLINT g;
1980  PLINT b;
1981 
1982  pl_errcode = 0; errmsg[0] = '\0';
1983 
1984  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
1985  Tcl_AppendResult( interp, "command syntax: \"",
1986  "plgcolbg ?r g b?", "\"",
1987  (char *) NULL);
1988  return TCL_ERROR;
1989  }
1990 
1991  if ( (!1 && 0 && (argc < (1 + 3 - 0))) ||
1992  (!1 && !0 && (argc != (3 + 1))) ||
1993  ( 1 && (argc != 1) && (argc != (3 + 1))) ) {
1994  Tcl_AppendResult( interp, "wrong # args: should be \"",
1995  "plgcolbg ?r g b?", "\"",
1996  (char *) NULL);
1997  return TCL_ERROR;
1998  }
1999 
2000 /* r is for output. */
2001 /* g is for output. */
2002 /* b is for output. */
2003 
2004  plgcolbg ( &r, &g, &b );
2005 
2006  sprintf( buf, "%d", r );
2007  if (argc > 1)
2008  Tcl_SetVar( interp, argv[1+0], buf, 0 );
2009  else
2010  Tcl_AppendResult( interp, buf, (char *) NULL );
2011  if (argc == 1)
2012  Tcl_AppendResult( interp, " ", (char *) NULL );
2013  sprintf( buf, "%d", g );
2014  if (argc > 1)
2015  Tcl_SetVar( interp, argv[1+1], buf, 0 );
2016  else
2017  Tcl_AppendResult( interp, buf, (char *) NULL );
2018  if (argc == 1)
2019  Tcl_AppendResult( interp, " ", (char *) NULL );
2020  sprintf( buf, "%d", b );
2021  if (argc > 1)
2022  Tcl_SetVar( interp, argv[1+2], buf, 0 );
2023  else
2024  Tcl_AppendResult( interp, buf, (char *) NULL );
2025 
2026  if (pl_errcode != 0) {
2027  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2028  return TCL_ERROR;
2029  }
2030 
2031  plflush();
2032  return TCL_OK;
2033 }
2034 
2035 /*--------------------------------------------------------------------------*\
2036  * plgcolbgaCmd
2037  *
2038  * Processes plgcolbga Tcl command.
2039 \*--------------------------------------------------------------------------*/
2040 
2041 static int
2042 plgcolbgaCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2043 {
2044  PLINT r;
2045  PLINT g;
2046  PLINT b;
2047  PLFLT a;
2048 
2049  pl_errcode = 0; errmsg[0] = '\0';
2050 
2051  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2052  Tcl_AppendResult( interp, "command syntax: \"",
2053  "plgcolbga ?r g b a?", "\"",
2054  (char *) NULL);
2055  return TCL_ERROR;
2056  }
2057 
2058  if ( (!1 && 0 && (argc < (1 + 4 - 0))) ||
2059  (!1 && !0 && (argc != (4 + 1))) ||
2060  ( 1 && (argc != 1) && (argc != (4 + 1))) ) {
2061  Tcl_AppendResult( interp, "wrong # args: should be \"",
2062  "plgcolbga ?r g b a?", "\"",
2063  (char *) NULL);
2064  return TCL_ERROR;
2065  }
2066 
2067 /* r is for output. */
2068 /* g is for output. */
2069 /* b is for output. */
2070 /* a is for output. */
2071 
2072  plgcolbga ( &r, &g, &b, &a );
2073 
2074  sprintf( buf, "%d", r );
2075  if (argc > 1)
2076  Tcl_SetVar( interp, argv[1+0], buf, 0 );
2077  else
2078  Tcl_AppendResult( interp, buf, (char *) NULL );
2079  if (argc == 1)
2080  Tcl_AppendResult( interp, " ", (char *) NULL );
2081  sprintf( buf, "%d", g );
2082  if (argc > 1)
2083  Tcl_SetVar( interp, argv[1+1], buf, 0 );
2084  else
2085  Tcl_AppendResult( interp, buf, (char *) NULL );
2086  if (argc == 1)
2087  Tcl_AppendResult( interp, " ", (char *) NULL );
2088  sprintf( buf, "%d", b );
2089  if (argc > 1)
2090  Tcl_SetVar( interp, argv[1+2], buf, 0 );
2091  else
2092  Tcl_AppendResult( interp, buf, (char *) NULL );
2093  if (argc == 1)
2094  Tcl_AppendResult( interp, " ", (char *) NULL );
2095  Tcl_PrintDouble( interp, a, buf );
2096  if (argc > 1)
2097  Tcl_SetVar( interp, argv[1+3], buf, 0 );
2098  else
2099  Tcl_AppendResult( interp, buf, (char *) NULL );
2100 
2101  if (pl_errcode != 0) {
2102  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2103  return TCL_ERROR;
2104  }
2105 
2106  plflush();
2107  return TCL_OK;
2108 }
2109 
2110 /*--------------------------------------------------------------------------*\
2111  * plgcompressionCmd
2112  *
2113  * Processes plgcompression Tcl command.
2114 \*--------------------------------------------------------------------------*/
2115 
2116 static int
2117 plgcompressionCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2118 {
2119  PLINT compression;
2120 
2121  pl_errcode = 0; errmsg[0] = '\0';
2122 
2123  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2124  Tcl_AppendResult( interp, "command syntax: \"",
2125  "plgcompression ?compression?", "\"",
2126  (char *) NULL);
2127  return TCL_ERROR;
2128  }
2129 
2130  if ( (!1 && 0 && (argc < (1 + 1 - 0))) ||
2131  (!1 && !0 && (argc != (1 + 1))) ||
2132  ( 1 && (argc != 1) && (argc != (1 + 1))) ) {
2133  Tcl_AppendResult( interp, "wrong # args: should be \"",
2134  "plgcompression ?compression?", "\"",
2135  (char *) NULL);
2136  return TCL_ERROR;
2137  }
2138 
2139 /* compression is for output. */
2140 
2141  plgcompression ( &compression );
2142 
2143  sprintf( buf, "%d", compression );
2144  if (argc > 1)
2145  Tcl_SetVar( interp, argv[1+0], buf, 0 );
2146  else
2147  Tcl_AppendResult( interp, buf, (char *) NULL );
2148 
2149  if (pl_errcode != 0) {
2150  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2151  return TCL_ERROR;
2152  }
2153 
2154  plflush();
2155  return TCL_OK;
2156 }
2157 
2158 /*--------------------------------------------------------------------------*\
2159  * plgdevCmd
2160  *
2161  * Processes plgdev Tcl command.
2162 \*--------------------------------------------------------------------------*/
2163 
2164 static int
2165 plgdevCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2166 {
2167  char devnam[200];
2168 
2169  pl_errcode = 0; errmsg[0] = '\0';
2170 
2171  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2172  Tcl_AppendResult( interp, "command syntax: \"",
2173  "plgdev ?devnam?", "\"",
2174  (char *) NULL);
2175  return TCL_ERROR;
2176  }
2177 
2178  if ( (!1 && 0 && (argc < (1 + 1 - 0))) ||
2179  (!1 && !0 && (argc != (1 + 1))) ||
2180  ( 1 && (argc != 1) && (argc != (1 + 1))) ) {
2181  Tcl_AppendResult( interp, "wrong # args: should be \"",
2182  "plgdev ?devnam?", "\"",
2183  (char *) NULL);
2184  return TCL_ERROR;
2185  }
2186 
2187 /* devnam is for output. */
2188 
2189  plgdev ( devnam );
2190 
2191  if (argc > 1)
2192  Tcl_SetVar( interp, argv[1+0], devnam, 0 );
2193  else
2194  Tcl_AppendResult( interp, devnam, (char *) NULL );
2195 
2196  if (pl_errcode != 0) {
2197  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2198  return TCL_ERROR;
2199  }
2200 
2201  plflush();
2202  return TCL_OK;
2203 }
2204 
2205 /*--------------------------------------------------------------------------*\
2206  * plgdidevCmd
2207  *
2208  * Processes plgdidev Tcl command.
2209 \*--------------------------------------------------------------------------*/
2210 
2211 static int
2212 plgdidevCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2213 {
2214  PLFLT mar;
2215  PLFLT aspect;
2216  PLFLT jx;
2217  PLFLT jy;
2218 
2219  pl_errcode = 0; errmsg[0] = '\0';
2220 
2221  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2222  Tcl_AppendResult( interp, "command syntax: \"",
2223  "plgdidev ?mar aspect jx jy?", "\"",
2224  (char *) NULL);
2225  return TCL_ERROR;
2226  }
2227 
2228  if ( (!1 && 0 && (argc < (1 + 4 - 0))) ||
2229  (!1 && !0 && (argc != (4 + 1))) ||
2230  ( 1 && (argc != 1) && (argc != (4 + 1))) ) {
2231  Tcl_AppendResult( interp, "wrong # args: should be \"",
2232  "plgdidev ?mar aspect jx jy?", "\"",
2233  (char *) NULL);
2234  return TCL_ERROR;
2235  }
2236 
2237 /* mar is for output. */
2238 /* aspect is for output. */
2239 /* jx is for output. */
2240 /* jy is for output. */
2241 
2242  plgdidev ( &mar, &aspect, &jx, &jy );
2243 
2244  Tcl_PrintDouble( interp, mar, buf );
2245  if (argc > 1)
2246  Tcl_SetVar( interp, argv[1+0], buf, 0 );
2247  else
2248  Tcl_AppendResult( interp, buf, (char *) NULL );
2249  if (argc == 1)
2250  Tcl_AppendResult( interp, " ", (char *) NULL );
2251  Tcl_PrintDouble( interp, aspect, buf );
2252  if (argc > 1)
2253  Tcl_SetVar( interp, argv[1+1], buf, 0 );
2254  else
2255  Tcl_AppendResult( interp, buf, (char *) NULL );
2256  if (argc == 1)
2257  Tcl_AppendResult( interp, " ", (char *) NULL );
2258  Tcl_PrintDouble( interp, jx, buf );
2259  if (argc > 1)
2260  Tcl_SetVar( interp, argv[1+2], buf, 0 );
2261  else
2262  Tcl_AppendResult( interp, buf, (char *) NULL );
2263  if (argc == 1)
2264  Tcl_AppendResult( interp, " ", (char *) NULL );
2265  Tcl_PrintDouble( interp, jy, buf );
2266  if (argc > 1)
2267  Tcl_SetVar( interp, argv[1+3], buf, 0 );
2268  else
2269  Tcl_AppendResult( interp, buf, (char *) NULL );
2270 
2271  if (pl_errcode != 0) {
2272  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2273  return TCL_ERROR;
2274  }
2275 
2276  plflush();
2277  return TCL_OK;
2278 }
2279 
2280 /*--------------------------------------------------------------------------*\
2281  * plgdioriCmd
2282  *
2283  * Processes plgdiori Tcl command.
2284 \*--------------------------------------------------------------------------*/
2285 
2286 static int
2287 plgdioriCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2288 {
2289  PLFLT rot;
2290 
2291  pl_errcode = 0; errmsg[0] = '\0';
2292 
2293  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2294  Tcl_AppendResult( interp, "command syntax: \"",
2295  "plgdiori ?rot?", "\"",
2296  (char *) NULL);
2297  return TCL_ERROR;
2298  }
2299 
2300  if ( (!1 && 0 && (argc < (1 + 1 - 0))) ||
2301  (!1 && !0 && (argc != (1 + 1))) ||
2302  ( 1 && (argc != 1) && (argc != (1 + 1))) ) {
2303  Tcl_AppendResult( interp, "wrong # args: should be \"",
2304  "plgdiori ?rot?", "\"",
2305  (char *) NULL);
2306  return TCL_ERROR;
2307  }
2308 
2309 /* rot is for output. */
2310 
2311  plgdiori ( &rot );
2312 
2313  Tcl_PrintDouble( interp, rot, buf );
2314  if (argc > 1)
2315  Tcl_SetVar( interp, argv[1+0], buf, 0 );
2316  else
2317  Tcl_AppendResult( interp, buf, (char *) NULL );
2318 
2319  if (pl_errcode != 0) {
2320  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2321  return TCL_ERROR;
2322  }
2323 
2324  plflush();
2325  return TCL_OK;
2326 }
2327 
2328 /*--------------------------------------------------------------------------*\
2329  * plgdipltCmd
2330  *
2331  * Processes plgdiplt Tcl command.
2332 \*--------------------------------------------------------------------------*/
2333 
2334 static int
2335 plgdipltCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2336 {
2337  PLFLT xmin;
2338  PLFLT ymin;
2339  PLFLT xmax;
2340  PLFLT ymax;
2341 
2342  pl_errcode = 0; errmsg[0] = '\0';
2343 
2344  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2345  Tcl_AppendResult( interp, "command syntax: \"",
2346  "plgdiplt ?xmin ymin xmax ymax?", "\"",
2347  (char *) NULL);
2348  return TCL_ERROR;
2349  }
2350 
2351  if ( (!1 && 0 && (argc < (1 + 4 - 0))) ||
2352  (!1 && !0 && (argc != (4 + 1))) ||
2353  ( 1 && (argc != 1) && (argc != (4 + 1))) ) {
2354  Tcl_AppendResult( interp, "wrong # args: should be \"",
2355  "plgdiplt ?xmin ymin xmax ymax?", "\"",
2356  (char *) NULL);
2357  return TCL_ERROR;
2358  }
2359 
2360 /* xmin is for output. */
2361 /* ymin is for output. */
2362 /* xmax is for output. */
2363 /* ymax is for output. */
2364 
2365  plgdiplt ( &xmin, &ymin, &xmax, &ymax );
2366 
2367  Tcl_PrintDouble( interp, xmin, buf );
2368  if (argc > 1)
2369  Tcl_SetVar( interp, argv[1+0], buf, 0 );
2370  else
2371  Tcl_AppendResult( interp, buf, (char *) NULL );
2372  if (argc == 1)
2373  Tcl_AppendResult( interp, " ", (char *) NULL );
2374  Tcl_PrintDouble( interp, ymin, buf );
2375  if (argc > 1)
2376  Tcl_SetVar( interp, argv[1+1], buf, 0 );
2377  else
2378  Tcl_AppendResult( interp, buf, (char *) NULL );
2379  if (argc == 1)
2380  Tcl_AppendResult( interp, " ", (char *) NULL );
2381  Tcl_PrintDouble( interp, xmax, buf );
2382  if (argc > 1)
2383  Tcl_SetVar( interp, argv[1+2], buf, 0 );
2384  else
2385  Tcl_AppendResult( interp, buf, (char *) NULL );
2386  if (argc == 1)
2387  Tcl_AppendResult( interp, " ", (char *) NULL );
2388  Tcl_PrintDouble( interp, ymax, buf );
2389  if (argc > 1)
2390  Tcl_SetVar( interp, argv[1+3], buf, 0 );
2391  else
2392  Tcl_AppendResult( interp, buf, (char *) NULL );
2393 
2394  if (pl_errcode != 0) {
2395  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2396  return TCL_ERROR;
2397  }
2398 
2399  plflush();
2400  return TCL_OK;
2401 }
2402 
2403 /*--------------------------------------------------------------------------*\
2404  * plgescCmd
2405  *
2406  * Processes plgesc Tcl command.
2407 \*--------------------------------------------------------------------------*/
2408 
2409 static int
2410 plgescCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2411 {
2412  char esc;
2413 
2414  pl_errcode = 0; errmsg[0] = '\0';
2415 
2416  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2417  Tcl_AppendResult( interp, "command syntax: \"",
2418  "plgesc ?esc?", "\"",
2419  (char *) NULL);
2420  return TCL_ERROR;
2421  }
2422 
2423  if ( (!1 && 0 && (argc < (1 + 1 - 0))) ||
2424  (!1 && !0 && (argc != (1 + 1))) ||
2425  ( 1 && (argc != 1) && (argc != (1 + 1))) ) {
2426  Tcl_AppendResult( interp, "wrong # args: should be \"",
2427  "plgesc ?esc?", "\"",
2428  (char *) NULL);
2429  return TCL_ERROR;
2430  }
2431 
2432 /* esc is for output. */
2433 
2434  plgesc ( &esc );
2435 
2436  sprintf( buf, "%c", esc );
2437  if (argc > 1)
2438  Tcl_SetVar( interp, argv[1+0], buf, 0 );
2439  else
2440  Tcl_AppendResult( interp, buf, (char *) NULL );
2441 
2442  if (pl_errcode != 0) {
2443  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2444  return TCL_ERROR;
2445  }
2446 
2447  plflush();
2448  return TCL_OK;
2449 }
2450 
2451 /*--------------------------------------------------------------------------*\
2452  * plgfamCmd
2453  *
2454  * Processes plgfam Tcl command.
2455 \*--------------------------------------------------------------------------*/
2456 
2457 static int
2458 plgfamCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2459 {
2460  PLINT fam;
2461  PLINT num;
2462  PLINT bmax;
2463 
2464  pl_errcode = 0; errmsg[0] = '\0';
2465 
2466  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2467  Tcl_AppendResult( interp, "command syntax: \"",
2468  "plgfam ?fam num bmax?", "\"",
2469  (char *) NULL);
2470  return TCL_ERROR;
2471  }
2472 
2473  if ( (!1 && 0 && (argc < (1 + 3 - 0))) ||
2474  (!1 && !0 && (argc != (3 + 1))) ||
2475  ( 1 && (argc != 1) && (argc != (3 + 1))) ) {
2476  Tcl_AppendResult( interp, "wrong # args: should be \"",
2477  "plgfam ?fam num bmax?", "\"",
2478  (char *) NULL);
2479  return TCL_ERROR;
2480  }
2481 
2482 /* fam is for output. */
2483 /* num is for output. */
2484 /* bmax is for output. */
2485 
2486  plgfam ( &fam, &num, &bmax );
2487 
2488  sprintf( buf, "%d", fam );
2489  if (argc > 1)
2490  Tcl_SetVar( interp, argv[1+0], buf, 0 );
2491  else
2492  Tcl_AppendResult( interp, buf, (char *) NULL );
2493  if (argc == 1)
2494  Tcl_AppendResult( interp, " ", (char *) NULL );
2495  sprintf( buf, "%d", num );
2496  if (argc > 1)
2497  Tcl_SetVar( interp, argv[1+1], buf, 0 );
2498  else
2499  Tcl_AppendResult( interp, buf, (char *) NULL );
2500  if (argc == 1)
2501  Tcl_AppendResult( interp, " ", (char *) NULL );
2502  sprintf( buf, "%d", bmax );
2503  if (argc > 1)
2504  Tcl_SetVar( interp, argv[1+2], buf, 0 );
2505  else
2506  Tcl_AppendResult( interp, buf, (char *) NULL );
2507 
2508  if (pl_errcode != 0) {
2509  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2510  return TCL_ERROR;
2511  }
2512 
2513  plflush();
2514  return TCL_OK;
2515 }
2516 
2517 /*--------------------------------------------------------------------------*\
2518  * plgfciCmd
2519  *
2520  * Processes plgfci Tcl command.
2521 \*--------------------------------------------------------------------------*/
2522 
2523 static int
2524 plgfciCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2525 {
2526  PLUNICODE fci;
2527 
2528  pl_errcode = 0; errmsg[0] = '\0';
2529 
2530  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2531  Tcl_AppendResult( interp, "command syntax: \"",
2532  "plgfci ?fci?", "\"",
2533  (char *) NULL);
2534  return TCL_ERROR;
2535  }
2536 
2537  if ( (!1 && 0 && (argc < (1 + 1 - 0))) ||
2538  (!1 && !0 && (argc != (1 + 1))) ||
2539  ( 1 && (argc != 1) && (argc != (1 + 1))) ) {
2540  Tcl_AppendResult( interp, "wrong # args: should be \"",
2541  "plgfci ?fci?", "\"",
2542  (char *) NULL);
2543  return TCL_ERROR;
2544  }
2545 
2546 /* fci is for output. */
2547 
2548  plgfci ( &fci );
2549 
2550  sprintf( buf, "%u", fci );
2551  if (argc > 1)
2552  Tcl_SetVar( interp, argv[1+0], buf, 0 );
2553  else
2554  Tcl_AppendResult( interp, buf, (char *) NULL );
2555 
2556  if (pl_errcode != 0) {
2557  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2558  return TCL_ERROR;
2559  }
2560 
2561  plflush();
2562  return TCL_OK;
2563 }
2564 
2565 /*--------------------------------------------------------------------------*\
2566  * plgfnamCmd
2567  *
2568  * Processes plgfnam Tcl command.
2569 \*--------------------------------------------------------------------------*/
2570 
2571 static int
2572 plgfnamCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2573 {
2574  char fnam[200];
2575 
2576  pl_errcode = 0; errmsg[0] = '\0';
2577 
2578  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2579  Tcl_AppendResult( interp, "command syntax: \"",
2580  "plgfnam ?fnam?", "\"",
2581  (char *) NULL);
2582  return TCL_ERROR;
2583  }
2584 
2585  if ( (!1 && 0 && (argc < (1 + 1 - 0))) ||
2586  (!1 && !0 && (argc != (1 + 1))) ||
2587  ( 1 && (argc != 1) && (argc != (1 + 1))) ) {
2588  Tcl_AppendResult( interp, "wrong # args: should be \"",
2589  "plgfnam ?fnam?", "\"",
2590  (char *) NULL);
2591  return TCL_ERROR;
2592  }
2593 
2594 /* fnam is for output. */
2595 
2596  plgfnam ( fnam );
2597 
2598  if (argc > 1)
2599  Tcl_SetVar( interp, argv[1+0], fnam, 0 );
2600  else
2601  Tcl_AppendResult( interp, fnam, (char *) NULL );
2602 
2603  if (pl_errcode != 0) {
2604  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2605  return TCL_ERROR;
2606  }
2607 
2608  plflush();
2609  return TCL_OK;
2610 }
2611 
2612 /*--------------------------------------------------------------------------*\
2613  * plgfontCmd
2614  *
2615  * Processes plgfont Tcl command.
2616 \*--------------------------------------------------------------------------*/
2617 
2618 static int
2619 plgfontCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2620 {
2621  PLINT family;
2622  PLINT style;
2623  PLINT weight;
2624 
2625  pl_errcode = 0; errmsg[0] = '\0';
2626 
2627  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2628  Tcl_AppendResult( interp, "command syntax: \"",
2629  "plgfont ?family style weight?", "\"",
2630  (char *) NULL);
2631  return TCL_ERROR;
2632  }
2633 
2634  if ( (!1 && 0 && (argc < (1 + 3 - 0))) ||
2635  (!1 && !0 && (argc != (3 + 1))) ||
2636  ( 1 && (argc != 1) && (argc != (3 + 1))) ) {
2637  Tcl_AppendResult( interp, "wrong # args: should be \"",
2638  "plgfont ?family style weight?", "\"",
2639  (char *) NULL);
2640  return TCL_ERROR;
2641  }
2642 
2643 /* family is for output. */
2644 /* style is for output. */
2645 /* weight is for output. */
2646 
2647  plgfont ( &family, &style, &weight );
2648 
2649  sprintf( buf, "%d", family );
2650  if (argc > 1)
2651  Tcl_SetVar( interp, argv[1+0], buf, 0 );
2652  else
2653  Tcl_AppendResult( interp, buf, (char *) NULL );
2654  if (argc == 1)
2655  Tcl_AppendResult( interp, " ", (char *) NULL );
2656  sprintf( buf, "%d", style );
2657  if (argc > 1)
2658  Tcl_SetVar( interp, argv[1+1], buf, 0 );
2659  else
2660  Tcl_AppendResult( interp, buf, (char *) NULL );
2661  if (argc == 1)
2662  Tcl_AppendResult( interp, " ", (char *) NULL );
2663  sprintf( buf, "%d", weight );
2664  if (argc > 1)
2665  Tcl_SetVar( interp, argv[1+2], buf, 0 );
2666  else
2667  Tcl_AppendResult( interp, buf, (char *) NULL );
2668 
2669  if (pl_errcode != 0) {
2670  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2671  return TCL_ERROR;
2672  }
2673 
2674  plflush();
2675  return TCL_OK;
2676 }
2677 
2678 /*--------------------------------------------------------------------------*\
2679  * plglevelCmd
2680  *
2681  * Processes plglevel Tcl command.
2682 \*--------------------------------------------------------------------------*/
2683 
2684 static int
2685 plglevelCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2686 {
2687  PLINT level;
2688 
2689  pl_errcode = 0; errmsg[0] = '\0';
2690 
2691  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2692  Tcl_AppendResult( interp, "command syntax: \"",
2693  "plglevel ?level?", "\"",
2694  (char *) NULL);
2695  return TCL_ERROR;
2696  }
2697 
2698  if ( (!1 && 0 && (argc < (1 + 1 - 0))) ||
2699  (!1 && !0 && (argc != (1 + 1))) ||
2700  ( 1 && (argc != 1) && (argc != (1 + 1))) ) {
2701  Tcl_AppendResult( interp, "wrong # args: should be \"",
2702  "plglevel ?level?", "\"",
2703  (char *) NULL);
2704  return TCL_ERROR;
2705  }
2706 
2707 /* level is for output. */
2708 
2709  plglevel ( &level );
2710 
2711  sprintf( buf, "%d", level );
2712  if (argc > 1)
2713  Tcl_SetVar( interp, argv[1+0], buf, 0 );
2714  else
2715  Tcl_AppendResult( interp, buf, (char *) NULL );
2716 
2717  if (pl_errcode != 0) {
2718  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2719  return TCL_ERROR;
2720  }
2721 
2722  plflush();
2723  return TCL_OK;
2724 }
2725 
2726 /*--------------------------------------------------------------------------*\
2727  * plgpageCmd
2728  *
2729  * Processes plgpage Tcl command.
2730 \*--------------------------------------------------------------------------*/
2731 
2732 static int
2733 plgpageCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2734 {
2735  PLFLT xp;
2736  PLFLT yp;
2737  PLINT xleng;
2738  PLINT yleng;
2739  PLINT xoff;
2740  PLINT yoff;
2741 
2742  pl_errcode = 0; errmsg[0] = '\0';
2743 
2744  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2745  Tcl_AppendResult( interp, "command syntax: \"",
2746  "plgpage ?xp yp xleng yleng xoff yoff?", "\"",
2747  (char *) NULL);
2748  return TCL_ERROR;
2749  }
2750 
2751  if ( (!1 && 0 && (argc < (1 + 6 - 0))) ||
2752  (!1 && !0 && (argc != (6 + 1))) ||
2753  ( 1 && (argc != 1) && (argc != (6 + 1))) ) {
2754  Tcl_AppendResult( interp, "wrong # args: should be \"",
2755  "plgpage ?xp yp xleng yleng xoff yoff?", "\"",
2756  (char *) NULL);
2757  return TCL_ERROR;
2758  }
2759 
2760 /* xp is for output. */
2761 /* yp is for output. */
2762 /* xleng is for output. */
2763 /* yleng is for output. */
2764 /* xoff is for output. */
2765 /* yoff is for output. */
2766 
2767  plgpage ( &xp, &yp, &xleng, &yleng, &xoff, &yoff );
2768 
2769  Tcl_PrintDouble( interp, xp, buf );
2770  if (argc > 1)
2771  Tcl_SetVar( interp, argv[1+0], buf, 0 );
2772  else
2773  Tcl_AppendResult( interp, buf, (char *) NULL );
2774  if (argc == 1)
2775  Tcl_AppendResult( interp, " ", (char *) NULL );
2776  Tcl_PrintDouble( interp, yp, buf );
2777  if (argc > 1)
2778  Tcl_SetVar( interp, argv[1+1], buf, 0 );
2779  else
2780  Tcl_AppendResult( interp, buf, (char *) NULL );
2781  if (argc == 1)
2782  Tcl_AppendResult( interp, " ", (char *) NULL );
2783  sprintf( buf, "%d", xleng );
2784  if (argc > 1)
2785  Tcl_SetVar( interp, argv[1+2], buf, 0 );
2786  else
2787  Tcl_AppendResult( interp, buf, (char *) NULL );
2788  if (argc == 1)
2789  Tcl_AppendResult( interp, " ", (char *) NULL );
2790  sprintf( buf, "%d", yleng );
2791  if (argc > 1)
2792  Tcl_SetVar( interp, argv[1+3], buf, 0 );
2793  else
2794  Tcl_AppendResult( interp, buf, (char *) NULL );
2795  if (argc == 1)
2796  Tcl_AppendResult( interp, " ", (char *) NULL );
2797  sprintf( buf, "%d", xoff );
2798  if (argc > 1)
2799  Tcl_SetVar( interp, argv[1+4], buf, 0 );
2800  else
2801  Tcl_AppendResult( interp, buf, (char *) NULL );
2802  if (argc == 1)
2803  Tcl_AppendResult( interp, " ", (char *) NULL );
2804  sprintf( buf, "%d", yoff );
2805  if (argc > 1)
2806  Tcl_SetVar( interp, argv[1+5], buf, 0 );
2807  else
2808  Tcl_AppendResult( interp, buf, (char *) NULL );
2809 
2810  if (pl_errcode != 0) {
2811  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2812  return TCL_ERROR;
2813  }
2814 
2815  plflush();
2816  return TCL_OK;
2817 }
2818 
2819 /*--------------------------------------------------------------------------*\
2820  * plgraCmd
2821  *
2822  * Processes plgra Tcl command.
2823 \*--------------------------------------------------------------------------*/
2824 
2825 static int
2826 plgraCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2827 {
2828 
2829  pl_errcode = 0; errmsg[0] = '\0';
2830 
2831  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2832  Tcl_AppendResult( interp, "command syntax: \"",
2833  "plgra ", "\"",
2834  (char *) NULL);
2835  return TCL_ERROR;
2836  }
2837 
2838  if ( (!0 && 0 && (argc < (1 + 0 - 0))) ||
2839  (!0 && !0 && (argc != (0 + 1))) ||
2840  ( 0 && (argc != 1) && (argc != (0 + 1))) ) {
2841  Tcl_AppendResult( interp, "wrong # args: should be \"",
2842  "plgra ", "\"",
2843  (char *) NULL);
2844  return TCL_ERROR;
2845  }
2846 
2847 
2848  plgra ( );
2849 
2850 
2851  if (pl_errcode != 0) {
2852  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2853  return TCL_ERROR;
2854  }
2855 
2856  plflush();
2857  return TCL_OK;
2858 }
2859 
2860 /*--------------------------------------------------------------------------*\
2861  * plgradientCmd
2862  *
2863  * Processes plgradient Tcl command.
2864 \*--------------------------------------------------------------------------*/
2865 
2866 static int
2867 plgradientCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2868 {
2869  PLINT n;
2870  PLFLT *x;
2871  tclMatrix *matx;
2872  PLFLT *y;
2873  tclMatrix *maty;
2874  PLFLT angle;
2875 
2876  pl_errcode = 0; errmsg[0] = '\0';
2877 
2878  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2879  Tcl_AppendResult( interp, "command syntax: \"",
2880  "plgradient n x y angle", "\"",
2881  (char *) NULL);
2882  return TCL_ERROR;
2883  }
2884 
2885  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
2886  (!0 && !0 && (argc != (4 + 1))) ||
2887  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
2888  Tcl_AppendResult( interp, "wrong # args: should be \"",
2889  "plgradient n x y angle", "\"",
2890  (char *) NULL);
2891  return TCL_ERROR;
2892  }
2893 
2894  n = atoi(argv[1+0]);
2895  matx = Tcl_GetMatrixPtr( interp, argv[1+1] );
2896  if (matx == NULL) return TCL_ERROR;
2897  x = matx->fdata;
2898  maty = Tcl_GetMatrixPtr( interp, argv[1+2] );
2899  if (maty == NULL) return TCL_ERROR;
2900  y = maty->fdata;
2901  angle = atof(argv[1+3]);
2902 
2903  plgradient ( n, x, y, angle );
2904 
2905 
2906  if (pl_errcode != 0) {
2907  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2908  return TCL_ERROR;
2909  }
2910 
2911  plflush();
2912  return TCL_OK;
2913 }
2914 
2915 /*--------------------------------------------------------------------------*\
2916  * plgspaCmd
2917  *
2918  * Processes plgspa Tcl command.
2919 \*--------------------------------------------------------------------------*/
2920 
2921 static int
2922 plgspaCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2923 {
2924  PLFLT xmin;
2925  PLFLT xmax;
2926  PLFLT ymin;
2927  PLFLT ymax;
2928 
2929  pl_errcode = 0; errmsg[0] = '\0';
2930 
2931  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
2932  Tcl_AppendResult( interp, "command syntax: \"",
2933  "plgspa ?xmin xmax ymin ymax?", "\"",
2934  (char *) NULL);
2935  return TCL_ERROR;
2936  }
2937 
2938  if ( (!1 && 0 && (argc < (1 + 4 - 0))) ||
2939  (!1 && !0 && (argc != (4 + 1))) ||
2940  ( 1 && (argc != 1) && (argc != (4 + 1))) ) {
2941  Tcl_AppendResult( interp, "wrong # args: should be \"",
2942  "plgspa ?xmin xmax ymin ymax?", "\"",
2943  (char *) NULL);
2944  return TCL_ERROR;
2945  }
2946 
2947 /* xmin is for output. */
2948 /* xmax is for output. */
2949 /* ymin is for output. */
2950 /* ymax is for output. */
2951 
2952  plgspa ( &xmin, &xmax, &ymin, &ymax );
2953 
2954  Tcl_PrintDouble( interp, xmin, buf );
2955  if (argc > 1)
2956  Tcl_SetVar( interp, argv[1+0], buf, 0 );
2957  else
2958  Tcl_AppendResult( interp, buf, (char *) NULL );
2959  if (argc == 1)
2960  Tcl_AppendResult( interp, " ", (char *) NULL );
2961  Tcl_PrintDouble( interp, xmax, buf );
2962  if (argc > 1)
2963  Tcl_SetVar( interp, argv[1+1], buf, 0 );
2964  else
2965  Tcl_AppendResult( interp, buf, (char *) NULL );
2966  if (argc == 1)
2967  Tcl_AppendResult( interp, " ", (char *) NULL );
2968  Tcl_PrintDouble( interp, ymin, buf );
2969  if (argc > 1)
2970  Tcl_SetVar( interp, argv[1+2], buf, 0 );
2971  else
2972  Tcl_AppendResult( interp, buf, (char *) NULL );
2973  if (argc == 1)
2974  Tcl_AppendResult( interp, " ", (char *) NULL );
2975  Tcl_PrintDouble( interp, ymax, buf );
2976  if (argc > 1)
2977  Tcl_SetVar( interp, argv[1+3], buf, 0 );
2978  else
2979  Tcl_AppendResult( interp, buf, (char *) NULL );
2980 
2981  if (pl_errcode != 0) {
2982  Tcl_AppendResult(interp, errmsg, (char *) NULL);
2983  return TCL_ERROR;
2984  }
2985 
2986  plflush();
2987  return TCL_OK;
2988 }
2989 
2990 /*--------------------------------------------------------------------------*\
2991  * plgstrmCmd
2992  *
2993  * Processes plgstrm Tcl command.
2994 \*--------------------------------------------------------------------------*/
2995 
2996 static int
2997 plgstrmCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
2998 {
2999  PLINT strm;
3000 
3001  pl_errcode = 0; errmsg[0] = '\0';
3002 
3003  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3004  Tcl_AppendResult( interp, "command syntax: \"",
3005  "plgstrm ?strm?", "\"",
3006  (char *) NULL);
3007  return TCL_ERROR;
3008  }
3009 
3010  if ( (!1 && 0 && (argc < (1 + 1 - 0))) ||
3011  (!1 && !0 && (argc != (1 + 1))) ||
3012  ( 1 && (argc != 1) && (argc != (1 + 1))) ) {
3013  Tcl_AppendResult( interp, "wrong # args: should be \"",
3014  "plgstrm ?strm?", "\"",
3015  (char *) NULL);
3016  return TCL_ERROR;
3017  }
3018 
3019 /* strm is for output. */
3020 
3021  plgstrm ( &strm );
3022 
3023  sprintf( buf, "%d", strm );
3024  if (argc > 1)
3025  Tcl_SetVar( interp, argv[1+0], buf, 0 );
3026  else
3027  Tcl_AppendResult( interp, buf, (char *) NULL );
3028 
3029  if (pl_errcode != 0) {
3030  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3031  return TCL_ERROR;
3032  }
3033 
3034  plflush();
3035  return TCL_OK;
3036 }
3037 
3038 /*--------------------------------------------------------------------------*\
3039  * plgverCmd
3040  *
3041  * Processes plgver Tcl command.
3042 \*--------------------------------------------------------------------------*/
3043 
3044 static int
3045 plgverCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3046 {
3047  char ver[200];
3048 
3049  pl_errcode = 0; errmsg[0] = '\0';
3050 
3051  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3052  Tcl_AppendResult( interp, "command syntax: \"",
3053  "plgver ?ver?", "\"",
3054  (char *) NULL);
3055  return TCL_ERROR;
3056  }
3057 
3058  if ( (!1 && 0 && (argc < (1 + 1 - 0))) ||
3059  (!1 && !0 && (argc != (1 + 1))) ||
3060  ( 1 && (argc != 1) && (argc != (1 + 1))) ) {
3061  Tcl_AppendResult( interp, "wrong # args: should be \"",
3062  "plgver ?ver?", "\"",
3063  (char *) NULL);
3064  return TCL_ERROR;
3065  }
3066 
3067 /* ver is for output. */
3068 
3069  plgver ( ver );
3070 
3071  if (argc > 1)
3072  Tcl_SetVar( interp, argv[1+0], ver, 0 );
3073  else
3074  Tcl_AppendResult( interp, ver, (char *) NULL );
3075 
3076  if (pl_errcode != 0) {
3077  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3078  return TCL_ERROR;
3079  }
3080 
3081  plflush();
3082  return TCL_OK;
3083 }
3084 
3085 /*--------------------------------------------------------------------------*\
3086  * plgvpdCmd
3087  *
3088  * Processes plgvpd Tcl command.
3089 \*--------------------------------------------------------------------------*/
3090 
3091 static int
3092 plgvpdCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3093 {
3094  PLFLT xmin;
3095  PLFLT xmax;
3096  PLFLT ymin;
3097  PLFLT ymax;
3098 
3099  pl_errcode = 0; errmsg[0] = '\0';
3100 
3101  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3102  Tcl_AppendResult( interp, "command syntax: \"",
3103  "plgvpd ?xmin xmax ymin ymax?", "\"",
3104  (char *) NULL);
3105  return TCL_ERROR;
3106  }
3107 
3108  if ( (!1 && 0 && (argc < (1 + 4 - 0))) ||
3109  (!1 && !0 && (argc != (4 + 1))) ||
3110  ( 1 && (argc != 1) && (argc != (4 + 1))) ) {
3111  Tcl_AppendResult( interp, "wrong # args: should be \"",
3112  "plgvpd ?xmin xmax ymin ymax?", "\"",
3113  (char *) NULL);
3114  return TCL_ERROR;
3115  }
3116 
3117 /* xmin is for output. */
3118 /* xmax is for output. */
3119 /* ymin is for output. */
3120 /* ymax is for output. */
3121 
3122  plgvpd ( &xmin, &xmax, &ymin, &ymax );
3123 
3124  Tcl_PrintDouble( interp, xmin, buf );
3125  if (argc > 1)
3126  Tcl_SetVar( interp, argv[1+0], buf, 0 );
3127  else
3128  Tcl_AppendResult( interp, buf, (char *) NULL );
3129  if (argc == 1)
3130  Tcl_AppendResult( interp, " ", (char *) NULL );
3131  Tcl_PrintDouble( interp, xmax, buf );
3132  if (argc > 1)
3133  Tcl_SetVar( interp, argv[1+1], buf, 0 );
3134  else
3135  Tcl_AppendResult( interp, buf, (char *) NULL );
3136  if (argc == 1)
3137  Tcl_AppendResult( interp, " ", (char *) NULL );
3138  Tcl_PrintDouble( interp, ymin, buf );
3139  if (argc > 1)
3140  Tcl_SetVar( interp, argv[1+2], buf, 0 );
3141  else
3142  Tcl_AppendResult( interp, buf, (char *) NULL );
3143  if (argc == 1)
3144  Tcl_AppendResult( interp, " ", (char *) NULL );
3145  Tcl_PrintDouble( interp, ymax, buf );
3146  if (argc > 1)
3147  Tcl_SetVar( interp, argv[1+3], buf, 0 );
3148  else
3149  Tcl_AppendResult( interp, buf, (char *) NULL );
3150 
3151  if (pl_errcode != 0) {
3152  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3153  return TCL_ERROR;
3154  }
3155 
3156  plflush();
3157  return TCL_OK;
3158 }
3159 
3160 /*--------------------------------------------------------------------------*\
3161  * plgvpwCmd
3162  *
3163  * Processes plgvpw Tcl command.
3164 \*--------------------------------------------------------------------------*/
3165 
3166 static int
3167 plgvpwCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3168 {
3169  PLFLT xmin;
3170  PLFLT xmax;
3171  PLFLT ymin;
3172  PLFLT ymax;
3173 
3174  pl_errcode = 0; errmsg[0] = '\0';
3175 
3176  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3177  Tcl_AppendResult( interp, "command syntax: \"",
3178  "plgvpw ?xmin xmax ymin ymax?", "\"",
3179  (char *) NULL);
3180  return TCL_ERROR;
3181  }
3182 
3183  if ( (!1 && 0 && (argc < (1 + 4 - 0))) ||
3184  (!1 && !0 && (argc != (4 + 1))) ||
3185  ( 1 && (argc != 1) && (argc != (4 + 1))) ) {
3186  Tcl_AppendResult( interp, "wrong # args: should be \"",
3187  "plgvpw ?xmin xmax ymin ymax?", "\"",
3188  (char *) NULL);
3189  return TCL_ERROR;
3190  }
3191 
3192 /* xmin is for output. */
3193 /* xmax is for output. */
3194 /* ymin is for output. */
3195 /* ymax is for output. */
3196 
3197  plgvpw ( &xmin, &xmax, &ymin, &ymax );
3198 
3199  Tcl_PrintDouble( interp, xmin, buf );
3200  if (argc > 1)
3201  Tcl_SetVar( interp, argv[1+0], buf, 0 );
3202  else
3203  Tcl_AppendResult( interp, buf, (char *) NULL );
3204  if (argc == 1)
3205  Tcl_AppendResult( interp, " ", (char *) NULL );
3206  Tcl_PrintDouble( interp, xmax, buf );
3207  if (argc > 1)
3208  Tcl_SetVar( interp, argv[1+1], buf, 0 );
3209  else
3210  Tcl_AppendResult( interp, buf, (char *) NULL );
3211  if (argc == 1)
3212  Tcl_AppendResult( interp, " ", (char *) NULL );
3213  Tcl_PrintDouble( interp, ymin, buf );
3214  if (argc > 1)
3215  Tcl_SetVar( interp, argv[1+2], buf, 0 );
3216  else
3217  Tcl_AppendResult( interp, buf, (char *) NULL );
3218  if (argc == 1)
3219  Tcl_AppendResult( interp, " ", (char *) NULL );
3220  Tcl_PrintDouble( interp, ymax, buf );
3221  if (argc > 1)
3222  Tcl_SetVar( interp, argv[1+3], buf, 0 );
3223  else
3224  Tcl_AppendResult( interp, buf, (char *) NULL );
3225 
3226  if (pl_errcode != 0) {
3227  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3228  return TCL_ERROR;
3229  }
3230 
3231  plflush();
3232  return TCL_OK;
3233 }
3234 
3235 /*--------------------------------------------------------------------------*\
3236  * plgxaxCmd
3237  *
3238  * Processes plgxax Tcl command.
3239 \*--------------------------------------------------------------------------*/
3240 
3241 static int
3242 plgxaxCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3243 {
3244  PLINT digmax;
3245  PLINT digits;
3246 
3247  pl_errcode = 0; errmsg[0] = '\0';
3248 
3249  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3250  Tcl_AppendResult( interp, "command syntax: \"",
3251  "plgxax ?digmax digits?", "\"",
3252  (char *) NULL);
3253  return TCL_ERROR;
3254  }
3255 
3256  if ( (!1 && 0 && (argc < (1 + 2 - 0))) ||
3257  (!1 && !0 && (argc != (2 + 1))) ||
3258  ( 1 && (argc != 1) && (argc != (2 + 1))) ) {
3259  Tcl_AppendResult( interp, "wrong # args: should be \"",
3260  "plgxax ?digmax digits?", "\"",
3261  (char *) NULL);
3262  return TCL_ERROR;
3263  }
3264 
3265 /* digmax is for output. */
3266 /* digits is for output. */
3267 
3268  plgxax ( &digmax, &digits );
3269 
3270  sprintf( buf, "%d", digmax );
3271  if (argc > 1)
3272  Tcl_SetVar( interp, argv[1+0], buf, 0 );
3273  else
3274  Tcl_AppendResult( interp, buf, (char *) NULL );
3275  if (argc == 1)
3276  Tcl_AppendResult( interp, " ", (char *) NULL );
3277  sprintf( buf, "%d", digits );
3278  if (argc > 1)
3279  Tcl_SetVar( interp, argv[1+1], buf, 0 );
3280  else
3281  Tcl_AppendResult( interp, buf, (char *) NULL );
3282 
3283  if (pl_errcode != 0) {
3284  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3285  return TCL_ERROR;
3286  }
3287 
3288  plflush();
3289  return TCL_OK;
3290 }
3291 
3292 /*--------------------------------------------------------------------------*\
3293  * plgyaxCmd
3294  *
3295  * Processes plgyax Tcl command.
3296 \*--------------------------------------------------------------------------*/
3297 
3298 static int
3299 plgyaxCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3300 {
3301  PLINT digmax;
3302  PLINT digits;
3303 
3304  pl_errcode = 0; errmsg[0] = '\0';
3305 
3306  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3307  Tcl_AppendResult( interp, "command syntax: \"",
3308  "plgyax ?digmax digits?", "\"",
3309  (char *) NULL);
3310  return TCL_ERROR;
3311  }
3312 
3313  if ( (!1 && 0 && (argc < (1 + 2 - 0))) ||
3314  (!1 && !0 && (argc != (2 + 1))) ||
3315  ( 1 && (argc != 1) && (argc != (2 + 1))) ) {
3316  Tcl_AppendResult( interp, "wrong # args: should be \"",
3317  "plgyax ?digmax digits?", "\"",
3318  (char *) NULL);
3319  return TCL_ERROR;
3320  }
3321 
3322 /* digmax is for output. */
3323 /* digits is for output. */
3324 
3325  plgyax ( &digmax, &digits );
3326 
3327  sprintf( buf, "%d", digmax );
3328  if (argc > 1)
3329  Tcl_SetVar( interp, argv[1+0], buf, 0 );
3330  else
3331  Tcl_AppendResult( interp, buf, (char *) NULL );
3332  if (argc == 1)
3333  Tcl_AppendResult( interp, " ", (char *) NULL );
3334  sprintf( buf, "%d", digits );
3335  if (argc > 1)
3336  Tcl_SetVar( interp, argv[1+1], buf, 0 );
3337  else
3338  Tcl_AppendResult( interp, buf, (char *) NULL );
3339 
3340  if (pl_errcode != 0) {
3341  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3342  return TCL_ERROR;
3343  }
3344 
3345  plflush();
3346  return TCL_OK;
3347 }
3348 
3349 /*--------------------------------------------------------------------------*\
3350  * plgzaxCmd
3351  *
3352  * Processes plgzax Tcl command.
3353 \*--------------------------------------------------------------------------*/
3354 
3355 static int
3356 plgzaxCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3357 {
3358  PLINT digmax;
3359  PLINT digits;
3360 
3361  pl_errcode = 0; errmsg[0] = '\0';
3362 
3363  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3364  Tcl_AppendResult( interp, "command syntax: \"",
3365  "plgzax ?digmax digits?", "\"",
3366  (char *) NULL);
3367  return TCL_ERROR;
3368  }
3369 
3370  if ( (!1 && 0 && (argc < (1 + 2 - 0))) ||
3371  (!1 && !0 && (argc != (2 + 1))) ||
3372  ( 1 && (argc != 1) && (argc != (2 + 1))) ) {
3373  Tcl_AppendResult( interp, "wrong # args: should be \"",
3374  "plgzax ?digmax digits?", "\"",
3375  (char *) NULL);
3376  return TCL_ERROR;
3377  }
3378 
3379 /* digmax is for output. */
3380 /* digits is for output. */
3381 
3382  plgzax ( &digmax, &digits );
3383 
3384  sprintf( buf, "%d", digmax );
3385  if (argc > 1)
3386  Tcl_SetVar( interp, argv[1+0], buf, 0 );
3387  else
3388  Tcl_AppendResult( interp, buf, (char *) NULL );
3389  if (argc == 1)
3390  Tcl_AppendResult( interp, " ", (char *) NULL );
3391  sprintf( buf, "%d", digits );
3392  if (argc > 1)
3393  Tcl_SetVar( interp, argv[1+1], buf, 0 );
3394  else
3395  Tcl_AppendResult( interp, buf, (char *) NULL );
3396 
3397  if (pl_errcode != 0) {
3398  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3399  return TCL_ERROR;
3400  }
3401 
3402  plflush();
3403  return TCL_OK;
3404 }
3405 
3406 /*--------------------------------------------------------------------------*\
3407  * plhistCmd
3408  *
3409  * Processes plhist Tcl command.
3410 \*--------------------------------------------------------------------------*/
3411 
3412 static int
3413 plhistCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3414 {
3415  PLINT n;
3416  PLFLT *data;
3417  tclMatrix *matdata;
3418  PLFLT datmin;
3419  PLFLT datmax;
3420  PLINT nbin;
3421  PLINT oldwin;
3422 
3423  pl_errcode = 0; errmsg[0] = '\0';
3424 
3425  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3426  Tcl_AppendResult( interp, "command syntax: \"",
3427  "plhist n data datmin datmax nbin oldwin", "\"",
3428  (char *) NULL);
3429  return TCL_ERROR;
3430  }
3431 
3432  if ( (!0 && 0 && (argc < (1 + 6 - 0))) ||
3433  (!0 && !0 && (argc != (6 + 1))) ||
3434  ( 0 && (argc != 1) && (argc != (6 + 1))) ) {
3435  Tcl_AppendResult( interp, "wrong # args: should be \"",
3436  "plhist n data datmin datmax nbin oldwin", "\"",
3437  (char *) NULL);
3438  return TCL_ERROR;
3439  }
3440 
3441  n = atoi(argv[1+0]);
3442  matdata = Tcl_GetMatrixPtr( interp, argv[1+1] );
3443  if (matdata == NULL) return TCL_ERROR;
3444  data = matdata->fdata;
3445  datmin = atof(argv[1+2]);
3446  datmax = atof(argv[1+3]);
3447  nbin = atoi(argv[1+4]);
3448  oldwin = atoi(argv[1+5]);
3449 
3450  plhist ( n, data, datmin, datmax, nbin, oldwin );
3451 
3452 
3453  if (pl_errcode != 0) {
3454  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3455  return TCL_ERROR;
3456  }
3457 
3458  plflush();
3459  return TCL_OK;
3460 }
3461 
3462 /*--------------------------------------------------------------------------*\
3463  * plhlsrgbCmd
3464  *
3465  * Processes plhlsrgb Tcl command.
3466 \*--------------------------------------------------------------------------*/
3467 
3468 static int
3469 plhlsrgbCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3470 {
3471  PLFLT h;
3472  PLFLT l;
3473  PLFLT s;
3474  PLFLT r;
3475  PLFLT g;
3476  PLFLT b;
3477 
3478  pl_errcode = 0; errmsg[0] = '\0';
3479 
3480  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3481  Tcl_AppendResult( interp, "command syntax: \"",
3482  "plhlsrgb ?h l s r g b?", "\"",
3483  (char *) NULL);
3484  return TCL_ERROR;
3485  }
3486 
3487  if ( (!1 && 0 && (argc < (1 + 6 - 0))) ||
3488  (!1 && !0 && (argc != (6 + 1))) ||
3489  ( 1 && (argc != 1) && (argc != (6 + 1))) ) {
3490  Tcl_AppendResult( interp, "wrong # args: should be \"",
3491  "plhlsrgb ?h l s r g b?", "\"",
3492  (char *) NULL);
3493  return TCL_ERROR;
3494  }
3495 
3496  h = atof(argv[1+0]);
3497  l = atof(argv[1+1]);
3498  s = atof(argv[1+2]);
3499 /* r is for output. */
3500 /* g is for output. */
3501 /* b is for output. */
3502 
3503  plhlsrgb ( h, l, s, &r, &g, &b );
3504 
3505  if (argc == 1)
3506  Tcl_AppendResult( interp, " ", (char *) NULL );
3507  Tcl_PrintDouble( interp, r, buf );
3508  if (argc > 1)
3509  Tcl_SetVar( interp, argv[1+3], buf, 0 );
3510  else
3511  Tcl_AppendResult( interp, buf, (char *) NULL );
3512  if (argc == 1)
3513  Tcl_AppendResult( interp, " ", (char *) NULL );
3514  Tcl_PrintDouble( interp, g, buf );
3515  if (argc > 1)
3516  Tcl_SetVar( interp, argv[1+4], buf, 0 );
3517  else
3518  Tcl_AppendResult( interp, buf, (char *) NULL );
3519  if (argc == 1)
3520  Tcl_AppendResult( interp, " ", (char *) NULL );
3521  Tcl_PrintDouble( interp, b, buf );
3522  if (argc > 1)
3523  Tcl_SetVar( interp, argv[1+5], buf, 0 );
3524  else
3525  Tcl_AppendResult( interp, buf, (char *) NULL );
3526 
3527  if (pl_errcode != 0) {
3528  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3529  return TCL_ERROR;
3530  }
3531 
3532  plflush();
3533  return TCL_OK;
3534 }
3535 
3536 /*--------------------------------------------------------------------------*\
3537  * plinitCmd
3538  *
3539  * Processes plinit Tcl command.
3540 \*--------------------------------------------------------------------------*/
3541 
3542 static int
3543 plinitCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3544 {
3545 
3546  pl_errcode = 0; errmsg[0] = '\0';
3547 
3548  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3549  Tcl_AppendResult( interp, "command syntax: \"",
3550  "plinit ", "\"",
3551  (char *) NULL);
3552  return TCL_ERROR;
3553  }
3554 
3555  if ( (!0 && 0 && (argc < (1 + 0 - 0))) ||
3556  (!0 && !0 && (argc != (0 + 1))) ||
3557  ( 0 && (argc != 1) && (argc != (0 + 1))) ) {
3558  Tcl_AppendResult( interp, "wrong # args: should be \"",
3559  "plinit ", "\"",
3560  (char *) NULL);
3561  return TCL_ERROR;
3562  }
3563 
3564 
3565  plinit ( );
3566 
3567 
3568  if (pl_errcode != 0) {
3569  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3570  return TCL_ERROR;
3571  }
3572 
3573  plflush();
3574  return TCL_OK;
3575 }
3576 
3577 /*--------------------------------------------------------------------------*\
3578  * pljoinCmd
3579  *
3580  * Processes pljoin Tcl command.
3581 \*--------------------------------------------------------------------------*/
3582 
3583 static int
3584 pljoinCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3585 {
3586  PLFLT x1;
3587  PLFLT y1;
3588  PLFLT x2;
3589  PLFLT y2;
3590 
3591  pl_errcode = 0; errmsg[0] = '\0';
3592 
3593  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3594  Tcl_AppendResult( interp, "command syntax: \"",
3595  "pljoin x1 y1 x2 y2", "\"",
3596  (char *) NULL);
3597  return TCL_ERROR;
3598  }
3599 
3600  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
3601  (!0 && !0 && (argc != (4 + 1))) ||
3602  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
3603  Tcl_AppendResult( interp, "wrong # args: should be \"",
3604  "pljoin x1 y1 x2 y2", "\"",
3605  (char *) NULL);
3606  return TCL_ERROR;
3607  }
3608 
3609  x1 = atof(argv[1+0]);
3610  y1 = atof(argv[1+1]);
3611  x2 = atof(argv[1+2]);
3612  y2 = atof(argv[1+3]);
3613 
3614  pljoin ( x1, y1, x2, y2 );
3615 
3616 
3617  if (pl_errcode != 0) {
3618  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3619  return TCL_ERROR;
3620  }
3621 
3622  plflush();
3623  return TCL_OK;
3624 }
3625 
3626 /*--------------------------------------------------------------------------*\
3627  * pllabCmd
3628  *
3629  * Processes pllab Tcl command.
3630 \*--------------------------------------------------------------------------*/
3631 
3632 static int
3633 pllabCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3634 {
3635  const char *xlabel;
3636  const char *ylabel;
3637  const char *tlabel;
3638 
3639  pl_errcode = 0; errmsg[0] = '\0';
3640 
3641  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3642  Tcl_AppendResult( interp, "command syntax: \"",
3643  "pllab xlabel ylabel tlabel", "\"",
3644  (char *) NULL);
3645  return TCL_ERROR;
3646  }
3647 
3648  if ( (!0 && 0 && (argc < (1 + 3 - 0))) ||
3649  (!0 && !0 && (argc != (3 + 1))) ||
3650  ( 0 && (argc != 1) && (argc != (3 + 1))) ) {
3651  Tcl_AppendResult( interp, "wrong # args: should be \"",
3652  "pllab xlabel ylabel tlabel", "\"",
3653  (char *) NULL);
3654  return TCL_ERROR;
3655  }
3656 
3657  xlabel = argv[1+0];
3658  ylabel = argv[1+1];
3659  tlabel = argv[1+2];
3660 
3661  pllab ( xlabel, ylabel, tlabel );
3662 
3663 
3664  if (pl_errcode != 0) {
3665  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3666  return TCL_ERROR;
3667  }
3668 
3669  plflush();
3670  return TCL_OK;
3671 }
3672 
3673 /*--------------------------------------------------------------------------*\
3674  * pllightsourceCmd
3675  *
3676  * Processes pllightsource Tcl command.
3677 \*--------------------------------------------------------------------------*/
3678 
3679 static int
3680 pllightsourceCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3681 {
3682  PLFLT x;
3683  PLFLT y;
3684  PLFLT z;
3685 
3686  pl_errcode = 0; errmsg[0] = '\0';
3687 
3688  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3689  Tcl_AppendResult( interp, "command syntax: \"",
3690  "pllightsource x y z", "\"",
3691  (char *) NULL);
3692  return TCL_ERROR;
3693  }
3694 
3695  if ( (!0 && 0 && (argc < (1 + 3 - 0))) ||
3696  (!0 && !0 && (argc != (3 + 1))) ||
3697  ( 0 && (argc != 1) && (argc != (3 + 1))) ) {
3698  Tcl_AppendResult( interp, "wrong # args: should be \"",
3699  "pllightsource x y z", "\"",
3700  (char *) NULL);
3701  return TCL_ERROR;
3702  }
3703 
3704  x = atof(argv[1+0]);
3705  y = atof(argv[1+1]);
3706  z = atof(argv[1+2]);
3707 
3708  pllightsource ( x, y, z );
3709 
3710 
3711  if (pl_errcode != 0) {
3712  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3713  return TCL_ERROR;
3714  }
3715 
3716  plflush();
3717  return TCL_OK;
3718 }
3719 
3720 /*--------------------------------------------------------------------------*\
3721  * pllineCmd
3722  *
3723  * Processes plline Tcl command.
3724 \*--------------------------------------------------------------------------*/
3725 
3726 static int
3727 pllineCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3728 {
3729  PLINT n;
3730  PLFLT *x;
3731  tclMatrix *matx;
3732  PLFLT *y;
3733  tclMatrix *maty;
3734 
3735  pl_errcode = 0; errmsg[0] = '\0';
3736 
3737  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3738  Tcl_AppendResult( interp, "command syntax: \"",
3739  "plline n x y", "\"",
3740  (char *) NULL);
3741  return TCL_ERROR;
3742  }
3743 
3744  if ( (!0 && 0 && (argc < (1 + 3 - 0))) ||
3745  (!0 && !0 && (argc != (3 + 1))) ||
3746  ( 0 && (argc != 1) && (argc != (3 + 1))) ) {
3747  Tcl_AppendResult( interp, "wrong # args: should be \"",
3748  "plline n x y", "\"",
3749  (char *) NULL);
3750  return TCL_ERROR;
3751  }
3752 
3753  n = atoi(argv[1+0]);
3754  matx = Tcl_GetMatrixPtr( interp, argv[1+1] );
3755  if (matx == NULL) return TCL_ERROR;
3756  x = matx->fdata;
3757  maty = Tcl_GetMatrixPtr( interp, argv[1+2] );
3758  if (maty == NULL) return TCL_ERROR;
3759  y = maty->fdata;
3760 
3761  plline ( n, x, y );
3762 
3763 
3764  if (pl_errcode != 0) {
3765  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3766  return TCL_ERROR;
3767  }
3768 
3769  plflush();
3770  return TCL_OK;
3771 }
3772 
3773 /*--------------------------------------------------------------------------*\
3774  * plline3Cmd
3775  *
3776  * Processes plline3 Tcl command.
3777 \*--------------------------------------------------------------------------*/
3778 
3779 static int
3780 plline3Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3781 {
3782  PLINT n;
3783  PLFLT *x;
3784  tclMatrix *matx;
3785  PLFLT *y;
3786  tclMatrix *maty;
3787  PLFLT *z;
3788  tclMatrix *matz;
3789 
3790  pl_errcode = 0; errmsg[0] = '\0';
3791 
3792  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3793  Tcl_AppendResult( interp, "command syntax: \"",
3794  "plline3 n x y z", "\"",
3795  (char *) NULL);
3796  return TCL_ERROR;
3797  }
3798 
3799  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
3800  (!0 && !0 && (argc != (4 + 1))) ||
3801  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
3802  Tcl_AppendResult( interp, "wrong # args: should be \"",
3803  "plline3 n x y z", "\"",
3804  (char *) NULL);
3805  return TCL_ERROR;
3806  }
3807 
3808  n = atoi(argv[1+0]);
3809  matx = Tcl_GetMatrixPtr( interp, argv[1+1] );
3810  if (matx == NULL) return TCL_ERROR;
3811  x = matx->fdata;
3812  maty = Tcl_GetMatrixPtr( interp, argv[1+2] );
3813  if (maty == NULL) return TCL_ERROR;
3814  y = maty->fdata;
3815  matz = Tcl_GetMatrixPtr( interp, argv[1+3] );
3816  if (matz == NULL) return TCL_ERROR;
3817  z = matz->fdata;
3818 
3819  plline3 ( n, x, y, z );
3820 
3821 
3822  if (pl_errcode != 0) {
3823  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3824  return TCL_ERROR;
3825  }
3826 
3827  plflush();
3828  return TCL_OK;
3829 }
3830 
3831 /*--------------------------------------------------------------------------*\
3832  * pllstyCmd
3833  *
3834  * Processes pllsty Tcl command.
3835 \*--------------------------------------------------------------------------*/
3836 
3837 static int
3838 pllstyCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3839 {
3840  PLINT lin;
3841 
3842  pl_errcode = 0; errmsg[0] = '\0';
3843 
3844  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3845  Tcl_AppendResult( interp, "command syntax: \"",
3846  "pllsty lin", "\"",
3847  (char *) NULL);
3848  return TCL_ERROR;
3849  }
3850 
3851  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
3852  (!0 && !0 && (argc != (1 + 1))) ||
3853  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
3854  Tcl_AppendResult( interp, "wrong # args: should be \"",
3855  "pllsty lin", "\"",
3856  (char *) NULL);
3857  return TCL_ERROR;
3858  }
3859 
3860  lin = atoi(argv[1+0]);
3861 
3862  pllsty ( lin );
3863 
3864 
3865  if (pl_errcode != 0) {
3866  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3867  return TCL_ERROR;
3868  }
3869 
3870  plflush();
3871  return TCL_OK;
3872 }
3873 
3874 /*--------------------------------------------------------------------------*\
3875  * plmkstrmCmd
3876  *
3877  * Processes plmkstrm Tcl command.
3878 \*--------------------------------------------------------------------------*/
3879 
3880 static int
3881 plmkstrmCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3882 {
3883  PLINT strm;
3884 
3885  pl_errcode = 0; errmsg[0] = '\0';
3886 
3887  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3888  Tcl_AppendResult( interp, "command syntax: \"",
3889  "plmkstrm ?strm?", "\"",
3890  (char *) NULL);
3891  return TCL_ERROR;
3892  }
3893 
3894  if ( (!1 && 0 && (argc < (1 + 1 - 0))) ||
3895  (!1 && !0 && (argc != (1 + 1))) ||
3896  ( 1 && (argc != 1) && (argc != (1 + 1))) ) {
3897  Tcl_AppendResult( interp, "wrong # args: should be \"",
3898  "plmkstrm ?strm?", "\"",
3899  (char *) NULL);
3900  return TCL_ERROR;
3901  }
3902 
3903 /* strm is for output. */
3904 
3905  plmkstrm ( &strm );
3906 
3907  sprintf( buf, "%d", strm );
3908  if (argc > 1)
3909  Tcl_SetVar( interp, argv[1+0], buf, 0 );
3910  else
3911  Tcl_AppendResult( interp, buf, (char *) NULL );
3912 
3913  if (pl_errcode != 0) {
3914  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3915  return TCL_ERROR;
3916  }
3917 
3918  plflush();
3919  return TCL_OK;
3920 }
3921 
3922 /*--------------------------------------------------------------------------*\
3923  * plmtexCmd
3924  *
3925  * Processes plmtex Tcl command.
3926 \*--------------------------------------------------------------------------*/
3927 
3928 static int
3929 plmtexCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3930 {
3931  const char *side;
3932  PLFLT disp;
3933  PLFLT pos;
3934  PLFLT just;
3935  const char *text;
3936 
3937  pl_errcode = 0; errmsg[0] = '\0';
3938 
3939  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3940  Tcl_AppendResult( interp, "command syntax: \"",
3941  "plmtex side disp pos just text", "\"",
3942  (char *) NULL);
3943  return TCL_ERROR;
3944  }
3945 
3946  if ( (!0 && 0 && (argc < (1 + 5 - 0))) ||
3947  (!0 && !0 && (argc != (5 + 1))) ||
3948  ( 0 && (argc != 1) && (argc != (5 + 1))) ) {
3949  Tcl_AppendResult( interp, "wrong # args: should be \"",
3950  "plmtex side disp pos just text", "\"",
3951  (char *) NULL);
3952  return TCL_ERROR;
3953  }
3954 
3955  side = argv[1+0];
3956  disp = atof(argv[1+1]);
3957  pos = atof(argv[1+2]);
3958  just = atof(argv[1+3]);
3959  text = argv[1+4];
3960 
3961  plmtex ( side, disp, pos, just, text );
3962 
3963 
3964  if (pl_errcode != 0) {
3965  Tcl_AppendResult(interp, errmsg, (char *) NULL);
3966  return TCL_ERROR;
3967  }
3968 
3969  plflush();
3970  return TCL_OK;
3971 }
3972 
3973 /*--------------------------------------------------------------------------*\
3974  * plmtex3Cmd
3975  *
3976  * Processes plmtex3 Tcl command.
3977 \*--------------------------------------------------------------------------*/
3978 
3979 static int
3980 plmtex3Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
3981 {
3982  const char *side;
3983  PLFLT disp;
3984  PLFLT pos;
3985  PLFLT just;
3986  const char *text;
3987 
3988  pl_errcode = 0; errmsg[0] = '\0';
3989 
3990  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
3991  Tcl_AppendResult( interp, "command syntax: \"",
3992  "plmtex3 side disp pos just text", "\"",
3993  (char *) NULL);
3994  return TCL_ERROR;
3995  }
3996 
3997  if ( (!0 && 0 && (argc < (1 + 5 - 0))) ||
3998  (!0 && !0 && (argc != (5 + 1))) ||
3999  ( 0 && (argc != 1) && (argc != (5 + 1))) ) {
4000  Tcl_AppendResult( interp, "wrong # args: should be \"",
4001  "plmtex3 side disp pos just text", "\"",
4002  (char *) NULL);
4003  return TCL_ERROR;
4004  }
4005 
4006  side = argv[1+0];
4007  disp = atof(argv[1+1]);
4008  pos = atof(argv[1+2]);
4009  just = atof(argv[1+3]);
4010  text = argv[1+4];
4011 
4012  plmtex3 ( side, disp, pos, just, text );
4013 
4014 
4015  if (pl_errcode != 0) {
4016  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4017  return TCL_ERROR;
4018  }
4019 
4020  plflush();
4021  return TCL_OK;
4022 }
4023 
4024 /*--------------------------------------------------------------------------*\
4025  * plpatCmd
4026  *
4027  * Processes plpat Tcl command.
4028 \*--------------------------------------------------------------------------*/
4029 
4030 static int
4031 plpatCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4032 {
4033  PLINT nlin;
4034  PLINT *inc;
4035  tclMatrix *matinc;
4036  PLINT *del;
4037  tclMatrix *matdel;
4038 
4039  pl_errcode = 0; errmsg[0] = '\0';
4040 
4041  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4042  Tcl_AppendResult( interp, "command syntax: \"",
4043  "plpat nlin inc del", "\"",
4044  (char *) NULL);
4045  return TCL_ERROR;
4046  }
4047 
4048  if ( (!0 && 0 && (argc < (1 + 3 - 0))) ||
4049  (!0 && !0 && (argc != (3 + 1))) ||
4050  ( 0 && (argc != 1) && (argc != (3 + 1))) ) {
4051  Tcl_AppendResult( interp, "wrong # args: should be \"",
4052  "plpat nlin inc del", "\"",
4053  (char *) NULL);
4054  return TCL_ERROR;
4055  }
4056 
4057  nlin = atoi(argv[1+0]);
4058  matinc = Tcl_GetMatrixPtr( interp, argv[1+1] );
4059  if (matinc == NULL) return TCL_ERROR;
4060  inc = matinc->idata;
4061  matdel = Tcl_GetMatrixPtr( interp, argv[1+2] );
4062  if (matdel == NULL) return TCL_ERROR;
4063  del = matdel->idata;
4064 
4065  plpat ( nlin, inc, del );
4066 
4067 
4068  if (pl_errcode != 0) {
4069  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4070  return TCL_ERROR;
4071  }
4072 
4073  plflush();
4074  return TCL_OK;
4075 }
4076 
4077 /*--------------------------------------------------------------------------*\
4078  * plpathCmd
4079  *
4080  * Processes plpath Tcl command.
4081 \*--------------------------------------------------------------------------*/
4082 
4083 static int
4084 plpathCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4085 {
4086  PLINT n;
4087  PLFLT x1;
4088  PLFLT y1;
4089  PLFLT x2;
4090  PLFLT y2;
4091 
4092  pl_errcode = 0; errmsg[0] = '\0';
4093 
4094  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4095  Tcl_AppendResult( interp, "command syntax: \"",
4096  "plpath n x1 y1 x2 y2", "\"",
4097  (char *) NULL);
4098  return TCL_ERROR;
4099  }
4100 
4101  if ( (!0 && 0 && (argc < (1 + 5 - 0))) ||
4102  (!0 && !0 && (argc != (5 + 1))) ||
4103  ( 0 && (argc != 1) && (argc != (5 + 1))) ) {
4104  Tcl_AppendResult( interp, "wrong # args: should be \"",
4105  "plpath n x1 y1 x2 y2", "\"",
4106  (char *) NULL);
4107  return TCL_ERROR;
4108  }
4109 
4110  n = atoi(argv[1+0]);
4111  x1 = atof(argv[1+1]);
4112  y1 = atof(argv[1+2]);
4113  x2 = atof(argv[1+3]);
4114  y2 = atof(argv[1+4]);
4115 
4116  plpath ( n, x1, y1, x2, y2 );
4117 
4118 
4119  if (pl_errcode != 0) {
4120  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4121  return TCL_ERROR;
4122  }
4123 
4124  plflush();
4125  return TCL_OK;
4126 }
4127 
4128 /*--------------------------------------------------------------------------*\
4129  * plpoinCmd
4130  *
4131  * Processes plpoin Tcl command.
4132 \*--------------------------------------------------------------------------*/
4133 
4134 static int
4135 plpoinCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4136 {
4137  PLINT n;
4138  PLFLT *x;
4139  tclMatrix *matx;
4140  PLFLT *y;
4141  tclMatrix *maty;
4142  PLINT code;
4143 
4144  pl_errcode = 0; errmsg[0] = '\0';
4145 
4146  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4147  Tcl_AppendResult( interp, "command syntax: \"",
4148  "plpoin n x y code", "\"",
4149  (char *) NULL);
4150  return TCL_ERROR;
4151  }
4152 
4153  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
4154  (!0 && !0 && (argc != (4 + 1))) ||
4155  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
4156  Tcl_AppendResult( interp, "wrong # args: should be \"",
4157  "plpoin n x y code", "\"",
4158  (char *) NULL);
4159  return TCL_ERROR;
4160  }
4161 
4162  n = atoi(argv[1+0]);
4163  matx = Tcl_GetMatrixPtr( interp, argv[1+1] );
4164  if (matx == NULL) return TCL_ERROR;
4165  x = matx->fdata;
4166  maty = Tcl_GetMatrixPtr( interp, argv[1+2] );
4167  if (maty == NULL) return TCL_ERROR;
4168  y = maty->fdata;
4169  code = atoi(argv[1+3]);
4170 
4171  plpoin ( n, x, y, code );
4172 
4173 
4174  if (pl_errcode != 0) {
4175  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4176  return TCL_ERROR;
4177  }
4178 
4179  plflush();
4180  return TCL_OK;
4181 }
4182 
4183 /*--------------------------------------------------------------------------*\
4184  * plpoin3Cmd
4185  *
4186  * Processes plpoin3 Tcl command.
4187 \*--------------------------------------------------------------------------*/
4188 
4189 static int
4190 plpoin3Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4191 {
4192  PLINT n;
4193  PLFLT *x;
4194  tclMatrix *matx;
4195  PLFLT *y;
4196  tclMatrix *maty;
4197  PLFLT *z;
4198  tclMatrix *matz;
4199  PLINT code;
4200 
4201  pl_errcode = 0; errmsg[0] = '\0';
4202 
4203  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4204  Tcl_AppendResult( interp, "command syntax: \"",
4205  "plpoin3 n x y z code", "\"",
4206  (char *) NULL);
4207  return TCL_ERROR;
4208  }
4209 
4210  if ( (!0 && 0 && (argc < (1 + 5 - 0))) ||
4211  (!0 && !0 && (argc != (5 + 1))) ||
4212  ( 0 && (argc != 1) && (argc != (5 + 1))) ) {
4213  Tcl_AppendResult( interp, "wrong # args: should be \"",
4214  "plpoin3 n x y z code", "\"",
4215  (char *) NULL);
4216  return TCL_ERROR;
4217  }
4218 
4219  n = atoi(argv[1+0]);
4220  matx = Tcl_GetMatrixPtr( interp, argv[1+1] );
4221  if (matx == NULL) return TCL_ERROR;
4222  x = matx->fdata;
4223  maty = Tcl_GetMatrixPtr( interp, argv[1+2] );
4224  if (maty == NULL) return TCL_ERROR;
4225  y = maty->fdata;
4226  matz = Tcl_GetMatrixPtr( interp, argv[1+3] );
4227  if (matz == NULL) return TCL_ERROR;
4228  z = matz->fdata;
4229  code = atoi(argv[1+4]);
4230 
4231  plpoin3 ( n, x, y, z, code );
4232 
4233 
4234  if (pl_errcode != 0) {
4235  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4236  return TCL_ERROR;
4237  }
4238 
4239  plflush();
4240  return TCL_OK;
4241 }
4242 
4243 /*--------------------------------------------------------------------------*\
4244  * plpoly3Cmd
4245  *
4246  * Processes plpoly3 Tcl command.
4247 \*--------------------------------------------------------------------------*/
4248 
4249 static int
4250 plpoly3Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4251 {
4252  PLINT n;
4253  PLFLT *x;
4254  tclMatrix *matx;
4255  PLFLT *y;
4256  tclMatrix *maty;
4257  PLFLT *z;
4258  tclMatrix *matz;
4259  PLINT *draw;
4260  tclMatrix *matdraw;
4261  PLINT ifcc;
4262 
4263  pl_errcode = 0; errmsg[0] = '\0';
4264 
4265  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4266  Tcl_AppendResult( interp, "command syntax: \"",
4267  "plpoly3 n x y z draw ifcc", "\"",
4268  (char *) NULL);
4269  return TCL_ERROR;
4270  }
4271 
4272  if ( (!0 && 0 && (argc < (1 + 6 - 0))) ||
4273  (!0 && !0 && (argc != (6 + 1))) ||
4274  ( 0 && (argc != 1) && (argc != (6 + 1))) ) {
4275  Tcl_AppendResult( interp, "wrong # args: should be \"",
4276  "plpoly3 n x y z draw ifcc", "\"",
4277  (char *) NULL);
4278  return TCL_ERROR;
4279  }
4280 
4281  n = atoi(argv[1+0]);
4282  matx = Tcl_GetMatrixPtr( interp, argv[1+1] );
4283  if (matx == NULL) return TCL_ERROR;
4284  x = matx->fdata;
4285  maty = Tcl_GetMatrixPtr( interp, argv[1+2] );
4286  if (maty == NULL) return TCL_ERROR;
4287  y = maty->fdata;
4288  matz = Tcl_GetMatrixPtr( interp, argv[1+3] );
4289  if (matz == NULL) return TCL_ERROR;
4290  z = matz->fdata;
4291  matdraw = Tcl_GetMatrixPtr( interp, argv[1+4] );
4292  if (matdraw == NULL) return TCL_ERROR;
4293  draw = matdraw->idata;
4294  ifcc = atoi(argv[1+5]);
4295 
4296  plpoly3 ( n, x, y, z, draw, ifcc );
4297 
4298 
4299  if (pl_errcode != 0) {
4300  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4301  return TCL_ERROR;
4302  }
4303 
4304  plflush();
4305  return TCL_OK;
4306 }
4307 
4308 /*--------------------------------------------------------------------------*\
4309  * plprecCmd
4310  *
4311  * Processes plprec Tcl command.
4312 \*--------------------------------------------------------------------------*/
4313 
4314 static int
4315 plprecCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4316 {
4317  PLINT setp;
4318  PLINT prec;
4319 
4320  pl_errcode = 0; errmsg[0] = '\0';
4321 
4322  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4323  Tcl_AppendResult( interp, "command syntax: \"",
4324  "plprec setp prec", "\"",
4325  (char *) NULL);
4326  return TCL_ERROR;
4327  }
4328 
4329  if ( (!0 && 0 && (argc < (1 + 2 - 0))) ||
4330  (!0 && !0 && (argc != (2 + 1))) ||
4331  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
4332  Tcl_AppendResult( interp, "wrong # args: should be \"",
4333  "plprec setp prec", "\"",
4334  (char *) NULL);
4335  return TCL_ERROR;
4336  }
4337 
4338  setp = atoi(argv[1+0]);
4339  prec = atoi(argv[1+1]);
4340 
4341  plprec ( setp, prec );
4342 
4343 
4344  if (pl_errcode != 0) {
4345  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4346  return TCL_ERROR;
4347  }
4348 
4349  plflush();
4350  return TCL_OK;
4351 }
4352 
4353 /*--------------------------------------------------------------------------*\
4354  * plpstyCmd
4355  *
4356  * Processes plpsty Tcl command.
4357 \*--------------------------------------------------------------------------*/
4358 
4359 static int
4360 plpstyCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4361 {
4362  PLINT patt;
4363 
4364  pl_errcode = 0; errmsg[0] = '\0';
4365 
4366  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4367  Tcl_AppendResult( interp, "command syntax: \"",
4368  "plpsty patt", "\"",
4369  (char *) NULL);
4370  return TCL_ERROR;
4371  }
4372 
4373  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
4374  (!0 && !0 && (argc != (1 + 1))) ||
4375  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
4376  Tcl_AppendResult( interp, "wrong # args: should be \"",
4377  "plpsty patt", "\"",
4378  (char *) NULL);
4379  return TCL_ERROR;
4380  }
4381 
4382  patt = atoi(argv[1+0]);
4383 
4384  plpsty ( patt );
4385 
4386 
4387  if (pl_errcode != 0) {
4388  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4389  return TCL_ERROR;
4390  }
4391 
4392  plflush();
4393  return TCL_OK;
4394 }
4395 
4396 /*--------------------------------------------------------------------------*\
4397  * plptexCmd
4398  *
4399  * Processes plptex Tcl command.
4400 \*--------------------------------------------------------------------------*/
4401 
4402 static int
4403 plptexCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4404 {
4405  PLFLT x;
4406  PLFLT y;
4407  PLFLT dx;
4408  PLFLT dy;
4409  PLFLT just;
4410  const char *text;
4411 
4412  pl_errcode = 0; errmsg[0] = '\0';
4413 
4414  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4415  Tcl_AppendResult( interp, "command syntax: \"",
4416  "plptex x y dx dy just text", "\"",
4417  (char *) NULL);
4418  return TCL_ERROR;
4419  }
4420 
4421  if ( (!0 && 0 && (argc < (1 + 6 - 0))) ||
4422  (!0 && !0 && (argc != (6 + 1))) ||
4423  ( 0 && (argc != 1) && (argc != (6 + 1))) ) {
4424  Tcl_AppendResult( interp, "wrong # args: should be \"",
4425  "plptex x y dx dy just text", "\"",
4426  (char *) NULL);
4427  return TCL_ERROR;
4428  }
4429 
4430  x = atof(argv[1+0]);
4431  y = atof(argv[1+1]);
4432  dx = atof(argv[1+2]);
4433  dy = atof(argv[1+3]);
4434  just = atof(argv[1+4]);
4435  text = argv[1+5];
4436 
4437  plptex ( x, y, dx, dy, just, text );
4438 
4439 
4440  if (pl_errcode != 0) {
4441  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4442  return TCL_ERROR;
4443  }
4444 
4445  plflush();
4446  return TCL_OK;
4447 }
4448 
4449 /*--------------------------------------------------------------------------*\
4450  * plptex3Cmd
4451  *
4452  * Processes plptex3 Tcl command.
4453 \*--------------------------------------------------------------------------*/
4454 
4455 static int
4456 plptex3Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4457 {
4458  PLFLT wx;
4459  PLFLT wy;
4460  PLFLT wz;
4461  PLFLT dx;
4462  PLFLT dy;
4463  PLFLT dz;
4464  PLFLT sx;
4465  PLFLT sy;
4466  PLFLT sz;
4467  PLFLT just;
4468  const char *text;
4469 
4470  pl_errcode = 0; errmsg[0] = '\0';
4471 
4472  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4473  Tcl_AppendResult( interp, "command syntax: \"",
4474  "plptex3 wx wy wz dx dy dz sx sy sz just text", "\"",
4475  (char *) NULL);
4476  return TCL_ERROR;
4477  }
4478 
4479  if ( (!0 && 0 && (argc < (1 + 11 - 0))) ||
4480  (!0 && !0 && (argc != (11 + 1))) ||
4481  ( 0 && (argc != 1) && (argc != (11 + 1))) ) {
4482  Tcl_AppendResult( interp, "wrong # args: should be \"",
4483  "plptex3 wx wy wz dx dy dz sx sy sz just text", "\"",
4484  (char *) NULL);
4485  return TCL_ERROR;
4486  }
4487 
4488  wx = atof(argv[1+0]);
4489  wy = atof(argv[1+1]);
4490  wz = atof(argv[1+2]);
4491  dx = atof(argv[1+3]);
4492  dy = atof(argv[1+4]);
4493  dz = atof(argv[1+5]);
4494  sx = atof(argv[1+6]);
4495  sy = atof(argv[1+7]);
4496  sz = atof(argv[1+8]);
4497  just = atof(argv[1+9]);
4498  text = argv[1+10];
4499 
4500  plptex3 ( wx, wy, wz, dx, dy, dz, sx, sy, sz, just, text );
4501 
4502 
4503  if (pl_errcode != 0) {
4504  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4505  return TCL_ERROR;
4506  }
4507 
4508  plflush();
4509  return TCL_OK;
4510 }
4511 
4512 /*--------------------------------------------------------------------------*\
4513  * plreplotCmd
4514  *
4515  * Processes plreplot Tcl command.
4516 \*--------------------------------------------------------------------------*/
4517 
4518 static int
4519 plreplotCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4520 {
4521 
4522  pl_errcode = 0; errmsg[0] = '\0';
4523 
4524  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4525  Tcl_AppendResult( interp, "command syntax: \"",
4526  "plreplot ", "\"",
4527  (char *) NULL);
4528  return TCL_ERROR;
4529  }
4530 
4531  if ( (!0 && 0 && (argc < (1 + 0 - 0))) ||
4532  (!0 && !0 && (argc != (0 + 1))) ||
4533  ( 0 && (argc != 1) && (argc != (0 + 1))) ) {
4534  Tcl_AppendResult( interp, "wrong # args: should be \"",
4535  "plreplot ", "\"",
4536  (char *) NULL);
4537  return TCL_ERROR;
4538  }
4539 
4540 
4541  plreplot ( );
4542 
4543 
4544  if (pl_errcode != 0) {
4545  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4546  return TCL_ERROR;
4547  }
4548 
4549  plflush();
4550  return TCL_OK;
4551 }
4552 
4553 /*--------------------------------------------------------------------------*\
4554  * plrgbhlsCmd
4555  *
4556  * Processes plrgbhls Tcl command.
4557 \*--------------------------------------------------------------------------*/
4558 
4559 static int
4560 plrgbhlsCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4561 {
4562  PLFLT r;
4563  PLFLT g;
4564  PLFLT b;
4565  PLFLT h;
4566  PLFLT l;
4567  PLFLT s;
4568 
4569  pl_errcode = 0; errmsg[0] = '\0';
4570 
4571  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4572  Tcl_AppendResult( interp, "command syntax: \"",
4573  "plrgbhls ?r g b h l s?", "\"",
4574  (char *) NULL);
4575  return TCL_ERROR;
4576  }
4577 
4578  if ( (!1 && 0 && (argc < (1 + 6 - 0))) ||
4579  (!1 && !0 && (argc != (6 + 1))) ||
4580  ( 1 && (argc != 1) && (argc != (6 + 1))) ) {
4581  Tcl_AppendResult( interp, "wrong # args: should be \"",
4582  "plrgbhls ?r g b h l s?", "\"",
4583  (char *) NULL);
4584  return TCL_ERROR;
4585  }
4586 
4587  r = atof(argv[1+0]);
4588  g = atof(argv[1+1]);
4589  b = atof(argv[1+2]);
4590 /* h is for output. */
4591 /* l is for output. */
4592 /* s is for output. */
4593 
4594  plrgbhls ( r, g, b, &h, &l, &s );
4595 
4596  if (argc == 1)
4597  Tcl_AppendResult( interp, " ", (char *) NULL );
4598  Tcl_PrintDouble( interp, h, buf );
4599  if (argc > 1)
4600  Tcl_SetVar( interp, argv[1+3], buf, 0 );
4601  else
4602  Tcl_AppendResult( interp, buf, (char *) NULL );
4603  if (argc == 1)
4604  Tcl_AppendResult( interp, " ", (char *) NULL );
4605  Tcl_PrintDouble( interp, l, buf );
4606  if (argc > 1)
4607  Tcl_SetVar( interp, argv[1+4], buf, 0 );
4608  else
4609  Tcl_AppendResult( interp, buf, (char *) NULL );
4610  if (argc == 1)
4611  Tcl_AppendResult( interp, " ", (char *) NULL );
4612  Tcl_PrintDouble( interp, s, buf );
4613  if (argc > 1)
4614  Tcl_SetVar( interp, argv[1+5], buf, 0 );
4615  else
4616  Tcl_AppendResult( interp, buf, (char *) NULL );
4617 
4618  if (pl_errcode != 0) {
4619  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4620  return TCL_ERROR;
4621  }
4622 
4623  plflush();
4624  return TCL_OK;
4625 }
4626 
4627 /*--------------------------------------------------------------------------*\
4628  * plschrCmd
4629  *
4630  * Processes plschr Tcl command.
4631 \*--------------------------------------------------------------------------*/
4632 
4633 static int
4634 plschrCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4635 {
4636  PLFLT def;
4637  PLFLT scale;
4638 
4639  pl_errcode = 0; errmsg[0] = '\0';
4640 
4641  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4642  Tcl_AppendResult( interp, "command syntax: \"",
4643  "plschr def scale", "\"",
4644  (char *) NULL);
4645  return TCL_ERROR;
4646  }
4647 
4648  if ( (!0 && 0 && (argc < (1 + 2 - 0))) ||
4649  (!0 && !0 && (argc != (2 + 1))) ||
4650  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
4651  Tcl_AppendResult( interp, "wrong # args: should be \"",
4652  "plschr def scale", "\"",
4653  (char *) NULL);
4654  return TCL_ERROR;
4655  }
4656 
4657  def = atof(argv[1+0]);
4658  scale = atof(argv[1+1]);
4659 
4660  plschr ( def, scale );
4661 
4662 
4663  if (pl_errcode != 0) {
4664  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4665  return TCL_ERROR;
4666  }
4667 
4668  plflush();
4669  return TCL_OK;
4670 }
4671 
4672 /*--------------------------------------------------------------------------*\
4673  * plscmap0Cmd
4674  *
4675  * Processes plscmap0 Tcl command.
4676 \*--------------------------------------------------------------------------*/
4677 
4678 static int
4679 plscmap0Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4680 {
4681  PLINT *r;
4682  tclMatrix *matr;
4683  PLINT *g;
4684  tclMatrix *matg;
4685  PLINT *b;
4686  tclMatrix *matb;
4687  PLINT ncol0;
4688 
4689  pl_errcode = 0; errmsg[0] = '\0';
4690 
4691  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4692  Tcl_AppendResult( interp, "command syntax: \"",
4693  "plscmap0 r g b ncol0", "\"",
4694  (char *) NULL);
4695  return TCL_ERROR;
4696  }
4697 
4698  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
4699  (!0 && !0 && (argc != (4 + 1))) ||
4700  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
4701  Tcl_AppendResult( interp, "wrong # args: should be \"",
4702  "plscmap0 r g b ncol0", "\"",
4703  (char *) NULL);
4704  return TCL_ERROR;
4705  }
4706 
4707  matr = Tcl_GetMatrixPtr( interp, argv[1+0] );
4708  if (matr == NULL) return TCL_ERROR;
4709  r = matr->idata;
4710  matg = Tcl_GetMatrixPtr( interp, argv[1+1] );
4711  if (matg == NULL) return TCL_ERROR;
4712  g = matg->idata;
4713  matb = Tcl_GetMatrixPtr( interp, argv[1+2] );
4714  if (matb == NULL) return TCL_ERROR;
4715  b = matb->idata;
4716  ncol0 = atoi(argv[1+3]);
4717 
4718  plscmap0 ( r, g, b, ncol0 );
4719 
4720 
4721  if (pl_errcode != 0) {
4722  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4723  return TCL_ERROR;
4724  }
4725 
4726  plflush();
4727  return TCL_OK;
4728 }
4729 
4730 /*--------------------------------------------------------------------------*\
4731  * plscmap0aCmd
4732  *
4733  * Processes plscmap0a Tcl command.
4734 \*--------------------------------------------------------------------------*/
4735 
4736 static int
4737 plscmap0aCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4738 {
4739  PLINT *r;
4740  tclMatrix *matr;
4741  PLINT *g;
4742  tclMatrix *matg;
4743  PLINT *b;
4744  tclMatrix *matb;
4745  PLFLT *a;
4746  tclMatrix *mata;
4747  PLINT ncol0;
4748 
4749  pl_errcode = 0; errmsg[0] = '\0';
4750 
4751  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4752  Tcl_AppendResult( interp, "command syntax: \"",
4753  "plscmap0a r g b a ncol0", "\"",
4754  (char *) NULL);
4755  return TCL_ERROR;
4756  }
4757 
4758  if ( (!0 && 0 && (argc < (1 + 5 - 0))) ||
4759  (!0 && !0 && (argc != (5 + 1))) ||
4760  ( 0 && (argc != 1) && (argc != (5 + 1))) ) {
4761  Tcl_AppendResult( interp, "wrong # args: should be \"",
4762  "plscmap0a r g b a ncol0", "\"",
4763  (char *) NULL);
4764  return TCL_ERROR;
4765  }
4766 
4767  matr = Tcl_GetMatrixPtr( interp, argv[1+0] );
4768  if (matr == NULL) return TCL_ERROR;
4769  r = matr->idata;
4770  matg = Tcl_GetMatrixPtr( interp, argv[1+1] );
4771  if (matg == NULL) return TCL_ERROR;
4772  g = matg->idata;
4773  matb = Tcl_GetMatrixPtr( interp, argv[1+2] );
4774  if (matb == NULL) return TCL_ERROR;
4775  b = matb->idata;
4776  mata = Tcl_GetMatrixPtr( interp, argv[1+3] );
4777  if (mata == NULL) return TCL_ERROR;
4778  a = mata->fdata;
4779  ncol0 = atoi(argv[1+4]);
4780 
4781  plscmap0a ( r, g, b, a, ncol0 );
4782 
4783 
4784  if (pl_errcode != 0) {
4785  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4786  return TCL_ERROR;
4787  }
4788 
4789  plflush();
4790  return TCL_OK;
4791 }
4792 
4793 /*--------------------------------------------------------------------------*\
4794  * plscmap0nCmd
4795  *
4796  * Processes plscmap0n Tcl command.
4797 \*--------------------------------------------------------------------------*/
4798 
4799 static int
4800 plscmap0nCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4801 {
4802  PLINT ncol0;
4803 
4804  pl_errcode = 0; errmsg[0] = '\0';
4805 
4806  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4807  Tcl_AppendResult( interp, "command syntax: \"",
4808  "plscmap0n ncol0", "\"",
4809  (char *) NULL);
4810  return TCL_ERROR;
4811  }
4812 
4813  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
4814  (!0 && !0 && (argc != (1 + 1))) ||
4815  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
4816  Tcl_AppendResult( interp, "wrong # args: should be \"",
4817  "plscmap0n ncol0", "\"",
4818  (char *) NULL);
4819  return TCL_ERROR;
4820  }
4821 
4822  ncol0 = atoi(argv[1+0]);
4823 
4824  plscmap0n ( ncol0 );
4825 
4826 
4827  if (pl_errcode != 0) {
4828  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4829  return TCL_ERROR;
4830  }
4831 
4832  plflush();
4833  return TCL_OK;
4834 }
4835 
4836 /*--------------------------------------------------------------------------*\
4837  * plscmap1Cmd
4838  *
4839  * Processes plscmap1 Tcl command.
4840 \*--------------------------------------------------------------------------*/
4841 
4842 static int
4843 plscmap1Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4844 {
4845  PLINT *r;
4846  tclMatrix *matr;
4847  PLINT *g;
4848  tclMatrix *matg;
4849  PLINT *b;
4850  tclMatrix *matb;
4851  PLINT ncol1;
4852 
4853  pl_errcode = 0; errmsg[0] = '\0';
4854 
4855  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4856  Tcl_AppendResult( interp, "command syntax: \"",
4857  "plscmap1 r g b ncol1", "\"",
4858  (char *) NULL);
4859  return TCL_ERROR;
4860  }
4861 
4862  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
4863  (!0 && !0 && (argc != (4 + 1))) ||
4864  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
4865  Tcl_AppendResult( interp, "wrong # args: should be \"",
4866  "plscmap1 r g b ncol1", "\"",
4867  (char *) NULL);
4868  return TCL_ERROR;
4869  }
4870 
4871  matr = Tcl_GetMatrixPtr( interp, argv[1+0] );
4872  if (matr == NULL) return TCL_ERROR;
4873  r = matr->idata;
4874  matg = Tcl_GetMatrixPtr( interp, argv[1+1] );
4875  if (matg == NULL) return TCL_ERROR;
4876  g = matg->idata;
4877  matb = Tcl_GetMatrixPtr( interp, argv[1+2] );
4878  if (matb == NULL) return TCL_ERROR;
4879  b = matb->idata;
4880  ncol1 = atoi(argv[1+3]);
4881 
4882  plscmap1 ( r, g, b, ncol1 );
4883 
4884 
4885  if (pl_errcode != 0) {
4886  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4887  return TCL_ERROR;
4888  }
4889 
4890  plflush();
4891  return TCL_OK;
4892 }
4893 
4894 /*--------------------------------------------------------------------------*\
4895  * plscmap1aCmd
4896  *
4897  * Processes plscmap1a Tcl command.
4898 \*--------------------------------------------------------------------------*/
4899 
4900 static int
4901 plscmap1aCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4902 {
4903  PLINT *r;
4904  tclMatrix *matr;
4905  PLINT *g;
4906  tclMatrix *matg;
4907  PLINT *b;
4908  tclMatrix *matb;
4909  PLFLT *a;
4910  tclMatrix *mata;
4911  PLINT ncol1;
4912 
4913  pl_errcode = 0; errmsg[0] = '\0';
4914 
4915  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4916  Tcl_AppendResult( interp, "command syntax: \"",
4917  "plscmap1a r g b a ncol1", "\"",
4918  (char *) NULL);
4919  return TCL_ERROR;
4920  }
4921 
4922  if ( (!0 && 0 && (argc < (1 + 5 - 0))) ||
4923  (!0 && !0 && (argc != (5 + 1))) ||
4924  ( 0 && (argc != 1) && (argc != (5 + 1))) ) {
4925  Tcl_AppendResult( interp, "wrong # args: should be \"",
4926  "plscmap1a r g b a ncol1", "\"",
4927  (char *) NULL);
4928  return TCL_ERROR;
4929  }
4930 
4931  matr = Tcl_GetMatrixPtr( interp, argv[1+0] );
4932  if (matr == NULL) return TCL_ERROR;
4933  r = matr->idata;
4934  matg = Tcl_GetMatrixPtr( interp, argv[1+1] );
4935  if (matg == NULL) return TCL_ERROR;
4936  g = matg->idata;
4937  matb = Tcl_GetMatrixPtr( interp, argv[1+2] );
4938  if (matb == NULL) return TCL_ERROR;
4939  b = matb->idata;
4940  mata = Tcl_GetMatrixPtr( interp, argv[1+3] );
4941  if (mata == NULL) return TCL_ERROR;
4942  a = mata->fdata;
4943  ncol1 = atoi(argv[1+4]);
4944 
4945  plscmap1a ( r, g, b, a, ncol1 );
4946 
4947 
4948  if (pl_errcode != 0) {
4949  Tcl_AppendResult(interp, errmsg, (char *) NULL);
4950  return TCL_ERROR;
4951  }
4952 
4953  plflush();
4954  return TCL_OK;
4955 }
4956 
4957 /*--------------------------------------------------------------------------*\
4958  * plscmap1lCmd
4959  *
4960  * Processes plscmap1l Tcl command.
4961 \*--------------------------------------------------------------------------*/
4962 
4963 static int
4964 plscmap1lCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
4965 {
4966  PLINT itype;
4967  PLINT npts;
4968  PLFLT *intensity;
4969  tclMatrix *matintensity;
4970  PLFLT *coord1;
4971  tclMatrix *matcoord1;
4972  PLFLT *coord2;
4973  tclMatrix *matcoord2;
4974  PLFLT *coord3;
4975  tclMatrix *matcoord3;
4976  PLINT *alt_hue_path;
4977  tclMatrix *matalt_hue_path;
4978 
4979  pl_errcode = 0; errmsg[0] = '\0';
4980 
4981  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
4982  Tcl_AppendResult( interp, "command syntax: \"",
4983  "plscmap1l itype npts intensity coord1 coord2 coord3 alt_hue_path", "\"",
4984  (char *) NULL);
4985  return TCL_ERROR;
4986  }
4987 
4988  if ( (!0 && 0 && (argc < (1 + 7 - 0))) ||
4989  (!0 && !0 && (argc != (7 + 1))) ||
4990  ( 0 && (argc != 1) && (argc != (7 + 1))) ) {
4991  Tcl_AppendResult( interp, "wrong # args: should be \"",
4992  "plscmap1l itype npts intensity coord1 coord2 coord3 alt_hue_path", "\"",
4993  (char *) NULL);
4994  return TCL_ERROR;
4995  }
4996 
4997  itype = atoi(argv[1+0]);
4998  npts = atoi(argv[1+1]);
4999  matintensity = Tcl_GetMatrixPtr( interp, argv[1+2] );
5000  if (matintensity == NULL) return TCL_ERROR;
5001  intensity = matintensity->fdata;
5002  matcoord1 = Tcl_GetMatrixPtr( interp, argv[1+3] );
5003  if (matcoord1 == NULL) return TCL_ERROR;
5004  coord1 = matcoord1->fdata;
5005  matcoord2 = Tcl_GetMatrixPtr( interp, argv[1+4] );
5006  if (matcoord2 == NULL) return TCL_ERROR;
5007  coord2 = matcoord2->fdata;
5008  matcoord3 = Tcl_GetMatrixPtr( interp, argv[1+5] );
5009  if (matcoord3 == NULL) return TCL_ERROR;
5010  coord3 = matcoord3->fdata;
5011  matalt_hue_path = Tcl_GetMatrixPtr( interp, argv[1+6] );
5012  if (matalt_hue_path == NULL) return TCL_ERROR;
5013  alt_hue_path = matalt_hue_path->idata;
5014 
5015  plscmap1l ( itype, npts, intensity, coord1, coord2, coord3, alt_hue_path );
5016 
5017 
5018  if (pl_errcode != 0) {
5019  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5020  return TCL_ERROR;
5021  }
5022 
5023  plflush();
5024  return TCL_OK;
5025 }
5026 
5027 /*--------------------------------------------------------------------------*\
5028  * plscmap1laCmd
5029  *
5030  * Processes plscmap1la Tcl command.
5031 \*--------------------------------------------------------------------------*/
5032 
5033 static int
5034 plscmap1laCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5035 {
5036  PLINT itype;
5037  PLINT npts;
5038  PLFLT *intensity;
5039  tclMatrix *matintensity;
5040  PLFLT *coord1;
5041  tclMatrix *matcoord1;
5042  PLFLT *coord2;
5043  tclMatrix *matcoord2;
5044  PLFLT *coord3;
5045  tclMatrix *matcoord3;
5046  PLFLT *a;
5047  tclMatrix *mata;
5048  PLINT *alt_hue_path;
5049  tclMatrix *matalt_hue_path;
5050 
5051  pl_errcode = 0; errmsg[0] = '\0';
5052 
5053  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5054  Tcl_AppendResult( interp, "command syntax: \"",
5055  "plscmap1la itype npts intensity coord1 coord2 coord3 a alt_hue_path", "\"",
5056  (char *) NULL);
5057  return TCL_ERROR;
5058  }
5059 
5060  if ( (!0 && 0 && (argc < (1 + 8 - 0))) ||
5061  (!0 && !0 && (argc != (8 + 1))) ||
5062  ( 0 && (argc != 1) && (argc != (8 + 1))) ) {
5063  Tcl_AppendResult( interp, "wrong # args: should be \"",
5064  "plscmap1la itype npts intensity coord1 coord2 coord3 a alt_hue_path", "\"",
5065  (char *) NULL);
5066  return TCL_ERROR;
5067  }
5068 
5069  itype = atoi(argv[1+0]);
5070  npts = atoi(argv[1+1]);
5071  matintensity = Tcl_GetMatrixPtr( interp, argv[1+2] );
5072  if (matintensity == NULL) return TCL_ERROR;
5073  intensity = matintensity->fdata;
5074  matcoord1 = Tcl_GetMatrixPtr( interp, argv[1+3] );
5075  if (matcoord1 == NULL) return TCL_ERROR;
5076  coord1 = matcoord1->fdata;
5077  matcoord2 = Tcl_GetMatrixPtr( interp, argv[1+4] );
5078  if (matcoord2 == NULL) return TCL_ERROR;
5079  coord2 = matcoord2->fdata;
5080  matcoord3 = Tcl_GetMatrixPtr( interp, argv[1+5] );
5081  if (matcoord3 == NULL) return TCL_ERROR;
5082  coord3 = matcoord3->fdata;
5083  mata = Tcl_GetMatrixPtr( interp, argv[1+6] );
5084  if (mata == NULL) return TCL_ERROR;
5085  a = mata->fdata;
5086  matalt_hue_path = Tcl_GetMatrixPtr( interp, argv[1+7] );
5087  if (matalt_hue_path == NULL) return TCL_ERROR;
5088  alt_hue_path = matalt_hue_path->idata;
5089 
5090  plscmap1la ( itype, npts, intensity, coord1, coord2, coord3, a, alt_hue_path );
5091 
5092 
5093  if (pl_errcode != 0) {
5094  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5095  return TCL_ERROR;
5096  }
5097 
5098  plflush();
5099  return TCL_OK;
5100 }
5101 
5102 /*--------------------------------------------------------------------------*\
5103  * plscmap1nCmd
5104  *
5105  * Processes plscmap1n Tcl command.
5106 \*--------------------------------------------------------------------------*/
5107 
5108 static int
5109 plscmap1nCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5110 {
5111  PLINT ncol1;
5112 
5113  pl_errcode = 0; errmsg[0] = '\0';
5114 
5115  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5116  Tcl_AppendResult( interp, "command syntax: \"",
5117  "plscmap1n ncol1", "\"",
5118  (char *) NULL);
5119  return TCL_ERROR;
5120  }
5121 
5122  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
5123  (!0 && !0 && (argc != (1 + 1))) ||
5124  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
5125  Tcl_AppendResult( interp, "wrong # args: should be \"",
5126  "plscmap1n ncol1", "\"",
5127  (char *) NULL);
5128  return TCL_ERROR;
5129  }
5130 
5131  ncol1 = atoi(argv[1+0]);
5132 
5133  plscmap1n ( ncol1 );
5134 
5135 
5136  if (pl_errcode != 0) {
5137  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5138  return TCL_ERROR;
5139  }
5140 
5141  plflush();
5142  return TCL_OK;
5143 }
5144 
5145 /*--------------------------------------------------------------------------*\
5146  * plscmap1_rangeCmd
5147  *
5148  * Processes plscmap1_range Tcl command.
5149 \*--------------------------------------------------------------------------*/
5150 
5151 static int
5152 plscmap1_rangeCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5153 {
5154  PLFLT min_color;
5155  PLFLT max_color;
5156 
5157  pl_errcode = 0; errmsg[0] = '\0';
5158 
5159  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5160  Tcl_AppendResult( interp, "command syntax: \"",
5161  "plscmap1_range min_color max_color", "\"",
5162  (char *) NULL);
5163  return TCL_ERROR;
5164  }
5165 
5166  if ( (!0 && 0 && (argc < (1 + 2 - 0))) ||
5167  (!0 && !0 && (argc != (2 + 1))) ||
5168  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
5169  Tcl_AppendResult( interp, "wrong # args: should be \"",
5170  "plscmap1_range min_color max_color", "\"",
5171  (char *) NULL);
5172  return TCL_ERROR;
5173  }
5174 
5175  min_color = atof(argv[1+0]);
5176  max_color = atof(argv[1+1]);
5177 
5178  plscmap1_range ( min_color, max_color );
5179 
5180 
5181  if (pl_errcode != 0) {
5182  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5183  return TCL_ERROR;
5184  }
5185 
5186  plflush();
5187  return TCL_OK;
5188 }
5189 
5190 /*--------------------------------------------------------------------------*\
5191  * plscol0Cmd
5192  *
5193  * Processes plscol0 Tcl command.
5194 \*--------------------------------------------------------------------------*/
5195 
5196 static int
5197 plscol0Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5198 {
5199  PLINT icol0;
5200  PLINT r;
5201  PLINT g;
5202  PLINT b;
5203 
5204  pl_errcode = 0; errmsg[0] = '\0';
5205 
5206  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5207  Tcl_AppendResult( interp, "command syntax: \"",
5208  "plscol0 icol0 r g b", "\"",
5209  (char *) NULL);
5210  return TCL_ERROR;
5211  }
5212 
5213  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
5214  (!0 && !0 && (argc != (4 + 1))) ||
5215  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
5216  Tcl_AppendResult( interp, "wrong # args: should be \"",
5217  "plscol0 icol0 r g b", "\"",
5218  (char *) NULL);
5219  return TCL_ERROR;
5220  }
5221 
5222  icol0 = atoi(argv[1+0]);
5223  r = atoi(argv[1+1]);
5224  g = atoi(argv[1+2]);
5225  b = atoi(argv[1+3]);
5226 
5227  plscol0 ( icol0, r, g, b );
5228 
5229 
5230  if (pl_errcode != 0) {
5231  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5232  return TCL_ERROR;
5233  }
5234 
5235  plflush();
5236  return TCL_OK;
5237 }
5238 
5239 /*--------------------------------------------------------------------------*\
5240  * plscol0aCmd
5241  *
5242  * Processes plscol0a Tcl command.
5243 \*--------------------------------------------------------------------------*/
5244 
5245 static int
5246 plscol0aCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5247 {
5248  PLINT icol0;
5249  PLINT r;
5250  PLINT g;
5251  PLINT b;
5252  PLFLT a;
5253 
5254  pl_errcode = 0; errmsg[0] = '\0';
5255 
5256  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5257  Tcl_AppendResult( interp, "command syntax: \"",
5258  "plscol0a icol0 r g b a", "\"",
5259  (char *) NULL);
5260  return TCL_ERROR;
5261  }
5262 
5263  if ( (!0 && 0 && (argc < (1 + 5 - 0))) ||
5264  (!0 && !0 && (argc != (5 + 1))) ||
5265  ( 0 && (argc != 1) && (argc != (5 + 1))) ) {
5266  Tcl_AppendResult( interp, "wrong # args: should be \"",
5267  "plscol0a icol0 r g b a", "\"",
5268  (char *) NULL);
5269  return TCL_ERROR;
5270  }
5271 
5272  icol0 = atoi(argv[1+0]);
5273  r = atoi(argv[1+1]);
5274  g = atoi(argv[1+2]);
5275  b = atoi(argv[1+3]);
5276  a = atof(argv[1+4]);
5277 
5278  plscol0a ( icol0, r, g, b, a );
5279 
5280 
5281  if (pl_errcode != 0) {
5282  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5283  return TCL_ERROR;
5284  }
5285 
5286  plflush();
5287  return TCL_OK;
5288 }
5289 
5290 /*--------------------------------------------------------------------------*\
5291  * plscolbgCmd
5292  *
5293  * Processes plscolbg Tcl command.
5294 \*--------------------------------------------------------------------------*/
5295 
5296 static int
5297 plscolbgCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5298 {
5299  PLINT r;
5300  PLINT g;
5301  PLINT b;
5302 
5303  pl_errcode = 0; errmsg[0] = '\0';
5304 
5305  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5306  Tcl_AppendResult( interp, "command syntax: \"",
5307  "plscolbg r g b", "\"",
5308  (char *) NULL);
5309  return TCL_ERROR;
5310  }
5311 
5312  if ( (!0 && 0 && (argc < (1 + 3 - 0))) ||
5313  (!0 && !0 && (argc != (3 + 1))) ||
5314  ( 0 && (argc != 1) && (argc != (3 + 1))) ) {
5315  Tcl_AppendResult( interp, "wrong # args: should be \"",
5316  "plscolbg r g b", "\"",
5317  (char *) NULL);
5318  return TCL_ERROR;
5319  }
5320 
5321  r = atoi(argv[1+0]);
5322  g = atoi(argv[1+1]);
5323  b = atoi(argv[1+2]);
5324 
5325  plscolbg ( r, g, b );
5326 
5327 
5328  if (pl_errcode != 0) {
5329  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5330  return TCL_ERROR;
5331  }
5332 
5333  plflush();
5334  return TCL_OK;
5335 }
5336 
5337 /*--------------------------------------------------------------------------*\
5338  * plscolbgaCmd
5339  *
5340  * Processes plscolbga Tcl command.
5341 \*--------------------------------------------------------------------------*/
5342 
5343 static int
5344 plscolbgaCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5345 {
5346  PLINT r;
5347  PLINT g;
5348  PLINT b;
5349  PLFLT a;
5350 
5351  pl_errcode = 0; errmsg[0] = '\0';
5352 
5353  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5354  Tcl_AppendResult( interp, "command syntax: \"",
5355  "plscolbga r g b a", "\"",
5356  (char *) NULL);
5357  return TCL_ERROR;
5358  }
5359 
5360  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
5361  (!0 && !0 && (argc != (4 + 1))) ||
5362  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
5363  Tcl_AppendResult( interp, "wrong # args: should be \"",
5364  "plscolbga r g b a", "\"",
5365  (char *) NULL);
5366  return TCL_ERROR;
5367  }
5368 
5369  r = atoi(argv[1+0]);
5370  g = atoi(argv[1+1]);
5371  b = atoi(argv[1+2]);
5372  a = atof(argv[1+3]);
5373 
5374  plscolbga ( r, g, b, a );
5375 
5376 
5377  if (pl_errcode != 0) {
5378  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5379  return TCL_ERROR;
5380  }
5381 
5382  plflush();
5383  return TCL_OK;
5384 }
5385 
5386 /*--------------------------------------------------------------------------*\
5387  * plscolorCmd
5388  *
5389  * Processes plscolor Tcl command.
5390 \*--------------------------------------------------------------------------*/
5391 
5392 static int
5393 plscolorCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5394 {
5395  PLINT color;
5396 
5397  pl_errcode = 0; errmsg[0] = '\0';
5398 
5399  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5400  Tcl_AppendResult( interp, "command syntax: \"",
5401  "plscolor color", "\"",
5402  (char *) NULL);
5403  return TCL_ERROR;
5404  }
5405 
5406  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
5407  (!0 && !0 && (argc != (1 + 1))) ||
5408  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
5409  Tcl_AppendResult( interp, "wrong # args: should be \"",
5410  "plscolor color", "\"",
5411  (char *) NULL);
5412  return TCL_ERROR;
5413  }
5414 
5415  color = atoi(argv[1+0]);
5416 
5417  plscolor ( color );
5418 
5419 
5420  if (pl_errcode != 0) {
5421  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5422  return TCL_ERROR;
5423  }
5424 
5425  plflush();
5426  return TCL_OK;
5427 }
5428 
5429 /*--------------------------------------------------------------------------*\
5430  * plscompressionCmd
5431  *
5432  * Processes plscompression Tcl command.
5433 \*--------------------------------------------------------------------------*/
5434 
5435 static int
5436 plscompressionCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5437 {
5438  PLINT compression;
5439 
5440  pl_errcode = 0; errmsg[0] = '\0';
5441 
5442  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5443  Tcl_AppendResult( interp, "command syntax: \"",
5444  "plscompression compression", "\"",
5445  (char *) NULL);
5446  return TCL_ERROR;
5447  }
5448 
5449  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
5450  (!0 && !0 && (argc != (1 + 1))) ||
5451  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
5452  Tcl_AppendResult( interp, "wrong # args: should be \"",
5453  "plscompression compression", "\"",
5454  (char *) NULL);
5455  return TCL_ERROR;
5456  }
5457 
5458  compression = atoi(argv[1+0]);
5459 
5460  plscompression ( compression );
5461 
5462 
5463  if (pl_errcode != 0) {
5464  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5465  return TCL_ERROR;
5466  }
5467 
5468  plflush();
5469  return TCL_OK;
5470 }
5471 
5472 /*--------------------------------------------------------------------------*\
5473  * plsdevCmd
5474  *
5475  * Processes plsdev Tcl command.
5476 \*--------------------------------------------------------------------------*/
5477 
5478 static int
5479 plsdevCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5480 {
5481  const char *devnam;
5482 
5483  pl_errcode = 0; errmsg[0] = '\0';
5484 
5485  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5486  Tcl_AppendResult( interp, "command syntax: \"",
5487  "plsdev devnam", "\"",
5488  (char *) NULL);
5489  return TCL_ERROR;
5490  }
5491 
5492  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
5493  (!0 && !0 && (argc != (1 + 1))) ||
5494  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
5495  Tcl_AppendResult( interp, "wrong # args: should be \"",
5496  "plsdev devnam", "\"",
5497  (char *) NULL);
5498  return TCL_ERROR;
5499  }
5500 
5501  devnam = argv[1+0];
5502 
5503  plsdev ( devnam );
5504 
5505 
5506  if (pl_errcode != 0) {
5507  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5508  return TCL_ERROR;
5509  }
5510 
5511  plflush();
5512  return TCL_OK;
5513 }
5514 
5515 /*--------------------------------------------------------------------------*\
5516  * plsdidevCmd
5517  *
5518  * Processes plsdidev Tcl command.
5519 \*--------------------------------------------------------------------------*/
5520 
5521 static int
5522 plsdidevCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5523 {
5524  PLFLT mar;
5525  PLFLT aspect;
5526  PLFLT jx;
5527  PLFLT jy;
5528 
5529  pl_errcode = 0; errmsg[0] = '\0';
5530 
5531  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5532  Tcl_AppendResult( interp, "command syntax: \"",
5533  "plsdidev mar aspect jx jy", "\"",
5534  (char *) NULL);
5535  return TCL_ERROR;
5536  }
5537 
5538  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
5539  (!0 && !0 && (argc != (4 + 1))) ||
5540  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
5541  Tcl_AppendResult( interp, "wrong # args: should be \"",
5542  "plsdidev mar aspect jx jy", "\"",
5543  (char *) NULL);
5544  return TCL_ERROR;
5545  }
5546 
5547  mar = atof(argv[1+0]);
5548  aspect = atof(argv[1+1]);
5549  jx = atof(argv[1+2]);
5550  jy = atof(argv[1+3]);
5551 
5552  plsdidev ( mar, aspect, jx, jy );
5553 
5554 
5555  if (pl_errcode != 0) {
5556  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5557  return TCL_ERROR;
5558  }
5559 
5560  plflush();
5561  return TCL_OK;
5562 }
5563 
5564 /*--------------------------------------------------------------------------*\
5565  * plsdimapCmd
5566  *
5567  * Processes plsdimap Tcl command.
5568 \*--------------------------------------------------------------------------*/
5569 
5570 static int
5571 plsdimapCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5572 {
5573  PLINT dimxmin;
5574  PLINT dimxmax;
5575  PLINT dimymin;
5576  PLINT dimymax;
5577  PLFLT dimxpmm;
5578  PLFLT dimypmm;
5579 
5580  pl_errcode = 0; errmsg[0] = '\0';
5581 
5582  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5583  Tcl_AppendResult( interp, "command syntax: \"",
5584  "plsdimap dimxmin dimxmax dimymin dimymax dimxpmm dimypmm", "\"",
5585  (char *) NULL);
5586  return TCL_ERROR;
5587  }
5588 
5589  if ( (!0 && 0 && (argc < (1 + 6 - 0))) ||
5590  (!0 && !0 && (argc != (6 + 1))) ||
5591  ( 0 && (argc != 1) && (argc != (6 + 1))) ) {
5592  Tcl_AppendResult( interp, "wrong # args: should be \"",
5593  "plsdimap dimxmin dimxmax dimymin dimymax dimxpmm dimypmm", "\"",
5594  (char *) NULL);
5595  return TCL_ERROR;
5596  }
5597 
5598  dimxmin = atoi(argv[1+0]);
5599  dimxmax = atoi(argv[1+1]);
5600  dimymin = atoi(argv[1+2]);
5601  dimymax = atoi(argv[1+3]);
5602  dimxpmm = atof(argv[1+4]);
5603  dimypmm = atof(argv[1+5]);
5604 
5605  plsdimap ( dimxmin, dimxmax, dimymin, dimymax, dimxpmm, dimypmm );
5606 
5607 
5608  if (pl_errcode != 0) {
5609  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5610  return TCL_ERROR;
5611  }
5612 
5613  plflush();
5614  return TCL_OK;
5615 }
5616 
5617 /*--------------------------------------------------------------------------*\
5618  * plsdioriCmd
5619  *
5620  * Processes plsdiori Tcl command.
5621 \*--------------------------------------------------------------------------*/
5622 
5623 static int
5624 plsdioriCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5625 {
5626  PLFLT rot;
5627 
5628  pl_errcode = 0; errmsg[0] = '\0';
5629 
5630  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5631  Tcl_AppendResult( interp, "command syntax: \"",
5632  "plsdiori rot", "\"",
5633  (char *) NULL);
5634  return TCL_ERROR;
5635  }
5636 
5637  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
5638  (!0 && !0 && (argc != (1 + 1))) ||
5639  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
5640  Tcl_AppendResult( interp, "wrong # args: should be \"",
5641  "plsdiori rot", "\"",
5642  (char *) NULL);
5643  return TCL_ERROR;
5644  }
5645 
5646  rot = atof(argv[1+0]);
5647 
5648  plsdiori ( rot );
5649 
5650 
5651  if (pl_errcode != 0) {
5652  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5653  return TCL_ERROR;
5654  }
5655 
5656  plflush();
5657  return TCL_OK;
5658 }
5659 
5660 /*--------------------------------------------------------------------------*\
5661  * plsdipltCmd
5662  *
5663  * Processes plsdiplt Tcl command.
5664 \*--------------------------------------------------------------------------*/
5665 
5666 static int
5667 plsdipltCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5668 {
5669  PLFLT xmin;
5670  PLFLT ymin;
5671  PLFLT xmax;
5672  PLFLT ymax;
5673 
5674  pl_errcode = 0; errmsg[0] = '\0';
5675 
5676  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5677  Tcl_AppendResult( interp, "command syntax: \"",
5678  "plsdiplt xmin ymin xmax ymax", "\"",
5679  (char *) NULL);
5680  return TCL_ERROR;
5681  }
5682 
5683  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
5684  (!0 && !0 && (argc != (4 + 1))) ||
5685  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
5686  Tcl_AppendResult( interp, "wrong # args: should be \"",
5687  "plsdiplt xmin ymin xmax ymax", "\"",
5688  (char *) NULL);
5689  return TCL_ERROR;
5690  }
5691 
5692  xmin = atof(argv[1+0]);
5693  ymin = atof(argv[1+1]);
5694  xmax = atof(argv[1+2]);
5695  ymax = atof(argv[1+3]);
5696 
5697  plsdiplt ( xmin, ymin, xmax, ymax );
5698 
5699 
5700  if (pl_errcode != 0) {
5701  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5702  return TCL_ERROR;
5703  }
5704 
5705  plflush();
5706  return TCL_OK;
5707 }
5708 
5709 /*--------------------------------------------------------------------------*\
5710  * plsdiplzCmd
5711  *
5712  * Processes plsdiplz Tcl command.
5713 \*--------------------------------------------------------------------------*/
5714 
5715 static int
5716 plsdiplzCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5717 {
5718  PLFLT xmin;
5719  PLFLT ymin;
5720  PLFLT xmax;
5721  PLFLT ymax;
5722 
5723  pl_errcode = 0; errmsg[0] = '\0';
5724 
5725  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5726  Tcl_AppendResult( interp, "command syntax: \"",
5727  "plsdiplz xmin ymin xmax ymax", "\"",
5728  (char *) NULL);
5729  return TCL_ERROR;
5730  }
5731 
5732  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
5733  (!0 && !0 && (argc != (4 + 1))) ||
5734  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
5735  Tcl_AppendResult( interp, "wrong # args: should be \"",
5736  "plsdiplz xmin ymin xmax ymax", "\"",
5737  (char *) NULL);
5738  return TCL_ERROR;
5739  }
5740 
5741  xmin = atof(argv[1+0]);
5742  ymin = atof(argv[1+1]);
5743  xmax = atof(argv[1+2]);
5744  ymax = atof(argv[1+3]);
5745 
5746  plsdiplz ( xmin, ymin, xmax, ymax );
5747 
5748 
5749  if (pl_errcode != 0) {
5750  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5751  return TCL_ERROR;
5752  }
5753 
5754  plflush();
5755  return TCL_OK;
5756 }
5757 
5758 /*--------------------------------------------------------------------------*\
5759  * plseedCmd
5760  *
5761  * Processes plseed Tcl command.
5762 \*--------------------------------------------------------------------------*/
5763 
5764 static int
5765 plseedCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5766 {
5767  unsigned int s;
5768 
5769  pl_errcode = 0; errmsg[0] = '\0';
5770 
5771  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5772  Tcl_AppendResult( interp, "command syntax: \"",
5773  "plseed s", "\"",
5774  (char *) NULL);
5775  return TCL_ERROR;
5776  }
5777 
5778  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
5779  (!0 && !0 && (argc != (1 + 1))) ||
5780  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
5781  Tcl_AppendResult( interp, "wrong # args: should be \"",
5782  "plseed s", "\"",
5783  (char *) NULL);
5784  return TCL_ERROR;
5785  }
5786 
5787  s = (unsigned int) strtoul(argv[1+0],NULL,10);
5788 
5789  plseed ( s );
5790 
5791 
5792  if (pl_errcode != 0) {
5793  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5794  return TCL_ERROR;
5795  }
5796 
5797  plflush();
5798  return TCL_OK;
5799 }
5800 
5801 /*--------------------------------------------------------------------------*\
5802  * plsescCmd
5803  *
5804  * Processes plsesc Tcl command.
5805 \*--------------------------------------------------------------------------*/
5806 
5807 static int
5808 plsescCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5809 {
5810  char esc;
5811 
5812  pl_errcode = 0; errmsg[0] = '\0';
5813 
5814  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5815  Tcl_AppendResult( interp, "command syntax: \"",
5816  "plsesc esc", "\"",
5817  (char *) NULL);
5818  return TCL_ERROR;
5819  }
5820 
5821  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
5822  (!0 && !0 && (argc != (1 + 1))) ||
5823  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
5824  Tcl_AppendResult( interp, "wrong # args: should be \"",
5825  "plsesc esc", "\"",
5826  (char *) NULL);
5827  return TCL_ERROR;
5828  }
5829 
5830  esc = argv[1+0][0];
5831 
5832  plsesc ( esc );
5833 
5834 
5835  if (pl_errcode != 0) {
5836  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5837  return TCL_ERROR;
5838  }
5839 
5840  plflush();
5841  return TCL_OK;
5842 }
5843 
5844 /*--------------------------------------------------------------------------*\
5845  * plsfamCmd
5846  *
5847  * Processes plsfam Tcl command.
5848 \*--------------------------------------------------------------------------*/
5849 
5850 static int
5851 plsfamCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5852 {
5853  PLINT fam;
5854  PLINT num;
5855  PLINT bmax;
5856 
5857  pl_errcode = 0; errmsg[0] = '\0';
5858 
5859  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5860  Tcl_AppendResult( interp, "command syntax: \"",
5861  "plsfam fam num bmax", "\"",
5862  (char *) NULL);
5863  return TCL_ERROR;
5864  }
5865 
5866  if ( (!0 && 0 && (argc < (1 + 3 - 0))) ||
5867  (!0 && !0 && (argc != (3 + 1))) ||
5868  ( 0 && (argc != 1) && (argc != (3 + 1))) ) {
5869  Tcl_AppendResult( interp, "wrong # args: should be \"",
5870  "plsfam fam num bmax", "\"",
5871  (char *) NULL);
5872  return TCL_ERROR;
5873  }
5874 
5875  fam = atoi(argv[1+0]);
5876  num = atoi(argv[1+1]);
5877  bmax = atoi(argv[1+2]);
5878 
5879  plsfam ( fam, num, bmax );
5880 
5881 
5882  if (pl_errcode != 0) {
5883  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5884  return TCL_ERROR;
5885  }
5886 
5887  plflush();
5888  return TCL_OK;
5889 }
5890 
5891 /*--------------------------------------------------------------------------*\
5892  * plsfciCmd
5893  *
5894  * Processes plsfci Tcl command.
5895 \*--------------------------------------------------------------------------*/
5896 
5897 static int
5898 plsfciCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5899 {
5900  PLUNICODE fci;
5901 
5902  pl_errcode = 0; errmsg[0] = '\0';
5903 
5904  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5905  Tcl_AppendResult( interp, "command syntax: \"",
5906  "plsfci fci", "\"",
5907  (char *) NULL);
5908  return TCL_ERROR;
5909  }
5910 
5911  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
5912  (!0 && !0 && (argc != (1 + 1))) ||
5913  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
5914  Tcl_AppendResult( interp, "wrong # args: should be \"",
5915  "plsfci fci", "\"",
5916  (char *) NULL);
5917  return TCL_ERROR;
5918  }
5919 
5920  fci = (PLUNICODE) strtoul(argv[1+0],NULL,10);
5921 
5922  plsfci ( fci );
5923 
5924 
5925  if (pl_errcode != 0) {
5926  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5927  return TCL_ERROR;
5928  }
5929 
5930  plflush();
5931  return TCL_OK;
5932 }
5933 
5934 /*--------------------------------------------------------------------------*\
5935  * plsfnamCmd
5936  *
5937  * Processes plsfnam Tcl command.
5938 \*--------------------------------------------------------------------------*/
5939 
5940 static int
5941 plsfnamCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5942 {
5943  const char *fnam;
5944 
5945  pl_errcode = 0; errmsg[0] = '\0';
5946 
5947  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5948  Tcl_AppendResult( interp, "command syntax: \"",
5949  "plsfnam fnam", "\"",
5950  (char *) NULL);
5951  return TCL_ERROR;
5952  }
5953 
5954  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
5955  (!0 && !0 && (argc != (1 + 1))) ||
5956  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
5957  Tcl_AppendResult( interp, "wrong # args: should be \"",
5958  "plsfnam fnam", "\"",
5959  (char *) NULL);
5960  return TCL_ERROR;
5961  }
5962 
5963  fnam = argv[1+0];
5964 
5965  plsfnam ( fnam );
5966 
5967 
5968  if (pl_errcode != 0) {
5969  Tcl_AppendResult(interp, errmsg, (char *) NULL);
5970  return TCL_ERROR;
5971  }
5972 
5973  plflush();
5974  return TCL_OK;
5975 }
5976 
5977 /*--------------------------------------------------------------------------*\
5978  * plsfontCmd
5979  *
5980  * Processes plsfont Tcl command.
5981 \*--------------------------------------------------------------------------*/
5982 
5983 static int
5984 plsfontCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
5985 {
5986  PLINT family;
5987  PLINT style;
5988  PLINT weight;
5989 
5990  pl_errcode = 0; errmsg[0] = '\0';
5991 
5992  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
5993  Tcl_AppendResult( interp, "command syntax: \"",
5994  "plsfont family style weight", "\"",
5995  (char *) NULL);
5996  return TCL_ERROR;
5997  }
5998 
5999  if ( (!0 && 0 && (argc < (1 + 3 - 0))) ||
6000  (!0 && !0 && (argc != (3 + 1))) ||
6001  ( 0 && (argc != 1) && (argc != (3 + 1))) ) {
6002  Tcl_AppendResult( interp, "wrong # args: should be \"",
6003  "plsfont family style weight", "\"",
6004  (char *) NULL);
6005  return TCL_ERROR;
6006  }
6007 
6008  family = atoi(argv[1+0]);
6009  style = atoi(argv[1+1]);
6010  weight = atoi(argv[1+2]);
6011 
6012  plsfont ( family, style, weight );
6013 
6014 
6015  if (pl_errcode != 0) {
6016  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6017  return TCL_ERROR;
6018  }
6019 
6020  plflush();
6021  return TCL_OK;
6022 }
6023 
6024 /*--------------------------------------------------------------------------*\
6025  * plsmajCmd
6026  *
6027  * Processes plsmaj Tcl command.
6028 \*--------------------------------------------------------------------------*/
6029 
6030 static int
6031 plsmajCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6032 {
6033  PLFLT def;
6034  PLFLT scale;
6035 
6036  pl_errcode = 0; errmsg[0] = '\0';
6037 
6038  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6039  Tcl_AppendResult( interp, "command syntax: \"",
6040  "plsmaj def scale", "\"",
6041  (char *) NULL);
6042  return TCL_ERROR;
6043  }
6044 
6045  if ( (!0 && 0 && (argc < (1 + 2 - 0))) ||
6046  (!0 && !0 && (argc != (2 + 1))) ||
6047  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
6048  Tcl_AppendResult( interp, "wrong # args: should be \"",
6049  "plsmaj def scale", "\"",
6050  (char *) NULL);
6051  return TCL_ERROR;
6052  }
6053 
6054  def = atof(argv[1+0]);
6055  scale = atof(argv[1+1]);
6056 
6057  plsmaj ( def, scale );
6058 
6059 
6060  if (pl_errcode != 0) {
6061  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6062  return TCL_ERROR;
6063  }
6064 
6065  plflush();
6066  return TCL_OK;
6067 }
6068 
6069 /*--------------------------------------------------------------------------*\
6070  * plsminCmd
6071  *
6072  * Processes plsmin Tcl command.
6073 \*--------------------------------------------------------------------------*/
6074 
6075 static int
6076 plsminCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6077 {
6078  PLFLT def;
6079  PLFLT scale;
6080 
6081  pl_errcode = 0; errmsg[0] = '\0';
6082 
6083  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6084  Tcl_AppendResult( interp, "command syntax: \"",
6085  "plsmin def scale", "\"",
6086  (char *) NULL);
6087  return TCL_ERROR;
6088  }
6089 
6090  if ( (!0 && 0 && (argc < (1 + 2 - 0))) ||
6091  (!0 && !0 && (argc != (2 + 1))) ||
6092  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
6093  Tcl_AppendResult( interp, "wrong # args: should be \"",
6094  "plsmin def scale", "\"",
6095  (char *) NULL);
6096  return TCL_ERROR;
6097  }
6098 
6099  def = atof(argv[1+0]);
6100  scale = atof(argv[1+1]);
6101 
6102  plsmin ( def, scale );
6103 
6104 
6105  if (pl_errcode != 0) {
6106  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6107  return TCL_ERROR;
6108  }
6109 
6110  plflush();
6111  return TCL_OK;
6112 }
6113 
6114 /*--------------------------------------------------------------------------*\
6115  * plsoriCmd
6116  *
6117  * Processes plsori Tcl command.
6118 \*--------------------------------------------------------------------------*/
6119 
6120 static int
6121 plsoriCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6122 {
6123  PLINT ori;
6124 
6125  pl_errcode = 0; errmsg[0] = '\0';
6126 
6127  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6128  Tcl_AppendResult( interp, "command syntax: \"",
6129  "plsori ori", "\"",
6130  (char *) NULL);
6131  return TCL_ERROR;
6132  }
6133 
6134  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
6135  (!0 && !0 && (argc != (1 + 1))) ||
6136  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
6137  Tcl_AppendResult( interp, "wrong # args: should be \"",
6138  "plsori ori", "\"",
6139  (char *) NULL);
6140  return TCL_ERROR;
6141  }
6142 
6143  ori = atoi(argv[1+0]);
6144 
6145  plsori ( ori );
6146 
6147 
6148  if (pl_errcode != 0) {
6149  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6150  return TCL_ERROR;
6151  }
6152 
6153  plflush();
6154  return TCL_OK;
6155 }
6156 
6157 /*--------------------------------------------------------------------------*\
6158  * plspageCmd
6159  *
6160  * Processes plspage Tcl command.
6161 \*--------------------------------------------------------------------------*/
6162 
6163 static int
6164 plspageCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6165 {
6166  PLFLT xp;
6167  PLFLT yp;
6168  PLINT xleng;
6169  PLINT yleng;
6170  PLINT xoff;
6171  PLINT yoff;
6172 
6173  pl_errcode = 0; errmsg[0] = '\0';
6174 
6175  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6176  Tcl_AppendResult( interp, "command syntax: \"",
6177  "plspage xp yp xleng yleng xoff yoff", "\"",
6178  (char *) NULL);
6179  return TCL_ERROR;
6180  }
6181 
6182  if ( (!0 && 0 && (argc < (1 + 6 - 0))) ||
6183  (!0 && !0 && (argc != (6 + 1))) ||
6184  ( 0 && (argc != 1) && (argc != (6 + 1))) ) {
6185  Tcl_AppendResult( interp, "wrong # args: should be \"",
6186  "plspage xp yp xleng yleng xoff yoff", "\"",
6187  (char *) NULL);
6188  return TCL_ERROR;
6189  }
6190 
6191  xp = atof(argv[1+0]);
6192  yp = atof(argv[1+1]);
6193  xleng = atoi(argv[1+2]);
6194  yleng = atoi(argv[1+3]);
6195  xoff = atoi(argv[1+4]);
6196  yoff = atoi(argv[1+5]);
6197 
6198  plspage ( xp, yp, xleng, yleng, xoff, yoff );
6199 
6200 
6201  if (pl_errcode != 0) {
6202  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6203  return TCL_ERROR;
6204  }
6205 
6206  plflush();
6207  return TCL_OK;
6208 }
6209 
6210 /*--------------------------------------------------------------------------*\
6211  * plspal0Cmd
6212  *
6213  * Processes plspal0 Tcl command.
6214 \*--------------------------------------------------------------------------*/
6215 
6216 static int
6217 plspal0Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6218 {
6219  const char *filename;
6220 
6221  pl_errcode = 0; errmsg[0] = '\0';
6222 
6223  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6224  Tcl_AppendResult( interp, "command syntax: \"",
6225  "plspal0 filename", "\"",
6226  (char *) NULL);
6227  return TCL_ERROR;
6228  }
6229 
6230  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
6231  (!0 && !0 && (argc != (1 + 1))) ||
6232  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
6233  Tcl_AppendResult( interp, "wrong # args: should be \"",
6234  "plspal0 filename", "\"",
6235  (char *) NULL);
6236  return TCL_ERROR;
6237  }
6238 
6239  filename = argv[1+0];
6240 
6241  plspal0 ( filename );
6242 
6243 
6244  if (pl_errcode != 0) {
6245  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6246  return TCL_ERROR;
6247  }
6248 
6249  plflush();
6250  return TCL_OK;
6251 }
6252 
6253 /*--------------------------------------------------------------------------*\
6254  * plspal1Cmd
6255  *
6256  * Processes plspal1 Tcl command.
6257 \*--------------------------------------------------------------------------*/
6258 
6259 static int
6260 plspal1Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6261 {
6262  const char *filename;
6263  PLINT interpolate;
6264 
6265  pl_errcode = 0; errmsg[0] = '\0';
6266 
6267  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6268  Tcl_AppendResult( interp, "command syntax: \"",
6269  "plspal1 filename interpolate", "\"",
6270  (char *) NULL);
6271  return TCL_ERROR;
6272  }
6273 
6274  if ( (!0 && 0 && (argc < (1 + 2 - 0))) ||
6275  (!0 && !0 && (argc != (2 + 1))) ||
6276  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
6277  Tcl_AppendResult( interp, "wrong # args: should be \"",
6278  "plspal1 filename interpolate", "\"",
6279  (char *) NULL);
6280  return TCL_ERROR;
6281  }
6282 
6283  filename = argv[1+0];
6284  interpolate = atoi(argv[1+1]);
6285 
6286  plspal1 ( filename, interpolate );
6287 
6288 
6289  if (pl_errcode != 0) {
6290  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6291  return TCL_ERROR;
6292  }
6293 
6294  plflush();
6295  return TCL_OK;
6296 }
6297 
6298 /*--------------------------------------------------------------------------*\
6299  * plspauseCmd
6300  *
6301  * Processes plspause Tcl command.
6302 \*--------------------------------------------------------------------------*/
6303 
6304 static int
6305 plspauseCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6306 {
6307  PLINT paus;
6308 
6309  pl_errcode = 0; errmsg[0] = '\0';
6310 
6311  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6312  Tcl_AppendResult( interp, "command syntax: \"",
6313  "plspause paus", "\"",
6314  (char *) NULL);
6315  return TCL_ERROR;
6316  }
6317 
6318  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
6319  (!0 && !0 && (argc != (1 + 1))) ||
6320  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
6321  Tcl_AppendResult( interp, "wrong # args: should be \"",
6322  "plspause paus", "\"",
6323  (char *) NULL);
6324  return TCL_ERROR;
6325  }
6326 
6327  paus = atoi(argv[1+0]);
6328 
6329  plspause ( paus );
6330 
6331 
6332  if (pl_errcode != 0) {
6333  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6334  return TCL_ERROR;
6335  }
6336 
6337  plflush();
6338  return TCL_OK;
6339 }
6340 
6341 /*--------------------------------------------------------------------------*\
6342  * plsstrmCmd
6343  *
6344  * Processes plsstrm Tcl command.
6345 \*--------------------------------------------------------------------------*/
6346 
6347 static int
6348 plsstrmCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6349 {
6350  PLINT strm;
6351 
6352  pl_errcode = 0; errmsg[0] = '\0';
6353 
6354  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6355  Tcl_AppendResult( interp, "command syntax: \"",
6356  "plsstrm strm", "\"",
6357  (char *) NULL);
6358  return TCL_ERROR;
6359  }
6360 
6361  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
6362  (!0 && !0 && (argc != (1 + 1))) ||
6363  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
6364  Tcl_AppendResult( interp, "wrong # args: should be \"",
6365  "plsstrm strm", "\"",
6366  (char *) NULL);
6367  return TCL_ERROR;
6368  }
6369 
6370  strm = atoi(argv[1+0]);
6371 
6372  plsstrm ( strm );
6373 
6374 
6375  if (pl_errcode != 0) {
6376  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6377  return TCL_ERROR;
6378  }
6379 
6380  plflush();
6381  return TCL_OK;
6382 }
6383 
6384 /*--------------------------------------------------------------------------*\
6385  * plssubCmd
6386  *
6387  * Processes plssub Tcl command.
6388 \*--------------------------------------------------------------------------*/
6389 
6390 static int
6391 plssubCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6392 {
6393  PLINT nx;
6394  PLINT ny;
6395 
6396  pl_errcode = 0; errmsg[0] = '\0';
6397 
6398  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6399  Tcl_AppendResult( interp, "command syntax: \"",
6400  "plssub nx ny", "\"",
6401  (char *) NULL);
6402  return TCL_ERROR;
6403  }
6404 
6405  if ( (!0 && 0 && (argc < (1 + 2 - 0))) ||
6406  (!0 && !0 && (argc != (2 + 1))) ||
6407  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
6408  Tcl_AppendResult( interp, "wrong # args: should be \"",
6409  "plssub nx ny", "\"",
6410  (char *) NULL);
6411  return TCL_ERROR;
6412  }
6413 
6414  nx = atoi(argv[1+0]);
6415  ny = atoi(argv[1+1]);
6416 
6417  plssub ( nx, ny );
6418 
6419 
6420  if (pl_errcode != 0) {
6421  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6422  return TCL_ERROR;
6423  }
6424 
6425  plflush();
6426  return TCL_OK;
6427 }
6428 
6429 /*--------------------------------------------------------------------------*\
6430  * plssymCmd
6431  *
6432  * Processes plssym Tcl command.
6433 \*--------------------------------------------------------------------------*/
6434 
6435 static int
6436 plssymCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6437 {
6438  PLFLT def;
6439  PLFLT scale;
6440 
6441  pl_errcode = 0; errmsg[0] = '\0';
6442 
6443  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6444  Tcl_AppendResult( interp, "command syntax: \"",
6445  "plssym def scale", "\"",
6446  (char *) NULL);
6447  return TCL_ERROR;
6448  }
6449 
6450  if ( (!0 && 0 && (argc < (1 + 2 - 0))) ||
6451  (!0 && !0 && (argc != (2 + 1))) ||
6452  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
6453  Tcl_AppendResult( interp, "wrong # args: should be \"",
6454  "plssym def scale", "\"",
6455  (char *) NULL);
6456  return TCL_ERROR;
6457  }
6458 
6459  def = atof(argv[1+0]);
6460  scale = atof(argv[1+1]);
6461 
6462  plssym ( def, scale );
6463 
6464 
6465  if (pl_errcode != 0) {
6466  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6467  return TCL_ERROR;
6468  }
6469 
6470  plflush();
6471  return TCL_OK;
6472 }
6473 
6474 /*--------------------------------------------------------------------------*\
6475  * plstarCmd
6476  *
6477  * Processes plstar Tcl command.
6478 \*--------------------------------------------------------------------------*/
6479 
6480 static int
6481 plstarCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6482 {
6483  PLINT nx;
6484  PLINT ny;
6485 
6486  pl_errcode = 0; errmsg[0] = '\0';
6487 
6488  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6489  Tcl_AppendResult( interp, "command syntax: \"",
6490  "plstar nx ny", "\"",
6491  (char *) NULL);
6492  return TCL_ERROR;
6493  }
6494 
6495  if ( (!0 && 0 && (argc < (1 + 2 - 0))) ||
6496  (!0 && !0 && (argc != (2 + 1))) ||
6497  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
6498  Tcl_AppendResult( interp, "wrong # args: should be \"",
6499  "plstar nx ny", "\"",
6500  (char *) NULL);
6501  return TCL_ERROR;
6502  }
6503 
6504  nx = atoi(argv[1+0]);
6505  ny = atoi(argv[1+1]);
6506 
6507  plstar ( nx, ny );
6508 
6509 
6510  if (pl_errcode != 0) {
6511  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6512  return TCL_ERROR;
6513  }
6514 
6515  plflush();
6516  return TCL_OK;
6517 }
6518 
6519 /*--------------------------------------------------------------------------*\
6520  * plstartCmd
6521  *
6522  * Processes plstart Tcl command.
6523 \*--------------------------------------------------------------------------*/
6524 
6525 static int
6526 plstartCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6527 {
6528  const char *devname;
6529  PLINT nx;
6530  PLINT ny;
6531 
6532  pl_errcode = 0; errmsg[0] = '\0';
6533 
6534  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6535  Tcl_AppendResult( interp, "command syntax: \"",
6536  "plstart devname nx ny", "\"",
6537  (char *) NULL);
6538  return TCL_ERROR;
6539  }
6540 
6541  if ( (!0 && 0 && (argc < (1 + 3 - 0))) ||
6542  (!0 && !0 && (argc != (3 + 1))) ||
6543  ( 0 && (argc != 1) && (argc != (3 + 1))) ) {
6544  Tcl_AppendResult( interp, "wrong # args: should be \"",
6545  "plstart devname nx ny", "\"",
6546  (char *) NULL);
6547  return TCL_ERROR;
6548  }
6549 
6550  devname = argv[1+0];
6551  nx = atoi(argv[1+1]);
6552  ny = atoi(argv[1+2]);
6553 
6554  plstart ( devname, nx, ny );
6555 
6556 
6557  if (pl_errcode != 0) {
6558  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6559  return TCL_ERROR;
6560  }
6561 
6562  plflush();
6563  return TCL_OK;
6564 }
6565 
6566 /*--------------------------------------------------------------------------*\
6567  * plstringCmd
6568  *
6569  * Processes plstring Tcl command.
6570 \*--------------------------------------------------------------------------*/
6571 
6572 static int
6573 plstringCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6574 {
6575  PLINT n;
6576  PLFLT *x;
6577  tclMatrix *matx;
6578  PLFLT *y;
6579  tclMatrix *maty;
6580  const char *string;
6581 
6582  pl_errcode = 0; errmsg[0] = '\0';
6583 
6584  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6585  Tcl_AppendResult( interp, "command syntax: \"",
6586  "plstring n x y string", "\"",
6587  (char *) NULL);
6588  return TCL_ERROR;
6589  }
6590 
6591  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
6592  (!0 && !0 && (argc != (4 + 1))) ||
6593  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
6594  Tcl_AppendResult( interp, "wrong # args: should be \"",
6595  "plstring n x y string", "\"",
6596  (char *) NULL);
6597  return TCL_ERROR;
6598  }
6599 
6600  n = atoi(argv[1+0]);
6601  matx = Tcl_GetMatrixPtr( interp, argv[1+1] );
6602  if (matx == NULL) return TCL_ERROR;
6603  x = matx->fdata;
6604  maty = Tcl_GetMatrixPtr( interp, argv[1+2] );
6605  if (maty == NULL) return TCL_ERROR;
6606  y = maty->fdata;
6607  string = argv[1+3];
6608 
6609  plstring ( n, x, y, string );
6610 
6611 
6612  if (pl_errcode != 0) {
6613  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6614  return TCL_ERROR;
6615  }
6616 
6617  plflush();
6618  return TCL_OK;
6619 }
6620 
6621 /*--------------------------------------------------------------------------*\
6622  * plstring3Cmd
6623  *
6624  * Processes plstring3 Tcl command.
6625 \*--------------------------------------------------------------------------*/
6626 
6627 static int
6628 plstring3Cmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6629 {
6630  PLINT n;
6631  PLFLT *x;
6632  tclMatrix *matx;
6633  PLFLT *y;
6634  tclMatrix *maty;
6635  PLFLT *z;
6636  tclMatrix *matz;
6637  const char *string;
6638 
6639  pl_errcode = 0; errmsg[0] = '\0';
6640 
6641  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6642  Tcl_AppendResult( interp, "command syntax: \"",
6643  "plstring3 n x y z string", "\"",
6644  (char *) NULL);
6645  return TCL_ERROR;
6646  }
6647 
6648  if ( (!0 && 0 && (argc < (1 + 5 - 0))) ||
6649  (!0 && !0 && (argc != (5 + 1))) ||
6650  ( 0 && (argc != 1) && (argc != (5 + 1))) ) {
6651  Tcl_AppendResult( interp, "wrong # args: should be \"",
6652  "plstring3 n x y z string", "\"",
6653  (char *) NULL);
6654  return TCL_ERROR;
6655  }
6656 
6657  n = atoi(argv[1+0]);
6658  matx = Tcl_GetMatrixPtr( interp, argv[1+1] );
6659  if (matx == NULL) return TCL_ERROR;
6660  x = matx->fdata;
6661  maty = Tcl_GetMatrixPtr( interp, argv[1+2] );
6662  if (maty == NULL) return TCL_ERROR;
6663  y = maty->fdata;
6664  matz = Tcl_GetMatrixPtr( interp, argv[1+3] );
6665  if (matz == NULL) return TCL_ERROR;
6666  z = matz->fdata;
6667  string = argv[1+4];
6668 
6669  plstring3 ( n, x, y, z, string );
6670 
6671 
6672  if (pl_errcode != 0) {
6673  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6674  return TCL_ERROR;
6675  }
6676 
6677  plflush();
6678  return TCL_OK;
6679 }
6680 
6681 /*--------------------------------------------------------------------------*\
6682  * plstripaCmd
6683  *
6684  * Processes plstripa Tcl command.
6685 \*--------------------------------------------------------------------------*/
6686 
6687 static int
6688 plstripaCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6689 {
6690  PLINT id;
6691  PLINT pen;
6692  PLFLT x;
6693  PLFLT y;
6694 
6695  pl_errcode = 0; errmsg[0] = '\0';
6696 
6697  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6698  Tcl_AppendResult( interp, "command syntax: \"",
6699  "plstripa id pen x y", "\"",
6700  (char *) NULL);
6701  return TCL_ERROR;
6702  }
6703 
6704  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
6705  (!0 && !0 && (argc != (4 + 1))) ||
6706  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
6707  Tcl_AppendResult( interp, "wrong # args: should be \"",
6708  "plstripa id pen x y", "\"",
6709  (char *) NULL);
6710  return TCL_ERROR;
6711  }
6712 
6713  id = atoi(argv[1+0]);
6714  pen = atoi(argv[1+1]);
6715  x = atof(argv[1+2]);
6716  y = atof(argv[1+3]);
6717 
6718  plstripa ( id, pen, x, y );
6719 
6720 
6721  if (pl_errcode != 0) {
6722  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6723  return TCL_ERROR;
6724  }
6725 
6726  plflush();
6727  return TCL_OK;
6728 }
6729 
6730 /*--------------------------------------------------------------------------*\
6731  * plstripdCmd
6732  *
6733  * Processes plstripd Tcl command.
6734 \*--------------------------------------------------------------------------*/
6735 
6736 static int
6737 plstripdCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6738 {
6739  PLINT id;
6740 
6741  pl_errcode = 0; errmsg[0] = '\0';
6742 
6743  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6744  Tcl_AppendResult( interp, "command syntax: \"",
6745  "plstripd id", "\"",
6746  (char *) NULL);
6747  return TCL_ERROR;
6748  }
6749 
6750  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
6751  (!0 && !0 && (argc != (1 + 1))) ||
6752  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
6753  Tcl_AppendResult( interp, "wrong # args: should be \"",
6754  "plstripd id", "\"",
6755  (char *) NULL);
6756  return TCL_ERROR;
6757  }
6758 
6759  id = atoi(argv[1+0]);
6760 
6761  plstripd ( id );
6762 
6763 
6764  if (pl_errcode != 0) {
6765  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6766  return TCL_ERROR;
6767  }
6768 
6769  plflush();
6770  return TCL_OK;
6771 }
6772 
6773 /*--------------------------------------------------------------------------*\
6774  * plstylCmd
6775  *
6776  * Processes plstyl Tcl command.
6777 \*--------------------------------------------------------------------------*/
6778 
6779 static int
6780 plstylCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6781 {
6782  PLINT nms;
6783  PLINT *mark;
6784  tclMatrix *matmark;
6785  PLINT *space;
6786  tclMatrix *matspace;
6787 
6788  pl_errcode = 0; errmsg[0] = '\0';
6789 
6790  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6791  Tcl_AppendResult( interp, "command syntax: \"",
6792  "plstyl nms mark space", "\"",
6793  (char *) NULL);
6794  return TCL_ERROR;
6795  }
6796 
6797  if ( (!0 && 0 && (argc < (1 + 3 - 0))) ||
6798  (!0 && !0 && (argc != (3 + 1))) ||
6799  ( 0 && (argc != 1) && (argc != (3 + 1))) ) {
6800  Tcl_AppendResult( interp, "wrong # args: should be \"",
6801  "plstyl nms mark space", "\"",
6802  (char *) NULL);
6803  return TCL_ERROR;
6804  }
6805 
6806  nms = atoi(argv[1+0]);
6807  matmark = Tcl_GetMatrixPtr( interp, argv[1+1] );
6808  if (matmark == NULL) return TCL_ERROR;
6809  mark = matmark->idata;
6810  matspace = Tcl_GetMatrixPtr( interp, argv[1+2] );
6811  if (matspace == NULL) return TCL_ERROR;
6812  space = matspace->idata;
6813 
6814  plstyl ( nms, mark, space );
6815 
6816 
6817  if (pl_errcode != 0) {
6818  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6819  return TCL_ERROR;
6820  }
6821 
6822  plflush();
6823  return TCL_OK;
6824 }
6825 
6826 /*--------------------------------------------------------------------------*\
6827  * plsvpaCmd
6828  *
6829  * Processes plsvpa Tcl command.
6830 \*--------------------------------------------------------------------------*/
6831 
6832 static int
6833 plsvpaCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6834 {
6835  PLFLT xmin;
6836  PLFLT xmax;
6837  PLFLT ymin;
6838  PLFLT ymax;
6839 
6840  pl_errcode = 0; errmsg[0] = '\0';
6841 
6842  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6843  Tcl_AppendResult( interp, "command syntax: \"",
6844  "plsvpa xmin xmax ymin ymax", "\"",
6845  (char *) NULL);
6846  return TCL_ERROR;
6847  }
6848 
6849  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
6850  (!0 && !0 && (argc != (4 + 1))) ||
6851  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
6852  Tcl_AppendResult( interp, "wrong # args: should be \"",
6853  "plsvpa xmin xmax ymin ymax", "\"",
6854  (char *) NULL);
6855  return TCL_ERROR;
6856  }
6857 
6858  xmin = atof(argv[1+0]);
6859  xmax = atof(argv[1+1]);
6860  ymin = atof(argv[1+2]);
6861  ymax = atof(argv[1+3]);
6862 
6863  plsvpa ( xmin, xmax, ymin, ymax );
6864 
6865 
6866  if (pl_errcode != 0) {
6867  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6868  return TCL_ERROR;
6869  }
6870 
6871  plflush();
6872  return TCL_OK;
6873 }
6874 
6875 /*--------------------------------------------------------------------------*\
6876  * plsxaxCmd
6877  *
6878  * Processes plsxax Tcl command.
6879 \*--------------------------------------------------------------------------*/
6880 
6881 static int
6882 plsxaxCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6883 {
6884  PLINT digmax;
6885  PLINT digits;
6886 
6887  pl_errcode = 0; errmsg[0] = '\0';
6888 
6889  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6890  Tcl_AppendResult( interp, "command syntax: \"",
6891  "plsxax digmax digits", "\"",
6892  (char *) NULL);
6893  return TCL_ERROR;
6894  }
6895 
6896  if ( (!0 && 0 && (argc < (1 + 2 - 0))) ||
6897  (!0 && !0 && (argc != (2 + 1))) ||
6898  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
6899  Tcl_AppendResult( interp, "wrong # args: should be \"",
6900  "plsxax digmax digits", "\"",
6901  (char *) NULL);
6902  return TCL_ERROR;
6903  }
6904 
6905  digmax = atoi(argv[1+0]);
6906  digits = atoi(argv[1+1]);
6907 
6908  plsxax ( digmax, digits );
6909 
6910 
6911  if (pl_errcode != 0) {
6912  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6913  return TCL_ERROR;
6914  }
6915 
6916  plflush();
6917  return TCL_OK;
6918 }
6919 
6920 /*--------------------------------------------------------------------------*\
6921  * plsyaxCmd
6922  *
6923  * Processes plsyax Tcl command.
6924 \*--------------------------------------------------------------------------*/
6925 
6926 static int
6927 plsyaxCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6928 {
6929  PLINT digmax = 0;
6930  PLINT digits = 0;
6931 
6932  pl_errcode = 0; errmsg[0] = '\0';
6933 
6934  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6935  Tcl_AppendResult( interp, "command syntax: \"",
6936  "plsyax digmax digits", "\"",
6937  (char *) NULL);
6938  return TCL_ERROR;
6939  }
6940 
6941  if ( (!0 && 2 && (argc < (1 + 2 - 2))) ||
6942  (!0 && !2 && (argc != (2 + 1))) ||
6943  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
6944  Tcl_AppendResult( interp, "wrong # args: should be \"",
6945  "plsyax digmax digits", "\"",
6946  (char *) NULL);
6947  return TCL_ERROR;
6948  }
6949 
6950  if (argc > 0+1) {
6951  digmax = atoi(argv[1+0]);
6952  }
6953  if (argc > 1+1) {
6954  digits = atoi(argv[1+1]);
6955  }
6956 
6957  plsyax ( digmax, digits );
6958 
6959 
6960  if (pl_errcode != 0) {
6961  Tcl_AppendResult(interp, errmsg, (char *) NULL);
6962  return TCL_ERROR;
6963  }
6964 
6965  plflush();
6966  return TCL_OK;
6967 }
6968 
6969 /*--------------------------------------------------------------------------*\
6970  * plsymCmd
6971  *
6972  * Processes plsym Tcl command.
6973 \*--------------------------------------------------------------------------*/
6974 
6975 static int
6976 plsymCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
6977 {
6978  PLINT n;
6979  PLFLT *x;
6980  tclMatrix *matx;
6981  PLFLT *y;
6982  tclMatrix *maty;
6983  PLINT code;
6984 
6985  pl_errcode = 0; errmsg[0] = '\0';
6986 
6987  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
6988  Tcl_AppendResult( interp, "command syntax: \"",
6989  "plsym n x y code", "\"",
6990  (char *) NULL);
6991  return TCL_ERROR;
6992  }
6993 
6994  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
6995  (!0 && !0 && (argc != (4 + 1))) ||
6996  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
6997  Tcl_AppendResult( interp, "wrong # args: should be \"",
6998  "plsym n x y code", "\"",
6999  (char *) NULL);
7000  return TCL_ERROR;
7001  }
7002 
7003  n = atoi(argv[1+0]);
7004  matx = Tcl_GetMatrixPtr( interp, argv[1+1] );
7005  if (matx == NULL) return TCL_ERROR;
7006  x = matx->fdata;
7007  maty = Tcl_GetMatrixPtr( interp, argv[1+2] );
7008  if (maty == NULL) return TCL_ERROR;
7009  y = maty->fdata;
7010  code = atoi(argv[1+3]);
7011 
7012  plsym ( n, x, y, code );
7013 
7014 
7015  if (pl_errcode != 0) {
7016  Tcl_AppendResult(interp, errmsg, (char *) NULL);
7017  return TCL_ERROR;
7018  }
7019 
7020  plflush();
7021  return TCL_OK;
7022 }
7023 
7024 /*--------------------------------------------------------------------------*\
7025  * plszaxCmd
7026  *
7027  * Processes plszax Tcl command.
7028 \*--------------------------------------------------------------------------*/
7029 
7030 static int
7031 plszaxCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
7032 {
7033  PLINT digmax;
7034  PLINT digits;
7035 
7036  pl_errcode = 0; errmsg[0] = '\0';
7037 
7038  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
7039  Tcl_AppendResult( interp, "command syntax: \"",
7040  "plszax digmax digits", "\"",
7041  (char *) NULL);
7042  return TCL_ERROR;
7043  }
7044 
7045  if ( (!0 && 0 && (argc < (1 + 2 - 0))) ||
7046  (!0 && !0 && (argc != (2 + 1))) ||
7047  ( 0 && (argc != 1) && (argc != (2 + 1))) ) {
7048  Tcl_AppendResult( interp, "wrong # args: should be \"",
7049  "plszax digmax digits", "\"",
7050  (char *) NULL);
7051  return TCL_ERROR;
7052  }
7053 
7054  digmax = atoi(argv[1+0]);
7055  digits = atoi(argv[1+1]);
7056 
7057  plszax ( digmax, digits );
7058 
7059 
7060  if (pl_errcode != 0) {
7061  Tcl_AppendResult(interp, errmsg, (char *) NULL);
7062  return TCL_ERROR;
7063  }
7064 
7065  plflush();
7066  return TCL_OK;
7067 }
7068 
7069 /*--------------------------------------------------------------------------*\
7070  * pltextCmd
7071  *
7072  * Processes pltext Tcl command.
7073 \*--------------------------------------------------------------------------*/
7074 
7075 static int
7076 pltextCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
7077 {
7078 
7079  pl_errcode = 0; errmsg[0] = '\0';
7080 
7081  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
7082  Tcl_AppendResult( interp, "command syntax: \"",
7083  "pltext ", "\"",
7084  (char *) NULL);
7085  return TCL_ERROR;
7086  }
7087 
7088  if ( (!0 && 0 && (argc < (1 + 0 - 0))) ||
7089  (!0 && !0 && (argc != (0 + 1))) ||
7090  ( 0 && (argc != 1) && (argc != (0 + 1))) ) {
7091  Tcl_AppendResult( interp, "wrong # args: should be \"",
7092  "pltext ", "\"",
7093  (char *) NULL);
7094  return TCL_ERROR;
7095  }
7096 
7097 
7098  pltext ( );
7099 
7100 
7101  if (pl_errcode != 0) {
7102  Tcl_AppendResult(interp, errmsg, (char *) NULL);
7103  return TCL_ERROR;
7104  }
7105 
7106  plflush();
7107  return TCL_OK;
7108 }
7109 
7110 /*--------------------------------------------------------------------------*\
7111  * pltimefmtCmd
7112  *
7113  * Processes pltimefmt Tcl command.
7114 \*--------------------------------------------------------------------------*/
7115 
7116 static int
7117 pltimefmtCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
7118 {
7119  const char *fmt;
7120 
7121  pl_errcode = 0; errmsg[0] = '\0';
7122 
7123  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
7124  Tcl_AppendResult( interp, "command syntax: \"",
7125  "pltimefmt fmt", "\"",
7126  (char *) NULL);
7127  return TCL_ERROR;
7128  }
7129 
7130  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
7131  (!0 && !0 && (argc != (1 + 1))) ||
7132  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
7133  Tcl_AppendResult( interp, "wrong # args: should be \"",
7134  "pltimefmt fmt", "\"",
7135  (char *) NULL);
7136  return TCL_ERROR;
7137  }
7138 
7139  fmt = argv[1+0];
7140 
7141  pltimefmt ( fmt );
7142 
7143 
7144  if (pl_errcode != 0) {
7145  Tcl_AppendResult(interp, errmsg, (char *) NULL);
7146  return TCL_ERROR;
7147  }
7148 
7149  plflush();
7150  return TCL_OK;
7151 }
7152 
7153 /*--------------------------------------------------------------------------*\
7154  * plvaspCmd
7155  *
7156  * Processes plvasp Tcl command.
7157 \*--------------------------------------------------------------------------*/
7158 
7159 static int
7160 plvaspCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
7161 {
7162  PLFLT aspect;
7163 
7164  pl_errcode = 0; errmsg[0] = '\0';
7165 
7166  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
7167  Tcl_AppendResult( interp, "command syntax: \"",
7168  "plvasp aspect", "\"",
7169  (char *) NULL);
7170  return TCL_ERROR;
7171  }
7172 
7173  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
7174  (!0 && !0 && (argc != (1 + 1))) ||
7175  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
7176  Tcl_AppendResult( interp, "wrong # args: should be \"",
7177  "plvasp aspect", "\"",
7178  (char *) NULL);
7179  return TCL_ERROR;
7180  }
7181 
7182  aspect = atof(argv[1+0]);
7183 
7184  plvasp ( aspect );
7185 
7186 
7187  if (pl_errcode != 0) {
7188  Tcl_AppendResult(interp, errmsg, (char *) NULL);
7189  return TCL_ERROR;
7190  }
7191 
7192  plflush();
7193  return TCL_OK;
7194 }
7195 
7196 /*--------------------------------------------------------------------------*\
7197  * plvpasCmd
7198  *
7199  * Processes plvpas Tcl command.
7200 \*--------------------------------------------------------------------------*/
7201 
7202 static int
7203 plvpasCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
7204 {
7205  PLFLT xmin;
7206  PLFLT xmax;
7207  PLFLT ymin;
7208  PLFLT ymax;
7209  PLFLT aspect;
7210 
7211  pl_errcode = 0; errmsg[0] = '\0';
7212 
7213  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
7214  Tcl_AppendResult( interp, "command syntax: \"",
7215  "plvpas xmin xmax ymin ymax aspect", "\"",
7216  (char *) NULL);
7217  return TCL_ERROR;
7218  }
7219 
7220  if ( (!0 && 0 && (argc < (1 + 5 - 0))) ||
7221  (!0 && !0 && (argc != (5 + 1))) ||
7222  ( 0 && (argc != 1) && (argc != (5 + 1))) ) {
7223  Tcl_AppendResult( interp, "wrong # args: should be \"",
7224  "plvpas xmin xmax ymin ymax aspect", "\"",
7225  (char *) NULL);
7226  return TCL_ERROR;
7227  }
7228 
7229  xmin = atof(argv[1+0]);
7230  xmax = atof(argv[1+1]);
7231  ymin = atof(argv[1+2]);
7232  ymax = atof(argv[1+3]);
7233  aspect = atof(argv[1+4]);
7234 
7235  plvpas ( xmin, xmax, ymin, ymax, aspect );
7236 
7237 
7238  if (pl_errcode != 0) {
7239  Tcl_AppendResult(interp, errmsg, (char *) NULL);
7240  return TCL_ERROR;
7241  }
7242 
7243  plflush();
7244  return TCL_OK;
7245 }
7246 
7247 /*--------------------------------------------------------------------------*\
7248  * plvporCmd
7249  *
7250  * Processes plvpor Tcl command.
7251 \*--------------------------------------------------------------------------*/
7252 
7253 static int
7254 plvporCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
7255 {
7256  PLFLT xmin;
7257  PLFLT xmax;
7258  PLFLT ymin;
7259  PLFLT ymax;
7260 
7261  pl_errcode = 0; errmsg[0] = '\0';
7262 
7263  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
7264  Tcl_AppendResult( interp, "command syntax: \"",
7265  "plvpor xmin xmax ymin ymax", "\"",
7266  (char *) NULL);
7267  return TCL_ERROR;
7268  }
7269 
7270  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
7271  (!0 && !0 && (argc != (4 + 1))) ||
7272  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
7273  Tcl_AppendResult( interp, "wrong # args: should be \"",
7274  "plvpor xmin xmax ymin ymax", "\"",
7275  (char *) NULL);
7276  return TCL_ERROR;
7277  }
7278 
7279  xmin = atof(argv[1+0]);
7280  xmax = atof(argv[1+1]);
7281  ymin = atof(argv[1+2]);
7282  ymax = atof(argv[1+3]);
7283 
7284  plvpor ( xmin, xmax, ymin, ymax );
7285 
7286 
7287  if (pl_errcode != 0) {
7288  Tcl_AppendResult(interp, errmsg, (char *) NULL);
7289  return TCL_ERROR;
7290  }
7291 
7292  plflush();
7293  return TCL_OK;
7294 }
7295 
7296 /*--------------------------------------------------------------------------*\
7297  * plvstaCmd
7298  *
7299  * Processes plvsta Tcl command.
7300 \*--------------------------------------------------------------------------*/
7301 
7302 static int
7303 plvstaCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
7304 {
7305 
7306  pl_errcode = 0; errmsg[0] = '\0';
7307 
7308  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
7309  Tcl_AppendResult( interp, "command syntax: \"",
7310  "plvsta ", "\"",
7311  (char *) NULL);
7312  return TCL_ERROR;
7313  }
7314 
7315  if ( (!0 && 0 && (argc < (1 + 0 - 0))) ||
7316  (!0 && !0 && (argc != (0 + 1))) ||
7317  ( 0 && (argc != 1) && (argc != (0 + 1))) ) {
7318  Tcl_AppendResult( interp, "wrong # args: should be \"",
7319  "plvsta ", "\"",
7320  (char *) NULL);
7321  return TCL_ERROR;
7322  }
7323 
7324 
7325  plvsta ( );
7326 
7327 
7328  if (pl_errcode != 0) {
7329  Tcl_AppendResult(interp, errmsg, (char *) NULL);
7330  return TCL_ERROR;
7331  }
7332 
7333  plflush();
7334  return TCL_OK;
7335 }
7336 
7337 /*--------------------------------------------------------------------------*\
7338  * plw3dCmd
7339  *
7340  * Processes plw3d Tcl command.
7341 \*--------------------------------------------------------------------------*/
7342 
7343 static int
7344 plw3dCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
7345 {
7346  PLFLT basex;
7347  PLFLT basey;
7348  PLFLT height;
7349  PLFLT xmin0;
7350  PLFLT xmax0;
7351  PLFLT ymin0;
7352  PLFLT ymax0;
7353  PLFLT zmin0;
7354  PLFLT zmax0;
7355  PLFLT alt;
7356  PLFLT az;
7357 
7358  pl_errcode = 0; errmsg[0] = '\0';
7359 
7360  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
7361  Tcl_AppendResult( interp, "command syntax: \"",
7362  "plw3d basex basey height xmin0 xmax0 ymin0 ymax0 zmin0 zmax0 alt az", "\"",
7363  (char *) NULL);
7364  return TCL_ERROR;
7365  }
7366 
7367  if ( (!0 && 0 && (argc < (1 + 11 - 0))) ||
7368  (!0 && !0 && (argc != (11 + 1))) ||
7369  ( 0 && (argc != 1) && (argc != (11 + 1))) ) {
7370  Tcl_AppendResult( interp, "wrong # args: should be \"",
7371  "plw3d basex basey height xmin0 xmax0 ymin0 ymax0 zmin0 zmax0 alt az", "\"",
7372  (char *) NULL);
7373  return TCL_ERROR;
7374  }
7375 
7376  basex = atof(argv[1+0]);
7377  basey = atof(argv[1+1]);
7378  height = atof(argv[1+2]);
7379  xmin0 = atof(argv[1+3]);
7380  xmax0 = atof(argv[1+4]);
7381  ymin0 = atof(argv[1+5]);
7382  ymax0 = atof(argv[1+6]);
7383  zmin0 = atof(argv[1+7]);
7384  zmax0 = atof(argv[1+8]);
7385  alt = atof(argv[1+9]);
7386  az = atof(argv[1+10]);
7387 
7388  plw3d ( basex, basey, height, xmin0, xmax0, ymin0, ymax0, zmin0, zmax0, alt, az );
7389 
7390 
7391  if (pl_errcode != 0) {
7392  Tcl_AppendResult(interp, errmsg, (char *) NULL);
7393  return TCL_ERROR;
7394  }
7395 
7396  plflush();
7397  return TCL_OK;
7398 }
7399 
7400 /*--------------------------------------------------------------------------*\
7401  * plwidthCmd
7402  *
7403  * Processes plwidth Tcl command.
7404 \*--------------------------------------------------------------------------*/
7405 
7406 static int
7407 plwidthCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
7408 {
7409  PLFLT width;
7410 
7411  pl_errcode = 0; errmsg[0] = '\0';
7412 
7413  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
7414  Tcl_AppendResult( interp, "command syntax: \"",
7415  "plwidth width", "\"",
7416  (char *) NULL);
7417  return TCL_ERROR;
7418  }
7419 
7420  if ( (!0 && 0 && (argc < (1 + 1 - 0))) ||
7421  (!0 && !0 && (argc != (1 + 1))) ||
7422  ( 0 && (argc != 1) && (argc != (1 + 1))) ) {
7423  Tcl_AppendResult( interp, "wrong # args: should be \"",
7424  "plwidth width", "\"",
7425  (char *) NULL);
7426  return TCL_ERROR;
7427  }
7428 
7429  width = atof(argv[1+0]);
7430 
7431  plwidth ( width );
7432 
7433 
7434  if (pl_errcode != 0) {
7435  Tcl_AppendResult(interp, errmsg, (char *) NULL);
7436  return TCL_ERROR;
7437  }
7438 
7439  plflush();
7440  return TCL_OK;
7441 }
7442 
7443 /*--------------------------------------------------------------------------*\
7444  * plwindCmd
7445  *
7446  * Processes plwind Tcl command.
7447 \*--------------------------------------------------------------------------*/
7448 
7449 static int
7450 plwindCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
7451 {
7452  PLFLT xmin;
7453  PLFLT xmax;
7454  PLFLT ymin;
7455  PLFLT ymax;
7456 
7457  pl_errcode = 0; errmsg[0] = '\0';
7458 
7459  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
7460  Tcl_AppendResult( interp, "command syntax: \"",
7461  "plwind xmin xmax ymin ymax", "\"",
7462  (char *) NULL);
7463  return TCL_ERROR;
7464  }
7465 
7466  if ( (!0 && 0 && (argc < (1 + 4 - 0))) ||
7467  (!0 && !0 && (argc != (4 + 1))) ||
7468  ( 0 && (argc != 1) && (argc != (4 + 1))) ) {
7469  Tcl_AppendResult( interp, "wrong # args: should be \"",
7470  "plwind xmin xmax ymin ymax", "\"",
7471  (char *) NULL);
7472  return TCL_ERROR;
7473  }
7474 
7475  xmin = atof(argv[1+0]);
7476  xmax = atof(argv[1+1]);
7477  ymin = atof(argv[1+2]);
7478  ymax = atof(argv[1+3]);
7479 
7480  plwind ( xmin, xmax, ymin, ymax );
7481 
7482 
7483  if (pl_errcode != 0) {
7484  Tcl_AppendResult(interp, errmsg, (char *) NULL);
7485  return TCL_ERROR;
7486  }
7487 
7488  plflush();
7489  return TCL_OK;
7490 }
7491 
7492 /*--------------------------------------------------------------------------*\
7493  * plxormodCmd
7494  *
7495  * Processes plxormod Tcl command.
7496 \*--------------------------------------------------------------------------*/
7497 
7498 static int
7499 plxormodCmd( ClientData PL_UNUSED( clientData ), Tcl_Interp *interp, int argc, const char *argv[] )
7500 {
7501  PLINT mod;
7502  PLINT st;
7503 
7504  pl_errcode = 0; errmsg[0] = '\0';
7505 
7506  if ( (argc == 2) && (strlen(argv[1])>0) && (strncmp(argv[1],"-help",strlen(argv[1])) == 0) ) {
7507  Tcl_AppendResult( interp, "command syntax: \"",
7508  "plxormod ?mod st?", "\"",
7509  (char *) NULL);
7510  return TCL_ERROR;
7511  }
7512 
7513  if ( (!1 && 0 && (argc < (1 + 2 - 0))) ||
7514  (!1 && !0 && (argc != (2 + 1))) ||
7515  ( 1 && (argc != 1) && (argc != (2 + 1))) ) {
7516  Tcl_AppendResult( interp, "wrong # args: should be \"",
7517  "plxormod ?mod st?", "\"",
7518  (char *) NULL);
7519  return TCL_ERROR;
7520  }
7521 
7522  mod = atoi(argv[1+0]);
7523 /* st is for output. */
7524 
7525  plxormod ( mod, &st );
7526 
7527  if (argc == 1)
7528  Tcl_AppendResult( interp, " ", (char *) NULL );
7529  sprintf( buf, "%d", st );
7530  if (argc > 1)
7531  Tcl_SetVar( interp, argv[1+1], buf, 0 );
7532  else
7533  Tcl_AppendResult( interp, buf, (char *) NULL );
7534 
7535  if (pl_errcode != 0) {
7536  Tcl_AppendResult(interp, errmsg, (char *) NULL);
7537  return TCL_ERROR;
7538  }
7539 
7540  plflush();
7541  return TCL_OK;
7542 }
7543