home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / c-kermit / ckvvms.h < prev    next >
C/C++ Source or Header  |  2020-01-01  |  4KB  |  160 lines

  1. /* DEC/CMS REPLACEMENT HISTORY, Element CKVVMS.H */
  2. /* *3    29-AUG-1989 00:32:39 BUDA "Add ^Y/^C from server mode" */
  3. /* *2    16-APR-1989 17:54:51 BUDA "Add definition of SUB_PROC buffer size" */
  4. /* *1    11-APR-1989 22:57:00 BUDA "Initial creation" */
  5. /* DEC/CMS REPLACEMENT HISTORY, Element CKVVMS.H */
  6. /*
  7.  * 006 22-Aug-1993 fdc     Add prototype for print_msg().
  8.  * 005 26-Aug-1992 tmk       Remove unused CKVRMS32 stuff
  9.  * 004 01-Dec-1989 mab       Add RMS support
  10.  * 002 01-Aug-1989 mab       Add partial buffer definition
  11.  * 002 08-Jul-1989 mab       Add ^C/^Y code to server mode
  12.  * 001 05-Mar-1989 mab     Put some common pieces in one place
  13.  */
  14. /*
  15.   C-Kermit structures and symbols for interrupt, terminal control, and i/o
  16.   for VMS systems
  17.  
  18.   Mark A. Buda, Digital Equipment Corporation
  19. */
  20. struct iosb_struct {
  21.     unsigned short status;
  22.     unsigned short size;
  23.     unsigned short terminator;
  24.     unsigned short termsize;
  25. };
  26.  
  27. struct tt_mode {
  28.     unsigned char class;
  29.     unsigned char type;
  30.     unsigned short width;
  31.     unsigned int basic : 24;
  32.     unsigned char length;
  33.     unsigned long extended;
  34. };
  35.  
  36. struct itmlst {
  37.     unsigned short len;
  38.     unsigned short code;
  39.     char *adr;
  40.     char *retlen;
  41. };
  42.  
  43. struct sysatr {
  44.     unsigned long int retval;    /* Address or value returned */
  45.     unsigned long int len;    /* length of item */
  46.     unsigned long int type;
  47.     char *bpnt;            /* Buffer pointer */
  48.     unsigned long int bcnt;    /* Buffer count */
  49.     char *tbuf_adr;        /* Starting address of tmp buffer */
  50.     char *tbuf_pnt;        /* Address within buffer */
  51.     unsigned long int tbuf_len; /* Length of buffer */
  52.     unsigned long int tbuf_cnt;
  53. };
  54.  
  55. struct trmmbx_message {            /* jah - for edit 031 in ckvtio.c */
  56.     unsigned short type;        /* Mailbox message type */
  57.     unsigned short unit;        /* TTY unit number */
  58.     unsigned char ctlname_size;        /* TTY controller name length */
  59.     char ctlname[15];            /* TTY controller name */
  60.     /* Add broadcast message stuff here if/when needed */
  61. };
  62.  
  63. struct trmmbx_struct {            /* jah - for edit 031 in ckvtio.c */
  64.     unsigned short channel;        /* Mailbox channel */
  65.     unsigned short efn;            /* EFN we set for unsolicited input */
  66.     unsigned long status;        /* Completion status set by AST code */
  67.     struct iosb_struct iosb;        /* I/O status block for mailbox read */
  68.     struct trmmbx_message message;    /* A short mailbox message buffer */
  69. };
  70.  
  71. /*  Event flags used for I/O completion testing  */
  72. #define CON_EFN 1
  73. #define TTY_EFN 2
  74. #define TIM_EFN 3
  75. #define QIOW_EFN 4
  76.  
  77. /* Error checking and reporting macros */
  78.  
  79. int print_msg();
  80.  
  81. #define SUCCESS(x) ((vms_status = (x)) & 1)
  82. #define CHECK_ERR(s,x) (SUCCESS(x) ? 1 : print_msg(s))
  83. /*
  84.  * Module CKVTIO
  85.  * Routine print_msg(sts)     ! Print VMS error message.
  86.  * define buffer sizes that are malloced at routine first call.
  87.  */
  88. #define PMSG_BUF_SIZE 255
  89. #define PMSG_MSG_SIZE PMSG_BUF_SIZE+5
  90.  
  91. /*
  92.  * Size of subprocess buffer
  93.  * This will have a direct affect on the size of a message that comes
  94.  * from the subprocess mailbox.
  95.  */
  96. #define SUB_BUF_SIZE 300
  97.  
  98. #ifndef DEVNAMLEN
  99. #define DEVNAMLEN 64
  100. #endif
  101.  
  102. /*
  103.  * The following macro was borrowed from a posting on USENET - Thank you.
  104.  */
  105.  
  106. #define IDENT(arg) arg    /* Handy macro expands to its arguments */
  107.  
  108. #define VSTRING(name, maxlen, init)    \
  109.     struct IDENT(name)_vs {        \
  110.     struct dsc$descriptor_s dsc;    \
  111.     unsigned short int curlen;    \
  112.     char body[maxlen];        \
  113.     } name = {{maxlen, DSC$K_DTYPE_VT, DSC$K_CLASS_VS, &name.curlen}, \
  114.     sizeof(init)-1, init}
  115.  
  116. /*
  117.  * Example of using VSTRING:
  118.  *
  119.  * VSTRING(user,12,"Humpty Dumpty");
  120.  * VSTRING(line,256,"");
  121.  *
  122.  */
  123.  
  124. /*
  125.  * UCB$M_* symbols are not in a 'C' usable format.  Define this
  126.  * symbol for use in CKVTIO, when doing a getdviw()
  127.  */
  128.  
  129. #ifndef UCB$M_ONLINE
  130. #define UCB$M_ONLINE 16
  131. #endif
  132.  
  133. /*
  134.  * Used by parsedir as the flags argument
  135.  */
  136.  
  137. #define PARSE_NODE    0x001
  138. #define PARSE_DEVICE    0x002
  139. #define PARSE_DIRECTORY    0x004
  140. #define PARSE_NAME    0x008
  141. #define PARSE_TYPE    0x010
  142. #define PARSE_VERSION    0x020
  143.  
  144. /*
  145.  *
  146.  */
  147.  
  148. #define CKV_M_CTRLY (1 << ('Y'-64))
  149. #define CKV_M_CTRLC (1 << ('C'-64))
  150. #define CKV_K_CTRLC ('C'-64)
  151. #define CKV_K_CTRLY ('Y'-64)
  152.  
  153. /*
  154.  * Partial Buffer size.  This is used by zoutdump() when it gets
  155.  * an incomplete record.
  156.  */
  157.  
  158. #define PARTIAL_BUF_SIZE 1024
  159.  
  160.