source: tol/toltcl/generic/toltclInt.h @ fe54d8d

1941-docker-image-to-testdevel
Last change on this file since fe54d8d was fe54d8d, checked in by Jorge Pérez <josp.jorge@…>, 16 years ago

refs #740, implement

tol::info anything $objRef

it is invoked when and Anything object is inserted in the inspector.

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@3370 be4846ae-f051-483a-831f-b64e7d08527f

  • Property mode set to 100644
File size: 12.7 KB
Line 
1/* toltclInt.h - Declarations of things used internally by the
2                 toltcl extension.
3                 GNU/tolTcl Library
4
5   Copyright (C) 2001, 2002, 2003 - Bayes Decisión, SL
6
7   This program is free software; you can redistribute it and/or modify
8   it under the terms of the GNU General Public License as published by
9   the Free Software Foundation; either version 2, or (at your option)
10   any later version.
11
12   This program is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   GNU General Public License for more details.
16
17   You should have received a copy of the GNU General Public License
18   along with this program; if not, write to the Free Software
19   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20   USA.
21 */
22
23#ifndef TOLTCLINT_H
24#define TOLTCLINT_H 1
25
26#include <tt_common.h>
27#include <tcl.h>
28
29#ifndef __GNUC__
30#if !defined(strncasecmp)
31#    define strncasecmp _strnicmp
32#endif
33#if !defined(strcasecmp)
34#    define strcasecmp  _stricmp
35#endif
36#if !defined(isinf)
37#    define isinf       !_finite
38#endif
39#endif
40
41
42BEGIN_C_DECLS
43
44
45extern Tcl_Interp * TT_interp;
46
47/*! Fill in obj_result the version info corresponding to tol
48 *   {major MajorNum minor MinorNum release ReleaseNum coment Comment}
49 */
50extern int Tol_InfoVersion _ANSI_ARGS_((Tcl_Interp * interp,
51                                        Tcl_Obj * obj_result));
52
53/*! Set the language to be used  by TOL. Fill in obj_result the previous
54 *  language.
55 */
56extern int Tol_SetLanguage _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * lang,
57                                        Tcl_Obj * obj_result));
58
59/*! Return the language used  by TOL. Fill in obj_result the current
60 *  language.
61 */
62extern int Tol_GetLanguage _ANSI_ARGS_((Tcl_Interp * interp,
63                                        Tcl_Obj * obj_result));
64
65/*! Fill in obj_result the result of evaluating including the file
66 *  given as argument: the absolute path.
67 */
68extern int Tol_IncludeFile _ANSI_ARGS_((Tcl_Interp * interp,
69                                        Tcl_Obj * obj_file,
70                                        Tcl_Obj * obj_result));
71
72extern int Tol_DecompileFile _ANSI_ARGS_((Tcl_Interp * interp,
73                                          Tcl_Obj * obj_file,
74                                          Tcl_Obj * obj_result));
75
76extern int Tol_InfoFile _ANSI_ARGS_((Tcl_Interp * interp,
77                                     Tcl_Obj * file,
78                                     Tcl_Obj * obj_result));
79
80/*! Fill in obj_result the result of evaluating in TOL the given
81 *  string.
82 */
83extern int Tol_EvalExpr _ANSI_ARGS_((Tcl_Obj * obj_expr,
84                                     int hidden,
85                                     Tcl_Obj * obj_result));
86
87/*! Fill in obj_result the content of the given tol object's names. The
88 *  object are searched in the console's stack.
89 */
90extern int Tol_ListStack _ANSI_ARGS_((Tcl_Interp * interp,
91                                      int objc,
92                                      Tcl_Obj *CONST objv[],
93                                      Tcl_Obj * obj_result));
94
95/*! Release the given tol object's names. The object are searched in
96 *  the console's stack.
97 */
98extern int Tol_ReleaseStack _ANSI_ARGS_((Tcl_Interp * interp,
99                                         int objc,
100                                         Tcl_Obj *CONST objv[],
101                                         Tcl_Obj * obj_result));
102
103                                         
104/*! Return the fields of a TOL structure.
105 *  { name1 type1 ... namej typej }
106 *  type could be the name of a grammar or {STRUCT struct-name}
107 */
108extern int Tol_GetStructure _ANSI_ARGS_(( Tcl_Interp * interp,
109                                          Tcl_Obj * name, Tcl_Obj * obj_result));
110
111/*! Puts in obj_result the global reference of the given
112 *  syntaxobject. The syntaxobject could be given as set member or as
113 *  global variable. In case of error leave in obj_result the message.
114 *  Returns TCL_OK if succesfull or TCL_ERROR in case of error.
115 */
116int Tol_GetReference(Tcl_Interp *interp, int objc,
117                     Tcl_Obj *CONST objv[], Tcl_Obj * obj_result);
118
119/*
120 * Fill in obj_result the result the string representation of the
121 * address of the object referenced in obj_ref.
122 */
123extern int Tol_GetAddressFromObject _ANSI_ARGS_( (Tcl_Interp * interp,
124                                                 Tcl_Obj * obj_ref,
125                                                 Tcl_Obj * obj_result));
126/*
127 * Fill in obj_result the specific type for an Anything object, could
128 * be: Struct, Class or Anything.
129 */
130extern int Tol_GetAnythingType _ANSI_ARGS_( (Tcl_Interp * interp,
131                                             Tcl_Obj * obj_ref,
132                                             Tcl_Obj * obj_result));
133
134/*! Return the path of a set if it is a file, trigger an error in other case
135 */
136extern int Tol_GetSetPath _ANSI_ARGS_(( Tcl_Interp * interp,
137                                        Tcl_Obj * name, Tcl_Obj * obj_result));
138
139/*! Iterate over a first level's children of a given set.  The set
140 *  could be tolset if the indexes is empty or tolset[i1][i2]...[ik]
141 *  for the given indexes {i1,i2,...,ik}
142 */
143extern int Tol_IterChildren _ANSI_ARGS_((Tcl_Interp * interp,
144                                         int objc,
145                                         Tcl_Obj *CONST objv[],
146                                         Tcl_Obj * obj_result));
147
148/*! Implement a foreach proc similar to the one provided in Tcl except
149 *  that instead of iterating over the list's items it iterates over
150 *  the Set's items. The set could be tolset if the indexes is empty
151 *  or tolset[i1][i2]...[ik] for the given indexes {i1,i2,...,ik}
152 */
153extern int Tol_ForEach _ANSI_ARGS_((Tcl_Interp * interp,
154                                    int objc,
155                                    Tcl_Obj *CONST objv[],
156                                    Tcl_Obj * obj_result));
157
158/*! Fill in obj_result the content of the matrix variable.
159 */
160extern int Tol_GetMatrixContent _ANSI_ARGS_((Tcl_Interp * interp,
161                                             Tcl_Obj * obj_name,
162                                             Tcl_Obj * obj_result));
163
164/*! Fill in obj_result the content of the serie variable.
165 */
166extern int Tol_GetSerieContent _ANSI_ARGS_((Tcl_Interp * interp,
167                                            int objc,
168                                            Tcl_Obj *CONST objv[],
169                                            Tcl_Obj * obj_result));
170
171/*! Create a new command to manipulate a group of series.
172 */
173extern int Tol_CreateSerieGrp _ANSI_ARGS_((Tcl_Interp * interp,
174                                           int objc,
175                                           Tcl_Obj *CONST series[],
176                                           Tcl_Obj * obj_result));
177
178/*! Create a new command to manipulate a group of series.
179 */
180extern int Tol_DestroySerieGrp _ANSI_ARGS_((Tcl_Interp * interp,
181                                           int objc,
182                                           Tcl_Obj *CONST objv[],
183                                           Tcl_Obj * obj_result));
184
185/*! Create a new command to manipulate a group of sets (only one set)
186 */
187extern int Tol_CreateTable _ANSI_ARGS_((Tcl_Interp * interp,
188                                        Tcl_Obj * tblcmd,
189                                        Tcl_Obj * objref,
190                                        int ismat,
191                                        Tcl_Obj * obj_result));
192
193/*! Create a new command to manipulate a group of sets (only one set)
194 */
195extern int Tol_DestroyTable _ANSI_ARGS_((Tcl_Interp * interp,
196                                         int objc,
197                                         Tcl_Obj *CONST objv[],
198                                         Tcl_Obj * obj_result));
199
200/*! Fill in obj_result the list of tol files included
201 */
202extern int Tol_InfoIncluded _ANSI_ARGS_((Tcl_Interp * interp,
203                                         Tcl_Obj * obj_result));
204
205/*! Fill in obj_result the list of grammars defined in TOL
206 */
207extern int Tol_SetGrammarsObj _ANSI_ARGS_((Tcl_Interp * interp,
208                                           Tcl_Obj * obj_result));
209
210/*! Fill in obj_result the list of packages defined in TOL
211 */
212extern int Tol_SetPackagesObj _ANSI_ARGS_((Tcl_Interp * interp,
213                                           Tcl_Obj * obj_result));
214
215/*! Fill in obj_result the description of gra_name.
216 */
217int Tol_SetGrammarDescObj _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * gra_name,
218                                        Tcl_Obj * obj_result));
219
220/*! Fill in obj_result the description of pkgName.
221 */
222int Tol_SetPackageDescObj _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj *pkgName,
223                                       Tcl_Obj * obj_result));
224
225/*! Fill in obj_result the functions defined for grammar gra_name.
226 */
227extern int Tol_SetFunctionsObj _ANSI_ARGS_((Tcl_Interp * interp,
228                                            Tcl_Obj * gra_name,
229                                            Tcl_Obj * obj_result));
230
231/*! Fill in obj_result the function's prototype and description
232 *  for a given function in a given grammar.
233 */
234int Tol_SetFunctionInfoObj _ANSI_ARGS_((Tcl_Obj * gra_name,
235                            Tcl_Obj * fun_name,
236                            Tcl_Obj * obj_result));
237/*! Fill in obj_result the variables defined for grammar gra_name.
238 */
239extern
240int Tol_SetVariablesObj _ANSI_ARGS_((Tcl_Interp * interp,
241                                    Tcl_Obj * gra_name,
242                                    Tcl_Obj * obj_result));
243
244/*! Fill in obj_result the variables's description for a given function
245 *  in a given grammar.
246 */
247extern
248int Tol_SetVariableInfoObj _ANSI_ARGS_((Tcl_Obj * gra_name,
249                                       Tcl_Obj * var_name,
250                                       Tcl_Obj * obj_result));
251
252/*! Create a new command to access the given TOL timeset object name.
253 */
254extern
255int Tol_CreateTMSCmd _ANSI_ARGS_((Tcl_Interp * interp,
256                                  Tcl_Obj * tmscmd,
257                                  Tcl_Obj * tmsname,
258                                  Tcl_Obj * obj_result));
259
260/*! Destroy the tcl tms commands given in objv.
261 */
262extern
263int Tol_DestroyTMSCmd _ANSI_ARGS_((Tcl_Interp * interp,
264                                  int objc, Tcl_Obj *CONST objv[],
265                                  Tcl_Obj * obj_result));
266
267/*! Implement tol::date
268 */
269extern
270int Tol_DateOption _ANSI_ARGS_((Tcl_Interp * interp,
271                                int objc, Tcl_Obj *CONST objv[],
272                                Tcl_Obj * obj_result));
273
274/*! Implement tol::autocorr
275 */
276extern
277int Tol_GetAutoCorr _ANSI_ARGS_((Tcl_Interp * interp,
278                                int objc, Tcl_Obj *CONST objv[],
279                                Tcl_Obj * obj_result));
280
281/*! Implement tol::seriestat
282 */
283extern
284int Tol_ComputeSerieStat _ANSI_ARGS_((Tcl_Interp * interp,
285                                      int objc, Tcl_Obj *CONST objv[],
286                                      Tcl_Obj * obj_result));
287extern
288int Tol_StopEvaluation _ANSI_ARGS_(());
289
290extern
291int Tol_LCFormat _ANSI_ARGS_((Tcl_Interp*   interp,
292                              Tcl_Obj*CONST value,
293                              Tcl_Obj*      obj_result));
294extern
295void Tol_InstallHciWriter _ANSI_ARGS_(());
296
297extern
298void Tol_InstallMethodsHook _ANSI_ARGS_(());
299
300END_C_DECLS
301
302//------------------------------------------------------------
303#ifdef __cplusplus
304
305//#define FINDVARIABLE FindVariable
306#define FINDVARIABLE(name) FindOperand(name,true)
307
308class BSyntaxObject;
309class BGrammar;
310class BDate;
311class BList;
312
313extern
314int Tol_CreateSerieGrp _ANSI_ARGS_((Tcl_Interp * interp,
315                                    char * sgrp_name,
316                                    BList * series,
317                                    Tcl_Obj * obj_result));
318
319extern
320int Tol_ParseDate(Tcl_Interp * interp, char * what, BDate & date);
321
322/*!
323 *  Tol_ResolveObject --
324 *
325 *     Resolve a SyntaxObject given a toltcl object reference. A
326 *     reference is {TYPE ?container? i1 i2 ... in} or a global
327 *     container's name of type File|Set|NameBlock|Console. When TYPE
328 *     is Console then container is not given. The grammar of the
329 *     object found is matched to the given argument grammar. If the
330 *     return value is NULL an error message is left in interp.
331 */
332extern
333BSyntaxObject * Tol_ResolveObject(Tcl_Interp *interp,
334                                  Tcl_Obj    *obj_ref,
335                                  Tcl_Obj    *obj_result/*,
336                                                          BGrammar   *grammar=NULL*/);
337
338extern
339int Tol_ListToDate _ANSI_ARGS_(( Tcl_Interp * interp, Tcl_Obj * list,
340                    BDate & date, Tcl_Obj * obj_result ));
341
342extern
343int Tol_DateToList _ANSI_ARGS_(( BDate & date, Tcl_Obj * obj_result ));
344
345#endif /* __cplusplus */
346//------------------------------------------------------------
347
348#endif /* TOLTCLINT_H */
Note: See TracBrowser for help on using the repository browser.