25
25
extern int Tk_SimpleObjCmd();
26
extern int xctcl_standardaction();
26
27
extern int xctcl_refresh();
27
28
extern int xctcl_library();
28
29
extern int xctcl_font();
30
extern int xctcl_cursor();
29
31
extern int xctcl_bind();
30
32
extern int xctcl_filerecover();
31
33
extern int xctcl_color();
35
37
extern int xctcl_quit();
36
38
extern int xctcl_promptsavelib();
37
39
extern int xctcl_promptsavepage();
40
extern int xctcl_eventmode();
38
41
extern int xctcl_delete();
39
extern int xctcl_undelete();
42
extern int xctcl_undo();
43
extern int xctcl_redo();
40
44
extern int xctcl_copy();
41
45
extern int xctcl_move();
42
46
extern int xctcl_edit();
58
63
extern int xctcl_spline();
59
64
extern int xctcl_path();
60
65
extern int xctcl_arc();
66
extern int xctcl_graphic();
61
67
extern int xctcl_object();
62
68
extern int xctcl_here();
63
69
extern int xctcl_start();
65
70
extern int xctcl_netlist();
66
71
extern int xctcl_symschem();
68
72
extern int xctcl_tag();
75
79
static cmdstruct xc_commands[] =
81
{"standardaction", (void *)xctcl_standardaction},
77
82
{"start", (void *)xctcl_start},
78
83
{"tag", (void *)xctcl_tag},
79
84
{"refresh", (void *)xctcl_refresh},
80
85
{"library", (void *)xctcl_library},
81
86
{"loadfont", (void *)xctcl_font},
87
{"cursor", (void *)xctcl_cursor},
82
88
{"bindkey", (void *)xctcl_bind},
83
89
{"filerecover", (void *)xctcl_filerecover},
84
90
{"color", (void *)xctcl_color},
88
94
{"quitnocheck", (void *)xctcl_quit},
89
95
{"promptchecksavelib", (void *)xctcl_promptsavelib},
90
96
{"promptsavepage", (void *)xctcl_promptsavepage},
97
{"eventmode", (void *)xctcl_eventmode},
91
98
{"delete", (void *)xctcl_delete},
92
{"undelete", (void *)xctcl_undelete},
99
{"undo", (void *)xctcl_undo},
100
{"redo", (void *)xctcl_redo},
93
101
{"select", (void *)xctcl_select},
94
102
{"deselect", (void *)xctcl_deselect},
95
103
{"copy", (void *)xctcl_copy},
100
108
{"pop", (void *)xctcl_pop},
101
109
{"rotate", (void *)xctcl_rotate},
102
110
{"flip", (void *)xctcl_flip},
103
{"config", (void *)xctcl_set},
111
{"config", (void *)xctcl_config},
104
112
{"page", (void *)xctcl_page},
105
113
{"zoom", (void *)xctcl_zoom},
106
114
{"pan", (void *)xctcl_pan},
111
119
{"spline", (void *)xctcl_spline},
112
120
{"path", (void *)xctcl_path},
113
121
{"arc", (void *)xctcl_arc},
122
{"graphic", (void *)xctcl_graphic},
114
123
{"object", (void *)xctcl_object},
115
124
{"here", (void *)xctcl_here},
117
125
{"netlist", (void *)xctcl_netlist},
118
126
{"symbol", (void *)xctcl_symschem},
119
127
{"schematic", (void *)xctcl_symschem},
128
{"spice", (void *)xctcl_spice},
121
129
{"", NULL} /* sentinel */
189
201
Tcl_SetVar(interp, "XCIRCUIT_LIB_DIR", tmp_s, TCL_GLOBAL_ONLY);
191
/* Set $CAD_HOME as a Tcl variable */
203
/* Set $CAD_ROOT as a Tcl variable */
193
cadhome = getenv("CAD_HOME");
205
cadhome = getenv("CAD_ROOT");
194
206
if (cadhome == NULL) cadhome = CAD_DIR;
195
Tcl_SetVar(interp, "CAD_HOME", cadhome, TCL_GLOBAL_ONLY);
207
Tcl_SetVar(interp, "CAD_ROOT", cadhome, TCL_GLOBAL_ONLY);
209
/* Set $XCIRCUIT_VERSION and $XCIRCUIT_REVISION as Tcl variables */
211
sprintf(version_string, "%d", PROG_REVISION);
212
Tcl_SetVar(interp, "XCIRCUIT_REVISION", version_string, TCL_GLOBAL_ONLY);
214
sprintf(version_string, "%g", PROG_VERSION);
215
Tcl_SetVar(interp, "XCIRCUIT_VERSION", version_string, TCL_GLOBAL_ONLY);
197
217
/* Export the namespace commands */
199
219
Tcl_Eval(interp, "namespace eval xcircuit namespace export *");
200
Tcl_PkgProvide(interp, "Xcircuit", "3.0");
220
Tcl_PkgProvide(interp, "Xcircuit", version_string);
202
222
/* Initialize the console interpreter, if there is one. */