home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / AZTEC-C / COMND004.ARK / COMND.H < prev    next >
C/C++ Source or Header  |  1986-06-17  |  4KB  |  137 lines

  1. /* comnd.h    Common (user and library) definitions for the
  2.         COMND services.
  3.  
  4.     Copyright (C) 1984, 1985 Mark E. Mallett
  5.  
  6.     Permission is hereby granted to distribute this file indiscriminately.
  7.  
  8. Edit history
  9.  
  10. When    Who    What
  11. ------    ---    --------------------------------
  12. 84xxxx    MEM    Create file.
  13.  
  14.  
  15.  
  16. */
  17.  
  18.  
  19. #include "mem.h"            /* Include my standard names */
  20.  
  21. /* Various constants, etc. */
  22.  
  23.  
  24.     /* CFB command function codes */
  25.  
  26. #define    _CMINI    0x0000            /* Initialize the parse */
  27. #define    _CMKEY    0x0001            /* Keyword parse */
  28. #define    _CMNUM    0x0002            /* Number */
  29. #define    _CMNOI    0x0003            /* Noise words (guide string) */
  30. #define    _CMCFM    0x0004            /* Confirm */
  31. #define    _CMGSK    0x0005            /* General Storage Keyword */
  32. #define    _CMSWI    0x0006            /* Switch */
  33. #define    _CMTXT    0x0007            /* Text to end of line */
  34. #define    _CMTOK    0x0008            /* Token */
  35. #define    _CMUQS    0x0009            /* Unquoted string */
  36. #define    _CMDAT    0x000A            /* Date and/or time */
  37.  
  38. #define    _CMMAX    0x000A            /* Maximum function code */
  39.  
  40.  
  41.     /* COMND result codes */
  42.  
  43. #define    _CROK    0x0000            /* OK completion */
  44. #define    _CRNOP    0x0001            /* No-parse (no matching input) */
  45. #define    _CRRPT    0x0002            /* Reparse required */
  46. #define    _CRIFC    0x0003            /* Invalid function code */
  47. #define    _CRBOF    0x0004            /* Buffer overflow */
  48. #define    _CRBAS    0x0005            /* Invalid radix */
  49. #define    _CRAGN    0x0006            /* Try-again (for support mode only) */
  50.  
  51.  
  52.  
  53.     /* Flags in the CSB_RFL element of the command state block */
  54.  
  55. #define    _CFNOP    0x0001            /* No Parse */
  56. #define    _CFESC    0x0002            /* Terminated by escape */
  57. #define _CFEOC    0x0004            /* Terminated by CR */
  58. #define    _CFRPT    0x0008            /* Reparse required */
  59. #define    _CFSWT    0x0010            /* Switch ended with colon */
  60. #define    _CFPFE    0x0020            /* Previous field term. with esc */
  61.  
  62.  
  63.     /* Flags in the CSB_PFL element of the command state block */
  64.  
  65. #define    _CFRAI    0x0001            /* Raise lowercase to uppercase */
  66. #define    _CFNEC    0x0002            /* No echo if this is set */
  67.  
  68.  
  69.     /* Flags in the CFB_FLG element of the command function block */
  70.  
  71. #define    _CFHPP    0x0001            /* User-supplied help string */
  72. #define    _CFDPP    0x0002            /* User-supplied default */
  73. #define    _CFSDH    0x0004            /* Suppress default help */
  74. #define    _CFCC    0x0008            /* CC table supplied */
  75. #define    _CFDTD    0x0040            /* Parse date (for _CMDAT) */
  76. #define    _CFDTT    0x0080            /* Parse time (for _CMDAT) */
  77. /*
  78.  
  79. *//*    Structures    */
  80.  
  81.     /* CSB - The Command State Block */
  82.  
  83. typedef
  84.   struct CSBs
  85.     {
  86.     BYTE    CSB_PFL;        /* Passed flags (from caller) */
  87.     BYTE    CSB_RFL;        /* Returned flags (to caller) */
  88.     struct setjmp *CSB_RSB;        /* Reparse SETJMP buffer */
  89.     int        (*CSB_INP)();        /* Addr of input-char routine */
  90.     int        (*CSB_OUT)();        /* Addr of output-char routine */
  91.     BYTE    *CSB_PMT;        /* Prompt */
  92.     BYTE    *CSB_BUF;        /* Buffer address */
  93.     int        CSB_BSZ;        /* Buffer size */
  94.     BYTE    *CSB_ABF;        /* Atom buffer */
  95.     int        CSB_ASZ;        /* Atom buffer size */
  96.     int        CSB_PRS;        /* Parse index */
  97.     int        CSB_FLN;        /* Filled length (# chars filled) */
  98.     int        CSB_RCD;        /* Result code. */
  99.     union    {            /* Returned value */
  100.     int    _INT;            /*  --for int value--  */
  101.     char    *_ADR;            /*  --for address value--  */
  102.     }    CSB_RVL;        /* (returned value) */
  103.     struct CFBs *CSB_CFB;        /* Addr of matching CFB, if any */
  104.     }
  105.   CSB;
  106.  
  107.  
  108.     /* CFB - the Command Function Block */
  109.  
  110. typedef
  111.   struct CFBs
  112.     {
  113.     BYTE    CFB_FNC;        /* Function code */
  114.     BYTE    CFB_FLG;        /* Flags */
  115.     struct CFB  *CFB_CFB;        /* Addr of next CFB for parse
  116.                        resolution */
  117.     AITYPE    CFB_DAT;        /* Data, if any */
  118.     BYTE    *CFB_HLP;        /* Help string */
  119.     BYTE    *CFB_DEF;        /* Default string */
  120.     int        *CFB_CC;        /* Char characteristics table addr */
  121.     }
  122.   CFB;
  123.  
  124.  
  125.     /* CGK - Command General Keyword parsing block */
  126.  
  127.     /*    CGK is pointed to by CFB type _CMGSK.  It specifies
  128.         a routine to call to fetch each new candidate keyword. */
  129.  
  130. typedef
  131.   struct CGKs
  132.     {
  133.     char    *CGK_BAS;        /* Base address to give to kfr */
  134.     char    **(*CGK_KFR)();        /* Keyword fetch routine address */
  135.     }
  136.   CGK;
  137.