home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / cbw / part01 / parser.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-16  |  809 b   |  30 lines

  1. /*
  2.  * Header for command parsing and completing routines.
  3.  *
  4.  * Robert W. Baldwin, December 1984.
  5.  */
  6.  
  7.  
  8.  
  9. #define    CMDBAD    "I don't know how to do that."
  10.  
  11.  
  12. /* A command table is an array of cmdent's terminated by a
  13.  * cmdent that has a cmdname = NULL.
  14.  * The command name can contain helpful noise words since
  15.  * the comparision is only done on characters upto the first space.
  16.  * The cmdproc is passed the full command string (including cmd name),
  17.  * and returns a pointer to a status message.  The return pointer should
  18.  * be NULL is everything goes ok.
  19.  *
  20.  * The command table should have atleast two non-empty entries for completion
  21.  * to work properly.
  22.  */
  23.  
  24. #define    cmdent    struct xcmdent
  25.  
  26. struct    xcmdent    {
  27.         char    *cmdname;    /* Comparison done up to first blank. */
  28.         char    *(*cmdproc)(/* cmd-string */);
  29.         };
  30.