File: etwish.c

package info (click to toggle)
et 80b2-8
  • links: PTS
  • area: main
  • in suites: potato, slink
  • size: 1,068 kB
  • ctags: 1,074
  • sloc: ansic: 10,313; tcl: 2,633; makefile: 179; sh: 19
file content (22 lines) | stat: -rw-r--r-- 767 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
** This program implements the the interactive "wish" program of Tcl/Tk
** using ET.  The difference between this progarm and the standard "wish"
** is that this program has the startup scripts compiled in, and is
** thus completely stand-alone.
**
** You can use this program as a template to build your own "wish" with
** additional commands written in C.  Just use the ET_PROC construct to
** code your commands, then insert a single ET_INSTALL_COMMANDS statement
** after the Et_Init().
*/
void main(int argc, char **argv){
  Et_Init(&argc,argv);
  if( argc>2 && (strcmp(argv[1],"-f")==0 || strcmp(argv[1],"-file")==0) ){
    ET( source "%q(argv[2])" );
  }else if( argc>1 ){
    ET( source "%q(argv[1])" );
  }else{
    Et_ReadStdin();
  }
  Et_MainLoop();
}