ecushm.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. #define SHM_REV 0x0EC0000EL /* high 16-bits unique, low=revision */
  2. /*+-------------------------------------------------------------------------
  3. ecushm.h -- ecu shared data segment
  4. wht@wht.net
  5. --------------------------------------------------------------------------*/
  6. /*+:EDITS:*/
  7. /*:04-26-2000-11:15-wht@bob-RELEASE 4.42 */
  8. /*:01-08-2000-12:59-wht@menlo-add Lsockserve */
  9. /*:01-24-1997-02:37-wht@yuriatin-SOURCE RELEASE 4.00 */
  10. /*:09-11-1996-20:00-wht@yuriatin-3.48-major telnet,curses,structural overhaul */
  11. /*:09-09-1996-03:16-wht@yuriatin-CFG_TelnetOption sizing */
  12. /*:11-23-1995-11:20-wht@kepler-source control 3.37 for tsx-11 */
  13. /*:11-14-1995-10:23-wht@kepler-3.37.80-source control point: SOCKETS */
  14. /*:11-12-1995-00:18-wht@gyro-show_telnet_traffic now in shm */
  15. /*:11-11-1995-23:57-wht@gyro-add rcvr_ansi_filter */
  16. /*:11-03-1995-16:54-wht@wwtp1-use CFG_TelnetOption */
  17. /*:10-20-1995-02:44-wht@kepler-length line logical, descr, rname strings */
  18. /*:10-19-1995-01:01-wht@kepler-add Ltelnet */
  19. /*:08-27-1995-06:31-wht@n4hgf-add Lrtscts_val */
  20. /*:07-25-1994-00:39-wht@n4hgf-allow for predef of max lines and columns */
  21. /*:05-04-1994-04:39-wht@n4hgf-ECU release 3.30 */
  22. /*:09-10-1992-13:59-wht@n4hgf-ECU release 3.20 */
  23. /*:09-10-1992-04:34-wht@n4hgf-add rcvrdisp semaphore */
  24. /*:09-06-1992-13:29-wht@n4hgf-add receiver process buffered screen write */
  25. /*:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA */
  26. /*:08-17-1992-04:55-wht@n4hgf-keep rcvr pid in shm for friend code */
  27. /*:07-19-1992-07:44-wht@n4hgf-85 lines too expensive to keep updated */
  28. /*:07-19-1992-07:42-wht@n4hgf-ttyinit_param -> ttyuse */
  29. /*:05-08-1992-03:36-wht@n4hgf-bumped rev: max screen geometry now 85x80 */
  30. /*:03-27-1992-16:21-wht@n4hgf-re-include protection for all .h files */
  31. /*:12-15-1991-14:22-wht@n4hgf-autorz and zmodem_asterisk_count added */
  32. /*:12-13-1991-04:16-wht@n4hgf-move bell_notify_state to shm */
  33. /*:11-11-1991-22:25-wht@n4hgf-add Ldcdwatch and Ltiobuf */
  34. /*:08-21-1991-01:34-wht@n4hgf-FAR depends only on M_I286 */
  35. /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  36. /*:12-19-1990-17:09-wht@n4hgf-make cursor variables unsigned */
  37. /*:11-30-1990-19:01-wht@n4hgf-add ttyinit_param */
  38. /*:11-28-1990-17:43-wht@n4hgf-move cursor_y, cursor_x to right after revision */
  39. /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  40. #ifndef _ecushm_h
  41. #define _ecushm_h
  42. #if defined(M_I286)
  43. #define FAR far
  44. #else
  45. #define FAR
  46. #endif
  47. #if !defined(UINT16)
  48. #define UINT16 unsigned short
  49. #endif
  50. #if !defined(uchar)
  51. #define uchar unsigned char
  52. #endif
  53. #if !defined(UINT)
  54. #define UINT unsigned int
  55. #endif
  56. #if !defined(UINT32)
  57. #define UINT32 unsigned long
  58. #endif
  59. /* tty usage parameter (shm->ttyuse) */
  60. #define TTYUSE_NORMAL 0 /* must be zero */
  61. #define TTYUSE_FORCE_SIMPLE 1
  62. /*
  63. * max length of a hostname or telephone number
  64. */
  65. /*
  66. * max length of a hostname or telephone number
  67. * string this the actual number of characters: arrays are
  68. * defined DESTREF_LEN + 1 in length to provide for null
  69. * (if telnet enabled, 10 more spaces for longest hostnames
  70. * we can manage in 80 col display)
  71. */
  72. #ifdef CFG_TelnetOption
  73. #define LOGICAL_LEN 50
  74. #define DESTREF_LEN 50
  75. #else
  76. #define LOGICAL_LEN 40
  77. #define DESTREF_LEN 40
  78. #endif
  79. #ifndef CFG_ScreenLinesMax
  80. #define CFG_ScreenLinesMax 50
  81. #endif
  82. #ifndef CFG_ScreenColsMax
  83. #define CFG_ScreenColsMax 80
  84. #endif
  85. #define SHM_STRLEN 256
  86. #define TO_SCREEN_BUFSZ 128
  87. typedef struct ecu_sds
  88. {
  89. uchar screen[CFG_ScreenLinesMax][CFG_ScreenColsMax];
  90. UINT32 shm_revision;
  91. UINT cursor_y; /* program-maintained receive cursor */
  92. UINT cursor_x; /* program-maintained receive cursor */
  93. UINT16 scr_lines; /* lines in use */
  94. UINT16 scr_cols; /* columns in use */
  95. UINT16 scr_size; /* screen size (lines * cols) */
  96. UINT16 terminating; /* made one when ECU terminating */
  97. /* xmtr to rcvr communication area */
  98. int xcmd; /* signal from xmtr to rcvr SIGUSR2 */
  99. int xi1;
  100. int xi2;
  101. int xi3;
  102. char xs1[SHM_STRLEN];
  103. /* rcvr to xmtr communication area */
  104. int rcmd; /* signal from rcvr to xmtr SIGUSR2 */
  105. int ri1;
  106. int ri2;
  107. char rs1[SHM_STRLEN];
  108. UINT32 rcvd_chars; /* rcvr char count */
  109. UINT32 rcvd_chars_this_connect; /* count since last connect */
  110. UINT32 xmit_chars; /* xmit char count */
  111. UINT32 xmit_chars_this_connect; /* count since last connect */
  112. int Ladd_nl_incoming; /* when in ksr mode, add nl to cr on receive */
  113. int Ladd_nl_outgoing; /* when in ksr mode, add nl to cr on xmit */
  114. int Lfull_duplex; /* if non-zero, full duplex else half */
  115. int Liofd; /* file descriptor for line */
  116. int Lmodem_already_init; /* true if modem already initialized */
  117. int Lconnected; /* we try to keep accurate */
  118. int Lparity; /* 0==NONE, 'e' == even, 'o' == odd */
  119. UINT Lbitrate; /* bit rate */
  120. char Ldescr[70]; /* description of remote */
  121. char Lline[64]; /* /dev/ttyname for outgoing line */
  122. char Llogical[LOGICAL_LEN + 1]; /* logical name of remote (from dial
  123. * dir) */
  124. char Lrname[70]; /* logical name of remote (settable) */
  125. long Loff_hook_time; /* time() at connect */
  126. char Ltelno[DESTREF_LEN + 1]; /* telephone number for remote or null */
  127. UINT32 Lxonxoff; /* status of line IXON and IXOFF */
  128. uchar Ldcdwatch; /* state of line DCD watcher */
  129. uchar Ltelnet; /* true if connection is telnet, false if
  130. * serial */
  131. uchar Lsockserve; /* if Ltelnet true: true if connection is
  132. * under sockserve, false if not */
  133. #ifdef CFG_TelnetOption
  134. uchar Ltelnet_raw; /* true if telnet IAC + CR/0 suppression */
  135. char Lipaddr_str[32]; /* "nnn.nnn.nnn.nnn:nnnnn" */
  136. #endif
  137. uchar Lrtscts_val; /* RTS/CTS state */
  138. /*
  139. * this is a projectile vomit hack, but you don't need termio.h to use
  140. * ecushm.h this way
  141. */
  142. #define TIOBUF_SIZE 40 /* big enough for all systems I know about */
  143. long Ltiobuf[(TIOBUF_SIZE / sizeof(long)) + 1]; /* buffer for termio */
  144. CFG_PidType xmtr_pid; /* transmitter process pid */
  145. CFG_PidType xmtr_ppid; /* transmitter process' parent's pid */
  146. CFG_PidType xmtr_pgrp; /* transmitter process group */
  147. CFG_PidType rcvr_pid; /* receiver pid (or -1 if inactive) */
  148. char tty_name[64]; /* comm line name (not console) */
  149. uchar ttyuse; /* see TTYUSE_... above and ecuxfer.c */
  150. uchar bell_notify_state; /* bell/text-event to annunciator mapping
  151. * state */
  152. uchar autorz; /* if true, automatic rz on rcvd zmodem
  153. * prefix */
  154. uchar autorz_pos; /* position in autorz match sequence */
  155. uchar rcvr_ansi_filter; /* true if ANSI filter desired */
  156. uchar show_telnet_traffic; /* if true, show telnet options traffic */
  157. uchar telnet_ttype[64]; /* transmitted telnet term name */
  158. /*
  159. * receiver process buffered screen write
  160. */
  161. char rcvrdisp_buffer[TO_SCREEN_BUFSZ];
  162. char *rcvrdisp_ptr;
  163. int rcvrdisp_count;
  164. int rcvrdisp_semid;
  165. UINT32 friend_space[128]; /* space for friend programs */
  166. }
  167. ECU_SDS;
  168. extern ECU_SDS FAR *shm; /* shared segment pointer */
  169. #endif /* _ecushm_h */
  170. /* vi: set tabstop=4 shiftwidth=4: */
  171. /* end of ecushm.h */