1 |
aw0a |
1 |
/* |
2 |
|
|
* ScriptProc.h |
3 |
|
|
* by Kirk Abbott and Ben Allan |
4 |
|
|
* Created: 1/94 |
5 |
|
|
* Version: $Revision: 1.9 $ |
6 |
|
|
* Version control file: $RCSfile: ScriptProc.h,v $ |
7 |
|
|
* Date last modified: $Date: 2003/08/23 18:43:07 $ |
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 |
jds |
54 |
/** @file |
31 |
|
|
* Script procedures. |
32 |
|
|
* <pre> |
33 |
|
|
* Requires: #include "tcl.h" |
34 |
|
|
* #include "utilities/ascConfig.h" |
35 |
|
|
* </pre> |
36 |
|
|
*/ |
37 |
|
|
|
38 |
johnpye |
67 |
#ifndef ASCTK_SCRIPTPROC_H |
39 |
|
|
#define ASCTK_SCRIPTPROC_H |
40 |
aw0a |
1 |
|
41 |
|
|
extern int Asc_ScriptInterrupt; |
42 |
jds |
54 |
/**< |
43 |
|
|
* The C variable corresponding to the script being interrupted |
44 |
aw0a |
1 |
* by an interactive user or call with a trapped exception. |
45 |
|
|
*/ |
46 |
|
|
|
47 |
jds |
54 |
extern int Asc_ScriptConfigureInterrupt(int bool, Tcl_Interp *interp); |
48 |
|
|
/**< |
49 |
|
|
* <!-- err = Asc_ScriptConfigureInterrupt(bool,interp); --> |
50 |
|
|
* <!-- int err,bool; --> |
51 |
aw0a |
1 |
* Configures the script variable ascScripVect(menubreak) to |
52 |
|
|
* shadow the C int Asc_ScriptInterrupt. |
53 |
|
|
* Tcl makes sure changes to ascScripVect(menubreak) |
54 |
|
|
* are reflected in the C variable. |
55 |
|
|
* See the man pages of Tcl_LinkVar, Tcl_UnlinkVar, Tcl_UpdateLinkedVar |
56 |
|
|
* for details. |
57 |
jds |
54 |
* |
58 |
|
|
* @param interp The interpretter the ascend application is running in. |
59 |
|
|
* @param bool Is 1 at startup and 0 at shutdown. |
60 |
|
|
* @return Returns 0 if the call is ok, 1 if the call is not ok. |
61 |
aw0a |
1 |
*/ |
62 |
|
|
|
63 |
|
|
extern int Asc_ScriptEvalCmd(ClientData cdata, Tcl_Interp *interp, |
64 |
|
|
int argc, CONST84 char *argv[]); |
65 |
jds |
54 |
/**< |
66 |
|
|
* <!-- int Asc_ScriptEvalCmd; --> |
67 |
|
|
* Attempts to evaluate in the global sphere rather than locally.<br><br> |
68 |
|
|
* |
69 |
aw0a |
1 |
* Registered as : \"script_eval\" string"; |
70 |
|
|
*/ |
71 |
|
|
|
72 |
|
|
extern int Asc_ScriptRefineCmd(ClientData cdata, Tcl_Interp *interp, |
73 |
|
|
int argc, CONST84 char *argv[]); |
74 |
jds |
54 |
/**< |
75 |
|
|
* Refines the qlfdid given to type if possible. if qlfdid exists and |
76 |
|
|
* is none null, return will be as Asc_BrowInstanceRefineCmd().<br><br> |
77 |
|
|
* |
78 |
|
|
* Registered as: srefine <type> search <qlfdid> |
79 |
aw0a |
1 |
*/ |
80 |
|
|
|
81 |
|
|
extern int Asc_ScriptMergeCmd(ClientData cdata, Tcl_Interp *interp, |
82 |
|
|
int argc, CONST84 char *argv[]); |
83 |
jds |
54 |
/**< |
84 |
|
|
* Merges the qlfdid if possible.<br><br> |
85 |
|
|
* |
86 |
|
|
* Registered as: smerge <qlfdid> <qlfdid> |
87 |
aw0a |
1 |
*/ |
88 |
|
|
|
89 |
|
|
extern int Asc_FastRaiseCmd(ClientData cdata, Tcl_Interp *interp, |
90 |
|
|
int argc, CONST84 char *argv[]); |
91 |
jds |
54 |
/**< |
92 |
|
|
* Calls XRaiseWindow rather than the big tk spew which is so slow.<br><br> |
93 |
|
|
* |
94 |
|
|
* Registered as: asc_raise windowname |
95 |
aw0a |
1 |
*/ |
96 |
|
|
|
97 |
|
|
STDHLF_H(Asc_TimeCmd); |
98 |
|
|
|
99 |
|
|
extern int Asc_TimeCmd(ClientData cdata, Tcl_Interp *interp, |
100 |
|
|
int argc, CONST84 char *argv[]); |
101 |
jds |
54 |
/**< |
102 |
|
|
* Timing function. |
103 |
aw0a |
1 |
* string is a valid tcl script to be evaluated globally as script_eval. |
104 |
|
|
* n is the number of times to evaluate the script for an average time. |
105 |
jds |
54 |
* n defaults to 1 since many ASCEND scripts are not repeatable.<br><br> |
106 |
|
|
* |
107 |
|
|
* Registered as: asc_clock <string> [n] |
108 |
aw0a |
1 |
*/ |
109 |
jds |
54 |
|
110 |
|
|
/** Long help text part 1 */ |
111 |
aw0a |
1 |
#define Asc_TimeCmdHL1 \ |
112 |
|
|
"\ |
113 |
|
|
* Returns a list of numbers: \n\ |
114 |
|
|
* {real_time_avg time_avg clock_avg clock_max clock_min CPS} \n\ |
115 |
|
|
* real_time_avg- average real seconds consumed per evaluation of string. \n\ |
116 |
|
|
* time_avg- average cpu seconds consumed per evaluation of string. \n\ |
117 |
|
|
" |
118 |
jds |
54 |
/** Long help text part 2 */ |
119 |
aw0a |
1 |
#define Asc_TimeCmdHL2 \ |
120 |
|
|
"\ |
121 |
|
|
* clock_avg- average clock units consumed per evaluation of string. \n\ |
122 |
|
|
* clock_max- most clock units consumed by a single call \n\ |
123 |
|
|
* clock_min- least clock units consumed by a single call \n\ |
124 |
|
|
* CPS- CLOCKS_PER_SEC value by which times are computed from clocks. \n\ |
125 |
|
|
" |
126 |
|
|
|
127 |
|
|
extern int Asc_StringCompact(ClientData cdata, Tcl_Interp *interp, |
128 |
|
|
int argc, CONST84 char *argv[]); |
129 |
jds |
54 |
/**< |
130 |
aw0a |
1 |
* Takes a string and eats away any extra blanks or tabs that are |
131 |
|
|
* not protected by matched {}. replaces unprotected tabs with a |
132 |
|
|
* single space. trims leading/trailing blanks/tabs. Doesn't |
133 |
jds |
54 |
* treat \n as a special character.<br><br> |
134 |
|
|
* |
135 |
|
|
* Registered as: stringcompact <string> |
136 |
aw0a |
1 |
*/ |
137 |
|
|
|
138 |
johnpye |
67 |
#endif /* ASCTK_SCRIPTPROC_H */ |
139 |
aw0a |
1 |
|