/[ascend]/trunk/tcltk98/generic/interface/SimsProc.c
ViewVC logotype

Contents of /trunk/tcltk98/generic/interface/SimsProc.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 64 - (show annotations) (download) (as text)
Wed Nov 30 06:06:46 2005 UTC (14 years, 7 months ago) by johnpye
File MIME type: text/x-csrc
File size: 19991 byte(s)
Moved non-Tcl parts of qlfdid to base/generic.
Moved non-Tcl parts of SimsProc to base/generic/compiler/simlist (changeset 96).
Moved g_compiler_timing to base/generic/compiler/simlist.
1 /*
2 * SimsProc.c
3 * by Kirk Abbott and Ben Allan
4 * Created: 1/94
5 * Version: $Revision: 1.31 $
6 * Version control file: $RCSfile: SimsProc.c,v $
7 * Date last modified: $Date: 2003/08/23 18:43:08 $
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
31 #include <ctype.h>
32 #include "tcl.h"
33 #include "utilities/ascConfig.h"
34 #include "utilities/ascMalloc.h"
35 #include "general/tm_time.h"
36 #include "general/list.h"
37 #include "general/dstring.h"
38 #include "compiler/compiler.h"
39 #include "compiler/instance_enum.h"
40 #include "compiler/cmpfunc.h"
41 #include "compiler/fractions.h"
42 #include "compiler/dimen.h"
43 #include "compiler/types.h"
44 #include "compiler/stattypes.h"
45 #include "compiler/statement.h"
46 #include "compiler/slist.h"
47 #include "compiler/syntax.h"
48 #include "compiler/prototype.h"
49 #include "compiler/symtab.h"
50 #include "compiler/instance_io.h"
51 #include "compiler/instance_name.h"
52 #include "compiler/parentchild.h"
53 #include "compiler/instquery.h"
54 #include "compiler/extinst.h"
55 #include "compiler/child.h"
56 #include "compiler/type_desc.h"
57 #include "compiler/copyinst.h"
58 #include "compiler/destroyinst.h"
59 #include "compiler/module.h"
60 #include "compiler/library.h"
61 #include "compiler/name.h"
62 #include "compiler/pending.h"
63 #include "compiler/check.h"
64 #include "compiler/stattypes.h"
65 #include "compiler/relation_type.h"
66 #include "compiler/bintoken.h"
67 #include "compiler/instantiate.h"
68 #include "compiler/value_type.h"
69 #include "compiler/statio.h"
70 #include "compiler/bit.h"
71 #include "compiler/simlist.h"
72 #include "solver/slv_types.h"
73 #include "interface/HelpProc.h"
74 #include "interface/Qlfdid.h"
75 #include "interface/Driver.h"
76 #include "interface/BrowserProc.h"
77 #include "interface/HelpProc.h"
78 #include "interface/SimsProc.h"
79
80 #ifndef lint
81 static CONST char SimsProcID[] = "$Id: SimsProc.c,v 1.31 2003/08/23 18:43:08 ballan Exp $";
82 #endif
83
84 int Asc_SimsQueryCmd(ClientData cdata, Tcl_Interp *interp,
85 int argc, CONST84 char *argv[])
86 {
87 struct Instance *sim;
88
89 (void)cdata; /* stop gcc whine about unused parameter */
90
91 if (( argc == 2 ) && ( (strncmp(argv[1],"getcurrent",4)) == 0 )) {
92 sim = Asc_GetCurrentSim();
93 if (sim) {
94 Tcl_AppendResult(interp,(char *)SCP(GetSimulationName(sim)),
95 (char *)NULL);
96 return TCL_OK;
97 } else {
98 Tcl_SetResult(interp, "1", TCL_STATIC);
99 return TCL_OK;
100 }
101 }
102
103 if (( argc == 3 ) && ( (strncmp(argv[1],"setcurrent",4)) == 0 )) {
104 sim = Asc_FindSimulationTop(AddSymbol(argv[2]));
105 if (sim) {
106 Asc_SetCurrentSim(sim);
107 Tcl_SetResult(interp, "0", TCL_STATIC);
108 return TCL_OK;
109 } else {
110 Tcl_SetResult(interp, "1", TCL_STATIC);
111 return TCL_OK;
112 }
113 }
114
115 Tcl_AppendResult(interp,"Invalid args: Usage ", argv[0],
116 " <setcurrent,getcurrent>", (char *)NULL);
117 return TCL_ERROR;
118 }
119
120 int Asc_SimsUniqueNameCmd(ClientData cdata, Tcl_Interp *interp,
121 int argc, CONST84 char *argv[])
122 {
123 (void)cdata; /* stop gcc whine about unused parameter */
124
125 if ( argc != 2 ) {
126 Tcl_SetResult(interp, "call is: unique \"name\"", TCL_STATIC);
127 return TCL_ERROR;
128 }
129 if (Asc_SimsUniqueName(AddSymbol(argv[1]))) {
130 Tcl_SetResult(interp, "1", TCL_STATIC);
131 } else {
132 Tcl_SetResult(interp, "0", TCL_STATIC);
133 }
134 return TCL_OK;
135 }
136
137 int Asc_SimsCreateInstanceCmd(ClientData cdata, Tcl_Interp *interp,
138 int argc, CONST84 char *argv[])
139 {
140 struct TypeDescription *type;
141 struct Instance *new;
142 symchar *name, *defmethod;
143 int len, format, k;
144
145 (void)cdata; /* stop gcc whine about unused parameter */
146
147 if (( argc < 3 ) || ( argc > 6 )) {
148 Tcl_AppendResult(interp,"wrong # args:",
149 "Usage sim_create <instance_name> <instance_type>",
150 "[-m defaultMethod] [-p,-r]",(char *)NULL);
151 return TCL_ERROR;
152 }
153
154 name = AddSymbol(argv[1]);
155 len = SCLEN(name);
156 if ((len<1) || (len > 70)) {
157 Tcl_SetResult(interp, "Simulation name too long (> 70)", TCL_STATIC);
158 return TCL_ERROR;
159 }
160 if (isdigit(SCP(name)[0])) {
161 Tcl_SetResult(interp, "Instance names cannot begin with a digit",
162 TCL_STATIC);
163 return TCL_ERROR;
164 }
165
166 type = FindType(AddSymbol(argv[2]));
167 if (type==NULL) {
168 Tcl_AppendResult(interp,"CreateInstance called with unknown type",
169 (char *)NULL);
170 return TCL_ERROR;
171 }
172
173 /*
174 * Check for additional compilation flags.
175 */
176 format = 0; /* do standard compilation */
177 k = 3;
178 defmethod = AddSymbol("default_self"); /* when no input with -m */
179 while (k < argc) {
180 if (strcmp(argv[k],"-r")==0) {
181 format = 1; /* do no relations */
182 k++;
183 continue;
184 }
185 if (strcmp(argv[k],"-p")==0) {
186 format = 2; /* do patch compilation */
187 k++;
188 continue;
189 }
190 if (strcmp(argv[k],"-m")==0) {
191 if ( (k+1)== argc) {
192 k++;
193 defmethod = NULL; /* -m <noargs> --> no defaults */
194 } else {
195 defmethod = AddSymbol(argv[k+1]);
196 k += 2;
197 }
198 continue;
199 }
200 Tcl_AppendResult(interp,"Unknown compilation flag",(char *)NULL);
201 return TCL_ERROR;
202 }
203
204 if (Asc_SimsUniqueName(name)) {
205 Tcl_GlobalEval(interp,"Sims_SetupBinTokenCC");
206 new = SimsCreateInstance(GetName(type),name,format,defmethod);
207 if (new != NULL) {
208 gl_insert_sorted(g_simulation_list,new,(CmpFunc)Asc_SimsCmpSim);
209 Tcl_SetResult(interp, "0", TCL_STATIC);
210 return TCL_OK;
211 } else { /* Instantiate returned null */
212 Tcl_AppendResult(interp,"Simulation of type ",argv[2]," with name ",
213 (char *)SCP(name),
214 " cannot be instantiated.", (char *)NULL);
215 return TCL_ERROR;
216 }
217 } else { /* sim already exists */
218 Tcl_AppendResult(interp,"A simulation of the name ",(char *)SCP(name),
219 " already exists", (char *)NULL);
220 return TCL_ERROR;
221 }
222 #ifndef NDEBUG
223 return TCL_OK; /* NOT reached */
224 #endif
225 }
226
227
228 /*
229 * This function searches the simulation list for
230 * the *root* instance of the simulation.
231 */
232 struct Instance *Asc_FindSimulationRoot(symchar *str)
233 {
234 unsigned long c,len;
235 struct Instance *ptr;
236
237 len = gl_length(g_simulation_list);
238 for (c = len; c >= 1; c--) {
239 ptr = (struct Instance *)gl_fetch(g_simulation_list,c);
240 if (GetSimulationName(ptr) == str) {
241 return GetSimulationRoot(ptr);
242 }
243 }
244 return NULL;
245 }
246
247 symchar *Asc_SimsFindSimulationName(CONST struct Instance *root)
248 {
249 unsigned long len,c;
250 struct Instance *ptr;
251
252 if (!root) {
253 return NULL;
254 }
255 len = gl_length(g_simulation_list);
256 for(c=len;c>=1;c--) {
257 ptr = (struct Instance *)gl_fetch(g_simulation_list,c);
258 if (GetSimulationRoot(ptr)==root) {
259 return GetSimulationName(ptr);
260 }
261 }
262 return NULL;
263 }
264
265 /*
266 *********************************************************************
267 * Resume Instantiation functions
268 *
269 * An experimental UpdateInstanceCmd is included here.
270 *
271 * Query ? Is it possible for Reinstantiate to move the root instance ?
272 * Not sure. At the moment it does not return an instance pointer.
273 *********************************************************************
274 */
275
276 int Asc_SimsResumeInstantiateCmd(ClientData cdata, Tcl_Interp *interp,
277 int argc, CONST84 char *argv[])
278 {
279 double start_time;
280 struct Instance *xisting;
281
282 (void)cdata; /* stop gcc whine about unused parameter */
283
284 if ( argc != 2 ) {
285 Tcl_SetResult(interp, "call is: sresume <instancename> ", TCL_STATIC);
286 return TCL_ERROR;
287 }
288 xisting = Asc_FindSimulationRoot(AddSymbol(argv[1]));
289 if (xisting) {
290 if (g_compiler_timing) {
291 start_time = tm_cpu_time();
292 }
293 ReInstantiate(xisting);
294 if (g_compiler_timing) {
295 FPRINTF(stdout,"Reinstantiation CPU time = %g seconds\n",
296 tm_cpu_time() - start_time);
297 }
298 Tcl_SetResult(interp, "0", TCL_STATIC);
299 return TCL_OK;
300 } else {
301 Tcl_AppendResult(interp,"Instance ", argv[1], "not found",(char *)NULL);
302 return TCL_ERROR;
303 }
304 }
305
306 int Asc_SimsUpdateInstanceCmd(ClientData cdata, Tcl_Interp *interp,
307 int argc, CONST84 char *argv[])
308 {
309 struct Instance *target;
310 struct TypeDescription *desc, *patchdef;
311 CONST struct StatementList *slist;
312 double start_time;
313
314 (void)cdata; /* stop gcc whine about unused parameter */
315
316 if ( argc != 3 ) {
317 Tcl_SetResult(interp, "call is: __sims_update qlfdid type", TCL_STATIC);
318 return TCL_ERROR;
319 }
320 /*
321 * Find the target instance, and leave g_search_inst
322 * looking at it.
323 */
324 if (Asc_QlfdidSearch3(argv[1],0)) {
325 Tcl_SetResult(interp, "target instance not found", TCL_STATIC);
326 return TCL_ERROR;
327 }
328 target = g_search_inst;
329
330 patchdef = FindType(AddSymbol(argv[2]));
331 if (!patchdef) {
332 Tcl_SetResult(interp, "Cannot find patch type", TCL_STATIC);
333 return TCL_ERROR;
334 }
335 desc = InstanceTypeDesc(target);
336 if (GetPatchOriginal(patchdef)!=desc) {
337 Tcl_SetResult(interp, "Inconsistent types in patch", TCL_STATIC);
338 return TCL_ERROR;
339 }
340
341 start_time = tm_cpu_time(); /* do the update */
342 slist = GetStatementList(patchdef);
343 UpdateInstance(g_root,target,slist);
344 if (g_compiler_timing) {
345 PRINTF("Reinstantiation CPU time = %g seconds\n",
346 tm_cpu_time() - start_time);
347 }
348
349 return TCL_OK;
350 }
351
352
353 int Asc_SimsCopyInstanceCmd(ClientData cdata, Tcl_Interp *interp,
354 int argc, CONST84 char *argv[])
355 {
356 struct Instance *target;
357 double start_time;
358
359 (void)cdata; /* stop gcc whine about unused parameter */
360
361 if ( argc != 2 ) {
362 Tcl_SetResult(interp, "call is: __sims_copy qlfdid", TCL_STATIC);
363 return TCL_ERROR;
364 }
365
366 /*
367 * Find the target instance, and leave g_search_inst
368 * looking at it.
369 */
370 if (Asc_QlfdidSearch3(argv[1],0)) {
371 Tcl_SetResult(interp, "target instance not found", TCL_STATIC);
372 return TCL_ERROR;
373 }
374
375 start_time = tm_cpu_time();
376 target = g_search_inst;
377 target = CopyInstance(target);
378 start_time = tm_cpu_time() - start_time;
379 FPRINTF(stderr,"Time to copy instance = %g\n",start_time);
380 DestroyInstance(target,NULL);
381
382 return TCL_OK;
383 }
384
385
386 int Asc_SimsProtoTypeInstanceCmd(ClientData cdata, Tcl_Interp *interp,
387 int argc, CONST84 char *argv[])
388 {
389 struct Instance *target, *result;
390 CONST struct TypeDescription *desc;
391 double start_time;
392
393 (void)cdata; /* stop gcc whine about unused parameter */
394
395 if ( argc != 2 ) {
396 Tcl_SetResult(interp, "call is: __sims_proto qlfdid", TCL_STATIC);
397 return TCL_ERROR;
398 }
399
400 if (Asc_QlfdidSearch3(argv[1],0)) {
401 Tcl_SetResult(interp, "target instance not found", TCL_STATIC);
402 return TCL_ERROR;
403 }
404
405 start_time = tm_cpu_time();
406 target = g_search_inst;
407 switch (InstanceKind(target)) {
408 case ARRAY_ENUM_INST:
409 case ARRAY_INT_INST:
410 case SIM_INST:
411 Tcl_SetResult(interp, "Cannot prototype this type of instance",TCL_STATIC);
412 return TCL_ERROR;
413 default:
414 break;
415 }
416
417 desc = InstanceTypeDesc(target);
418 if (LookupPrototype(GetName(desc))) {
419 Tcl_SetResult(interp, "a prototype already exists", TCL_STATIC);
420 return TCL_OK;
421 }
422 result = CopyInstance(target);
423 start_time = tm_cpu_time() - start_time;
424 if (result) {
425 AddPrototype(result);
426 FPRINTF(stderr,"Time to prototype instance = %g\n",start_time);
427 return TCL_OK;
428 } else {
429 Tcl_SetResult(interp, "Error in prototyping instance", TCL_STATIC);
430 return TCL_ERROR;
431 }
432 }
433
434
435 int Asc_SimsSaveInstanceCmd(ClientData cdata, Tcl_Interp *interp,
436 int argc, CONST84 char *argv[])
437 {
438 FILE *fp = NULL;
439 struct Instance *target;
440 double start_time;
441
442 (void)cdata; /* stop gcc whine about unused parameter */
443
444 if ( argc != 3 ) {
445 Tcl_SetResult(interp, "call is: __sims_saveinst qlfdid file", TCL_STATIC);
446 return TCL_ERROR;
447 }
448
449 /*
450 * Find the target instance, and leave g_search_inst
451 * looking at it.
452 */
453 if (Asc_QlfdidSearch3(argv[1],0)) {
454 Tcl_SetResult(interp, "target instance not found", TCL_STATIC);
455 return TCL_ERROR;
456 }
457 /*
458 * Set up the file pointer.
459 */
460 fp = fopen(argv[2],"w");
461 if (!fp) {
462 Tcl_SetResult(interp, "error in opening file", TCL_STATIC);
463 return TCL_ERROR;
464 }
465
466 start_time = tm_cpu_time();
467 target = g_search_inst;
468 SaveInstance(fp,target,0);
469 start_time = tm_cpu_time() - start_time;
470 FPRINTF(stderr,"Time to save instance = %g\n",start_time);
471
472 if (fp) {
473 fclose(fp);
474 }
475 return TCL_OK;
476 }
477
478
479
480 /*
481 *********************************************************************
482 * Destroy Simulation functions
483 *
484 * The DestroyInstance code correctly deals with *all*
485 * instances. As such SIM_INST are correctly handled as well
486 * DO NOT refer to it after this. Parts of the sim instance that
487 * are shared by other instances, (as in the case of universals)
488 * are properly handled, and will not be deallocated unless this
489 * simulation is the only parent.
490 *********************************************************************
491 */
492
493 int Asc_SimsDestroySimulationCmd(ClientData cdata, Tcl_Interp *interp,
494 int argc, CONST84 char *argv[])
495 {
496 struct Instance *xisting, *current;
497 unsigned long ndx;
498
499 (void)cdata; /* stop gcc whine about unused parameter */
500
501 if ( argc != 2 ) {
502 Tcl_SetResult(interp, "wrong # args: Usage: sim_destroy <simname>",
503 TCL_STATIC);
504 return TCL_ERROR;
505 }
506 xisting = Asc_FindSimulationTop(AddSymbol(argv[1]));
507 if (xisting) {
508 /* the next line grabs the index in the list */
509 ndx = gl_search(g_simulation_list,xisting,(CmpFunc)Asc_SimsCmpSim);
510 current = Asc_GetCurrentSim();
511 if (current) {
512 if (Asc_SimsCmpSim(xisting,current)==0) {
513 Asc_SetCurrentSim(NULL);
514 Asc_DeAllocSim(xisting);
515 gl_delete(g_simulation_list,ndx,0);
516 Tcl_AppendResult(interp,"Simulation ",argv[1], " deleted",
517 (char *)NULL);
518 return TCL_OK;
519 }
520 }
521 Asc_DeAllocSim(xisting); /* prepares for cleanup */
522 gl_delete(g_simulation_list,ndx,0);
523 Tcl_AppendResult(interp,"Simulation ",argv[1], " deleted", (char *)NULL);
524 return TCL_OK;
525 } else {
526 Tcl_AppendResult(interp,"Simulation ",argv[1]," not found",(char *)NULL);
527 return TCL_ERROR;
528 }
529 }
530
531 int Asc_BrowShowPendings(ClientData cdata, Tcl_Interp *interp,
532 int argc, CONST84 char *argv[])
533 {
534 struct Instance *i;
535 char buf[MAXIMUM_NUMERIC_LENGTH]; /* string to hold long */
536 unsigned long p=0L;
537
538 (void)cdata; /* stop gcc whine about unused parameter */
539
540 if ( argc != 3 ) {
541 Tcl_AppendResult(interp,"wrong # args: Usage: ",
542 "\"bnumpendings\" ?sim?inst ?simname?current?search?",
543 (char *)NULL);
544 return TCL_ERROR;
545 }
546 if ( (strncmp(argv[1],"simulation",3)) == 0 ) {
547 i = Asc_FindSimulationRoot(AddSymbol(argv[2]));
548 } else if ( (strncmp(argv[1],"instance",3)) == 0 ) {
549 if ( (strncmp(argv[2],"current",3)) == 0 ) {
550 i = g_curinst;
551 } else {
552 i = g_search_inst;
553 }
554 }
555 if (!i) {
556 Tcl_SetResult(interp, "10000", TCL_STATIC); /* Just some big number */
557 return TCL_OK;
558 }
559 p = NumberPendingInstances(i);
560 if (p>0L) {
561 sprintf(buf,"%lu",p);
562 Tcl_SetResult(interp, buf, TCL_VOLATILE);
563 }
564 return TCL_OK;
565 }
566
567 static
568 void BrowWritePendingStatements(FILE *f, CONST struct Instance *i)
569 {
570 CONST struct BitList *blist;
571 CONST struct TypeDescription *desc;
572 CONST struct StatementList *slist;
573 CONST struct Statement *stat;
574 CONST struct gl_list_t *list;
575 unsigned long c,len;
576 blist = InstanceBitList(i);
577 if ((blist!=NULL)&&(!BitListEmpty(blist))) {
578 FPRINTF(stderr,"PENDING STATEMENTS\n");
579 desc = InstanceTypeDesc(i);
580 slist = GetStatementList(desc);
581 list = GetList(slist);
582 len = gl_length(list);
583 for(c=1;c<=len;c++) {
584 if (ReadBit(blist,c-1)) {
585 stat = (struct Statement *)gl_fetch(list,c);
586 WriteStatement(f,stat,4);
587 if (StatementType(stat)== SELECT) {
588 c = c + SelectStatNumberStats(stat);
589 }
590 }
591 }
592 }
593 }
594
595 int Asc_BrowWritePendingsSTDOUT(ClientData cdata, Tcl_Interp *interp,
596 int argc, CONST84 char *argv[])
597 {
598 struct Instance *i;
599
600 (void)cdata; /* stop gcc whine about unused parameter */
601
602 if ( argc != 2 ) {
603 Tcl_SetResult(interp, "wrong # args : Usage \"bwritependings\" simname",
604 TCL_STATIC);
605 return TCL_ERROR;
606 }
607 i = Asc_FindSimulationRoot(AddSymbol(argv[1]));
608 if (!i) {
609 Tcl_SetResult(interp, "given simulation nonexistent !", TCL_STATIC);
610 return TCL_ERROR;
611 }
612 BrowWritePendingStatements(stdout,i);
613 return TCL_OK;
614 }
615
616 int Asc_SimListPending(ClientData cdata, Tcl_Interp *interp,
617 int argc, CONST84 char *argv[])
618 {
619 struct Instance *i;
620 FILE *fp = stdout;
621
622 (void)cdata; /* stop gcc whine about unused parameter */
623
624 if (( argc != 2 ) && ( argc != 3 )) {
625 Tcl_SetResult(interp,
626 "simlistpending: simlistpending simname [optional filename]",
627 TCL_STATIC);
628 return TCL_ERROR;
629 }
630 i = Asc_FindSimulationRoot(AddSymbol(argv[1]));
631 if (!i) {
632 Tcl_SetResult(interp, "simlistpending: given simulation not found!",
633 TCL_STATIC);
634 return TCL_ERROR;
635 }
636 if ( argc == 3 ) {
637 fp = fopen(argv[2],"w+");
638 if (fp==NULL) {
639 Tcl_SetResult(interp, "simlistpending: given bad filename", TCL_STATIC);
640 return TCL_ERROR;
641 }
642 }
643 FPRINTF(fp,"\n-------------------------------------\n");
644 FPRINTF(fp," Pendings statements for simulation %s\n\n",argv[1]);
645 CheckInstance(fp,i);
646 FPRINTF(fp,"\n-------------------------------------\n");
647 if ( argc == 3 ) {
648 fclose(fp);
649 }
650 return TCL_OK;
651 }
652
653
654 STDHLF(Asc_SimBinTokenSetOptions, (Asc_SimBinTokenSetOptionsHL,Asc_SimBinTokenSetOptionsHL2,HLFSTOP));
655 int Asc_SimBinTokenSetOptions(ClientData cdata, Tcl_Interp *interp,
656 int argc, CONST84 char **argv)
657 {
658 char *srcname, *objname, *libname, *buildcommand, *unlinkcommand;
659 long maxrels;
660 int verbose, housekeep;
661 int s1,s2,s3;
662
663 ASCUSE; /* see if first arg is -help */
664 if (argc != 9 ) {
665 Asc_HelpGetUsage(interp,Asc_SimBinTokenSetOptionsHN);
666 return TCL_ERROR;
667 };
668 srcname = ascstrdup(argv[1]);
669 objname = ascstrdup(argv[2]);
670 libname = ascstrdup(argv[3]);
671 buildcommand = ascstrdup(argv[4]);
672 unlinkcommand = ascstrdup(argv[5]);
673 s1 = Tcl_ExprLong(interp,argv[6],&maxrels);
674 Tcl_ResetResult(interp);
675 s2 = Tcl_GetInt(interp,argv[7],&verbose);
676 Tcl_ResetResult(interp);
677 s3 = Tcl_GetInt(interp,argv[8],&housekeep);
678 Tcl_ResetResult(interp);
679 if (srcname == NULL || objname == NULL || libname == NULL ||
680 buildcommand == NULL || unlinkcommand == NULL ||
681 s1 != TCL_OK || s2 != TCL_OK || s3 != TCL_OK) {
682 Tcl_AppendResult(interp,argv[0],": Error converting input",(char *)NULL);
683 return TCL_ERROR;
684 }
685 BinTokenSetOptions(srcname,objname,libname,buildcommand,unlinkcommand,
686 (unsigned long)maxrels,verbose,housekeep);
687 return TCL_OK;
688 }

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22