Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | mjames | 1 | /* $Id: cmdparse.h,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $ |
2 | |||
3 | Header file: cmdparse.h |
||
4 | |||
5 | $Log: cmdparse.h,v $ |
||
6 | Revision 1.1.1.1 2003/11/04 23:34:56 mjames |
||
7 | Imported into local repositrory |
||
8 | |||
9 | Revision 1.6 2001/10/31 22:20:01 mjames |
||
10 | Tidying up problematical comments caused by CVS |
||
11 | 'intelligent' comment guessing |
||
12 | |||
13 | Revision 1.5 2001/06/06 12:10:24 mjames |
||
14 | Move from HPUX |
||
15 | |||
16 | Revision 1.4 2001/02/06 22:41:15 mjames |
||
17 | Added correct argument passing for 'read file comp_suffix arg0 arg1 arg2 ... |
||
18 | |||
19 | Revision 1.3 2001/01/04 21:26:55 mjames |
||
20 | Modifications to add in the TCL style |
||
21 | argument list to all of the functions |
||
22 | . |
||
23 | |||
24 | Revision 1.2 2001/01/02 07:53:52 mjames |
||
25 | Made changes to allow for interface with TCL/Tk |
||
26 | |||
27 | Revision 1.1.1.1 2000/10/19 21:58:35 mjames |
||
28 | Mike put it here |
||
29 | |||
30 | |||
31 | |||
32 | Chopped a lot of RCS revision history |
||
33 | * */ |
||
11 | mjames | 34 | |
35 | |||
36 | |||
37 | #if ! defined _CMDPARSE |
||
2 | mjames | 38 | #define _CMDPARSE |
39 | |||
11 | mjames | 40 | |
41 | #if ! defined ET_TCLARGS |
||
2 | mjames | 42 | #define TCLARGS |
11 | mjames | 43 | #else |
2 | mjames | 44 | #define TCLARGS ET_TCLARGS |
45 | #endif |
||
46 | |||
11 | mjames | 47 | |
2 | mjames | 48 | #define LINELEN 1024 |
49 | #define WORDSINLINE 50 |
||
50 | #define PATHLENGTH 200 |
||
51 | #define WORDWIDTH 100 |
||
52 | |||
11 | mjames | 53 | enum ReturnCodes {OKCMD, FAILED, NARGS, UNKNOWNCMD, BADVARS, QUITCMD}; |
2 | mjames | 54 | |
55 | struct CommandStruct; |
||
56 | |||
11 | mjames | 57 | |
58 | |||
59 | |||
60 | |||
2 | mjames | 61 | struct command |
11 | mjames | 62 | { |
63 | char *name; |
||
64 | int NumChar; |
||
65 | /* see above for macro defining this */ |
||
66 | int (*function) (TCLARGS); |
||
67 | struct command * Menu; |
||
68 | char *helpstr; |
||
69 | char *extras; |
||
70 | char *TCL_command; |
||
71 | }; |
||
2 | mjames | 72 | |
11 | mjames | 73 | |
2 | mjames | 74 | typedef struct command CommandMenu[]; |
75 | |||
76 | #if defined USE_COMMANDSTRUCT |
||
77 | struct CommandStruct |
||
11 | mjames | 78 | { |
79 | char *Text; |
||
80 | char *Words[WORDSINLINE]; |
||
81 | int CurrentCommand; |
||
82 | int NumberCommands; |
||
83 | int nArgs; |
||
84 | char **Args; |
||
85 | }; |
||
2 | mjames | 86 | #endif |
87 | /* is the TCL interface in GUI or command line mode ? */ |
||
88 | |||
89 | #if defined ET_TCLARGS |
||
90 | |||
11 | mjames | 91 | typedef enum {Tcl_GUI,Tcl_Cmd} tcl_mode_t; |
2 | mjames | 92 | |
11 | mjames | 93 | extern tcl_mode_t Tcl_Mode; |
2 | mjames | 94 | |
11 | mjames | 95 | /* make this a global */ |
96 | extern Tcl_Interp * Tcl_interp; |
||
2 | mjames | 97 | |
11 | mjames | 98 | |
2 | mjames | 99 | #endif |
100 | |||
101 | /* debug level */ |
||
102 | extern long level; |
||
103 | |||
11 | mjames | 104 | extern int Execute (int argc,char * argv[], CommandMenu Dispatch); |
2 | mjames | 105 | |
11 | mjames | 106 | extern int ExecuteString (char * commandstring , int nArgs, char * Args[]) ; |
2 | mjames | 107 | |
11 | mjames | 108 | extern int ParseFile (FILE * CmdFile,int nArgs, char * Args[]); |
2 | mjames | 109 | |
11 | mjames | 110 | extern int ExecuteCommand (FILE * CmdFile, |
111 | int nArgs, |
||
112 | char * Args[]); |
||
2 | mjames | 113 | |
11 | mjames | 114 | |
115 | |||
116 | |||
117 | |||
2 | mjames | 118 | #endif |
11 | mjames | 119 |