1 |
/* |
2 |
* BrowserProc.h |
3 |
* by Kirk Abbott and Ben Allan |
4 |
* Created: 1/94 |
5 |
* Version: $Revision: 1.9 $ |
6 |
* Version control file: $RCSfile: BrowserProc.h,v $ |
7 |
* Date last modified: $Date: 2003/08/23 18:43:04 $ |
8 |
* Last modified by: $Author: ballan $ |
9 |
* |
10 |
* This file is part of the ASCEND Tcl/Tk interface |
11 |
* |
12 |
* Copyright 1997, Carnegie Mellon University |
13 |
* |
14 |
* The ASCEND Tcl/Tk interface is free software; you can redistribute |
15 |
* it and/or modify it under the terms of the GNU General Public License as |
16 |
* published by the Free Software Foundation; either version 2 of the |
17 |
* License, or (at your option) any later version. |
18 |
* |
19 |
* The ASCEND Tcl/Tk interface is distributed in hope that it will be |
20 |
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
22 |
* General Public License for more details. |
23 |
* |
24 |
* You should have received a copy of the GNU General Public License |
25 |
* along with the program; if not, write to the Free Software Foundation, |
26 |
* Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the file named |
27 |
* COPYING. COPYING is found in ../compiler. |
28 |
*/ |
29 |
|
30 |
/** @file |
31 |
* Browser Procedures |
32 |
* <pre> |
33 |
* To include this header, you must include the following: |
34 |
* #include "tcl.h" |
35 |
* #include "utilities/ascConfig.h" |
36 |
* #include "compiler/instance_enum.h" |
37 |
* #include "interface/BrowserProc.h" |
38 |
* </pre> |
39 |
*/ |
40 |
|
41 |
#ifndef ASCTK_BROWSERPROC_H |
42 |
#define ASCTK_BROWSERPROC_H |
43 |
|
44 |
extern struct Instance *g_root; |
45 |
/**< The root instance in the Browser */ |
46 |
extern struct Instance *g_curinst; |
47 |
/**< The current instance in the Browser */ |
48 |
|
49 |
extern int Asc_BrowRootInitCmd(ClientData cdata, Tcl_Interp *interp, |
50 |
int argc, CONST84 char *argv[]); |
51 |
/**< |
52 |
* <!-- Asc_BrowRootInitCmd --> |
53 |
* This should set initialize the root.<br><br> |
54 |
* Registered as: rootinit |
55 |
*/ |
56 |
|
57 |
extern int Asc_BrowRootCmd(ClientData cdata, Tcl_Interp *interp, |
58 |
int argc, CONST84 char *argv[]); |
59 |
/**< |
60 |
* This should set the root.<br><br> |
61 |
* Registered as: root $arg$ |
62 |
*/ |
63 |
|
64 |
extern int Asc_BrowRootBackupCmd(ClientData cdata, Tcl_Interp *interp, |
65 |
int argc, CONST84 char *argv[]); |
66 |
/**< |
67 |
* This should backup to the old root.<br><br> |
68 |
* Registered as: oldinst -- will be supseded by the general inst routines. |
69 |
*/ |
70 |
|
71 |
extern int Asc_BrowRootNCmd(ClientData cdata, Tcl_Interp *interp, |
72 |
int argc, CONST84 char *argv[]); |
73 |
/**< |
74 |
* This should set the root. Uses direct addressing. The instance must |
75 |
* already exist in the instance query list. For this to be used.<br><br> |
76 |
* Registered as: rootn $arg$ |
77 |
*/ |
78 |
|
79 |
extern int Asc_BrowTransferCmd(ClientData cdata, Tcl_Interp *interp, |
80 |
int argc, CONST84 char *argv[]); |
81 |
/**< |
82 |
* Used to transfer from a search instance to the maim browser. One of |
83 |
* the main steps in exportin to the browser from any window. The sims |
84 |
* export to browser is a easier case and can be handled through rootinit.<br><br> |
85 |
* Registered as: btransfer |
86 |
*/ |
87 |
|
88 |
extern int Asc_BrowSimListCmd(ClientData cdata, Tcl_Interp *interp, |
89 |
int argc, CONST84 char *argv[]); |
90 |
/**< |
91 |
* Should list all the active simulations.<br><br> |
92 |
* Registered as: slist |
93 |
*/ |
94 |
|
95 |
extern int Asc_BrowSimTypeCmd(ClientData cdata, Tcl_Interp *interp, |
96 |
int argc, CONST84 char *argv[]); |
97 |
/**< |
98 |
* Returns the type of a simulation given the name of the simulation. |
99 |
* Will return an error message if the simlist is null or the name not |
100 |
* found.<br><br> |
101 |
* Registered as: simtype |
102 |
*/ |
103 |
|
104 |
extern int Asc_BrowInstStatCmd(ClientData cdata, Tcl_Interp *interp, |
105 |
int argc, CONST84 char *argv[]); |
106 |
/**< |
107 |
* Print instance tree stats to stdout, a la Tom.<br><br> |
108 |
* Registered as: bstatistics |
109 |
*/ |
110 |
|
111 |
extern int Asc_BrowInstListCmd(ClientData cdata, Tcl_Interp *interp, |
112 |
int argc, CONST84 char *argv[]); |
113 |
/**< |
114 |
* Should list all the working instances.<br><br> |
115 |
* Registered as: ilist |
116 |
*/ |
117 |
|
118 |
extern int Asc_BrowPrintCmd(ClientData cdata, Tcl_Interp *interp, |
119 |
int argc, CONST84 char *argv[]); |
120 |
/**< |
121 |
* Should print the current instance or the simulation list if no |
122 |
* arguements are given.<br><br> |
123 |
* Registered as: bprint |
124 |
*/ |
125 |
|
126 |
extern int Asc_BrowInstQueryCmd(ClientData cdata, Tcl_Interp *interp, |
127 |
int argc, CONST84 char *argv[]); |
128 |
/**< |
129 |
* <!-- Asc_BrowInstQueryCmd --> |
130 |
* Returns the name, type, previous instance, # of children, # of parents, |
131 |
* child list, parents list, and if parent atomic, respectively. |
132 |
* It also returns the appropriate value (TRUE or FALSE) fo the queries: |
133 |
* is the instance assignable ? fixable ? mutable ? constant ? |
134 |
* is it in the list of variables of a WHEN statement ? |
135 |
* If current instance is null, returns NULL_INSTANCE and TCL_ERROR. |
136 |
* Takes the search instance also. if no third argument given, uses |
137 |
* current.<br><br> |
138 |
* |
139 |
* Registered as: inst querykind [cur,search]; |
140 |
* arg : name, type, old, nchild, nparents, child, parent, |
141 |
* isassignable, isfixable, ismutable, isconstant, |
142 |
* iswhenvar, atomchild; |
143 |
*/ |
144 |
|
145 |
extern int Asc_BrowRunInitializeCmd(ClientData cdata,Tcl_Interp *interp, |
146 |
int argc, CONST84 char *argv[]); |
147 |
/**< |
148 |
* <!-- Asc_BrowRunInitializeCmd --> |
149 |
* Will take the current instance and run the named procedure associated |
150 |
* with it. Returns an TCL_OK or TCL_ERROR status flag.<br><br> |
151 |
* Registered as: \"runproc\" $name$ |
152 |
*/ |
153 |
|
154 |
extern int Asc_BrowInstanceMergeCmd(ClientData cdata,Tcl_Interp *interp, |
155 |
int argc, CONST84 char *argv[]); |
156 |
/**< |
157 |
* <!-- Asc_BrowInstanceMergeCmd --> |
158 |
* NOTE WELL -- this function will attempt to merge the current instance |
159 |
* g_curinst and the search instance g_search_inst. Hence to set up |
160 |
* g_search_inst appropriately, call Asc_BrowQlfdidSeachCmd() FIRST.<br><br> |
161 |
* Registered as: \"bmerge\" <noargs> |
162 |
*/ |
163 |
|
164 |
extern int Asc_BrowInstanceRefineCmd(ClientData cdata,Tcl_Interp *interp, |
165 |
int argc, CONST84 char *argv[]); |
166 |
/**< |
167 |
* <!-- Asc_BrowInstanceRefineCmd --> |
168 |
* Will take the current or search instance as specified and will try |
169 |
* to refine it to the specified type. Will return TCL_OK if all works |
170 |
* and a spew of TCL_ERRORs if things are not perfect. Note this function |
171 |
* makes use of RefineClique in instance.c and hence refines all the |
172 |
* members of the clique.<br><br> |
173 |
* Registered as: \"brefine\" ?current?search? type; |
174 |
*/ |
175 |
|
176 |
extern int Asc_BrowMakeAlikeCmd(ClientData cdata,Tcl_Interp *interp, |
177 |
int argc, CONST84 char *argv[]); |
178 |
/**< |
179 |
* <!-- int Asc_BrowMakeAlikeCmd; --> |
180 |
* Will make two instances ARE_ALIKE. |
181 |
* Operates on the current and the search instances.<br><br> |
182 |
* Registered as: \"bmakealike\" current search. |
183 |
*/ |
184 |
|
185 |
/* |
186 |
* Other useful queries exported for general use. |
187 |
*/ |
188 |
|
189 |
extern int Asc_BrowInstIsAtomic(struct Instance *i); |
190 |
/**< |
191 |
* <!-- int Asc_BrowInstIsAtomic(i); --> |
192 |
* Returns true if the instance is one of the atom types. It will fiil |
193 |
* for relations, as at the moment they are not strictly considered |
194 |
* as being atomic. |
195 |
*/ |
196 |
|
197 |
extern int Asc_BrowInstIsSubAtomic(struct Instance *i); |
198 |
/**< |
199 |
* <!-- int Asc_BrowInstIsSubAtomic(i); --> |
200 |
* Returns true if the instance is a child of one of the atom types. |
201 |
* i.e, sub-atomic :-) |
202 |
*/ |
203 |
|
204 |
extern int Asc_BrowInstIsConstant(struct Instance *i); |
205 |
/**< |
206 |
* <!-- int Asc_BrowInstIsConstant(i); --> |
207 |
* Returns true if the instance is a constant. |
208 |
*/ |
209 |
|
210 |
extern int Asc_BrowInstIsMutable(struct Instance *i); |
211 |
/**< |
212 |
* <!-- int Asc_BrowInstIsMutable(i); --> |
213 |
* Returns true if the instance is mutable. The instance must have the |
214 |
* notion of a *value*. Otherwise returns false. |
215 |
*/ |
216 |
|
217 |
STDHLF_H(Asc_BrowAnonTypesCmd); |
218 |
extern int Asc_BrowAnonTypesCmd(ClientData, Tcl_Interp*, int, CONST84 char**); |
219 |
/** Registered as */ |
220 |
#define Asc_BrowAnonTypesCmdHN "__brow_anontypes" |
221 |
/** Usage */ |
222 |
#define Asc_BrowAnonTypesCmdHU \ |
223 |
"libr_anontypes <-current,-search>" |
224 |
/** Short help text */ |
225 |
#define Asc_BrowAnonTypesCmdHS \ |
226 |
"Times the execution of anonymous type classification and prints results" |
227 |
/** Long help text */ |
228 |
#define Asc_BrowAnonTypesCmdHL \ |
229 |
"\ |
230 |
* This is a testing interface for timing anonymous type classification.\n\ |
231 |
* It has no other particular use since no result is obtainable from the\n\ |
232 |
* TCL interpreter on return.\n\ |
233 |
" |
234 |
|
235 |
#endif /* ASCTK_BROWSERPROC_H */ |
236 |
|