home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume22 / ecu / patch03b < prev    next >
Text File  |  1991-08-28  |  51KB  |  1,997 lines

  1. Newsgroups: comp.sources.misc
  2. From: Warren Tucker <wht@n4hgf.GA.US>
  3. Subject:  v22i071:  ecu - ECU async comm package rev 3.10, Patch03b/3
  4. Message-ID: <1991Aug28.030146.19474@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: fefc41d7daa787a147df25c830d3d561
  6. Date: Wed, 28 Aug 1991 03:01:46 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Warren Tucker <wht@n4hgf.GA.US>
  10. Posting-number: Volume 22, Issue 71
  11. Archive-name: ecu/patch03b
  12. Environment: SCO, XENIX, ISC, SUNOS4.1, SYSVR4
  13. Patch-To: ecu: Volume 21, Issue 53-89
  14.  
  15. #!/bin/sh
  16. # this is ecu/patch3b (ECU 3.10 patch 3 part 2)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file PATCH3.01 continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 2; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test ! -f _shar_wnt_.tmp; then
  33.     echo 'x - still skipping PATCH3.01'
  34. else
  35. echo 'x - continuing file PATCH3.01'
  36. sed 's/^X//' << 'SHAR_EOF' >> 'PATCH3.01' &&
  37. --- 35,45 ----
  38. X  # include <local/fas.h>
  39. X  #endif
  40. X  
  41. + #ifdef SVR4
  42. + # include <sys/termiox.h>
  43. + extern int hx_flag;
  44. + #endif
  45. X  extern KDE keyset_table[];
  46. X  extern char *makedate;
  47. X  extern char curr_dir[CURR_DIRSIZ];
  48. ***************
  49. *** 511,525 ****
  50. X          break;
  51. X  
  52. X          case CTrtscts:
  53. ! #if defined(RTSFLOW)    /* only SCO has this */
  54. X          if(narg > 1)
  55. X          {
  56. X              lRTSCTS_control(yes_or_no(arg[1]));
  57. X          }
  58. X          ff(se,"  RTS %s CTS %s\r\n",
  59. X              (Ltermio.c_cflag & RTSFLOW) ? "on" : "off",
  60. X              (Ltermio.c_cflag & CTSFLOW) ? "on" : "off");
  61. X  #else
  62. X          ff(se,"  command not available\r\n");
  63. X  #endif
  64. X          break;
  65. --- 518,544 ----
  66. X          break;
  67. X  
  68. X          case CTrtscts:
  69. ! #if defined(RTSFLOW) || defined(SVR4) || defined(sun)
  70. X          if(narg > 1)
  71. X          {
  72. X              lRTSCTS_control(yes_or_no(arg[1]));
  73. X          }
  74. X          ff(se,"  RTS %s CTS %s\r\n",
  75. + #ifdef SVR4
  76. +             (hx_flag & RTSXOFF) ? "on" : "off",
  77. +             (hx_flag & CTSXON) ? "on" : "off");
  78. + #else
  79. + #if defined(RTSFLOW) /* SCO */
  80. X              (Ltermio.c_cflag & RTSFLOW) ? "on" : "off",
  81. X              (Ltermio.c_cflag & CTSFLOW) ? "on" : "off");
  82. X  #else
  83. + #if defined(sun)
  84. +             "N/A",
  85. +             (Ltermio.c_cflag & CRTSCTS) ? "on" : "off");
  86. + #endif /* sun */
  87. + #endif /* RTSFLOW */
  88. + #endif /* SVR4 */
  89. + #else /* no RTS/CTS flow manipulation known to exist */
  90. X          ff(se,"  command not available\r\n");
  91. X  #endif
  92. X          break;
  93. ***************
  94. *** 661,677 ****
  95. X  */
  96. X  
  97. X          case CTmemstat:
  98. ! #if defined(WHT) && defined(MALLOC_3X)
  99. X      {
  100. X          struct mallinfo minfo;
  101. X          extern char *startbrk;
  102. X          char *sbrk();
  103. - #define DEBUG_SURETY
  104. - #ifdef DEBUG_SURETY    /* malloc has been called a zillion times, but ... */
  105. -         char *cptr = malloc(100);
  106. -         free(cptr);
  107. -         pprintf("we got %08lx\n",cptr);
  108. - #endif
  109. X          minfo = mallinfo();
  110. X          pputs("\n"); /* all this casting for 16- vs 32- bit ints */
  111. X          pprintf("%10lu total space in arena\n",(ulong)minfo.arena);
  112. --- 680,690 ----
  113. X  */
  114. X  
  115. X          case CTmemstat:
  116. ! #if defined(MALLOC_3X)
  117. X      {
  118. X          struct mallinfo minfo;
  119. X          extern char *startbrk;
  120. X          char *sbrk();
  121. X          minfo = mallinfo();
  122. X          pputs("\n"); /* all this casting for 16- vs 32- bit ints */
  123. X          pprintf("%10lu total space in arena\n",(ulong)minfo.arena);
  124. ***************
  125. *** 691,697 ****
  126. X      }
  127. X  #else
  128. X          ff(se,"  not available\r\n");
  129. ! #endif /* WHT */
  130. X          break;
  131. X  
  132. X          case 0:
  133. --- 704,715 ----
  134. X      }
  135. X  #else
  136. X          ff(se,"  not available\r\n");
  137. ! #endif
  138. !         break;
  139. !         case CTkbdtest:
  140. !         ff(se,"\r\n");
  141. !         kbd_test();
  142. X          break;
  143. X  
  144. X          case 0:
  145. diff -c /export/home/wht/src/ecu312/ecuicmhelp.c ./ecuicmhelp.c
  146. *** /export/home/wht/src/ecu312/ecuicmhelp.c    Sun Aug 25 17:28:22 1991
  147. --- ./ecuicmhelp.c    Sun Aug 25 14:39:26 1991
  148. ***************
  149. *** 14,19 ****
  150. --- 14,20 ----
  151. X  
  152. X  --------------------------------------------------------------------------*/
  153. X  /*+:EDITS:*/
  154. + /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  155. X  /*:08-01-1991-03:52-wht@n4hgf-when editing string, set cursor to end */
  156. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  157. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  158. ***************
  159. *** 259,265 ****
  160. X          waddstr(stdscr,s80);
  161. X  
  162. X          if(!x)
  163. !             waddch(stdscr,(unsigned)sVR);
  164. X          y++;
  165. X          if(y >= LINES - 2)
  166. X          {
  167. --- 260,270 ----
  168. X          waddstr(stdscr,s80);
  169. X  
  170. X          if(!x)
  171. ! #ifdef SVR4
  172. !             wvline(stdscr,sVR & 0x00ff, 1); 
  173. ! #else
  174. !             waddch(stdscr,sVR);
  175. ! #endif
  176. X          y++;
  177. X          if(y >= LINES - 2)
  178. X          {
  179. diff -c /export/home/wht/src/ecu312/eculine.c ./eculine.c
  180. *** /export/home/wht/src/ecu312/eculine.c    Sun Aug 25 17:29:16 1991
  181. --- ./eculine.c    Mon Aug 26 05:51:00 1991
  182. ***************
  183. *** 36,41 ****
  184. --- 36,42 ----
  185. X  
  186. X  ------------------------------------------------------------------------*/
  187. X  /*+:EDITS:*/
  188. + /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  189. X  /*:08-11-1991-18:06-wht@n4hgf-SCO_TTY_NAMING considerations */
  190. X  /*:08-06-1991-14:18-wht@n4hgf-baud rates below 300 get two stop bits */
  191. X  /*:07-29-1991-01:55-wht@n4hgf-remove unused externs */
  192. ***************
  193. *** 56,61 ****
  194. --- 57,67 ----
  195. X  #include <setjmp.h>
  196. X  
  197. X  extern int errno;
  198. + #ifdef SVR4
  199. + # include <sys/termios.h>
  200. + # include <sys/termiox.h>
  201. + int hx_flag;
  202. + #endif
  203. X  extern int sigint;        /* SIGINT flag: see xmtr_SIGINT_handler */
  204. X  
  205. X  int lgetc_count;
  206. ***************
  207. *** 180,186 ****
  208. X  
  209. X  register actual_count = 0;
  210. X  register char *cptr = lrwt->buffer;
  211. ! register echo_flag = lrwt->echo;
  212. X  int max_count = lrwt->bufsize;
  213. X  char *rtn_val;
  214. X  int timeout_counter;
  215. --- 186,192 ----
  216. X  
  217. X  register actual_count = 0;
  218. X  register char *cptr = lrwt->buffer;
  219. ! register echo_flag = lrwt->echo_flag;
  220. X  int max_count = lrwt->bufsize;
  221. X  char *rtn_val;
  222. X  int timeout_counter;
  223. ***************
  224. *** 284,290 ****
  225. X  register char *cptr = lrwt->buffer;
  226. X  register max_count = lrwt->bufsize;
  227. X  register raw_mode = lrwt->raw_flag & 0x0F;
  228. ! register echo_flag = lrwt->echo;
  229. X  int check_sigint = (lrwt->raw_flag & 0x80);
  230. X  int old_ttymode = get_ttymode();    /* save original tty mode */
  231. X  int fdmask;
  232. --- 290,296 ----
  233. X  register char *cptr = lrwt->buffer;
  234. X  register max_count = lrwt->bufsize;
  235. X  register raw_mode = lrwt->raw_flag & 0x0F;
  236. ! register echo_flag = lrwt->echo_flag;
  237. X  int check_sigint = (lrwt->raw_flag & 0x80);
  238. X  int old_ttymode = get_ttymode();    /* save original tty mode */
  239. X  int fdmask;
  240. ***************
  241. *** 685,690 ****
  242. --- 691,727 ----
  243. X  lRTSCTS_control(flag)
  244. X  int flag;
  245. X  {
  246. + #ifdef SVR4
  247. +     struct termiox flowctrl;
  248. +     ioctl(shm->Liofd, TCGETX, &flowctrl);
  249. +     switch(flag)
  250. +     {
  251. +         case 0:
  252. +             flowctrl.x_hflag &= ~(RTSXOFF | CTSXON);
  253. +             Ltermio.c_iflag |= (IXOFF);
  254. +             break;
  255. +         case 1:
  256. +             flowctrl.x_hflag |= CTSXON;
  257. +             flowctrl.x_hflag &= ~RTSXOFF;
  258. +             Ltermio.c_iflag &= ~(IXON | IXOFF | IXANY);
  259. +             break;
  260. +         case 2:
  261. +             flowctrl.x_hflag |= RTSXOFF;
  262. +             flowctrl.x_hflag &= ~CTSXON;
  263. +             Ltermio.c_iflag &= ~(IXON | IXOFF | IXANY);
  264. +             break;
  265. +         case 3:
  266. +             flowctrl.x_hflag |= (RTSXOFF | CTSXON);
  267. +             Ltermio.c_iflag &= ~(IXON | IXOFF | IXANY);
  268. +             break;
  269. +     }
  270. +     shm->Lxonxoff = Ltermio.c_iflag & (IXON|IXOFF);
  271. +     ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);
  272. +     ioctl(shm->Liofd, TCSETX, &flowctrl);
  273. +     hx_flag = flowctrl.x_hflag;
  274. + #else !SVR4
  275. X  #if defined(RTSFLOW)    /* only SCO */
  276. X      switch(flag)
  277. X      {
  278. ***************
  279. *** 713,719 ****
  280. --- 750,776 ----
  281. X      shm->Lxonxoff = Ltermio.c_iflag & (IXON|IXOFF);
  282. X      ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);
  283. X  
  284. + #else
  285. + #if defined(sun)
  286. +     switch(flag)
  287. +     {
  288. +         case 0:
  289. +             Ltermio.c_iflag |= (IXOFF);
  290. +             Ltermio.c_cflag &= ~(CRTSCTS);
  291. +             break;
  292. +         default:
  293. +             Ltermio.c_iflag &= ~(IXON | IXOFF | IXANY);
  294. +             Ltermio.c_cflag |= ~(CRTSCTS);
  295. +             break;
  296. +     }
  297. +     shm->Lxonxoff = Ltermio.c_iflag & (IXON|IXOFF);
  298. +     ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);
  299. + #endif /* sun */
  300. X  #endif /* RTSFLOW */
  301. + #endif /* SVR4 */
  302. X  }    /* end of lRTSCTS_control */
  303. X  
  304. X  /*+-------------------------------------------------------------------------
  305. ***************
  306. *** 754,762 ****
  307. X              Ltermio.c_iflag |= ISTRIP;
  308. X              break;
  309. X          default:
  310. !             ff(se,"invalid parity: %c ... defaulting to no parity\r\n");
  311. !         case 0:
  312. X          case 'n':
  313. X              Ltermio.c_cflag |= CS8;
  314. X              Ltermio.c_iflag &= ~(ISTRIP);
  315. X              shm->Lparity = 0;
  316. --- 811,821 ----
  317. X              Ltermio.c_iflag |= ISTRIP;
  318. X              break;
  319. X          default:
  320. !             ff(se,"invalid parity: '%c' ... defaulting to no parity\r\n",
  321. !                 to_lower(shm->Lparity));
  322. X          case 'n':
  323. +             shm->Lparity = 0;
  324. +         case 0:
  325. X              Ltermio.c_cflag |= CS8;
  326. X              Ltermio.c_iflag &= ~(ISTRIP);
  327. X              shm->Lparity = 0;
  328. ***************
  329. *** 868,873 ****
  330. --- 927,935 ----
  331. X  
  332. X      lopen_err_str[0] = 0;
  333. X      return(0);
  334. + #ifdef SVR4
  335. +     hx_flag = 0;
  336. + #endif
  337. X  
  338. X  }    /* end of lopen */
  339. X  
  340. ***************
  341. *** 932,943 ****
  342. X  ltoggle_dtr()
  343. X  {
  344. X  struct termio b0t;
  345. X      b0t = Ltermio;
  346. X      b0t.c_cflag &= ~CBAUD;
  347. X  
  348. X      ioctl(shm->Liofd,TCSETA,(char *)&b0t);        /* drop DTR */
  349. X      Nap(1000L);
  350. X      ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);    /* raise DTR */
  351. X      Nap(300L);
  352. X  
  353. --- 994,1011 ----
  354. X  ltoggle_dtr()
  355. X  {
  356. X  struct termio b0t;
  357. ! #if defined(SVR4) || defined(sun)
  358. ! int tempfd;
  359. ! #endif
  360. X      b0t = Ltermio;
  361. X      b0t.c_cflag &= ~CBAUD;
  362. X  
  363. X      ioctl(shm->Liofd,TCSETA,(char *)&b0t);        /* drop DTR */
  364. X      Nap(1000L);
  365. + #if defined(SVR4) || defined(sun)
  366. +     if ((tempfd = open(shm->Lline, O_RDONLY, 0777)) != -1)
  367. +         close(tempfd);
  368. + #endif
  369. X      ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);    /* raise DTR */
  370. X      Nap(300L);
  371. X  
  372. diff -c /export/home/wht/src/ecu312/eculock.c ./eculock.c
  373. *** /export/home/wht/src/ecu312/eculock.c    Mon Aug 12 01:50:00 1991
  374. --- ./eculock.c    Sun Aug 25 14:39:27 1991
  375. ***************
  376. *** 19,24 ****
  377. --- 19,25 ----
  378. X  aged XENIX revision.
  379. X  ------------------------------------------------------------------------*/
  380. X  /*+:EDITS:*/
  381. + /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  382. X  /*:08-10-1991-17:39-wht@n4hgf-US_WEGOTIT handling */
  383. X  /*:08-09-1991-11:07-wht@n4hgf-configurable lock directory */
  384. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  385. ***************
  386. *** 52,60 ****
  387. X              status = LOPEN_ENABLED_IN_USE;
  388. X              break;
  389. X          case US_NOTFOUND:    /* not in utmp, or getty dead */
  390. -             status = LOPEN_WE_GOT_IT;    /* not really an error */
  391. X              break;
  392. X          case US_WEGOTIT:    /* we own the line */
  393. X              break;
  394. X          case US_LOGIN:        /* enabled for login, idle */
  395. X              status = ungetty_get_line();
  396. --- 53,61 ----
  397. X              status = LOPEN_ENABLED_IN_USE;
  398. X              break;
  399. X          case US_NOTFOUND:    /* not in utmp, or getty dead */
  400. X              break;
  401. X          case US_WEGOTIT:    /* we own the line */
  402. +             status = LOPEN_WE_GOT_IT;    /* not really an error */
  403. X              break;
  404. X          case US_LOGIN:        /* enabled for login, idle */
  405. X              status = ungetty_get_line();
  406. ***************
  407. *** 100,107 ****
  408. --- 101,112 ----
  409. X  #endif
  410. X  
  411. X      errno = 0;
  412. + #ifdef SVR4
  413. +     sprintf(LTMP_fname,"/var/spool/locks/LTMP.%d",pid);
  414. + #else
  415. X      strcpy(LTMP_fname,lock_dir_name);
  416. X      sprintf(LTMP_fname + strlen(LTMP_fname),"/LTMP.%05d",pid);
  417. + #endif
  418. X      if((fd = creat(LTMP_fname,0444)) < 0)
  419. X      {
  420. X          if(errno == EACCES)
  421. ***************
  422. *** 149,154 ****
  423. --- 154,160 ----
  424. X      if(itmp = make_lock_name(shm->Lline,LLCKname))
  425. X          return(itmp);
  426. X  
  427. + #ifndef SVR4
  428. X      if(itmp = check_utmp())
  429. X      {
  430. X          if(itmp == LOPEN_WE_GOT_IT)        /* if we already have the line ... */
  431. ***************
  432. *** 156,161 ****
  433. --- 162,168 ----
  434. X          if(itmp != LOPEN_ENABLED)        /* if other than enabled idle ... */
  435. X              return(itmp);                /* ... return the error */
  436. X      }
  437. + #endif
  438. X  
  439. X  #if defined(GETTY_LOCKS_TTY)
  440. X      if(!ungetty_ttyname[0])    /* if getty did not lock line */
  441. diff -c /export/home/wht/src/ecu312/ecunumrev.c ./ecunumrev.c
  442. *** /export/home/wht/src/ecu312/ecunumrev.c    Sun Aug 25 17:28:24 1991
  443. --- ./ecunumrev.c    Tue Aug 27 04:57:22 1991
  444. ***************
  445. *** 3,8 ****
  446. --- 3,9 ----
  447. X      wht@n4hgf.Mt-Park.GA.US
  448. X  ------------------------------------------------------------------------*/
  449. X  /*+:EDITS:*/
  450. + /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  451. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  452. X  /*:07-12-1991-14:14-wht@n4hgf-GCC140 differentiation */
  453. X  /*:04-27-1991-01:52-wht@n4hgf-overhaul revision numbers */
  454. ***************
  455. *** 22,51 ****
  456. X  #endif
  457. X  
  458. X  #ifdef WHT
  459. ! char *numeric_revision = "x3.54";
  460. X  #else
  461. X  char *numeric_revision = "3";
  462. X  #endif
  463. X  char *revstr = "";
  464. X  
  465. - #if defined(ISC)
  466. - char *revision_modifier = "-386i wht@n4hgf";
  467. - #else
  468. - #if defined(M_UNIX)
  469. - char *revision_modifier = "-386u wht@n4hgf";
  470. - #else
  471. - #if defined(M_I386)
  472. - #if defined(NO_SELECT)
  473. - char *revision_modifier = "-386n wht@n4hgf";
  474. - #else
  475. - char *revision_modifier = "-386s wht@n4hgf";
  476. - #endif /*  */
  477. - #else
  478. - char *revision_modifier = "-286n wht@n4hgf";
  479. - #endif /* M_I386 */
  480. - #endif /* M_UNIX */
  481. - #endif /* ISC */
  482. X  /*+-------------------------------------------------------------------------
  483. X      build_revision_string()
  484. X  --------------------------------------------------------------------------*/
  485. --- 23,34 ----
  486. X  #endif
  487. X  
  488. X  #ifdef WHT
  489. ! char *numeric_revision = "x3.6r";
  490. X  #else
  491. X  char *numeric_revision = "3";
  492. X  #endif
  493. X  char *revstr = "";
  494. X  
  495. X  /*+-------------------------------------------------------------------------
  496. X      build_revision_string()
  497. X  --------------------------------------------------------------------------*/
  498. ***************
  499. *** 58,66 ****
  500. X  
  501. X  #if defined(M_I286)
  502. X      strcat(s128,"286");
  503. ! #endif /* M_I286 */
  504. ! #if defined(M_I386) || defined(i386)
  505. X      strcat(s128,"386");
  506. X  #    if defined(M_XENIX)
  507. X  #        if defined(NO_SELECT)
  508. --- 41,48 ----
  509. X  
  510. X  #if defined(M_I286)
  511. X      strcat(s128,"286");
  512. ! #else
  513. ! #if defined(M_I386) || defined(i386) && (!defined(sun) && !defined(SVR4))
  514. X      strcat(s128,"386");
  515. X  #    if defined(M_XENIX)
  516. X  #        if defined(NO_SELECT)
  517. ***************
  518. *** 72,81 ****
  519. X  #    if defined(M_UNIX)
  520. X          strcat(s128,"u");
  521. X  #    endif /* M_UNIX */
  522. ! #    if defined(ISC)
  523. !         strcat(s128,"i");
  524. ! #    endif /* ISC */
  525. X  #endif /* M_I386 || i386 */
  526. X  
  527. X  #if defined(__GNUC__)
  528. X  #if defined(GCC140)
  529. --- 54,71 ----
  530. X  #    if defined(M_UNIX)
  531. X          strcat(s128,"u");
  532. X  #    endif /* M_UNIX */
  533. ! #else
  534. ! #if defined(sun)
  535. !     strcat(s128,"sun");
  536. ! #else
  537. ! #if defined(SVR4)
  538. !     strcat(s128,"SVR4");
  539. ! #else
  540. ! # include "porting.attention.needed.here"
  541. ! #endif /* SVR4 */
  542. ! #endif /* sun */
  543. X  #endif /* M_I386 || i386 */
  544. + #endif /* M_I286 */
  545. X  
  546. X  #if defined(__GNUC__)
  547. X  #if defined(GCC140)
  548. ***************
  549. *** 100,106 ****
  550. X          exit(255);
  551. X      }
  552. X      strcpy(revstr,s128);
  553. X  
  554. X  }    /* end of build_revision_string */
  555. X  
  556. --- 90,95 ----
  557. diff -c /export/home/wht/src/ecu312/ecuphone.c ./ecuphone.c
  558. *** /export/home/wht/src/ecu312/ecuphone.c    Sun Aug 25 17:29:18 1991
  559. --- ./ecuphone.c    Sun Aug 25 14:39:28 1991
  560. ***************
  561. *** 71,76 ****
  562. --- 71,78 ----
  563. X  
  564. X  --------------------------------------------------------------------------*/
  565. X  /*+:EDITS:*/
  566. + /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  567. + /*:08-15-1991-18:13-wht@n4hgf-do not allow edit of non-existent entry */
  568. X  /*:08-11-1991-19:56-wht@n4hgf-soup up tty name for ISC vs. SCO */
  569. X  /*:08-07-1991-13:48-root@n4hgf-w subcommand was not asking both questions */
  570. X  /*:08-01-1991-03:52-wht@n4hgf-when editing string, set cursor to end */
  571. ***************
  572. *** 206,213 ****
  573. --- 208,219 ----
  574. X          else
  575. X          {
  576. X              itmp = 10;
  577. + #ifdef SVR4
  578. +             whline(dirw, (unsigned long)(sHR & 0x00ff), itmp);
  579. + #else
  580. X              while(itmp--)
  581. X                  waddch(dirw,(unsigned)sHR);
  582. + #endif
  583. X          }
  584. X          wrefresh(dirw);
  585. X      }
  586. ***************
  587. *** 435,443 ****
  588. X      waddstr(dirw,s80);
  589. X      waddch(dirw,' ');
  590. X      getyx(dirw,itmp,x);
  591. X      while(x < DIRW_COLS - 1)
  592. X          waddch(dirw,sHR),x++;
  593. X  }    /* end of dirw_display_phonedir_name */
  594. X  
  595. X  /*+-----------------------------------------------------------------------
  596. --- 441,452 ----
  597. X      waddstr(dirw,s80);
  598. X      waddch(dirw,' ');
  599. X      getyx(dirw,itmp,x);
  600. + #ifdef SVR4
  601. +     whline(dirw, (unsigned long)(sHR & 0x00ff), DIRW_COLS - 1 - x);
  602. + #else
  603. X      while(x < DIRW_COLS - 1)
  604. X          waddch(dirw,sHR),x++;
  605. ! #endif
  606. X  }    /* end of dirw_display_phonedir_name */
  607. X  
  608. X  /*+-----------------------------------------------------------------------
  609. ***************
  610. *** 614,619 ****
  611. --- 623,632 ----
  612. X  {
  613. X  register y,x;
  614. X  
  615. + #ifdef SVR4
  616. +     wmove(dirw,DIRW_LINES - DIRW_BOT_LINES,1);
  617. +     whline(dirw, (unsigned long)(sHR & 0x00ff), DIRW_COLS - 2);
  618. + #else
  619. X      wmove(dirw,DIRW_LINES - DIRW_BOT_LINES,0);
  620. X      waddch(dirw,sLT);
  621. X      getyx(dirw,y,x);
  622. ***************
  623. *** 620,625 ****
  624. --- 633,639 ----
  625. X      while(x++ < (DIRW_COLS - 1))
  626. X          waddch(dirw,sHR);
  627. X      waddch(dirw,sRT);
  628. + #endif
  629. X      if(pde_marked_for_redial_count)
  630. X      {
  631. X          wmove(dirw,DIRW_LINES - DIRW_BOT_LINES,2);
  632. ***************
  633. *** 650,656 ****
  634. --- 664,674 ----
  635. X      wstandout(dirw);
  636. X      wprintw(dirw,
  637. X  " entry name %c telephone number %c tty %c baud P %c description                   ",
  638. + #ifdef SVR4
  639. +         '|','|','|','|');
  640. + #else
  641. X          sVR,sVR,sVR,sVR);
  642. + #endif
  643. X      wstandend(dirw);
  644. X      dirw_display_phonedir_name();
  645. X      dirw_display_config();
  646. ***************
  647. *** 679,686 ****
  648. --- 697,708 ----
  649. X      if((itmp = strlen(msg)) == 0)
  650. X      {
  651. X          itmp2 = last_msglen + 2;
  652. + #ifdef SVR4
  653. +         whline(dirw, (unsigned long)(sHR & 0x00ff), itmp2);
  654. + #else
  655. X          for(itmp = 0; itmp < itmp2; itmp++)
  656. X              waddch(dirw,(unsigned)sHR);
  657. + #endif
  658. X          last_msglen = 0;
  659. X      }
  660. X      else
  661. ***************
  662. *** 701,708 ****
  663. --- 723,734 ----
  664. X          waddch(dirw,' ');
  665. X          if((itmp2 = last_msglen - itmp) > 0)
  666. X          {
  667. + #ifdef SVR4
  668. +             whline(dirw, (unsigned long)(sHR & 0x00ff), itmp2);
  669. + #else
  670. X              while(itmp2--)
  671. X                  waddch(dirw,(unsigned)sHR);
  672. + #endif
  673. X          }
  674. X          last_msglen = itmp;        /* remember last message length */
  675. X      }
  676. ***************
  677. *** 719,725 ****
  678. --- 745,756 ----
  679. X  int stand_out;
  680. X  {
  681. X      wmove(scrw,line,0);
  682. + #ifdef SVR4
  683. +     wvline(scrw, (unsigned long)(sVR & 0x00ff), 1);
  684. +     wmove(scrw,line,1);
  685. + #else
  686. X      waddch(scrw,(unsigned)sVR);
  687. + #endif
  688. X  
  689. X      if(tpde->redial)
  690. X      {
  691. ***************
  692. *** 753,760 ****
  693. --- 784,806 ----
  694. X  
  695. X      pde_display_logical(line,tpde,stand_out);
  696. X      waddch(scrw,' ');
  697. + #ifdef SVR4
  698. +     wmove(scrw, line, 13);
  699. +     waddch(scrw,'|');
  700. + #else
  701. X      waddch(scrw,(unsigned)sVR);
  702. + #endif
  703. X      waddch(scrw,' ');
  704. + #ifdef SVR4
  705. +     wprintw(scrw,"%-16.16s %c",tpde->telno,'|');
  706. +     if(tpde->tty[0])
  707. +         wprintw(scrw,"%-5.5s%c",tpde->tty,'|');
  708. +     else
  709. +         wprintw(scrw,"Any  %c",'|');
  710. +     wprintw(scrw,"%5u %c %c ",tpde->baud,
  711. +         (tpde->parity) ? to_upper(tpde->parity) : 'N','|');
  712. +     wprintw(scrw,"%-29.29s",tpde->descr);
  713. + #else
  714. X      wprintw(scrw,"%-16.16s %c",tpde->telno,sVR);
  715. X      if(tpde->tty[0])
  716. X          wprintw(scrw,"%-5.5s%c",tpde->tty,sVR);
  717. ***************
  718. *** 763,768 ****
  719. --- 809,815 ----
  720. X      wprintw(scrw,"%5u %c %c ",tpde->baud,
  721. X          (tpde->parity) ? to_upper(tpde->parity) : 'N',sVR);
  722. X      wprintw(scrw,"%-29.29s %c",tpde->descr,sVR);
  723. + #endif
  724. X      return(0);
  725. X  
  726. X  }    /* end of pde_display */
  727. ***************
  728. *** 791,800 ****
  729. --- 838,856 ----
  730. X          else
  731. X          {
  732. X              wmove(scrw,line,0);
  733. + #ifdef SVR4
  734. +             wvline(scrw, (unsigned long)(sVR & 0x00ff), 1);
  735. +             wmove(scrw,line,1);
  736. + #else
  737. X              waddch(scrw,(unsigned)sVR);
  738. + #endif
  739. X              wclrtoeol(scrw);
  740. X              wmove(scrw,line,SCRW_COLS - 1);
  741. + #ifdef SVR4
  742. +             wvline(scrw, (unsigned long)(sVR & 0x00ff), 1);
  743. + #else
  744. X              waddch(scrw,(unsigned)sVR);
  745. + #endif
  746. X          }
  747. X      }
  748. X      wrefresh(scrw);
  749. ***************
  750. *** 1119,1124 ****
  751. --- 1175,1183 ----
  752. X  int wgpos = -1;
  753. X  char s80[80];
  754. X  
  755. +     if(!check_curr_pde())
  756. +         return;
  757. X      wmove(addw,9,2);
  758. X      waddstr(addw,prompt);
  759. X  
  760. ***************
  761. *** 2099,2110 ****
  762. X              strcpy(shm->Lline,"/dev/tty");
  763. X          strcat(shm->Lline,tpde->tty);
  764. X  #else
  765. - #if defined(ISC)
  766. X          strcpy(shm->Lline,"/dev/");
  767. X          strcat(shm->Lline,tpde->tty);
  768. - #else
  769. - #    include "need.porting.attention.here"
  770. - #endif /* ISC */
  771. X  #endif /* M_SYSV */
  772. X      }
  773. X      else    /* "Any" */
  774. --- 2158,2165 ----
  775. diff -c /export/home/wht/src/ecu312/ecurcvr.c ./ecurcvr.c
  776. *** /export/home/wht/src/ecu312/ecurcvr.c    Thu Jul 25 12:56:00 1991
  777. --- ./ecurcvr.c    Mon Aug 26 16:49:35 1991
  778. ***************
  779. *** 1,7 ****
  780. ! #define DEFENSIVE        /* lots of changes this rev: defining this
  781. !                          * will make for screwed up screen image
  782. !                          * but no core dump if nassssty bugs show up
  783. !                          */
  784. X  /* #define ANSI_DEBUG */        /* debug ansi */
  785. X  /* #define ANSI_DEBUG_2 */        /* debug ansi intensive output */
  786. X  /* #define ANSI_DEBUG_3 */        /* debug ansi selected output */
  787. --- 1,4 ----
  788. ! /* #define DEFENSIVE */
  789. X  /* #define ANSI_DEBUG */        /* debug ansi */
  790. X  /* #define ANSI_DEBUG_2 */        /* debug ansi intensive output */
  791. X  /* #define ANSI_DEBUG_3 */        /* debug ansi selected output */
  792. ***************
  793. *** 49,54 ****
  794. --- 46,52 ----
  795. X  
  796. X  --------------------------------------------------------------------------*/
  797. X  /*+:EDITS:*/
  798. + /*:08-26-1991-16:39-wht@n4hgf2-SD was still hopelessly manic */
  799. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  800. X  /*:07-05-1991-06:13-wht@n4hgf-SD was in baaaaadd shape */
  801. X  /*:01-09-1991-22:31-wht@n4hgf-ISC port */
  802. ***************
  803. *** 686,692 ****
  804. X      if(!tty_is_ansi)
  805. X      {
  806. X          tcap_cursor(0,0);
  807. !         tcap_insert_lines(count);
  808. X          tcap_cursor(shm->cursor_y,shm->cursor_x);
  809. X      }
  810. X  
  811. --- 684,690 ----
  812. X      if(!tty_is_ansi)
  813. X      {
  814. X          tcap_cursor(0,0);
  815. !         tcap_insert_lines(param);
  816. X          tcap_cursor(shm->cursor_y,shm->cursor_x);
  817. X      }
  818. X  
  819. diff -c /export/home/wht/src/ecu312/ecusetup.c ./ecusetup.c
  820. *** /export/home/wht/src/ecu312/ecusetup.c    Sun Aug 25 17:29:19 1991
  821. --- ./ecusetup.c    Mon Aug 26 15:56:02 1991
  822. ***************
  823. *** 34,39 ****
  824. --- 34,40 ----
  825. X  
  826. X  --------------------------------------------------------------------------*/
  827. X  /*+:EDITS:*/
  828. + /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  829. X  /*:08-12-1991-00:58-wht@n4hgf-ISC tty names */
  830. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  831. X  /*:07-17-1991-07:04-wht@n4hgf-avoid SCO UNIX nap bug */
  832. ***************
  833. *** 73,90 ****
  834. X  #define DESCR_LX    3
  835. X  
  836. X  #define TTY_Y        6
  837. - #if defined(M_SYSV)
  838. - #define TTY_X        16
  839. - #define TTY_LEN        5
  840. - #else
  841. - #if defined(ISC)
  842. X  #define TTY_X        13
  843. X  #define TTY_LEN        8
  844. - #else
  845. - #    include "porting.attention.needed.here"
  846. - #endif /* ISC */
  847. - #endif /* M_SYSV */
  848. X  #define TTY_LX        3
  849. X  
  850. X  #define TTYOPN_LY    6
  851. --- 74,81 ----
  852. ***************
  853. *** 150,157 ****
  854. X      if((itmp = strlen(msg)) == 0)
  855. X      {
  856. X          itmp2 = *last_msglen + 2;
  857. !         for(itmp = 0; itmp < itmp2; itmp++)
  858. !             waddch(setw,fillch & 0xFF);
  859. X          *last_msglen = 0;
  860. X      }
  861. X      else
  862. --- 141,152 ----
  863. X      if((itmp = strlen(msg)) == 0)
  864. X      {
  865. X          itmp2 = *last_msglen + 2;
  866. ! #ifdef SVR4
  867. !         whline(setw, (unsigned long)(fillch & 0x00ff), itmp2);
  868. ! #else
  869. !           for(itmp = 0; itmp < itmp2; itmp++)
  870. !             waddch(setw,fillch & 0xFF); 
  871. ! #endif
  872. X          *last_msglen = 0;
  873. X      }
  874. X      else
  875. ***************
  876. *** 172,179 ****
  877. X          waddch(setw,' ');
  878. X          if((itmp2 = *last_msglen - itmp) > 0)
  879. X          {
  880. X              while(itmp2--)
  881. !                 waddch(setw,fillch & 0xFF);
  882. X          }
  883. X          *last_msglen = itmp;        /* remember last message length */
  884. X      }
  885. --- 167,178 ----
  886. X          waddch(setw,' ');
  887. X          if((itmp2 = *last_msglen - itmp) > 0)
  888. X          {
  889. + #ifdef SVR4
  890. +             whline(setw, (unsigned long)(fillch & 0x00ff), itmp2);
  891. + #else
  892. X              while(itmp2--)
  893. !                   waddch(setw,fillch & 0xFF); 
  894. ! #endif
  895. X          }
  896. X          *last_msglen = itmp;        /* remember last message length */
  897. X      }
  898. ***************
  899. *** 188,194 ****
  900. X  char *msg;
  901. X  {
  902. X  static int last_msglen = 0;
  903. X      setw_msg(msg,SETW_MSG_BOT_Y,sHR,&last_msglen);
  904. X  }    /* end of setw_bot_msg */
  905. X  
  906. --- 187,192 ----
  907. ***************
  908. *** 250,265 ****
  909. X  void
  910. X  setup_display_tty()
  911. X  {
  912. X      clear_area(setw,TTY_Y,TTY_X,TTY_LEN);
  913. ! #if defined(M_SYSV)
  914. !     waddstr(setw,&shm->Lline[8]);
  915. ! #else
  916. ! #if defined(ISC)
  917. !     waddstr(setw,&shm->Lline[5]);
  918. ! #else
  919. ! #    include "porting.attention.needed.here"
  920. ! #endif /* ISC */
  921. ! #endif /* M_SYSV */
  922. X  
  923. X  }    /* end of setup_display_tty */
  924. X  
  925. --- 248,259 ----
  926. X  void
  927. X  setup_display_tty()
  928. X  {
  929. + char s[TTY_LEN + 1];
  930. +     strncpy(s,shm->Lline + 5,TTY_LEN);
  931. +     s[TTY_LEN] = 0;
  932. X      clear_area(setw,TTY_Y,TTY_X,TTY_LEN);
  933. !     waddstr(setw,s);
  934. X  
  935. X  }    /* end of setup_display_tty */
  936. X  
  937. ***************
  938. *** 485,508 ****
  939. X  
  940. X              case 1:
  941. X  #if defined(M_SYSV)
  942. !                 setw_bot_msg("comm line: i.e., 1a, 2a, 4a, 4b, 4c, 4d");
  943. ! #define _TTYPOS 8
  944. X  #else
  945. ! #if defined(ISC)
  946. X                  setw_bot_msg("comm line: i.e., acu00, tty00");
  947. - #define _TTYPOS 5
  948. X  #else
  949. X  #    include "porting.attention.needed.here"
  950. X  #endif /* ISC */
  951. X  #endif /* M_SYSV */
  952. X  
  953. X                  setup_display_tty();
  954. !                 strcpy(s80,&shm->Lline[_TTYPOS]);
  955. X                   itmp = wingets(setw,TTY_Y,TTY_X,s80,TTY_LEN + 1,&delim,
  956. X                      1,(int *)0);
  957. X                  setw_err_msg("");
  958. X                  if(strchr(use_input_delim,delim))
  959. !                     strcpy(&shm->Lline[_TTYPOS],s80);
  960. X                  setup_display_tty();
  961. X                  break;
  962. X  
  963. --- 479,504 ----
  964. X  
  965. X              case 1:
  966. X  #if defined(M_SYSV)
  967. !                 setw_bot_msg("comm line: i.e., tty1a, tty4d");
  968. X  #else
  969. ! #if defined(ISC) || defined(SVR4)
  970. X                  setw_bot_msg("comm line: i.e., acu00, tty00");
  971. X  #else
  972. + #if defined(sun)
  973. +                 setw_bot_msg("comm line: i.e., cua0, ttyd0");
  974. + #else
  975. X  #    include "porting.attention.needed.here"
  976. + #endif /* sun */
  977. X  #endif /* ISC */
  978. X  #endif /* M_SYSV */
  979. X  
  980. X                  setup_display_tty();
  981. !                 strcpy(s80,&shm->Lline[5]);
  982. X                   itmp = wingets(setw,TTY_Y,TTY_X,s80,TTY_LEN + 1,&delim,
  983. X                      1,(int *)0);
  984. X                  setw_err_msg("");
  985. X                  if(strchr(use_input_delim,delim))
  986. !                     strcpy(&shm->Lline[5],s80);
  987. X                  setup_display_tty();
  988. X                  break;
  989. X  
  990. ***************
  991. *** 593,598 ****
  992. --- 589,595 ----
  993. X  
  994. X          switch(delim)
  995. X          {
  996. +             case XFcurup:
  997. X              case CTL_B:
  998. X                  if(input_state)
  999. X                      input_state--;
  1000. ***************
  1001. *** 600,605 ****
  1002. --- 597,603 ----
  1003. X                      input_state = 6;
  1004. X                  break;
  1005. X  
  1006. +             case XFcurdn:
  1007. X              case TAB:
  1008. X              case NL:
  1009. X                  input_state++;
  1010. ***************
  1011. *** 681,687 ****
  1012. X      DCE_dial();
  1013. X  #endif
  1014. X      }
  1015. !     else
  1016. X          start_rcvr_process(1);
  1017. X  
  1018. X  }    /* end of setup_screen */
  1019. --- 679,685 ----
  1020. X      DCE_dial();
  1021. X  #endif
  1022. X      }
  1023. !     else 
  1024. X          start_rcvr_process(1);
  1025. X  
  1026. X  }    /* end of setup_screen */
  1027. diff -c /export/home/wht/src/ecu312/ecushm.h ./ecushm.h
  1028. *** /export/home/wht/src/ecu312/ecushm.h    Thu Jul 25 12:56:00 1991
  1029. --- ./ecushm.h    Fri Aug 23 14:21:59 1991
  1030. ***************
  1031. *** 4,9 ****
  1032. --- 4,10 ----
  1033. X      wht@n4hgf.Mt-Park.GA.US
  1034. X  --------------------------------------------------------------------------*/
  1035. X  /*+:EDITS:*/
  1036. + /*:08-21-1991-01:34-wht@n4hgf-FAR depends only on M_I286 */
  1037. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  1038. X  /*:12-19-1990-17:09-wht@n4hgf-make cursor variables unsigned */
  1039. X  /*:11-30-1990-19:01-wht@n4hgf-add ttyinit_param */
  1040. ***************
  1041. *** 10,19 ****
  1042. X  /*:11-28-1990-17:43-wht@n4hgf-move cursor_y, cursor_x to right after revision */
  1043. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  1044. X  
  1045. ! #if defined(i386) || defined(M_I386)
  1046. ! #define FAR
  1047. ! #else
  1048. X  #define FAR far
  1049. X  #endif
  1050. X  
  1051. X  #if !defined(ushort)
  1052. --- 11,20 ----
  1053. X  /*:11-28-1990-17:43-wht@n4hgf-move cursor_y, cursor_x to right after revision */
  1054. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  1055. X  
  1056. ! #if defined(M_I286)
  1057. X  #define FAR far
  1058. + #else
  1059. + #define FAR
  1060. X  #endif
  1061. X  
  1062. X  #if !defined(ushort)
  1063. diff -c /export/home/wht/src/ecu312/ecusighdl.c ./ecusighdl.c
  1064. *** /export/home/wht/src/ecu312/ecusighdl.c    Sun Aug 25 17:29:20 1991
  1065. --- ./ecusighdl.c    Mon Aug 26 16:08:51 1991
  1066. ***************
  1067. *** 5,11 ****
  1068. X  
  1069. X    Defined functions:
  1070. X      child_signals()
  1071. -     termecu(sig)
  1072. X      kill_rcvr_process(sig)
  1073. X      rcvr_SIGHUP_handler()
  1074. X      rcvr_SIGINT_handler()
  1075. --- 5,10 ----
  1076. ***************
  1077. *** 16,31 ****
  1078. X      rcvr_death_handler(sig)
  1079. X      rcvr_signals()
  1080. X      start_rcvr_process(notify_flag)
  1081. X      xmtr_SIGHUP_handler(sig)
  1082. X      xmtr_SIGINT_handler()
  1083. X      xmtr_SIGTERM_handler(sig)
  1084. X      xmtr_SIGUSR2_handler()
  1085. !     xmtr_bsd4_SIGCHLD_handler()
  1086. X      xmtr_signals()
  1087. -     xmtr_SIGCLD_handler()
  1088. X  
  1089. X  ------------------------------------------------------------------------*/
  1090. X  /*+:EDITS:*/
  1091. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  1092. X  /*:07-17-1991-07:04-wht@n4hgf-avoid SCO UNIX nap bug */
  1093. X  /*:06-29-1991-15:42-wht@n4hgf-if WHT and xterm, play with title bar */
  1094. --- 15,33 ----
  1095. X      rcvr_death_handler(sig)
  1096. X      rcvr_signals()
  1097. X      start_rcvr_process(notify_flag)
  1098. +     termecu(sig)
  1099. +     termecu_code_text(code)
  1100. +     xmtr_SIGCLD_handler()
  1101. X      xmtr_SIGHUP_handler(sig)
  1102. X      xmtr_SIGINT_handler()
  1103. X      xmtr_SIGTERM_handler(sig)
  1104. X      xmtr_SIGUSR2_handler()
  1105. !     xmtr_death_handler(sig)
  1106. X      xmtr_signals()
  1107. X  
  1108. X  ------------------------------------------------------------------------*/
  1109. X  /*+:EDITS:*/
  1110. + /*:08-25-1991-23:56-wht@n4hgf2-handle xmtr core dump gracefully */
  1111. X  /*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  1112. X  /*:07-17-1991-07:04-wht@n4hgf-avoid SCO UNIX nap bug */
  1113. X  /*:06-29-1991-15:42-wht@n4hgf-if WHT and xterm, play with title bar */
  1114. ***************
  1115. *** 69,74 ****
  1116. --- 71,77 ----
  1117. X  void xmtr_SIGHUP_handler();
  1118. X  void xmtr_SIGTERM_handler();
  1119. X  void xmtr_SIGCLD_handler();
  1120. + void Xcvr_death_handler();
  1121. X  void rcvr_common_signal_handler();
  1122. X  void rcvr_death_handler();
  1123. X  
  1124. ***************
  1125. *** 351,371 ****
  1126. X  {
  1127. X      rcvr_common_signal_handler();
  1128. X  }
  1129. X  void
  1130. X  rcvr_death_handler(sig)
  1131. X  int sig;
  1132. X  {
  1133. !     fprintf(stderr,"\r\nreceiver process caught signal %s\r\n",
  1134. !         signal_name_text(sig));
  1135. !     fprintf(stderr,"cursor y=%d x=%d\r\n",shm->cursor_y,shm->cursor_x);
  1136. ! #ifdef SIGABRT
  1137. !     signal(SIGABRT,SIG_DFL);
  1138. X  #else
  1139. !     signal(SIGIOT,SIG_IOT);
  1140. X  #endif
  1141. !     abort();
  1142. X      _exit(-1);
  1143. ! }
  1144. X  /*+-------------------------------------------------------------------------
  1145. X      xmtr_SIGINT_handler()
  1146. X  --------------------------------------------------------------------------*/
  1147. --- 354,383 ----
  1148. X  {
  1149. X      rcvr_common_signal_handler();
  1150. X  }
  1151. + /*+-------------------------------------------------------------------------
  1152. +     rcvr_death_handler(sig)
  1153. + --------------------------------------------------------------------------*/
  1154. X  void
  1155. X  rcvr_death_handler(sig)
  1156. X  int sig;
  1157. X  {
  1158. !     int itmp;
  1159. ! #ifdef lint
  1160. !     int *open_elevator_shaft = (int *)0;
  1161. X  #else
  1162. !     int *open_elevator_shaft = (int *)(shm - 1);
  1163. X  #endif
  1164. !     ttymode(0);
  1165. !     fprintf(stderr,"\r\nreceiver process caught signal %s\r\n",
  1166. !         signal_name_text(sig));
  1167. !     fprintf(stderr,"cursor y=%d x=%d\r\n",shm->cursor_y,shm->cursor_x);
  1168. !     signal(SIGSEGV,SIG_DFL);
  1169. !     signal(SIGBUS,SIG_DFL);
  1170. !     itmp = *open_elevator_shaft;
  1171. X      _exit(-1);
  1172. ! }    /* end of rcvr_death_handler */
  1173. X  /*+-------------------------------------------------------------------------
  1174. X      xmtr_SIGINT_handler()
  1175. X  --------------------------------------------------------------------------*/
  1176. ***************
  1177. *** 401,406 ****
  1178. --- 413,445 ----
  1179. X  }
  1180. X  
  1181. X  /*+-------------------------------------------------------------------------
  1182. +     xmtr_death_handler(sig)
  1183. + --------------------------------------------------------------------------*/
  1184. + void
  1185. + xmtr_death_handler(sig)
  1186. + int sig;
  1187. + {
  1188. + int itmp;
  1189. + #ifdef lint
  1190. + int *open_elevator_shaft = (int *)0;
  1191. + #else
  1192. + int *open_elevator_shaft = (int *)(shm - 1);
  1193. + #endif
  1194. +     ttymode(0);
  1195. +     fprintf(stderr,"\r\ntransmitter process caught signal %s\n",
  1196. +         signal_name_text(sig));
  1197. +     for(itmp = 1; itmp < NSIG; itmp++)
  1198. +         signal(itmp,SIG_IGN);
  1199. +     kill_rcvr_process(SIGUSR1);
  1200. +     signal(SIGSEGV,SIG_DFL);
  1201. +     signal(SIGBUS,SIG_DFL);
  1202. +     itmp = *open_elevator_shaft;
  1203. +     printf("itmp=%d oes=%08lx\n",itmp,open_elevator_shaft);
  1204. +     _exit(-1);
  1205. + }    /* end of xmtr_death_handler */
  1206. + /*+-------------------------------------------------------------------------
  1207. X      xmtr_SIGCLD_handler()
  1208. X  --------------------------------------------------------------------------*/
  1209. X  void
  1210. ***************
  1211. *** 453,458 ****
  1212. --- 492,498 ----
  1213. X  void
  1214. X  xmtr_signals()
  1215. X  {
  1216. X      signal(SIGHUP,xmtr_SIGHUP_handler);
  1217. X      signal(SIGQUIT,SIG_IGN);
  1218. X      signal(SIGINT,xmtr_SIGINT_handler);
  1219. ***************
  1220. *** 459,464 ****
  1221. --- 499,525 ----
  1222. X      signal(SIGTERM,xmtr_SIGTERM_handler);
  1223. X      signal(SIGCLD,xmtr_SIGCLD_handler);
  1224. X      signal(SIGUSR2,xmtr_SIGUSR2_handler);
  1225. + #ifdef SIGILL
  1226. +     signal(SIGILL,xmtr_death_handler);
  1227. + #endif
  1228. + #ifdef SIGIOT
  1229. +     signal(SIGIOT,xmtr_death_handler);
  1230. + #endif
  1231. + #ifdef SIGABRT
  1232. +     signal(SIGABRT,xmtr_death_handler);
  1233. + #endif
  1234. + #ifdef SIGEMT
  1235. +     signal(SIGEMT,xmtr_death_handler);
  1236. + #endif
  1237. + #ifdef SIGFPE
  1238. +     signal(SIGFPE,xmtr_death_handler);
  1239. + #endif
  1240. + #ifdef SIGBUS
  1241. +     signal(SIGBUS,xmtr_death_handler);
  1242. + #endif
  1243. + #ifdef SIGSEGV
  1244. +     signal(SIGSEGV,xmtr_death_handler);
  1245. + #endif
  1246. X  
  1247. X  }    /* end of xmtr_signals */
  1248. X  
  1249. ***************
  1250. *** 472,478 ****
  1251. X      signal(SIGQUIT,SIG_IGN);
  1252. X  #ifdef RCVR_CLEAN_CORE_DUMP
  1253. X      signal(SIGILL,SIG_DFL);
  1254. -     signal(SIGTRAP,SIG_DFL);
  1255. X      signal(SIGIOT,SIG_DFL);
  1256. X      signal(SIGABRT,SIG_DFL);
  1257. X      signal(SIGEMT,SIG_DFL);
  1258. --- 533,538 ----
  1259. ***************
  1260. *** 482,490 ****
  1261. X  #else
  1262. X  #ifdef SIGILL
  1263. X      signal(SIGILL,rcvr_death_handler);
  1264. - #endif
  1265. - #ifdef SIGTRAP
  1266. -     signal(SIGTRAP,rcvr_death_handler);
  1267. X  #endif
  1268. X  #ifdef SIGIOT
  1269. X      signal(SIGIOT,rcvr_death_handler);
  1270. --- 542,547 ----
  1271. diff -c /export/home/wht/src/ecu312/ecutty.c ./ecutty.c
  1272. *** /export/home/wht/src/ecu312/ecutty.c    Sun Aug 25 17:29:21 1991
  1273. --- ./ecutty.c    Mon Aug 26 05:29:24 1991
  1274. ***************
  1275. *** 1,3 ****
  1276. --- 1,4 ----
  1277. + /* #define NAP_DEBUG */
  1278. X  /*+-------------------------------------------------------------------------
  1279. X      ecutty.c - local tty (console) functions
  1280. X      wht@n4hgf.Mt-Park.GA.US
  1281. ***************
  1282. *** 43,48 ****
  1283. --- 44,51 ----
  1284. X  
  1285. X  --------------------------------------------------------------------------*/
  1286. X  /*+:EDITS:*/
  1287. + /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  1288. + /*:08-17-1991-18:29-wht@n4hgf-add kbdtest command */
  1289. X  /*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
  1290. X  /*:07-14-1991-18:18-wht@n4hgf-new ttygets functions */
  1291. X  /*:07-10-1991-16:19-wht@n4hgf-improve multi-char func key read timeout */
  1292. ***************
  1293. *** 64,72 ****
  1294. X  #if defined(M_SYSV)
  1295. X  #   include <sys/machdep.h>
  1296. X  #else
  1297. X  #  include <sys/at_ansi.h>
  1298. X  #  include <sys/kd.h>
  1299. ! #endif
  1300. X  
  1301. X  #define DEFINE_TTY_DATA
  1302. X  #include "ecutty.h"
  1303. --- 67,77 ----
  1304. X  #if defined(M_SYSV)
  1305. X  #   include <sys/machdep.h>
  1306. X  #else
  1307. + #if defined(ISC)
  1308. X  #  include <sys/at_ansi.h>
  1309. X  #  include <sys/kd.h>
  1310. ! #endif /* ISC */
  1311. ! #endif /* M_SYSV */
  1312. X  
  1313. X  #define DEFINE_TTY_DATA
  1314. X  #include "ecutty.h"
  1315. ***************
  1316. *** 112,117 ****
  1317. --- 117,123 ----
  1318. X  extern int COLS;
  1319. X  extern char screen_dump_file_name[];
  1320. X  
  1321. + char *kde_text();
  1322. X  
  1323. X  uint LINESxCOLS;
  1324. X  int current_ttymode = 0;
  1325. ***************
  1326. *** 120,125 ****
  1327. --- 126,132 ----
  1328. X  int tty_is_pts;
  1329. X  int tty_is_pty;
  1330. X  int tty_is_multiscreen;
  1331. + static int kbd_test_active = 0;
  1332. X  
  1333. X  struct termio tty_termio_at_entry;
  1334. X  struct termio tty_termio_current;
  1335. ***************
  1336. *** 147,152 ****
  1337. --- 154,168 ----
  1338. X  uchar *dole_out_tgc_accum = (uchar *)0;
  1339. X  int dole_out_tgc_accum_count = 0;
  1340. X  
  1341. + #ifdef SVR4
  1342. + ulong colors_current = 0x00003740;
  1343. + ulong colors_normal = 0x00003740;    /* */
  1344. + ulong colors_initial = 0x00003740;    /* */
  1345. + ulong colors_success = 0x00003740;    /* */
  1346. + ulong colors_alert = 0x00003740L;    /* */
  1347. + ulong colors_error = 0x00003140L;    /* */
  1348. + ulong colors_notify = 0x00003340L;    /* */
  1349. + #else
  1350. X  ulong colors_current = 0x04070A00L;
  1351. X  ulong colors_normal = 0x04070A00L;    /* default lt_green/black red/white */
  1352. X  ulong colors_initial = 0x04070A00L;    /* default initial colors */
  1353. ***************
  1354. *** 154,159 ****
  1355. --- 170,176 ----
  1356. X  ulong colors_alert = 0x0E000E00L;    /* yellow */
  1357. X  ulong colors_error = 0x04000400L;    /* red */
  1358. X  ulong colors_notify = 0x08000800L;    /* gray */
  1359. + #endif
  1360. X  
  1361. X  int use_colors = 0;        /* set by ttyinit, but default no */
  1362. X  int tty_not_char_special;
  1363. ***************
  1364. *** 228,244 ****
  1365. X  _setcolor(clrs)
  1366. X  ulong clrs;
  1367. X  {
  1368. X      if(!use_colors || tty_not_char_special)
  1369. X          return;
  1370. X  
  1371. X      /* normal */
  1372. X      ff(se,"\033[=%ldF\033[=%ldG",(clrs >> 8) & 0xFF,clrs & 0xFF);
  1373. X  
  1374. X      /* reverse */
  1375. X      ff(se,"\033[=%ldH\033[=%ldI",(clrs >> 24) & 0xFF,(clrs >> 16) & 0xFF);
  1376. X      colors_current = clrs;
  1377. X  }    /* end of _setcolor */
  1378. X  
  1379. X  /*+-------------------------------------------------------------------------
  1380. --- 245,269 ----
  1381. X  _setcolor(clrs)
  1382. X  ulong clrs;
  1383. X  {
  1384. +     char fg[4], bg[4];
  1385. X      if(!use_colors || tty_not_char_special)
  1386. X          return;
  1387. X  
  1388. + #ifdef SVR4
  1389. X      /* normal */
  1390. +     sprintf(fg,"%s", (clrs >> 8) & 0xFF);
  1391. +     sprintf(bg,"%s", clrs & 0xFF);
  1392. +     ff(se,"\033[%sm", fg);
  1393. +     ff(se,"\033[%sm", bg);
  1394. + #else
  1395. +     /* normal */
  1396. X      ff(se,"\033[=%ldF\033[=%ldG",(clrs >> 8) & 0xFF,clrs & 0xFF);
  1397. X  
  1398. X      /* reverse */
  1399. X      ff(se,"\033[=%ldH\033[=%ldI",(clrs >> 24) & 0xFF,(clrs >> 16) & 0xFF);
  1400. ! #endif
  1401. X      colors_current = clrs;
  1402. X  }    /* end of _setcolor */
  1403. X  
  1404. X  /*+-------------------------------------------------------------------------
  1405. ***************
  1406. *** 266,272 ****
  1407. X      }
  1408. X      _setcolor(new_colors);
  1409. X      tcap_stand_end();
  1410. X  }    /* end of setcolor */
  1411. X  
  1412. X  /*+-------------------------------------------------------------------------
  1413. --- 291,296 ----
  1414. ***************
  1415. *** 549,554 ****
  1416. --- 573,579 ----
  1417. X       * (I ain't proud of this beyond being a valiant attempt)
  1418. X       */
  1419. X      use_colors = 0;
  1420. + #if defined(M_SYSV) || defined(ISC)
  1421. X      if( ((itmp = ioctl(TTYIN,CONS_GET,&monitor_type)) >= 0) &&
  1422. X          (use_colors = (monitor_type != MONO)))
  1423. X      {
  1424. ***************
  1425. *** 556,561 ****
  1426. --- 581,587 ----
  1427. X          setcolor(colors_normal);
  1428. X      }
  1429. X      tty_is_multiscreen = !(itmp < 0);
  1430. + #endif
  1431. X  
  1432. X      /*
  1433. X       * save initial tty state
  1434. ***************
  1435. *** 624,631 ****
  1436. X      0 restore attributes saved at start of execution
  1437. X      1 raw mode (send xon/xoff, but do not respond to it, no ISIG/SIGINT)
  1438. X      2 raw mode (same as 1 but allow keyboard interrupts)
  1439. !     3 attributes at start of execution, but with echo disabled and no parity
  1440. !     4 same as 2 but terminate program on SIGINT
  1441. X  
  1442. X  ------------------------------------------------------------------------*/
  1443. X  void
  1444. --- 650,656 ----
  1445. X      0 restore attributes saved at start of execution
  1446. X      1 raw mode (send xon/xoff, but do not respond to it, no ISIG/SIGINT)
  1447. X      2 raw mode (same as 1 but allow keyboard interrupts)
  1448. !     3 same as 2 but terminate program on SIGINT
  1449. X  
  1450. X  ------------------------------------------------------------------------*/
  1451. X  void
  1452. ***************
  1453. *** 648,654 ****
  1454. X  
  1455. X      case 1:
  1456. X      case 2:
  1457. !     case 4:
  1458. X          tty_termio_current = tty_termio_at_entry;
  1459. X  
  1460. X          tty_termio_current.c_cflag &= ~(PARENB | PARODD);
  1461. --- 673,679 ----
  1462. X  
  1463. X      case 1:
  1464. X      case 2:
  1465. !     case 3:
  1466. X          tty_termio_current = tty_termio_at_entry;
  1467. X  
  1468. X          tty_termio_current.c_cflag &= ~(PARENB | PARODD);
  1469. ***************
  1470. *** 673,688 ****
  1471. X          current_ttymode = arg;
  1472. X          break;
  1473. X  
  1474. -     case 3:
  1475. -         tty_termio_current = tty_termio_at_entry;
  1476. -         tty_termio_current.c_cflag &= ~(PARENB | PARODD);
  1477. -         tty_termio_current.c_cflag |= CS8;
  1478. -         tty_termio_current.c_iflag &= ~(ISTRIP);
  1479. -         tty_termio_current.c_lflag &= ~(ICANON | ISIG | ECHO);
  1480. -         ioctl(TTYIN,TCSETAW,(char *)&tty_termio_current);
  1481. -         current_ttymode = 3;
  1482. -         break;
  1483. X      default:
  1484. X          ff(se,"\r\nttymode: invalid argument %d\r\n",arg);
  1485. X          break;
  1486. --- 698,703 ----
  1487. ***************
  1488. *** 751,756 ****
  1489. --- 766,780 ----
  1490. X  }    /* end of ttyflush */
  1491. X  
  1492. X  /*+-------------------------------------------------------------------------
  1493. +     ttyrdchk() - see if key pressed and not read
  1494. + --------------------------------------------------------------------------*/
  1495. + int
  1496. + ttyrdchk()
  1497. + {
  1498. +     return(rdchk(TTYIN) || dole_out_tgc_accum_count);
  1499. + }    /* end of ttyrdchk */
  1500. + /*+-------------------------------------------------------------------------
  1501. X      ttygetc(xkey_ok) -- get a key from the keyboard
  1502. X  if UNIX or XENIX, map extended keys to sign-bit-set special value
  1503. X  if xkey_ok is 0, disallow extended keys
  1504. ***************
  1505. *** 777,782 ****
  1506. --- 801,808 ----
  1507. X      {
  1508. X          ctmp = *dole_out_tgc_accum++;
  1509. X          dole_out_tgc_accum_count--;
  1510. +         if(kbd_is_7bit)
  1511. +             ctmp &= 0x7F;
  1512. X          return((uint)ctmp);
  1513. X      }
  1514. X  
  1515. ***************
  1516. *** 790,799 ****
  1517. X          termecu(TERMECU_TTYIN_READ_ERROR);
  1518. X      }
  1519. X  
  1520. !     if(kbd_is_7bit)
  1521. !         ctmp &= 0x7F;
  1522. !     if(tty_is_ansi && (ctmp == ESC))    /* if escape from ansi terminal */
  1523. X      {
  1524. X          itmp = 0;
  1525. X          timeout_remaining = tty_escape_timeout;
  1526. --- 816,823 ----
  1527. X          termecu(TERMECU_TTYIN_READ_ERROR);
  1528. X      }
  1529. X  
  1530. !     /* if escape from SCO/"ansi" terminal */
  1531. !     if(tty_is_ansi && ((ctmp & 0x7F) == ESC))
  1532. X      {
  1533. X          itmp = 0;
  1534. X          timeout_remaining = tty_escape_timeout;
  1535. ***************
  1536. *** 811,825 ****
  1537. X              if(!rdchk(TTYIN))
  1538. X                  continue;
  1539. X              read(TTYIN,(char *)&ctmp,1);
  1540. -             if(kbd_is_7bit)
  1541. -                 ctmp &= 0x7F;
  1542. -             if(itmp == (sizeof(tgc_accum) - 1))    /* do not allow overflow */
  1543. -                 break;
  1544. X              tgc_accum[itmp++] = ctmp;
  1545. X              if(itmp == 2)
  1546. X                  break;
  1547. X          }
  1548. X          tgc_accum[itmp] = 0;
  1549. X          if(!itmp)                /* no subsequent chars, so ... */
  1550. X              return(ESC);        /* return the escape */
  1551. X          else if((itmp == 2) && (tgc_accum[0] == '['))
  1552. --- 835,852 ----
  1553. X              if(!rdchk(TTYIN))
  1554. X                  continue;
  1555. X              read(TTYIN,(char *)&ctmp,1);
  1556. X              tgc_accum[itmp++] = ctmp;
  1557. X              if(itmp == 2)
  1558. X                  break;
  1559. X          }
  1560. X          tgc_accum[itmp] = 0;
  1561. +         if(kbd_test_active)
  1562. +         {
  1563. +             char title[32];
  1564. +             sprintf(title,"--> func key '%s' (%d key codes received)",
  1565. +                 kde_text(ctmp),itmp);
  1566. +             hex_dump(tgc_accum,-itmp,title,1);
  1567. +         }
  1568. X          if(!itmp)                /* no subsequent chars, so ... */
  1569. X              return(ESC);        /* return the escape */
  1570. X          else if((itmp == 2) && (tgc_accum[0] == '['))
  1571. ***************
  1572. *** 835,841 ****
  1573. X                  case XF7: case XF8: case XF9: case XF10: case XF11: case XF12:
  1574. X                  case XFbktab:
  1575. X                      if(xkey_ok)
  1576. !                         return(tgc_accum[1] | 0x80);
  1577. X                      /* fall thru -- xkey not allowed */
  1578. X                  default:
  1579. X                      ring_bell();
  1580. --- 862,868 ----
  1581. X                  case XF7: case XF8: case XF9: case XF10: case XF11: case XF12:
  1582. X                  case XFbktab:
  1583. X                      if(xkey_ok)
  1584. !                         return((uint)tgc_accum[1] | 0x80);
  1585. X                      /* fall thru -- xkey not allowed */
  1586. X                  default:
  1587. X                      ring_bell();
  1588. ***************
  1589. *** 844,854 ****
  1590. X              /*NOTREACHED*/
  1591. X          }
  1592. X          /* not func key -- must be typamatic control key */
  1593. X          dole_out_tgc_accum_count = itmp - 1;
  1594. X          dole_out_tgc_accum = tgc_accum + 1;
  1595. X          return((uint)tgc_accum[0]);
  1596. X      }
  1597. !     else if(!tty_is_ansi && (ctmp >= 0x01) && (ctmp <= 0x1F) &&
  1598. X              (ctmp != kbderase) && (ctmp != kbdkill) &&
  1599. X              (ctmp != kbdeol) && (ctmp != kbdeol2) &&
  1600. X              (ctmp != kbdintr) && (ctmp != kbdeof) )
  1601. --- 871,895 ----
  1602. X              /*NOTREACHED*/
  1603. X          }
  1604. X          /* not func key -- must be typamatic control key */
  1605. +         if(kbd_test_active)
  1606. +         {
  1607. +             char title[32];
  1608. +             if(itmp > 1)
  1609. +             {
  1610. +                 sprintf(title,
  1611. +                     "--> no func key recognized (%d key codes received)",itmp);
  1612. +                 hex_dump(tgc_accum,-itmp,title,1);
  1613. +             }
  1614. +         }
  1615. X          dole_out_tgc_accum_count = itmp - 1;
  1616. X          dole_out_tgc_accum = tgc_accum + 1;
  1617. +         if(kbd_is_7bit)
  1618. +             tgc_accum[0] &= 0x7F;
  1619. X          return((uint)tgc_accum[0]);
  1620. X      }
  1621. !     else if(!tty_is_ansi &&            /* this is getting crazy */
  1622. !             ((ctmp >= 0x01) && (ctmp <= 0x1F) ||
  1623. !              (ctmp >= 0x81) && (ctmp <= 0x9F)) &&
  1624. X              (ctmp != kbderase) && (ctmp != kbdkill) &&
  1625. X              (ctmp != kbdeol) && (ctmp != kbdeol2) &&
  1626. X              (ctmp != kbdintr) && (ctmp != kbdeof) )
  1627. ***************
  1628. *** 870,887 ****
  1629. X              if(!rdchk(TTYIN))
  1630. X                  continue;
  1631. X              read(TTYIN,(char *)&ctmp,1);
  1632. -             timeout_remaining = tty_escape_timeout;
  1633. -             if(kbd_is_7bit)
  1634. -                 ctmp &= 0x7F;
  1635. X              if(itmp == (sizeof(tgc_accum) - 1))    /* do not allow overflow */
  1636. X                  break;
  1637. X              tgc_accum[itmp++] = ctmp;
  1638. X          }
  1639. X          tgc_accum[itmp] = 0;
  1640. X          if((ctmp == XF_not_yet) && (itmp == 1))
  1641. !             return(tgc_accum[0]);
  1642. X          else if(ctmp < XF_no_way)    /* if we got a map */
  1643. X          {
  1644. X              if(!xkey_ok)
  1645. X              {
  1646. X                  ring_bell();
  1647. --- 911,940 ----
  1648. X              if(!rdchk(TTYIN))
  1649. X                  continue;
  1650. X              read(TTYIN,(char *)&ctmp,1);
  1651. X              if(itmp == (sizeof(tgc_accum) - 1))    /* do not allow overflow */
  1652. +             {
  1653. +                 ctmp = XF_no_way;
  1654. X                  break;
  1655. +             }
  1656. +             timeout_remaining = tty_escape_timeout;
  1657. X              tgc_accum[itmp++] = ctmp;
  1658. X          }
  1659. X          tgc_accum[itmp] = 0;
  1660. X          if((ctmp == XF_not_yet) && (itmp == 1))
  1661. !         {
  1662. !             if(kbd_is_7bit)
  1663. !                 tgc_accum[0] &= 0x7F;
  1664. !             return((uint)tgc_accum[0]);
  1665. !         }
  1666. X          else if(ctmp < XF_no_way)    /* if we got a map */
  1667. X          {
  1668. +             if(kbd_test_active)
  1669. +             {
  1670. +                 char title[32];
  1671. +                 sprintf(title,"--> func key '%s' (%d key codes received)",
  1672. +                     kde_text(ctmp),itmp);
  1673. +                 hex_dump(tgc_accum,-itmp,title,1);
  1674. +             }
  1675. X              if(!xkey_ok)
  1676. X              {
  1677. X                  ring_bell();
  1678. ***************
  1679. *** 893,908 ****
  1680. X                      screen_dump(screen_dump_file_name);
  1681. X                      goto GET_KEY;
  1682. X                  default:
  1683. !                     return(KDEk_to_XF[ctmp]);
  1684. X              }
  1685. X              /*NOTREACHED*/
  1686. X          }
  1687. X          /* not func key -- must be typamatic control key */
  1688. X          dole_out_tgc_accum_count = itmp - 1;
  1689. X          dole_out_tgc_accum = tgc_accum + 1;
  1690. X          return((uint)tgc_accum[0]);
  1691. X      }
  1692. !     return(ctmp);
  1693. X  }    /* end if ttygetc */
  1694. X  
  1695. X  /*+-----------------------------------------------------------------------
  1696. --- 946,979 ----
  1697. X                      screen_dump(screen_dump_file_name);
  1698. X                      goto GET_KEY;
  1699. X                  default:
  1700. !                     return((uint)KDEk_to_XF[ctmp]);
  1701. X              }
  1702. X              /*NOTREACHED*/
  1703. X          }
  1704. X          /* not func key -- must be typamatic control key */
  1705. +         if(kbd_test_active)
  1706. +         {
  1707. +             char title[32];
  1708. +             if(itmp > 1)
  1709. +             {
  1710. +                 sprintf(title,
  1711. +                     "--> no func key recognized (%d key codes received)",itmp);
  1712. +                 hex_dump(tgc_accum,-itmp,title,1);
  1713. +             }
  1714. +         }
  1715. X          dole_out_tgc_accum_count = itmp - 1;
  1716. X          dole_out_tgc_accum = tgc_accum + 1;
  1717. +         if(kbd_is_7bit)
  1718. +             tgc_accum[0] &= 0x7F;
  1719. X          return((uint)tgc_accum[0]);
  1720. X      }
  1721. !     /*
  1722. !      * simple key, not special
  1723. !      */
  1724. !     if(kbd_is_7bit)
  1725. !         ctmp &= 0x7F;
  1726. !     return((uint)ctmp);
  1727. X  }    /* end if ttygetc */
  1728. X  
  1729. X  /*+-----------------------------------------------------------------------
  1730. ***************
  1731. *** 1080,1086 ****
  1732. X                          ring_bell();
  1733. X                          continue;
  1734. X                      }
  1735. !                     str[strcount++] = inch & 0x7F;
  1736. X                      strpos++;
  1737. X                      fputc(inch,se);
  1738. X                  }
  1739. --- 1151,1157 ----
  1740. X                          ring_bell();
  1741. X                          continue;
  1742. X                      }
  1743. !                     str[strcount++] = inch;
  1744. X                      strpos++;
  1745. X                      fputc(inch,se);
  1746. X                  }
  1747. ***************
  1748. *** 1172,1177 ****
  1749. --- 1243,1286 ----
  1750. X      return(0);
  1751. X  
  1752. X  }    /* end of ttygets_esd */
  1753. + /*+-------------------------------------------------------------------------
  1754. +     kbd_test() - test keyboard handler
  1755. + --------------------------------------------------------------------------*/
  1756. + void
  1757. + kbd_test()
  1758. + {
  1759. + uint ctmp = 0;
  1760. +     pputs("Press keys to test (ESCape to exit)\n");
  1761. +     kbd_test_active = 1;
  1762. +     while(ctmp != ESC)
  1763. +     {
  1764. +         ctmp = ttygetc(1);
  1765. +         
  1766. +         if((ctmp < 0x80) && dole_out_tgc_accum_count)
  1767. +         {
  1768. +             pprintf("    got %d key sequence %s ",
  1769. +                 dole_out_tgc_accum_count,hex_to_ascii_name(ctmp));
  1770. +             while(dole_out_tgc_accum_count)
  1771. +             {
  1772. +                 pprintf("%s ",hex_to_ascii_name(*dole_out_tgc_accum++));
  1773. +                 dole_out_tgc_accum_count--;
  1774. +             }
  1775. +             pputs("\n");
  1776. +             ctmp = 0;
  1777. +             continue;
  1778. +         }
  1779. +         pputs("    got ");
  1780. +         if(ctmp >= 0x80)
  1781. +             pprintf("fkey '%s'\n",xf_text(ctmp));
  1782. +         else
  1783. +             pprintf("key  '%s'\n",hex_to_ascii_name(ctmp));
  1784. +     }
  1785. +     kbd_test_active = 0;
  1786. +     pputs("keyboard test complete\n\n");
  1787. +     
  1788. + }    /* end of kbd_test */
  1789. X  
  1790. X  /*+-------------------------------------------------------------------------
  1791. X      char *get_ttyname() - return pointer to static string
  1792. Common subdirectories: /export/home/wht/src/ecu312/ecuungetty and ./ecuungetty
  1793. diff -c /export/home/wht/src/ecu312/ecuutil.c ./ecuutil.c
  1794. *** /export/home/wht/src/ecu312/ecuutil.c    Sun Aug 25 17:29:22 1991
  1795. --- ./ecuutil.c    Sun Aug 25 16:05:22 1991
  1796. ***************
  1797. *** 33,38 ****
  1798. --- 33,40 ----
  1799. X  
  1800. X  ------------------------------------------------------------------------*/
  1801. X  /*+:EDITS:*/
  1802. + /*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  1803. + /*:08-17-1991-14:11-root@n4hgf-ascii_to_hex supports "csi" */
  1804. X  /*:08-13-1991-13:53-wht@n4hgf-UNIX and ISC nap() broken; XENIX still wins */
  1805. X  /*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
  1806. X  /*:04-16-1991-15:45-wht@n4hgf-gcc cannot use memmove */
  1807. ***************
  1808. *** 49,54 ****
  1809. --- 51,84 ----
  1810. X  #include "ecukey.h"
  1811. X  #include <pwd.h>
  1812. X  
  1813. + #if defined(sun)
  1814. + #undef ECHO
  1815. + #undef NL0
  1816. + #undef NL1
  1817. + #undef TAB0
  1818. + #undef TAB1
  1819. + #undef TAB2
  1820. + #undef XTABS
  1821. + #undef CR0
  1822. + #undef CR1
  1823. + #undef CR2
  1824. + #undef CR3
  1825. + #undef FF0
  1826. + #undef FF1
  1827. + #undef BS0
  1828. + #undef BS1
  1829. + #undef TOSTOP
  1830. + #undef FLUSHO
  1831. + #undef PENDIN
  1832. + #undef NOFLSH
  1833. + #include <sys/ioctl.h>
  1834. + #endif
  1835. + #ifdef SVR4
  1836. + # include <sys/termiox.h>
  1837. + extern int hx_flag;
  1838. + #endif
  1839. X  char *getenv();
  1840. X  
  1841. X  extern int errno;
  1842. ***************
  1843. *** 627,637 ****
  1844. X                  (flag & CREAD ) ? 1 : 0,
  1845. X                  (flag & HUPCL ) ? 1 : 0,
  1846. X                  (flag & CLOCAL) ? 1 : 0);
  1847. ! #if defined(RTSFLOW)    /* only SCO */
  1848. X      pprintf(" RTSFLOW:%d  CTSFLOW:%d",
  1849. X                  (flag & RTSFLOW ) ? 1 : 0,
  1850. X                  (flag & CTSFLOW ) ? 1 : 0);
  1851. X  #endif
  1852. X      pprintf("\n");
  1853. X  
  1854. X      flag = ttt->c_lflag;
  1855. --- 657,672 ----
  1856. X                  (flag & CREAD ) ? 1 : 0,
  1857. X                  (flag & HUPCL ) ? 1 : 0,
  1858. X                  (flag & CLOCAL) ? 1 : 0);
  1859. ! #if defined(RTSFLOW) || defined(SVR4)    /* only SCO and SVR4 */
  1860. X      pprintf(" RTSFLOW:%d  CTSFLOW:%d",
  1861. + #ifdef SVR4
  1862. +                 (hx_flag & RTSXOFF ) ? 1 : 0,
  1863. +                 (hx_flag & CTSXON ) ? 1 : 0);
  1864. + #else
  1865. X                  (flag & RTSFLOW ) ? 1 : 0,
  1866. X                  (flag & CTSFLOW ) ? 1 : 0);
  1867. X  #endif
  1868. + #endif
  1869. X      pprintf("\n");
  1870. X  
  1871. X      flag = ttt->c_lflag;
  1872. ***************
  1873. *** 720,725 ****
  1874. --- 755,761 ----
  1875. X      ascii_name_to_hex(str3char)
  1876. X  
  1877. X    return value of ascii ctl char name (e.g., "NUL") 0 - 0x1F
  1878. +   support CSI "ascii" 0x9B (for ESC + '[' ANSI)
  1879. X    returns -1 if input not valid
  1880. X  ------------------------------------------------------------------------*/
  1881. X  ascii_name_to_hex(str3char)
  1882. ***************
  1883. *** 728,735 ****
  1884. X  register char *cptr = ascii_ctlstr;
  1885. X  register intval;
  1886. X  
  1887. !     if(ulcmpb(str3char,"del") < 0)
  1888. !         return(127);
  1889. X  
  1890. X      for(intval = 0; intval <= SPACE; intval++)
  1891. X      {
  1892. --- 764,773 ----
  1893. X  register char *cptr = ascii_ctlstr;
  1894. X  register intval;
  1895. X  
  1896. !     if((strlen(str3char) == 3) && (ulcmpb(str3char,"del") < 0))
  1897. !         return(0x7F);
  1898. !     if((strlen(str3char) == 3) && (ulcmpb(str3char,"csi") < 0))
  1899. !         return(0x9B);
  1900. X  
  1901. X      for(intval = 0; intval <= SPACE; intval++)
  1902. X      {
  1903. ***************
  1904. *** 1041,1046 ****
  1905. --- 1079,1090 ----
  1906. X  Nap(msec)
  1907. X  long msec;
  1908. X  {
  1909. + #if defined(sun)
  1910. + struct timeval timer;
  1911. +     timer.tv_sec = 0;
  1912. +     timer.tv_usec = 1000L * msec;
  1913. +     select(0,0,0,0,&timer);
  1914. + #else
  1915. X  #if defined(M_XENIX) || defined(WORKING_UNIX_NAP)
  1916. X      return(nap(msec));
  1917. X  #else
  1918. ***************
  1919. *** 1049,1056 ****
  1920. X      if(nap(msec) < 0)
  1921. X          return(-1);
  1922. X      return(msec);
  1923. ! #endif
  1924. X  }    /* end of Nap */
  1925. X  
  1926. X  /* end of ecuutil.c */
  1927. X  /* vi: set tabstop=4 shiftwidth=4: */
  1928. --- 1093,1118 ----
  1929. X      if(nap(msec) < 0)
  1930. X          return(-1);
  1931. X      return(msec);
  1932. ! #endif /* defined(M_XENIX) || defined(WORKING_UNIX_NAP) */
  1933. ! #endif /* sun */
  1934. X  }    /* end of Nap */
  1935. + /*+-------------------------------------------------------------------------
  1936. +     rdchk(fd) - for systems without it but with FIONREAD
  1937. + --------------------------------------------------------------------------*/
  1938. + #if defined(sun)
  1939. + int
  1940. + rdchk(fd)
  1941. + {
  1942. + int chars_waiting;
  1943. +     if(ioctl(fd,FIONREAD,&chars_waiting))
  1944. +         return(0);
  1945. +     else
  1946. +         return(!!chars_waiting);
  1947. + }    /* end of rdchk */
  1948. + #endif
  1949. X  
  1950. X  /* end of ecuutil.c */
  1951. X  /* vi: set tabstop=4 shiftwidth=4: */
  1952. SHAR_EOF
  1953. true || echo 'restore of PATCH3.01 failed'
  1954. fi
  1955. echo 'End of ecu/patch part 2'
  1956. echo 'File PATCH3.01 is continued in part 3'
  1957. echo 3 > _shar_seq_.tmp
  1958. exit 0
  1959.  
  1960. exit 0 # Just in case...
  1961.