Subversion Repositories Vertical

Rev

Rev 2 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  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.  *  */
  34.  
  35.  
  36.  
  37. #if ! defined _CMDPARSE
  38. #define _CMDPARSE
  39.  
  40.  
  41. #if ! defined ET_TCLARGS
  42. #define TCLARGS
  43. #else  
  44. #define TCLARGS ET_TCLARGS
  45. #endif
  46.  
  47.  
  48. #define LINELEN 1024
  49. #define WORDSINLINE 50
  50. #define PATHLENGTH 200
  51. #define WORDWIDTH 100
  52.  
  53. enum ReturnCodes {OKCMD, FAILED, NARGS, UNKNOWNCMD, BADVARS, QUITCMD};
  54.  
  55. struct CommandStruct;
  56.  
  57.  
  58.  
  59.  
  60.  
  61. struct command
  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.    };
  72.  
  73.  
  74. typedef struct command CommandMenu[];
  75.  
  76. #if defined USE_COMMANDSTRUCT
  77. struct CommandStruct
  78.    {
  79.    char *Text;
  80.    char *Words[WORDSINLINE];
  81.    int   CurrentCommand;
  82.    int   NumberCommands;
  83.    int   nArgs;
  84.    char  **Args;
  85.    };
  86. #endif
  87. /* is the TCL interface in GUI or command line mode ? */
  88.  
  89. #if defined ET_TCLARGS
  90.  
  91. typedef enum {Tcl_GUI,Tcl_Cmd} tcl_mode_t;
  92.  
  93. extern  tcl_mode_t  Tcl_Mode;
  94.  
  95. /* make this a global */  
  96. extern  Tcl_Interp * Tcl_interp;
  97.  
  98.  
  99. #endif
  100.  
  101. /* debug level */
  102. extern long level;
  103.  
  104. extern int Execute (int argc,char * argv[], CommandMenu Dispatch);
  105.  
  106. extern int ExecuteString (char * commandstring , int nArgs, char * Args[]) ;
  107.  
  108. extern int ParseFile (FILE * CmdFile,int nArgs, char * Args[]);
  109.  
  110. extern int ExecuteCommand (FILE * CmdFile,
  111.                            int nArgs,
  112.                            char * Args[]);
  113.  
  114.  
  115.  
  116.  
  117.  
  118. #endif
  119.  
  120.