home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pine / ccmd / cmkey.cnf < prev    next >
Encoding:
Text File  |  1988-08-19  |  1.9 KB  |  69 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. /* keyword parse errors */
  12.  
  13. fnerror(NM,`Does not match keyword')
  14. fnerror(AMB,`Ambiguous')
  15. fnerror(ABR,`Invalid abbreviation chain in keyword table')
  16.  
  17. /*
  18.  * KEYWRD structure specifies one entry in a keyword table.  KEYTAB
  19.  * structure describes a table of keywords.
  20.  */
  21.  
  22. #ifdef notdef
  23. /*
  24.  * we want to return "anything" as the value of a keyword,
  25.  * so we need to know what is the 'largest' type in a machine independent 
  26.  * way.   I can't figure out a way to do this at compile time, so we'll use a 
  27.  * generated include file.
  28.  */
  29.  
  30. #include "cmkeyval.h"        /* this defines the keyval type */
  31. #endif
  32.  
  33. #ifdef KEYVAL_TYPE
  34. typedef KEYVAL_TYPE keyval;
  35. #else
  36. typedef long keyval;
  37. #endif
  38.  
  39.  
  40. typedef struct KEYWRD {
  41.     char *    _kwkwd;    /* keyword string */
  42.     short    _kwflg;    /* flags (see below) */
  43.     keyval    _kwval;    /* arbitrary value, not used internally */
  44.             /*  except for abbreviations... see KEY_ABR */
  45.             /*  flag below */
  46. } keywrd;
  47.  
  48. typedef struct KEYTAB {
  49.     int    _ktcnt;    /* number of keywords in table */
  50.     keywrd * _ktwds;/* array of keyword entries */
  51. } keytab;
  52.  
  53. /* Valid flags in fdb */
  54. fnflag(EMO)        /* exact match only */
  55.  
  56. /* flags that can be present in a keyword entry */
  57.  
  58. fnflag(ABR)        /* keyword is an abbreviation for the */
  59.             /* keyword indexed by this entry's _kwval value */
  60.  
  61. fnflag(NOR)        /* Ignore this keyword (do not recognize */
  62.             /*  any prefix, or even an exact match) */
  63. #define KEY_IGN KEY_NOR
  64. fnflag(INV)        /* Invisible keyword (not shown with help) */
  65. fnflag(MAT)        /* This keyword matches current input */
  66.             /*  (used internally) */
  67.  
  68. pvtype(keyval)_        /* KEY returns a keyval. */
  69.