home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ckv201.zip / ckvvms.h < prev    next >
C/C++ Source or Header  |  2001-11-03  |  5KB  |  164 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. #ifdef COMMENT
  99. /* This is handled in ckcdeb.h as of 2001-11-03 */
  100. /*
  101.  * Maximum length for a device name (does not include null terminator).
  102.  */
  103. #define DEVNAMLEN 64
  104. #endif /* COMMENT */
  105.  
  106. /*
  107.  * The following macro was borrowed from a posting on USENET - Thank you.
  108.  */
  109.  
  110. #define IDENT(arg) arg    /* Handy macro expands to its arguments */
  111.  
  112. #define VSTRING(name, maxlen, init)    \
  113.     struct IDENT(name)_vs {        \
  114.     struct dsc$descriptor_s dsc;    \
  115.     unsigned short int curlen;    \
  116.     char body[maxlen];        \
  117.     } name = {{maxlen, DSC$K_DTYPE_VT, DSC$K_CLASS_VS, &name.curlen}, \
  118.     sizeof(init)-1, init}
  119.  
  120. /*
  121.  * Example of using VSTRING:
  122.  *
  123.  * VSTRING(user,12,"Humpty Dumpty");
  124.  * VSTRING(line,256,"");
  125.  *
  126.  */
  127.  
  128. /*
  129.  * UCB$M_* symbols are not in a 'C' usable format.  Define this
  130.  * symbol for use in CKVTIO, when doing a getdviw()
  131.  */
  132.  
  133. #ifndef UCB$M_ONLINE
  134. #define UCB$M_ONLINE 16
  135. #endif
  136.  
  137. /*
  138.  * Used by parsedir as the flags argument
  139.  */
  140.  
  141. #define PARSE_NODE    0x001
  142. #define PARSE_DEVICE    0x002
  143. #define PARSE_DIRECTORY    0x004
  144. #define PARSE_NAME    0x008
  145. #define PARSE_TYPE    0x010
  146. #define PARSE_VERSION    0x020
  147.  
  148. /*
  149.  *
  150.  */
  151.  
  152. #define CKV_M_CTRLY (1 << ('Y'-64))
  153. #define CKV_M_CTRLC (1 << ('C'-64))
  154. #define CKV_K_CTRLC ('C'-64)
  155. #define CKV_K_CTRLY ('Y'-64)
  156.  
  157. /*
  158.  * Partial Buffer size.  This is used by zoutdump() when it gets
  159.  * an incomplete record.
  160.  */
  161.  
  162. #define PARTIAL_BUF_SIZE 1024
  163.  
  164.