home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / old / ckermit60 / ckvvms.h < prev    next >
C/C++ Source or Header  |  2020-01-01  |  4KB  |  165 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.  
  21. #include "ckcdeb.h"
  22.  
  23. struct iosb_struct {
  24.     unsigned short status;
  25.     unsigned short size;
  26.     unsigned short terminator;
  27.     unsigned short termsize;
  28. };
  29.  
  30. struct tt_mode {
  31.     unsigned char class;
  32.     unsigned char type;
  33.     unsigned short width;
  34.     unsigned int basic : 24;
  35.     unsigned char length;
  36.     unsigned long extended;
  37. };
  38.  
  39. struct itmlst {
  40.     unsigned short len;
  41.     unsigned short code;
  42.     char *adr;
  43.     char *retlen;
  44. };
  45.  
  46. struct sysatr {
  47.     unsigned long int retval;    /* Address or value returned */
  48.     unsigned long int len;    /* length of item */
  49.     unsigned long int type;
  50.     char *bpnt;            /* Buffer pointer */
  51.     unsigned long int bcnt;    /* Buffer count */
  52.     char *tbuf_adr;        /* Starting address of tmp buffer */
  53.     char *tbuf_pnt;        /* Address within buffer */
  54.     unsigned long int tbuf_len; /* Length of buffer */
  55.     unsigned long int tbuf_cnt;
  56. };
  57.  
  58. struct trmmbx_message {            /* jah - for edit 031 in ckvtio.c */
  59.     unsigned short type;        /* Mailbox message type */
  60.     unsigned short unit;        /* TTY unit number */
  61.     unsigned char ctlname_size;        /* TTY controller name length */
  62.     char ctlname[15];            /* TTY controller name */
  63.     /* Add broadcast message stuff here if/when needed */
  64. };
  65.  
  66. struct trmmbx_struct {            /* jah - for edit 031 in ckvtio.c */
  67.     unsigned short channel;        /* Mailbox channel */
  68.     unsigned short efn;            /* EFN we set for unsolicited input */
  69.     unsigned long status;        /* Completion status set by AST code */
  70.     struct iosb_struct iosb;        /* I/O status block for mailbox read */
  71.     struct trmmbx_message message;    /* A short mailbox message buffer */
  72. };
  73.  
  74. /*  Event flags used for I/O completion testing  */
  75. #define CON_EFN 1
  76. #define TTY_EFN 2
  77. #define TIM_EFN 3
  78. #define QIOW_EFN 4
  79.  
  80. /* Error checking and reporting macros */
  81.  
  82. int print_msg();
  83.  
  84. #define SUCCESS(x) ((vms_status = (x)) & 1)
  85. #define CHECK_ERR(s,x) (SUCCESS(x) ? 1 : print_msg(s))
  86. /*
  87.  * Module CKVTIO
  88.  * Routine print_msg(sts)     ! Print VMS error message.
  89.  * define buffer sizes that are malloced at routine first call.
  90.  */
  91. #define PMSG_BUF_SIZE 255
  92. #define PMSG_MSG_SIZE PMSG_BUF_SIZE+5
  93.  
  94. /*
  95.  * Size of subprocess buffer
  96.  * This will have a direct affect on the size of a message that comes
  97.  * from the subprocess mailbox.
  98.  */
  99. #define SUB_BUF_SIZE 300
  100.  
  101. /*
  102.  * Maximum length for a device name (does not include null terminator).
  103.  */
  104.  
  105. #define DEVNAMLEN 64
  106.  
  107. /*
  108.  * The following macro was borrowed from a posting on USENET - Thank you.
  109.  */
  110.  
  111. #define IDENT(arg) arg    /* Handy macro expands to its arguments */
  112.  
  113. #define VSTRING(name, maxlen, init)    \
  114.     struct IDENT(name)_vs {        \
  115.     struct dsc$descriptor_s dsc;    \
  116.     unsigned short int curlen;    \
  117.     char body[maxlen];        \
  118.     } name = {{maxlen, DSC$K_DTYPE_VT, DSC$K_CLASS_VS, &name.curlen}, \
  119.     sizeof(init)-1, init}
  120.  
  121. /*
  122.  * Example of using VSTRING:
  123.  *
  124.  * VSTRING(user,12,"Humpty Dumpty");
  125.  * VSTRING(line,256,"");
  126.  *
  127.  */
  128.  
  129. /*
  130.  * UCB$M_* symbols are not in a 'C' usable format.  Define this
  131.  * symbol for use in CKVTIO, when doing a getdviw()
  132.  */
  133.  
  134. #ifndef UCB$M_ONLINE
  135. #define UCB$M_ONLINE 16
  136. #endif
  137.  
  138. /*
  139.  * Used by parsedir as the flags argument
  140.  */
  141.  
  142. #define PARSE_NODE    0x001
  143. #define PARSE_DEVICE    0x002
  144. #define PARSE_DIRECTORY    0x004
  145. #define PARSE_NAME    0x008
  146. #define PARSE_TYPE    0x010
  147. #define PARSE_VERSION    0x020
  148.  
  149. /*
  150.  *
  151.  */
  152.  
  153. #define CKV_M_CTRLY (1 << ('Y'-64))
  154. #define CKV_M_CTRLC (1 << ('C'-64))
  155. #define CKV_K_CTRLC ('C'-64)
  156. #define CKV_K_CTRLY ('Y'-64)
  157.  
  158. /*
  159.  * Partial Buffer size.  This is used by zoutdump() when it gets
  160.  * an incomplete record.
  161.  */
  162.  
  163. #define PARTIAL_BUF_SIZE 1024
  164.  
  165.