home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pine / ccmd / cmswi.cnf < prev    next >
Encoding:
Text File  |  1988-08-19  |  1.6 KB  |  48 lines

  1. _ Author: Andrew Lowry
  2. _
  3. _ Columbia University Center for Computing Activities, July 1986.
  4. _ Copyright (C) 1986, 1987, Trustees of Columbia University in the
  5. _ City of New York.  Permission is granted to any individual or
  6. _ institution to use, copy, or redistribute this software so long as
  7. _ it is not sold for profit, provided this copyright notice is
  8. _ retained.
  9. _
  10.  
  11. /* switch parsing errors */
  12.  
  13. fnerror(NM,`Does not match switch')
  14. fnerror(AMB,`Ambiguous')
  15. fnerror(ABR,`Invalid abbreviation chain in switch table')
  16. fnerror(BEG,`Switch does not begin with required punctuation')
  17. fnerror(END,`Final switch punctuation not allowed on selected switch')
  18.  
  19. /*
  20.  * SWTCH structure specifies one entry in a switch table.  SWITAB
  21.  * structure describes a table of switches.  (We use the name
  22.  * swtch instead of switch because the latter is a C reserved word.)
  23.  */
  24.  
  25. typedef struct SWTCH {
  26.     char *    _swswi;        /* switch string (without punctuation)  */
  27.     short    _swflg;        /* flags (see below) */
  28.     int    _swval;        /* arbitrary value, not used internally */
  29.                 /*  except for abbreviations... see SWI_ABR */
  30.                 /*  flag below */
  31. } swtch;
  32.  
  33. typedef struct SWITAB {
  34.     int    _stcnt;        /* number of switches in table */
  35.     swtch  * _stwds;    /* array of switch entries  */
  36. } switab;
  37.  
  38. /* Flags that can be present in a switch entry */
  39.  
  40. fnflag(ABR)            /* switch is an abbreviation for the */
  41.                 /* switch indexed by this entry's _swval */
  42.                 /* value */
  43. fnflag(NOR)            /* Ignore this switch (do not recognize */
  44.                 /*  any prefix, or even an exact match) */
  45. fnflag(INV)            /* Invisible switch (not shown with help) */
  46. fnflag(MAT)            /* This switch matches current input (used */
  47.                 /*  internally) */
  48.