home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
programming
/
tcl
/
tclsrc
/
c
/
shade
< prev
next >
Wrap
Text File
|
1995-02-04
|
886b
|
41 lines
/*
* Main for shade
* (c) C.T.Stretch
* Fri,24 Jun 1994
*/
#include <stdio.h>
#include <stdlib.h>
#include "h.tcl"
#include "h.tclRISCOS"
#include "h.tclW"
int main(int n,char** args)
{ Tcl_Interp *ti;
int i,code;
char *q;
char buf[16];
if(n<2){ printf("Error from Tcl 1 parameter needed, %d given",n-1);exit(1);}
RiscOS_Init();
ti=Tcl_CreateInterp();
RiscOS_InitVars(ti);
Tcl_CreateCommand(ti,"w_init",W_InitCmd,NULL,NULL);
sprintf(buf,"%d",n);
Tcl_SetVar2(ti,"argc",0,buf,TCL_GLOBAL_ONLY);
for(i=0;i<n;i++)
{ sprintf(buf,"%d",i);
Tcl_SetVar2(ti,"argv",buf,args[i],TCL_GLOBAL_ONLY);
}
code=Tcl_EvalFile(ti,args[1]);
if(code)
{ if(w_Interp) W_Error("initialize");
else
{ printf("Error %d from Tcl - %s\n",code,ti->result);
q=Tcl_GetVar(ti,"errorInfo",0);
if(q) puts(q);
exit(code);
}
}
if(w_Interp) W_Poll();
}