NEURON
plt.cpp
Go to the documentation of this file.
1 #include <../../nrnconf.h>
2 
3 #include "gui-redirect.h"
4 
5 extern void Fig_file(const char*, int);
6 
7 #ifndef MINGW
8 
9 void hoc_Plt(void) {
11  int mode;
12  double x, y;
13  mode = *getarg(1);
14  if (mode >= 0 || ifarg(2)) {
15  if ((x = *getarg(2)) > 2047)
16  x = 2047;
17  else if (x < 0)
18  x = 0;
19  if ((y = *getarg(3)) > 2047)
20  y = 2047;
21  else if (y < 0)
22  y = 0;
23  } else {
24  x = y = 0.;
25  }
26  hoc_plt(mode, x, y);
27  hoc_ret();
28  hoc_pushx(1.);
29 }
30 
31 void hoc_Setcolor(void) {
32  TRY_GUI_REDIRECT_DOUBLE("setcolor", NULL);
33  double i;
34  i = hoc_set_color((int) *getarg(1));
35  hoc_ret();
36  hoc_pushx(i);
37 }
38 
39 void hoc_Lw(void) {
40  char* s;
41  static int dev = 2;
42  if (ifarg(1)) {
43  s = gargstr(1);
44  if (ifarg(2)) {
45  dev = *getarg(2);
46  }
47  if (s[0] != '\0') {
48  Fig_file(s, dev);
49  } else {
50  Fig_file((char*) 0, dev);
51  }
52  } else {
53  Fig_file((char*) 0, dev);
54  }
55  hoc_ret();
56  hoc_pushx(0.);
57 }
58 
59 #endif /*!defined(MINGW)*/
char * gargstr(int narg)
Definition: code2.cpp:227
#define i
Definition: md1redef.h:19
int hoc_set_color(int)
Definition: plot.cpp:549
void hoc_ret()
void hoc_plt(int, double, double)
Definition: plot.cpp:188
#define TRY_GUI_REDIRECT_DOUBLE(name, obj)
Definition: gui-redirect.h:47
#define getarg
Definition: hocdec.h:17
void hoc_pushx(double)
Definition: code.cpp:779
s
Definition: multisend.cpp:521
int ifarg(int)
Definition: code.cpp:1607
void Fig_file(const char *, int)
Definition: plot.cpp:346
void hoc_Plt(void)
Definition: plt.cpp:9
void hoc_Setcolor(void)
Definition: plt.cpp:31
void hoc_Lw(void)
Definition: plt.cpp:39
#define NULL
Definition: spdefs.h:105