home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume16 / ecu3 / patch05a < prev    next >
Encoding:
Internet Message Format  |  1991-02-10  |  45.6 KB

  1. From: wht@n4hgf (Warren Tucker)
  2. Newsgroups: comp.sources.misc
  3. Subject: v16i097:  ECU 3 Patch 5, Part 1 of 2
  4. Message-ID: <1991Feb11.004440.2689@sparky.IMD.Sterling.COM>
  5. Date: 11 Feb 91 00:44:40 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Checksum-Snefru: 40a64d0d 6618a44f 12036ab4 3d58f753
  8.  
  9. Submitted-by: wht@n4hgf.Mt-Park.GA.US (Warren Tucker)
  10. Posting-number: Volume 16, Issue 97
  11. Archive-name: ecu3/patch05a
  12. Patch-To: ecu3: Volume 16, Issue 25-59
  13.  
  14. .---------------.
  15. | ECU 3 PATCH 5 | -----> to apply see "TO USE" below
  16. `---------------'
  17.  
  18. 1. Fixed memory leak + bad free in feval_str().
  19.  
  20. 2. Some common types of procedure string operations have been made faster
  21. by redesign of the realloc_esd() function.
  22.  
  23. 3. Octal integer constants were implemented; they may be denoted by
  24. prefixing them with "0o".  Leading zero octal constants are not supported
  25. due to ECUs mutiple use of the same integer constant parser.  I thought 
  26. most people would rather %itos("0200") return 200(10) than 128(10).
  27.  
  28. 4. Many line drivers, particularly FAS, will wait a process closing
  29. a tty line until all characters queued for output have been sent.
  30. When closing a tty line that has been permanently XOFF'ed by a 
  31. dead remote system or a noisy XOFF, this can result in a hang.
  32. Now, a SIGALRM/setjmp scheme is used to recover from this condition
  33. and flush line output before reattempting the close.  Five
  34. seconds are allowed for the draining to occur.
  35.  
  36. 5. Multiscreen normal and reverse foreground and background colors
  37. in effect at the beginning of ecu execution are restored when the
  38. program terminates (thanks to staceyc@sco for illuminating the
  39. undocumented GIO_IOCTL ioctl; I've wanted to be able to do this for
  40. a long time).
  41.  
  42. 6. lamy@glsys.in-berlin.de reported a core dump immediately after
  43. the one-line startup message under XENIX 286.  Others have had the
  44. problem too.  I am puzzled -- it is happening in get_home_dir(),
  45. which seems rather straightforward.  A patch to avoid the problem
  46. is included: get the home directory from the environment variable
  47. HOME if possible rather than invoke libpwent.a.
  48.  
  49. 7. An embarassing nroff problem was reported by slerner@eingedi.
  50. Patches are included for the nroff source.  Mr. Lerner also pointed
  51. out an obsolete reference to samplproc.man.  The models subdirectory
  52. contain many sample, even useful, procedures and samplproc.man
  53. was discarded a long time ago.
  54.  
  55. If you do not have nroff or the spare CPU cycles to make the
  56. manual from nroff source, I'll email you one. Just mail me
  57. at wht@n4hgf.Mt-Park.GA.US or emory!n4hgf!wht and put
  58. "send ecu305 manual" in the subject line.  If I get enough
  59. requests, I'll repost it to c.s.m as ecuman305.
  60.  
  61. 8. A make bug in the trial ISC port was fixed in Make.ecu (thanks to
  62. jmd@p1so).
  63.  
  64. 9. During non-curses file transfer, the cumulative elapsed time
  65. is reported once per complete line of 'RRRTRR..' status.
  66.  
  67. 10. ache@hq.demos.su reported a bug in XENIX utmp handler
  68. code.  This is a fix for most XENIX systems, but define OLD_WAY
  69. in utmpstat.c if you have problems.
  70.  
  71. 11. Sometimes upon adding a new phone entry, it would be marked
  72. for redial upon creation.  This has been fixed by using calloc()
  73. instead malloc().
  74.  
  75. 12. We seem to be bumping some limits on 286 systems.  I added
  76. more code to handle more core dumps reported by lamy@glsys.in-berlin.de:
  77. somehow newwin() managed to return zero (probably memory alloc fail).
  78. The patch to ecuwinutil.c won't fix the problem, but will at least
  79. report it and die gracefully, rather than splatter on the pavement
  80. with a core dump.  Please write me with bug reports and crash info:
  81. see below.
  82.  
  83. .--------------------.
  84. | NOTES and REQUESTS |
  85. `--------------------'
  86.  
  87. 1. I do not have any XENIX system to test with.  It is a tribute
  88. to SCO orthogonality that 35,000+ line program works so well
  89. across 2 CPUs and two operating systems of many minor releases
  90. and many versions of development systems.  I continue to point
  91. this out when I hear SCO-bashers do their thing.  However, since
  92. s**t does happen, if you are reporting a problem that results in
  93. a core dump, please run the following for me (I would APPRECIATE it):
  94.  
  95.   % cd where ecu is
  96.   % ./ecu
  97.   ----- kaboom -----
  98.   % ^Jstty sane^J if needed (probably)
  99.   % adb ./ecu |& tee to.wht
  100.   * $x
  101.   * $c
  102.   * $r
  103.   * $q
  104. If you are a really industrious one and have sdb and compiled with -g,
  105.   % sdb ./ecu |& tee -a to.wht
  106.   % t
  107.   % q
  108. Then  
  109.   % mail -s 'ecu 3.xx core dump' wht@n4hgf.mt-park.ga.us < to.wht
  110.  
  111. 2. ache@hq.demos.su has made some excellent suggestions which
  112. would enhance the line handling/choosing algorithms.  They will
  113. require a change in the phone directory.  He suggests I interpret
  114. old directory formats, while writing only new ones.  The changes
  115. are far reaching and I haven't the time now to plug them in,
  116. but kudos to him and I'll try to find A Round Tuit.
  117.  
  118. .--------.
  119. | TO USE |
  120. `--------'
  121.  
  122. To apply this patch,
  123.  
  124. 1. unshar both parts (patch05a and patch05b); the order is unimportant
  125.    a. overlays these files:
  126.       doc/_proc.txt
  127.       ecunumrev.c
  128.       patchlevel.h
  129.       utmpstat.c
  130.    b. produces new files:
  131.       PATCH5.01
  132.       PATCH5.02
  133. 2. patch -p < PATCH5.01
  134. 3. patch -p < PATCH5.02
  135. 4. make
  136. 5. su root
  137. 6. make install
  138. 7. "un-su"
  139. 8. cd doc;mm ecu.txt > ecu.man (or write e-mail to me for an update)
  140.  
  141. #!/bin/sh
  142. # This is ecu3/patch05a, a shell archive (shar 3.46)
  143. # made 02/08/1991 08:39 UTC by wht@n4hgf
  144. # Source directory /u1/src/ecu
  145. #
  146. # existing files WILL be overwritten
  147. #
  148. # This shar contains:
  149. # length  mode       name
  150. # ------ ---------- ------------------------------------------
  151. #    170 -rw-r--r-- doc/_proc.txt
  152. #   1000 -rw-r--r-- ecunumrev.c
  153. #     21 -rw-r--r-- patchlevel.h
  154. #   3791 -rw-r--r-- utmpstat.c
  155. #  32621 -rw-r--r-- PATCH5.01
  156. #
  157. # ============= doc/_proc.txt ==============
  158. if test ! -d 'doc'; then
  159.     echo 'x - creating directory doc'
  160.     mkdir 'doc'
  161. fi
  162. echo 'x - extracting doc/_proc.txt (Text)'
  163. sed 's/^X//' << 'SHAR_EOF' > 'doc/_proc.txt' &&
  164. X.*s 1 "Procedure Language"
  165. X
  166. XSample procedures are found in the models subdirectory of the release.
  167. X
  168. X.so _p_param.txt
  169. X
  170. X.so _p_cmd.txt
  171. X
  172. X.so _p_ifunc.txt
  173. X
  174. X.so _p_sfunc.txt
  175. X
  176. SHAR_EOF
  177. chmod 0644 doc/_proc.txt ||
  178. echo 'restore of doc/_proc.txt failed'
  179. Wc_c="`wc -c < 'doc/_proc.txt'`"
  180. test 170 -eq "$Wc_c" ||
  181.     echo 'doc/_proc.txt: original size 170, current size' "$Wc_c"
  182. # ============= ecunumrev.c ==============
  183. echo 'x - extracting ecunumrev.c (Text)'
  184. sed 's/^X//' << 'SHAR_EOF' > 'ecunumrev.c' &&
  185. X/*+-----------------------------------------------------------------------
  186. X    ecunumrev.c - revision numbers
  187. X    wht@n4hgf.Mt-Park.GA.US
  188. X------------------------------------------------------------------------*/
  189. X/*+:EDITS:*/
  190. X/*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  191. X
  192. X#if defined(M_I286) && !defined(NO_SELECT)
  193. X#define NO_SELECT
  194. X#endif
  195. X
  196. X#ifdef WHT
  197. Xchar *numeric_revision = "wht3.06";
  198. X#else
  199. X#ifdef SCO
  200. Xchar *numeric_revision = "sco3";
  201. X#else
  202. X#ifdef __GNUC__
  203. Xchar *numeric_revision = "gcc3";
  204. X#else
  205. Xchar *numeric_revision = "unet3";
  206. X#endif
  207. X#endif
  208. X#endif
  209. X
  210. X#if defined(ISC)
  211. Xchar *revision_modifier = "-386i wht@n4hgf";
  212. X#else
  213. X#if defined(M_UNIX)
  214. Xchar *revision_modifier = "-386u wht@n4hgf";
  215. X#else
  216. X#if defined(M_I386)
  217. X#if defined(NO_SELECT)
  218. Xchar *revision_modifier = "-386n wht@n4hgf";
  219. X#else
  220. Xchar *revision_modifier = "-386s wht@n4hgf";
  221. X#endif
  222. X#else
  223. Xchar *revision_modifier = "-286n wht@n4hgf";
  224. X#endif /* M_I386 */
  225. X#endif /* M_UNIX */
  226. X#endif /* ISC */
  227. X
  228. X/* vi: set tabstop=4 shiftwidth=4: */
  229. SHAR_EOF
  230. chmod 0644 ecunumrev.c ||
  231. echo 'restore of ecunumrev.c failed'
  232. Wc_c="`wc -c < 'ecunumrev.c'`"
  233. test 1000 -eq "$Wc_c" ||
  234.     echo 'ecunumrev.c: original size 1000, current size' "$Wc_c"
  235. # ============= patchlevel.h ==============
  236. echo 'x - extracting patchlevel.h (Text)'
  237. sed 's/^X//' << 'SHAR_EOF' > 'patchlevel.h' &&
  238. X#define PATCHLEVEL 5
  239. SHAR_EOF
  240. chmod 0644 patchlevel.h ||
  241. echo 'restore of patchlevel.h failed'
  242. Wc_c="`wc -c < 'patchlevel.h'`"
  243. test 21 -eq "$Wc_c" ||
  244.     echo 'patchlevel.h: original size 21, current size' "$Wc_c"
  245. # ============= utmpstat.c ==============
  246. echo 'x - extracting utmpstat.c (Text)'
  247. sed 's/^X//' << 'SHAR_EOF' > 'utmpstat.c' &&
  248. X#if defined(SHARE_DEBUG)
  249. X#define LOG_UTMP
  250. X#endif
  251. X/*+-------------------------------------------------------------------------
  252. X    utmpstat.c - utmp status for XENIX/UNIX line
  253. X    wht@n4hgf.Mt-Park.GA.US
  254. X
  255. X  Defined functions:
  256. X    strcmpi(s1,s2)
  257. X    utmp_status(line)
  258. X
  259. X--------------------------------------------------------------------------*/
  260. X/*+:EDITS:*/
  261. X/*:02-07-1991-00:28-wht@n4hgf-utmp_status() was really messed up */
  262. X/*:02-03-1991-17:52-ache@hq.demos.su-fix for XENIX utmp handling bug */
  263. X/*:10-16-1990-20:43-wht@n4hgf-add SHARE_DEBUG */
  264. X/*:09-19-1990-19:36-wht@n4hgf-ecu_log_event now gets pid for log from caller */
  265. X/*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  266. X
  267. X#include "ecu.h"
  268. X#include "ecuhangup.h"
  269. X#include "utmpstatus.h"
  270. X#include "ecuungetty.h"
  271. X#include "dialprog.h"
  272. X#include <errno.h>
  273. X#include <utmp.h>
  274. X
  275. X#if !defined(ut_name)        /* nobody can keep their mind made up; ... */
  276. X#define ut_name ut_user        /* ... this is getting verry difficult, very old */
  277. X#endif
  278. X
  279. Xextern int errno;
  280. X
  281. Xchar *utmp_file = "/etc/utmp";
  282. Xstruct utmp last_utmp;
  283. X
  284. X/*+-------------------------------------------------------------------------
  285. X    strcmpi(s1,s2) - case-insensitive strcmp
  286. XIn here rather than ecuutil.c since other executables besides ecu
  287. Xuses this module and strcmpi needed there too 
  288. X--------------------------------------------------------------------------*/
  289. Xint
  290. Xstrcmpi(s1,s2)
  291. Xregister char *s1;
  292. Xregister char *s2;
  293. X{
  294. Xregister char c1,c2;
  295. X
  296. X    for ( ; *s1 ; s1++, s2++)
  297. X    {
  298. X        if(isupper(*s1))
  299. X            c1 = tolower(*s1);
  300. X        else
  301. X            c1 = *s1;
  302. X        if(isupper(*s2))
  303. X            c2 = tolower(*s2);
  304. X        else
  305. X            c2 = *s2;
  306. X        if(c1 != c2)
  307. X            break;
  308. X    }
  309. X    return (*s1 - *s2);
  310. X}    /* end of strcmpi */
  311. X
  312. X/*+-------------------------------------------------------------------------
  313. X    utmp_status(line) - check line status in utmp
  314. X'line' is "/dev/ttyxx"-style
  315. Xreturns US_ value and global utmp struct last_utmp;
  316. X--------------------------------------------------------------------------*/
  317. Xint
  318. Xutmp_status(line)
  319. Xchar *line;
  320. X{
  321. Xregister ufd;
  322. Xregister itmp;
  323. Xregister status = US_NOTFOUND;
  324. X#if defined(LOG_UTMP)
  325. Xchar logstr[128];
  326. X#endif
  327. X
  328. X/*
  329. X * crock/bozo alert: 
  330. X * ut_name ain't but EIGHT characters long, but
  331. X * EIGHT characters are often stored, so ya don't get no null
  332. X * ut_id ain't but FOUR characters long, but
  333. X * FOUR characters are routinely stored, so ya don't get no null
  334. X */
  335. Xchar namecopy[sizeof(last_utmp.ut_name) + 1];
  336. Xchar idcopy[sizeof(last_utmp.ut_id) + 1];
  337. X
  338. X    if((ufd = open(utmp_file,O_RDONLY,755)) < 0)
  339. X    {
  340. X        perror(utmp_file);
  341. X        hangup(HANGUP_LINE_OPEN_ERROR);
  342. X    }
  343. X
  344. X    while((status == US_NOTFOUND) &&
  345. X        (read(ufd,(char *)&last_utmp,sizeof(last_utmp)) > 0))
  346. X    {
  347. X        if(strcmpi(last_utmp.ut_line,line + 5))
  348. X            continue;
  349. X
  350. X        strncpy(namecopy,last_utmp.ut_name,sizeof(last_utmp.ut_name));
  351. X        namecopy[sizeof(namecopy) - 1] = 0;
  352. X
  353. X        strncpy(idcopy,last_utmp.ut_id,sizeof(last_utmp.ut_id));
  354. X        idcopy[sizeof(idcopy) - 1] = 0;
  355. X
  356. X        if(!strcmp(namecopy,"LOGIN"))
  357. X            status = US_DIALOUT;
  358. X        else if(!strcmp(namecopy,"DIALOUT"))
  359. X            status = US_LOGIN;
  360. X        else if((!strcmp(namecopy,"uugetty") || !strcmp(namecopy,"getty")))
  361. X        {
  362. X            if(itmp = line_locked(line))
  363. X                status = US_DIALOUT;
  364. X            else
  365. X                status = US_LOGIN;
  366. X        }
  367. X        else if(!kill(last_utmp.ut_pid,0) || (errno != ESRCH))
  368. X            status = US_LOGGEDIN;
  369. X    }
  370. X
  371. X#if defined(LOG_UTMP)
  372. X    if(status == US_NOTFOUND)
  373. X        sprintf(logstr,"UTMP %s: no entry in utmp, status=%d",line,status);
  374. X    else
  375. X    {
  376. X    char *ctime();
  377. X        sprintf(logstr,"UTMP %s:%s:%s:%d:status=%d:%s", 
  378. X            namecopy,idcopy,last_utmp.ut_line,
  379. X            last_utmp.ut_pid,status, ctime(&last_utmp.ut_time));
  380. X        logstr[strlen(logstr) - 1] = 0;    /* kill NL from ctime() */
  381. X    }
  382. X    ecu_log_event(getpid(),logstr);
  383. X#endif
  384. X
  385. X    close(ufd);
  386. X    return(status);
  387. X
  388. X}    /* end of utmp_status */
  389. X
  390. X/* vi: set tabstop=4 shiftwidth=4: */
  391. X/* end of utmpstat.c */
  392. SHAR_EOF
  393. chmod 0644 utmpstat.c ||
  394. echo 'restore of utmpstat.c failed'
  395. Wc_c="`wc -c < 'utmpstat.c'`"
  396. test 3791 -eq "$Wc_c" ||
  397.     echo 'utmpstat.c: original size 3791, current size' "$Wc_c"
  398. # ============= PATCH5.01 ==============
  399. echo 'x - extracting PATCH5.01 (Text)'
  400. sed 's/^X//' << 'SHAR_EOF' > 'PATCH5.01' &&
  401. X:
  402. X#-------------------------------------------------------
  403. X# PATCH5.01
  404. X# created by gendiff x1.03 on 08 Feb 1991 08:23 UTC
  405. X#-------------------------------------------------------
  406. X*** /u4/src/ecu3.04/Make.ecu    Fri Feb  8 03:22:07 1991
  407. X--- Make.ecu    Thu Feb  7 18:09:26 1991
  408. X***************
  409. X*** 45,50
  410. X  # lint_args.h, please do squirrel away the release copy first
  411. X  #--------------------------------------------------------------------
  412. X  #+:EDITS:
  413. X  #:01-22-1991-14:33-wht@n4hgf-XENIX calloc/memmove fix
  414. X  #:01-08-1991-03:26-wht@n4hgf-add ISC support
  415. X  #:11-28-1990-19:45-wht@n4hgf-improve M_ dependency description
  416. X
  417. X--- 45,51 -----
  418. X  # lint_args.h, please do squirrel away the release copy first
  419. X  #--------------------------------------------------------------------
  420. X  #+:EDITS:
  421. X+ #:02-03-1991-15:05-wht@n4hgf-fix error in passing -DISC around
  422. X  #:01-22-1991-14:33-wht@n4hgf-XENIX calloc/memmove fix
  423. X  #:01-08-1991-03:26-wht@n4hgf-add ISC support
  424. X  #:11-28-1990-19:45-wht@n4hgf-improve M_ dependency description
  425. X***************
  426. X*** 62,68
  427. X  ECULIBDIR = /usr/local/lib/ecu
  428. X  
  429. X  #--> leave commented unless you are making for ISC 2.2
  430. X! #ISC = -DISC -DISC22 -O
  431. X  
  432. X  #--> leave commented unless you have my morse speaker driver
  433. X  #MORSE=-DMORSE
  434. X
  435. X--- 63,69 -----
  436. X  ECULIBDIR = /usr/local/lib/ecu
  437. X  
  438. X  #--> leave commented unless you are making for ISC 2.2
  439. X! #NONSCO = -DISC -DISC22 -O
  440. X  
  441. X  #--> leave commented unless you have my morse speaker driver
  442. X  #MORSE=-DMORSE
  443. X***************
  444. X*** 92,100
  445. X  
  446. X  #make some composites based on above
  447. X  SYSTEM = `sysdep =M_UNIX UNIX/386 =M_I386 Xenix/386 =M_I286 Xenix/286 =ISC ISC`
  448. X! U3C = $(ZI) -Octl -CSON
  449. X! X3C = -DDUFF $(ZI) -Ot -CSON -i
  450. X! X2C = -DDUFF -M2let32 -LARGE -F 8000 -Ot -i
  451. X  CURSES = -DM_TERMCAP
  452. X  CURSES_LIB = -ltcap -ltermlib
  453. X  COMFLAGS = `sysdep =M_UNIX $(U3C) =M_I386 $(X3C) =M_I286 $(X2C) =ISC $(NONSCO)`
  454. X
  455. X--- 93,101 -----
  456. X  
  457. X  #make some composites based on above
  458. X  SYSTEM = `sysdep =M_UNIX UNIX/386 =M_I386 Xenix/386 =M_I286 Xenix/286 =ISC ISC`
  459. X! U3C = $(ZI) -Octl -CSON -DLINT_ARGS
  460. X! X3C = -DDUFF $(ZI) -Ot -CSON -i -DLINT_ARGS
  461. X! X2C = -DDUFF -M2let32 -LARGE -F 8000 -Ot -i -DLINT_ARGS
  462. X  CURSES = -DM_TERMCAP
  463. X  CURSES_LIB = -ltcap -ltermlib
  464. X  COMFLAGS = `sysdep =M_UNIX $(U3C) =M_I386 $(X3C) =M_I286 $(X2C) =ISC $(NONSCO)`
  465. X***************
  466. X*** 98,104
  467. X  CURSES = -DM_TERMCAP
  468. X  CURSES_LIB = -ltcap -ltermlib
  469. X  COMFLAGS = `sysdep =M_UNIX $(U3C) =M_I386 $(X3C) =M_I286 $(X2C) =ISC $(NONSCO)`
  470. X! CFLAGS = -DLINT_ARGS $(CURSES) $(CRYPT) $(MORSE) $(NOSEL) $(ADPROC) $(COMFLAGS)
  471. X  LDSYS = `sysdep =M_UNIX -lmalloc =ISC -lmalloc =M_I386 =M_I286 -SEG 256` 
  472. X  LDFLAGS = $(LDSYS) -lx $(LCRYPT) $(CURSES_LIB)
  473. X  
  474. X
  475. X--- 99,105 -----
  476. X  CURSES = -DM_TERMCAP
  477. X  CURSES_LIB = -ltcap -ltermlib
  478. X  COMFLAGS = `sysdep =M_UNIX $(U3C) =M_I386 $(X3C) =M_I286 $(X2C) =ISC $(NONSCO)`
  479. X! CFLAGS = -DECULIBDIR='"$(ECULIBDIR)"' $(CURSES) $(CRYPT) $(MORSE) $(NOSEL) $(ADPROC) $(COMFLAGS)
  480. X  LDSYS = `sysdep =M_UNIX -lmalloc =ISC -lmalloc =M_I386 =M_I286 -SEG 256` 
  481. X  LDFLAGS = $(LDSYS) -lx $(LCRYPT) $(CURSES_LIB)
  482. X  
  483. X***************
  484. X*** 293,299
  485. X      chmod 755 $(LBIN)/ecu $(LBIN)/ecusz $(LBIN)/ecurz $(LBIN)/ecusea
  486. X      -mkdir $(ECULIBDIR)
  487. X      -chmod 755 $(ECULIBDIR)
  488. X!     cd ecuungetty;make CRYPT=$(CRYPT) LCRYPT=$(LCRYPT) ECULIBDIR=$(ECULIBDIR)\
  489. X          install
  490. X      cp help/ecuhelp.data $(ECULIBDIR)
  491. X      @echo "--------------------------------------------------------------------"
  492. X
  493. X--- 294,300 -----
  494. X      chmod 755 $(LBIN)/ecu $(LBIN)/ecusz $(LBIN)/ecurz $(LBIN)/ecusea
  495. X      -mkdir $(ECULIBDIR)
  496. X      -chmod 755 $(ECULIBDIR)
  497. X!     cd ecuungetty;make CRYPT=$(CRYPT) LCRYPT=$(LCRYPT) ECULIBDIR='"$(ECULIBDIR)"'\
  498. X          install
  499. X      cp help/ecuhelp.data $(ECULIBDIR)
  500. X      @echo "--------------------------------------------------------------------"
  501. X*** /u4/src/ecu3.04/doc/_p_cmd.txt    Mon Dec 24 15:15:00 1990
  502. X--- doc/_p_cmd.txt    Thu Jan 10 06:13:27 1991
  503. X***************
  504. X*** 1356,1361
  505. X    1      |   1     |   1
  506. X    2      |   1     |   0
  507. X    3      |   0     |   1
  508. X  
  509. X  .DS L
  510. X  Examples:
  511. X
  512. X--- 1356,1362 -----
  513. X    1      |   1     |   1
  514. X    2      |   1     |   0
  515. X    3      |   0     |   1
  516. X+ .DE
  517. X  
  518. X  .DS L
  519. X  Examples:
  520. X*** /u4/src/ecu3.04/doc/_p_param.txt    Wed Aug 15 16:04:00 1990
  521. X--- doc/_p_param.txt    Thu Jan 31 16:47:43 1991
  522. X***************
  523. X*** 45,51
  524. X  .*s 4 "Constants"
  525. X  
  526. X  Integer constants are numeric strings, optionally with an initial
  527. X! minus sign, the absolue value of which must be less than 2147483648.
  528. X  
  529. X  .*s 4 "Variables"
  530. X  
  531. X
  532. X--- 45,62 -----
  533. X  .*s 4 "Constants"
  534. X  
  535. X  Integer constants are numeric strings, optionally with an initial
  536. X! minus sign, the absolute value of which must be less than 2147483648.
  537. X! If the constant begins with the string "0x", it is interpreted
  538. X! as hexadecimal. Octal, like FORTRAN and COBOL will be dead soon; until
  539. X! then, however, octal constants may be denoted by a leading "0o".
  540. X! 
  541. X! .DS L
  542. X! Examples:
  543. X!     123   --> 123(10)
  544. X!     0123  --> 123(10)
  545. X!     0x123 --> 291(10)
  546. X!     0o123 -->  83(10)
  547. X! .DE
  548. X  
  549. X  .*s 4 "Variables"
  550. X  
  551. X*** /u4/src/ecu3.04/doc/_top.txt    Tue Dec 18 19:09:00 1990
  552. X--- doc/_top.txt    Sun Feb  3 18:00:12 1991
  553. X***************
  554. X*** 28,34
  555. X  .sp 1i
  556. X  .ce 100
  557. X  Technical Description
  558. X! Revision 3.00
  559. X  \n(mo/\n(dy/\n(yr
  560. X  .ce 0
  561. X  .ls 1
  562. X
  563. X--- 28,34 -----
  564. X  .sp 1i
  565. X  .ce 100
  566. X  Technical Description
  567. X! Revision 3.05
  568. X  \n(mo/\n(dy/\n(yr
  569. X  .ce 0
  570. X  .ls 1
  571. X*** /u4/src/ecu3.04/ecuhangup.h    Mon Dec 24 22:29:00 1990
  572. X--- ecuhangup.h    Wed Feb  6 12:52:11 1991
  573. X***************
  574. X*** 23,28
  575. X  #define HANGUP_PWENT_ERROR            138
  576. X  #define HANGUP_USAGE                139
  577. X  #define HANGUP_CONFIG_ERROR            140
  578. X  #define HANGUP_RCVR_LOGIC_ERROR        142
  579. X  
  580. X  #define HANGUP_INIT_PROC_ERROR        192
  581. X
  582. X--- 23,29 -----
  583. X  #define HANGUP_PWENT_ERROR            138
  584. X  #define HANGUP_USAGE                139
  585. X  #define HANGUP_CONFIG_ERROR            140
  586. X+ #define HANGUP_CURSES_ERROR            141
  587. X  #define HANGUP_RCVR_LOGIC_ERROR        142
  588. X  
  589. X  #define HANGUP_INIT_PROC_ERROR        192
  590. X*** /u4/src/ecu3.04/ecuicmd.c    Fri Feb  8 03:22:29 1991
  591. X--- ecuicmd.c    Mon Feb  4 19:03:23 1991
  592. X***************
  593. X*** 9,14
  594. X  
  595. X  ------------------------------------------------------------------------*/
  596. X  /*+:EDITS:*/
  597. X  /*:01-09-1991-22:31-wht@n4hgf-ISC port */
  598. X  /*:12-24-1990-04:31-wht@n4hgf-experimental esio driver command */
  599. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  600. X
  601. X--- 9,15 -----
  602. X  
  603. X  ------------------------------------------------------------------------*/
  604. X  /*+:EDITS:*/
  605. X+ /*:02-04-1991-19:03-wht@n4hgf-add multiscreen tag to stat */
  606. X  /*:01-09-1991-22:31-wht@n4hgf-ISC port */
  607. X  /*:12-24-1990-04:31-wht@n4hgf-experimental esio driver command */
  608. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  609. X***************
  610. X*** 31,36
  611. X  extern char rcvr_log_file[];    /* if rcvr_log!= 0,log filename */
  612. X  extern int interrupt;
  613. X  extern int current_ttymode;
  614. X  extern int errno;
  615. X  extern int proc_level;
  616. X  extern int proctrace;
  617. X
  618. X--- 32,38 -----
  619. X  extern char rcvr_log_file[];    /* if rcvr_log!= 0,log filename */
  620. X  extern int interrupt;
  621. X  extern int current_ttymode;
  622. X+ extern int tty_is_multiscreen;
  623. X  extern int errno;
  624. X  extern int proc_level;
  625. X  extern int proctrace;
  626. X***************
  627. X*** 508,515
  628. X          ff(se,"\r\n\r\nDate/time");
  629. X          get_tod(4,cmd);
  630. X          ff(se,": %s\r\n",cmd);
  631. X!         ff(se,"Console: %s  communications line: %s  ",
  632. X!             get_ttyname(),shm->Lline);
  633. X          ff(se,"%u-%c-1\r\n",shm->Lbaud,
  634. X              (shm->Lparity) ? to_upper(shm->Lparity) : 'N');
  635. X          if(shm->Lmodem_off_hook)
  636. X
  637. X--- 510,518 -----
  638. X          ff(se,"\r\n\r\nDate/time");
  639. X          get_tod(4,cmd);
  640. X          ff(se,": %s\r\n",cmd);
  641. X!         ff(se,"Console: %s%s  communications line: %s  ",
  642. X!             get_ttyname(),(tty_is_multiscreen) ? " (multiscreen)" : "",
  643. X!             shm->Lline);
  644. X          ff(se,"%u-%c-1\r\n",shm->Lbaud,
  645. X              (shm->Lparity) ? to_upper(shm->Lparity) : 'N');
  646. X          if(shm->Lmodem_off_hook)
  647. X*** /u4/src/ecu3.04/eculine.c    Fri Feb  8 03:22:30 1991
  648. X--- eculine.c    Thu Feb  7 01:01:01 1991
  649. X***************
  650. X*** 7,12
  651. X      lbreak()
  652. X      lclear_xmtr_xoff()
  653. X      lclose()
  654. X      ldraino(inflush_flag)
  655. X      lflush(flush_type)
  656. X      lget_xon_xoff(ixon,ixoff)
  657. X
  658. X--- 7,13 -----
  659. X      lbreak()
  660. X      lclear_xmtr_xoff()
  661. X      lclose()
  662. X+     lclose_failed()
  663. X      ldraino(inflush_flag)
  664. X      lflush(flush_type)
  665. X      lget_xon_xoff(ixon,ixoff)
  666. X***************
  667. X*** 35,40
  668. X  
  669. X  ------------------------------------------------------------------------*/
  670. X  /*+:EDITS:*/
  671. X  /*:01-25-1991-05:57-wht@n4hgf-cringe - lflush was flushing console not line */
  672. X  /*:01-09-1991-22:31-wht@n4hgf-ISC port */
  673. X  /*:01-09-1991-21:26-wht@n4hgf-don't prototype nap() (ISC port) */
  674. X
  675. X--- 36,43 -----
  676. X  
  677. X  ------------------------------------------------------------------------*/
  678. X  /*+:EDITS:*/
  679. X+ /*:02-07-1991-01:00-wht@n4hgf-fix code in for lclose retry on remote XOFF */
  680. X+ /*:01-29-1991-14:54-wht@n4hgf-put code in for lclose retry on remote XOFF */
  681. X  /*:01-25-1991-05:57-wht@n4hgf-cringe - lflush was flushing console not line */
  682. X  /*:01-09-1991-22:31-wht@n4hgf-ISC port */
  683. X  /*:01-09-1991-21:26-wht@n4hgf-don't prototype nap() (ISC port) */
  684. X***************
  685. X*** 50,55
  686. X  #include <sys/time.h>
  687. X  #endif
  688. X  #endif
  689. X  
  690. X  extern int rcvr_pid;
  691. X  extern int errno;
  692. X
  693. X--- 53,59 -----
  694. X  #include <sys/time.h>
  695. X  #endif
  696. X  #endif
  697. X+ #include <setjmp.h>
  698. X  
  699. X  extern int rcvr_pid;
  700. X  extern int errno;
  701. X***************
  702. X*** 833,838
  703. X  
  704. X  }    /* end of lopen */
  705. X  
  706. X  /*+-----------------------------------------------------------------------
  707. X      lclose()
  708. X  ------------------------------------------------------------------------*/
  709. X
  710. X--- 837,857 -----
  711. X  
  712. X  }    /* end of lopen */
  713. X  
  714. X+ static jmp_buf lclose_insurance;
  715. X+ 
  716. X+ /*+-------------------------------------------------------------------------
  717. X+     lclose_failed(sig) - see lclose() below
  718. X+ --------------------------------------------------------------------------*/
  719. X+ void
  720. X+ lclose_failed(sig)
  721. X+ int sig;
  722. X+ {
  723. X+     if(sig != SIGALRM)
  724. X+         ff(se,"error %d in lclose_failed: tell wht@n4hgf\r\n",sig);
  725. X+     longjmp(lclose_insurance,1);
  726. X+ 
  727. X+ }    /* end of lclose_failed */
  728. X+ 
  729. X  /*+-----------------------------------------------------------------------
  730. X      lclose() - close the line
  731. X  
  732. X***************
  733. X*** 834,840
  734. X  }    /* end of lopen */
  735. X  
  736. X  /*+-----------------------------------------------------------------------
  737. X!     lclose()
  738. X  ------------------------------------------------------------------------*/
  739. X  void
  740. X  lclose()
  741. X
  742. X--- 853,866 -----
  743. X  }    /* end of lclose_failed */
  744. X  
  745. X  /*+-----------------------------------------------------------------------
  746. X!     lclose() - close the line
  747. X! 
  748. X! The FAS driver and others hang on a close until all output for a line
  749. X! has drained.  Sometimes during a hangup, a noisy XOFF can be received.
  750. X! Other changeces for failure include a DCE which drops CTS and leaves
  751. X! it off, locking the line up if there is output waiting to go out.
  752. X! To make sure the line is actually closed in these situations, a SIGLARM
  753. X! handler is used.
  754. X  ------------------------------------------------------------------------*/
  755. X  void
  756. X  lclose()
  757. X***************
  758. X*** 842,847
  759. X      if(shm->Liofd < 0)
  760. X          return;
  761. X      unlock_tty();    /* kill lock file (writes to line; must go before close) */
  762. X      close(shm->Liofd);
  763. X      shm->Liofd = -1;
  764. X  
  765. X
  766. X--- 868,889 -----
  767. X      if(shm->Liofd < 0)
  768. X          return;
  769. X      unlock_tty();    /* kill lock file (writes to line; must go before close) */
  770. X+     signal(SIGALRM,lclose_failed);
  771. X+     alarm(10);
  772. X+     if(setjmp(lclose_insurance))
  773. X+     {    /* close failed */
  774. X+         signal(SIGALRM,SIG_IGN);
  775. X+         ff(se,"\r\nclose failed (remote XOFF?) ... retrying close\r\n");
  776. X+         lclear_xmtr_xoff();
  777. X+         lflush(2);
  778. X+     }
  779. X+     else
  780. X+     {
  781. X+         lclear_xmtr_xoff();
  782. X+         ldraino(1);
  783. X+     }
  784. X+     signal(SIGALRM,SIG_IGN);
  785. X+     alarm(0);
  786. X      close(shm->Liofd);
  787. X      shm->Liofd = -1;
  788. X  
  789. X***************
  790. X*** 853,858
  791. X  void
  792. X  ltoggle_dtr()
  793. X  {
  794. X      close(shm->Liofd);
  795. X      nap(500L);
  796. X      shm->Liofd = open(shm->Lline,O_RDWR,0777);
  797. X
  798. X--- 895,910 -----
  799. X  void
  800. X  ltoggle_dtr()
  801. X  {
  802. X+     signal(SIGALRM,lclose_failed);
  803. X+     alarm(10);
  804. X+     if(setjmp(lclose_insurance))
  805. X+     {    /* close failed */
  806. X+         signal(SIGALRM,SIG_IGN);
  807. X+         ff(se,"\r\nclose failed (remote XOFF?) ... retrying close\r\n");
  808. X+         lflush(2);
  809. X+     }
  810. X+     else
  811. X+         ldraino(1);
  812. X      close(shm->Liofd);
  813. X      signal(SIGALRM,SIG_IGN);
  814. X      alarm(0);
  815. X***************
  816. X*** 854,859
  817. X  ltoggle_dtr()
  818. X  {
  819. X      close(shm->Liofd);
  820. X      nap(500L);
  821. X      shm->Liofd = open(shm->Lline,O_RDWR,0777);
  822. X      ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);
  823. X
  824. X--- 906,913 -----
  825. X      else
  826. X          ldraino(1);
  827. X      close(shm->Liofd);
  828. X+     signal(SIGALRM,SIG_IGN);
  829. X+     alarm(0);
  830. X      nap(500L);
  831. X      if((shm->Liofd = open(shm->Lline,O_RDWR,0777)) < 0)
  832. X      {
  833. X***************
  834. X*** 855,861
  835. X  {
  836. X      close(shm->Liofd);
  837. X      nap(500L);
  838. X!     shm->Liofd = open(shm->Lline,O_RDWR,0777);
  839. X      ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);
  840. X      nap(300L);
  841. X  }    /* end of ltoggle_dtr */
  842. X
  843. X--- 909,919 -----
  844. X      signal(SIGALRM,SIG_IGN);
  845. X      alarm(0);
  846. X      nap(500L);
  847. X!     if((shm->Liofd = open(shm->Lline,O_RDWR,0777)) < 0)
  848. X!     {
  849. X!         pprintf("!! Lost line during DTR toggle operation !!\n");
  850. X!         hangup(HANGUP_LINE_OPEN_ERROR);
  851. X!     }
  852. X      ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);
  853. X      nap(300L);
  854. X  }    /* end of ltoggle_dtr */
  855. X*** /u4/src/ecu3.04/ecuphone.c    Fri Feb  8 03:22:32 1991
  856. X--- ecuphone.c    Thu Feb  7 15:57:01 1991
  857. X***************
  858. X*** 58,63
  859. X  
  860. X  --------------------------------------------------------------------------*/
  861. X  /*+:EDITS:*/
  862. X  /*:01-09-1991-22:31-wht@n4hgf-ISC port */
  863. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  864. X  
  865. X
  866. X--- 58,64 -----
  867. X  
  868. X  --------------------------------------------------------------------------*/
  869. X  /*+:EDITS:*/
  870. X+ /*:02-05-1991-14:51-wht@n4hgf-calloc PDE instead of malloc */
  871. X  /*:01-09-1991-22:31-wht@n4hgf-ISC port */
  872. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  873. X  
  874. X***************
  875. X*** 1327,1333
  876. X      }
  877. X      else
  878. X      {
  879. X!         if(!(tpde = (PDE *)malloc(sizeof(PDE ))))
  880. X          {
  881. X              dirw_bot_msg("Out of memory -- cannot add new entry");
  882. X              return;
  883. X
  884. X--- 1328,1334 -----
  885. X      }
  886. X      else
  887. X      {
  888. X!         if(!(tpde = (PDE *)calloc(1,sizeof(PDE ))))
  889. X          {
  890. X              dirw_bot_msg("Out of memory -- cannot add new entry");
  891. X              return;
  892. X*** /u4/src/ecu3.04/ecusighdl.c    Fri Feb  8 03:21:12 1991
  893. X--- ecusighdl.c    Wed Feb  6 12:53:12 1991
  894. X***************
  895. X*** 26,31
  896. X  
  897. X  ------------------------------------------------------------------------*/
  898. X  /*+:EDITS:*/
  899. X  /*:12-18-1990-20:02-wht@n4hgf-add rcvr_death_handler */
  900. X  /*:09-19-1990-19:36-wht@n4hgf-ecu_log_event now gets pid for log from caller */
  901. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  902. X
  903. X--- 26,32 -----
  904. X  
  905. X  ------------------------------------------------------------------------*/
  906. X  /*+:EDITS:*/
  907. X+ /*:01-29-1991-12:57-wht@n4hgf-on exit, restore setcolor colors if possible */
  908. X  /*:12-18-1990-20:02-wht@n4hgf-add rcvr_death_handler */
  909. X  /*:09-19-1990-19:36-wht@n4hgf-ecu_log_event now gets pid for log from caller */
  910. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  911. X***************
  912. X*** 195,200
  913. X          case HANGUP_USAGE: return("usage");
  914. X          case HANGUP_INIT_PROC_ERROR: return("error during initial procedure");
  915. X          case HANGUP_CONFIG_ERROR: return("configuration error");
  916. X          default:
  917. X              sprintf(errant,"code %u?",code);
  918. X              return(errant);
  919. X
  920. X--- 196,202 -----
  921. X          case HANGUP_USAGE: return("usage");
  922. X          case HANGUP_INIT_PROC_ERROR: return("error during initial procedure");
  923. X          case HANGUP_CONFIG_ERROR: return("configuration error");
  924. X+         case HANGUP_CURSES_ERROR: return("error in curses use");
  925. X          default:
  926. X              sprintf(errant,"code %u?",code);
  927. X              return(errant);
  928. X***************
  929. X*** 273,279
  930. X                      pperror("errno may not apply, but");
  931. X              }
  932. X          }
  933. X!         setcolor(colors_normal);
  934. X      }
  935. X      else                            /* we are rcvr */
  936. X      {
  937. X
  938. X--- 275,281 -----
  939. X                      pperror("errno may not apply, but");
  940. X              }
  941. X          }
  942. X!         restore_initial_colors();
  943. X      }
  944. X      else                            /* we are rcvr */
  945. X      {
  946. X***************
  947. X*** 290,296
  948. X              if(errno)
  949. X                  pperror("errno may not apply, but");
  950. X          }
  951. X!         setcolor(colors_normal);
  952. X          kill(xmtr_pid,SIGHUP);
  953. X      }
  954. X      exit(sig);
  955. X
  956. X--- 292,298 -----
  957. X              if(errno)
  958. X                  pperror("errno may not apply, but");
  959. X          }
  960. X!         restore_initial_colors();
  961. X          kill(xmtr_pid,SIGHUP);
  962. X      }
  963. X      exit(sig);
  964. X*** /u4/src/ecu3.04/ecutty.c    Fri Feb  8 03:21:12 1991
  965. X--- ecutty.c    Mon Feb  4 19:30:40 1991
  966. X***************
  967. X*** 6,11
  968. X      _setcolor(clrs)
  969. X      B_to_timeout_msec(c_cflag,st_rdev)
  970. X      color_name_to_num(cname)
  971. X      get_ttymode()
  972. X      get_ttyname()
  973. X      ring_bell()
  974. X
  975. X--- 6,12 -----
  976. X      _setcolor(clrs)
  977. X      B_to_timeout_msec(c_cflag,st_rdev)
  978. X      color_name_to_num(cname)
  979. X+     get_initial_colors()
  980. X      get_ttymode()
  981. X      get_ttyname()
  982. X      ring_bell()
  983. X***************
  984. X*** 18,23
  985. X      ttyinit(param)
  986. X      ttymode(arg)
  987. X  
  988. X  --------------------------------------------------------------------------*/
  989. X  /*+:EDITS:*/
  990. X  /*:12-01-1990-14:33-wht@n4hgf-more non-ansi - fkey mapping with nonansi.c */
  991. X
  992. X--- 19,44 -----
  993. X      ttyinit(param)
  994. X      ttymode(arg)
  995. X  
  996. X+     In SCO versions, ECU keeps the the state of the normal and
  997. X+     reverse video foreground and background colors in a 32-bit value:
  998. X+ 
  999. X+      00000000001111111111222222222233
  1000. X+      01234567890123456789012345678901
  1001. X+      0000|--|0000|--|0000|--|0000|--|
  1002. X+           fg      bk      fg      bk
  1003. X+            reverse      normal
  1004. X+ 
  1005. X+     The color values are per the SCO extended color definitons:
  1006. X+ 
  1007. X+     black    0     gray         8
  1008. X+     blue     1     lt_blue      9
  1009. X+     green    2     lt_green    10
  1010. X+     cyan     3     lt_cyan     11
  1011. X+     red      4     lt_red      12
  1012. X+     magenta  5     lt_magenta  13
  1013. X+     brown    6     yellow      14
  1014. X+     white    7     hi_white    15
  1015. X+ 
  1016. X  --------------------------------------------------------------------------*/
  1017. X  /*+:EDITS:*/
  1018. X  /*:01-29-1991-14:03-wht@n4hgf-more time for ESC vs fkey discrimination */
  1019. X***************
  1020. X*** 20,25
  1021. X  
  1022. X  --------------------------------------------------------------------------*/
  1023. X  /*+:EDITS:*/
  1024. X  /*:12-01-1990-14:33-wht@n4hgf-more non-ansi - fkey mapping with nonansi.c */
  1025. X  /*:11-28-1990-15:56-wht@n4hgf-add non-ansi terminal support */
  1026. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  1027. X
  1028. X--- 41,48 -----
  1029. X  
  1030. X  --------------------------------------------------------------------------*/
  1031. X  /*+:EDITS:*/
  1032. X+ /*:01-29-1991-14:03-wht@n4hgf-more time for ESC vs fkey discrimination */
  1033. X+ /*:01-29-1991-13:44-wht@n4hgf-load colors_normal w/ioctl GIO_ATTR if M_UNIX */
  1034. X  /*:12-01-1990-14:33-wht@n4hgf-more non-ansi - fkey mapping with nonansi.c */
  1035. X  /*:11-28-1990-15:56-wht@n4hgf-add non-ansi terminal support */
  1036. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  1037. X***************
  1038. X*** 108,114
  1039. X  long TOmsec = 20L;        /* timeout on waiting for char after ESC */
  1040. X  
  1041. X  ulong colors_current = 0x04070A00L;
  1042. X! ulong colors_normal = 0x04070A00L;    /* lt_green/black red/white */
  1043. X  ulong colors_success = 0x07000A00L;    /* lt_green/black red/white */
  1044. X  ulong colors_alert = 0x0E000E00L;    /* yellow */
  1045. X  ulong colors_error = 0x04000400L;    /* red */
  1046. X
  1047. X--- 131,138 -----
  1048. X  long TOmsec = 20L;        /* timeout on waiting for char after ESC */
  1049. X  
  1050. X  ulong colors_current = 0x04070A00L;
  1051. X! ulong colors_normal = 0x04070A00L;    /* default lt_green/black red/white */
  1052. X! ulong colors_initial = 0x04070A00L;    /* default initial colors */
  1053. X  ulong colors_success = 0x07000A00L;    /* lt_green/black red/white */
  1054. X  ulong colors_alert = 0x0E000E00L;    /* yellow */
  1055. X  ulong colors_error = 0x04000400L;    /* red */
  1056. X***************
  1057. X*** 127,133
  1058. X  ushort c_cflag;
  1059. X  ushort st_rdev;
  1060. X  {
  1061. X! long ms = 0L;
  1062. X  
  1063. X      /* if multiscreen, 20 msec is pu-lenty */
  1064. X  
  1065. X
  1066. X--- 151,157 -----
  1067. X  ushort c_cflag;
  1068. X  ushort st_rdev;
  1069. X  {
  1070. X! long ms;
  1071. X  
  1072. X      /* if multiscreen, 20 msec is pu-lenty */
  1073. X      if(tty_is_multiscreen)
  1074. X***************
  1075. X*** 130,139
  1076. X  long ms = 0L;
  1077. X  
  1078. X      /* if multiscreen, 20 msec is pu-lenty */
  1079. X! 
  1080. X!     if(((st_rdev & 0xFF00) == (tty01.st_rdev & 0xFF00)) ||
  1081. X!        ((st_rdev & 0xFF00) == (console.st_rdev & 0xFF00)) )
  1082. X!     {
  1083. X          return(20L);
  1084. X      }
  1085. X  
  1086. X
  1087. X--- 154,160 -----
  1088. X  long ms;
  1089. X  
  1090. X      /* if multiscreen, 20 msec is pu-lenty */
  1091. X!     if(tty_is_multiscreen)
  1092. X          return(20L);
  1093. X  
  1094. X      /* make network/xterm/pty sweat, but don't make as many mistakes */
  1095. X***************
  1096. X*** 135,141
  1097. X         ((st_rdev & 0xFF00) == (console.st_rdev & 0xFF00)) )
  1098. X      {
  1099. X          return(20L);
  1100. X-     }
  1101. X  
  1102. X      /* baud rate fiddling */
  1103. X  
  1104. X
  1105. X--- 156,161 -----
  1106. X      /* if multiscreen, 20 msec is pu-lenty */
  1107. X      if(tty_is_multiscreen)
  1108. X          return(20L);
  1109. X  
  1110. X      /* make network/xterm/pty sweat, but don't make as many mistakes */
  1111. X      if(((st_rdev & 0xFF00) == (ttyp0.st_rdev & 0xFF00)))
  1112. X***************
  1113. X*** 137,143
  1114. X          return(20L);
  1115. X      }
  1116. X  
  1117. X!     /* baud rate fiddling */
  1118. X  
  1119. X      switch(c_cflag & CBAUD)
  1120. X      {
  1121. X
  1122. X--- 157,165 -----
  1123. X      if(tty_is_multiscreen)
  1124. X          return(20L);
  1125. X  
  1126. X!     /* make network/xterm/pty sweat, but don't make as many mistakes */
  1127. X!     if(((st_rdev & 0xFF00) == (ttyp0.st_rdev & 0xFF00)))
  1128. X!         return(100L);
  1129. X  
  1130. X      /* baud rate fiddling */
  1131. X      switch(c_cflag & CBAUD)
  1132. X***************
  1133. X*** 139,144
  1134. X  
  1135. X      /* baud rate fiddling */
  1136. X  
  1137. X      switch(c_cflag & CBAUD)
  1138. X      {
  1139. X          /*      char times * time/char */
  1140. X
  1141. X--- 161,167 -----
  1142. X      if(((st_rdev & 0xFF00) == (ttyp0.st_rdev & 0xFF00)))
  1143. X          return(100L);
  1144. X  
  1145. X+     /* baud rate fiddling */
  1146. X      switch(c_cflag & CBAUD)
  1147. X      {
  1148. X          /*       char times * time/char */
  1149. X***************
  1150. X*** 141,156
  1151. X  
  1152. X      switch(c_cflag & CBAUD)
  1153. X      {
  1154. X!         /*      char times * time/char */
  1155. X!         case B110:    ms = 3 * 100;
  1156. X!         case B300:    ms = 3 * 33;
  1157. X!         case B600:    ms = 3 * 16;
  1158. X!         case B1200:    ms = 3 * 8;
  1159. X!         case B2400:    ms = 3 * 4;
  1160. X!         case B4800:    ms = 8 * 2;
  1161. X!         case B9600:    ms = 8 * 1;
  1162. X!         case EXTA:    ms = 8 * 1;
  1163. X!         case EXTB:    ms = 8 * 1;
  1164. X      }
  1165. X  
  1166. X  
  1167. X
  1168. X--- 164,177 -----
  1169. X      /* baud rate fiddling */
  1170. X      switch(c_cflag & CBAUD)
  1171. X      {
  1172. X!         /*       char times * time/char */
  1173. X!         case B110:    ms = 10 * 100;
  1174. X!         case B300:    ms = 10 * 33;
  1175. X!         case B600:    ms = 10 * 16;
  1176. X!         case B1200:    ms = 10 * 8;
  1177. X!         case B2400:    ms = 10 * 4;
  1178. X!         default:        /* many character times for packetized ... */
  1179. X!             ms = 100L;    /* ... modems used for console */
  1180. X      }
  1181. X      return(ms);
  1182. X  
  1183. X***************
  1184. X*** 152,166
  1185. X          case EXTA:    ms = 8 * 1;
  1186. X          case EXTB:    ms = 8 * 1;
  1187. X      }
  1188. X- 
  1189. X- 
  1190. X-     /* make network/xterm/pty sweat, but don't make as many mistakes */
  1191. X- 
  1192. X-     if(((st_rdev & 0xFF00) == (ttyp0.st_rdev & 0xFF00)) && (ms < 80L))
  1193. X-         ms = 80L;
  1194. X-     else if(ms < 20L)    /* enforce minimum time for obvious reasons + */
  1195. X-         ms = 20L;        /* make sure we don't incur the UNIX nap() bug */
  1196. X- 
  1197. X      return(ms);
  1198. X  
  1199. X  }    /* end of B_to_timeout_msec */
  1200. X
  1201. X--- 173,178 -----
  1202. X          default:        /* many character times for packetized ... */
  1203. X              ms = 100L;    /* ... modems used for console */
  1204. X      }
  1205. X      return(ms);
  1206. X  
  1207. X  }    /* end of B_to_timeout_msec */
  1208. X***************
  1209. X*** 287,292
  1210. X  }    /* end of setcolor_internal */
  1211. X  
  1212. X  /*+-------------------------------------------------------------------------
  1213. X      read_colors_file()
  1214. X  --------------------------------------------------------------------------*/
  1215. X  void
  1216. X
  1217. X--- 299,365 -----
  1218. X  }    /* end of setcolor_internal */
  1219. X  
  1220. X  /*+-------------------------------------------------------------------------
  1221. X+     restore_initial_colors() - under UNIX, restore color scheme at execution
  1222. X+ 
  1223. X+ Under non-SCO-S5R3, don't have initial color, so use colors_normal
  1224. X+ --------------------------------------------------------------------------*/
  1225. X+ void
  1226. X+ restore_initial_colors()
  1227. X+ {
  1228. X+ #ifdef M_UNIX
  1229. X+     setcolor(colors_initial);
  1230. X+ #else
  1231. X+     setcolor(colors_normal);
  1232. X+ #endif
  1233. X+ }    /* end of restore_initial_colors */
  1234. X+ 
  1235. X+ /*+-------------------------------------------------------------------------
  1236. X+     get_initial_colors() - read colors at time of execution from driver
  1237. X+ 
  1238. X+      00000000001111111111222222222233
  1239. X+      01234567890123456789012345678901
  1240. X+      0000|--|0000|--|0000|--|0000|--|
  1241. X+           fg      bk      fg      bk
  1242. X+            reverse      normal
  1243. X+ 
  1244. X+   Thanks for the G2 on this to staceyc@sco.COM (Stacey Campbell)
  1245. X+ --------------------------------------------------------------------------*/
  1246. X+ #if defined(M_UNIX)
  1247. X+ void
  1248. X+ get_initial_colors()
  1249. X+ {
  1250. X+ #if !defined(GIO_ATTR)
  1251. X+ #define GIO_ATTR  ('a' << 8) | 0    /* Ioctl call for current attribute */
  1252. X+ #endif
  1253. X+     uint cur_attr;
  1254. X+     ulong fgnd;
  1255. X+     ulong bgnd;
  1256. X+ 
  1257. X+     colors_normal = 0L;
  1258. X+ 
  1259. X+ /*
  1260. X+  * first, reverse, so we can end up with normal colors selected
  1261. X+  */
  1262. X+     write(1,"\033[7m",4);        /* select reverse */
  1263. X+     cur_attr = (uint)ioctl(0, GIO_ATTR, 0);
  1264. X+     fgnd = (ulong)cur_attr & 0x0F;
  1265. X+     bgnd = (ulong) (cur_attr >> 4) & 0x0F;
  1266. X+     colors_normal |= (fgnd << 24) | (bgnd << 16);
  1267. X+ 
  1268. X+ /*
  1269. X+  * now, normal
  1270. X+  */
  1271. X+     write(1,"\033[m",3);        /* select normal */
  1272. X+     cur_attr = (uint)ioctl(0, GIO_ATTR, 0);
  1273. X+     fgnd = (ulong)cur_attr & 0x0F;
  1274. X+     bgnd = (ulong) (cur_attr >> 4) & 0x0F;
  1275. X+     colors_normal |= (fgnd << 8) | bgnd;
  1276. X+     colors_initial = colors_normal;        /* save for restore_initial_colors */
  1277. X+ 
  1278. X+ }    /* end of get_initial_colors */
  1279. X+ #endif
  1280. X+ 
  1281. X+ /*+-------------------------------------------------------------------------
  1282. X      read_colors_file()
  1283. X  --------------------------------------------------------------------------*/
  1284. X  void
  1285. X***************
  1286. X*** 303,308
  1287. X      if(tty_not_char_special)
  1288. X          return;
  1289. X  
  1290. X      get_home_dir(s128);
  1291. X      strcat(s128,"/.ecu/colors");
  1292. X      if(access(s128,4))
  1293. X
  1294. X--- 376,385 -----
  1295. X      if(tty_not_char_special)
  1296. X          return;
  1297. X  
  1298. X+ #if defined(M_UNIX)
  1299. X+     get_initial_colors();
  1300. X+ #endif
  1301. X+ 
  1302. X      get_home_dir(s128);
  1303. X      strcat(s128,"/.ecu/colors");
  1304. X      if(access(s128,4))
  1305. X***************
  1306. X*** 380,386
  1307. X          return;
  1308. X      }
  1309. X  
  1310. X!     /* save initial tty state */
  1311. X      ioctl(TTYIN,TCGETA,(char *)&tty_termio_at_entry);
  1312. X      TOmsec = B_to_timeout_msec(tty_termio_at_entry.c_cflag,tty_stat.st_rdev);
  1313. X  
  1314. X
  1315. X--- 457,479 -----
  1316. X          return;
  1317. X      }
  1318. X  
  1319. X!     /*
  1320. X!      * use color if we are on a multiscreen and video supports it
  1321. X!      * also, remember whether or not we are on a multiscreen
  1322. X!      * (I ain't proud of this beyond being a valiant attempt)
  1323. X!      */
  1324. X!     use_colors = 0;
  1325. X!     if( ((itmp = ioctl(TTYIN,CONS_GET,&monitor_type)) >= 0) &&
  1326. X!         (use_colors = (monitor_type != MONO)))
  1327. X!     {
  1328. X!         read_colors_file();
  1329. X!         setcolor(colors_normal);
  1330. X!     }
  1331. X!     tty_is_multiscreen = !(itmp < 0);
  1332. X! 
  1333. X!     /*
  1334. X!      * save initial tty state
  1335. X!      */
  1336. X      ioctl(TTYIN,TCGETA,(char *)&tty_termio_at_entry);
  1337. X      TOmsec = B_to_timeout_msec(tty_termio_at_entry.c_cflag,tty_stat.st_rdev);
  1338. X  
  1339. X***************
  1340. X*** 441,466
  1341. X      if(tcap_COLS > 80)
  1342. X          tcap_COLS = 80;
  1343. X      LINESxCOLS = tcap_LINES * tcap_COLS;
  1344. X- 
  1345. X-     /*
  1346. X-      * use color if we are on a multiscreen and video supports it
  1347. X-      * also, remember whether or not we are on a multiscreen
  1348. X-      * (I ain't proud of this beyond being a valiant attempt)
  1349. X-      */
  1350. X-     tty_is_multiscreen = 
  1351. X-         ((tty_stat.st_rdev & 0xFF00) == (tty01.st_rdev & 0xFF00)) ||
  1352. X-         ((tty_stat.st_rdev & 0xFF00) == (console.st_rdev & 0xFF00));
  1353. X-     use_colors = 0;
  1354. X-     itmp = 0;
  1355. X-     if(tty_is_multiscreen &&
  1356. X-         ((itmp = ioctl(TTYIN,CONS_GET,&monitor_type)) >= 0) &&
  1357. X-         (use_colors = (monitor_type != MONO)))
  1358. X-     {
  1359. X-         read_colors_file();
  1360. X-         setcolor(colors_normal);
  1361. X-     }
  1362. X-     if(itmp < 0)
  1363. X-         tty_is_multiscreen = 0;
  1364. X  
  1365. X  }    /* end of ttyinit */
  1366. X  
  1367. X
  1368. X--- 534,539 -----
  1369. X      if(tcap_COLS > 80)
  1370. X          tcap_COLS = 80;
  1371. X      LINESxCOLS = tcap_LINES * tcap_COLS;
  1372. X  
  1373. X  }    /* end of ttyinit */
  1374. X  
  1375. X*** /u4/src/ecu3.04/ecuutil.c    Fri Feb  8 03:22:34 1991
  1376. X--- ecuutil.c    Sun Feb  3 14:23:21 1991
  1377. X***************
  1378. X*** 31,36
  1379. X  
  1380. X  ------------------------------------------------------------------------*/
  1381. X  /*+:EDITS:*/
  1382. X  /*:01-25-1991-16:23-wht@n4hgf-source name wrong in headers */
  1383. X  /*:12-26-1990-14:32-wht@n4hgf-use memmove or Duff's Device in mem_cpy() */
  1384. X  /*:12-04-1990-00:58-wht@n4hgf-allow alternating between str/arg_token */
  1385. X
  1386. X--- 31,37 -----
  1387. X  
  1388. X  ------------------------------------------------------------------------*/
  1389. X  /*+:EDITS:*/
  1390. X+ /*:02-03-1991-14:23-wht@n4hgf-hack workaround for get_home_dir under x286 */
  1391. X  /*:01-25-1991-16:23-wht@n4hgf-source name wrong in headers */
  1392. X  /*:12-26-1990-14:32-wht@n4hgf-use memmove or Duff's Device in mem_cpy() */
  1393. X  /*:12-04-1990-00:58-wht@n4hgf-allow alternating between str/arg_token */
  1394. X***************
  1395. X*** 736,741
  1396. X  {
  1397. X  static char home_directory[256] = "";
  1398. X  struct passwd *pwent;
  1399. X  
  1400. X      if(home_directory[0])
  1401. X      {
  1402. X
  1403. X--- 737,743 -----
  1404. X  {
  1405. X  static char home_directory[256] = "";
  1406. X  struct passwd *pwent;
  1407. X+ char *cptr;
  1408. X  
  1409. X      if(home_directory[0])
  1410. X      {
  1411. X***************
  1412. X*** 740,745
  1413. X      if(home_directory[0])
  1414. X      {
  1415. X          strcpy(home_dir,home_directory);
  1416. X          return(0);
  1417. X      }
  1418. X  
  1419. X
  1420. X--- 742,754 -----
  1421. X      if(home_directory[0])
  1422. X      {
  1423. X          strcpy(home_dir,home_directory);
  1424. X+         return(0);
  1425. X+     }
  1426. X+ 
  1427. X+     if(cptr = getenv("HOME"))            /* x286 seems to blow up ... */
  1428. X+     {                                    /* ... in pwent code ... hmmm */
  1429. X+         strcpy(home_directory,cptr);
  1430. X+         strcpy(home_dir,cptr);
  1431. X          return(0);
  1432. X      }
  1433. X  
  1434. X*** /u4/src/ecu3.04/ecuwinutil.c    Fri Feb  8 03:20:15 1991
  1435. X--- ecuwinutil.c    Wed Feb  6 13:27:14 1991
  1436. X***************
  1437. X*** 97,103
  1438. X      {
  1439. X          fprintf(stderr,"curses features unavailable\r\n");
  1440. X  abort();
  1441. X!         hangup(HANGUP_TTYIN_READ_ERROR);
  1442. X      }
  1443. X  
  1444. X      ttymode_before_window_start = get_ttymode();
  1445. X
  1446. X--- 97,103 -----
  1447. X      {
  1448. X          fprintf(stderr,"curses features unavailable\r\n");
  1449. X  abort();
  1450. X!         hangup(HANGUP_CURSES_ERROR);
  1451. X      }
  1452. X  
  1453. X      ttymode_before_window_start = get_ttymode();
  1454. X***************
  1455. X*** 105,111
  1456. X      if(!initscr())
  1457. X      {
  1458. X          fprintf(stderr,"curses init failure ... check terminal type\r\n");
  1459. X!         hangup(HANGUP_USAGE);
  1460. X      }
  1461. X      savetty(); raw(); noecho(); nonl(); clear();
  1462. X  #if defined(M_TERMINFO)
  1463. X
  1464. X--- 105,111 -----
  1465. X      if(!initscr())
  1466. X      {
  1467. X          fprintf(stderr,"curses init failure ... check terminal type\r\n");
  1468. X!         hangup(HANGUP_CURSES_ERROR);
  1469. X      }
  1470. X      savetty(); raw(); noecho(); nonl(); clear();
  1471. X  #if defined(M_TERMINFO)
  1472. X***************
  1473. X*** 218,223
  1474. X      
  1475. X      if(nwin)
  1476. X          window_setup(nwin,title,title_x);
  1477. X      return(nwin);
  1478. X  }    /* end of window_create */
  1479. X  
  1480. X
  1481. X--- 218,228 -----
  1482. X      
  1483. X      if(nwin)
  1484. X          window_setup(nwin,title,title_x);
  1485. X+     else
  1486. X+     {
  1487. X+         fprintf(stderr,"\r\ncurses error: cannot create new window\r\n");
  1488. X+         hangup(HANGUP_CURSES_ERROR);
  1489. X+     }
  1490. X      return(nwin);
  1491. X  }    /* end of window_create */
  1492. X  
  1493. X*** /u4/src/ecu3.04/esdutil.c    Mon Dec 24 22:37:00 1990
  1494. X--- esdutil.c    Thu Jan 31 16:19:44 1991
  1495. X***************
  1496. X*** 34,39
  1497. X  This is old code; give me a break
  1498. X  -----------------------------------------------------------------*/
  1499. X  /*+:EDITS:*/
  1500. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  1501. X  
  1502. X  #include <ctype.h>
  1503. X
  1504. X--- 34,40 -----
  1505. X  This is old code; give me a break
  1506. X  -----------------------------------------------------------------*/
  1507. X  /*+:EDITS:*/
  1508. X+ /*:01-31-1991-14:49-wht@n4hgf-rework realloc_esd for speed
  1509. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  1510. X  
  1511. X  #include "ecu.h"
  1512. X***************
  1513. X*** 36,42
  1514. X  /*+:EDITS:*/
  1515. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  1516. X  
  1517. X- #include <ctype.h>
  1518. X  #include "ecu.h"
  1519. X  #include "ecuerror.h"
  1520. X  #include "esd.h"
  1521. X
  1522. X--- 37,42 -----
  1523. X  /*:01-31-1991-14:49-wht@n4hgf-rework realloc_esd for speed
  1524. X  /*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  1525. X  
  1526. X  #include "ecu.h"
  1527. X  #include "ecuerror.h"
  1528. X  #include "esd.h"
  1529. X***************
  1530. X*** 115,120
  1531. X  
  1532. X  /*+-----------------------------------------------------------------------
  1533. X      esdptr = realloc_esd(maxcb)    - realloc an esd buffer
  1534. X  ------------------------------------------------------------------------*/
  1535. X  int
  1536. X  realloc_esd(tesd,maxcb)
  1537. X
  1538. X--- 115,124 -----
  1539. X  
  1540. X  /*+-----------------------------------------------------------------------
  1541. X      esdptr = realloc_esd(maxcb)    - realloc an esd buffer
  1542. X+ 
  1543. X+ may only be used to enlarge an esd buffer
  1544. X+ this used to use realloc(), which did a lot of unnecessary copying
  1545. X+ also no more abnormal program termination on memory failure
  1546. X  ------------------------------------------------------------------------*/
  1547. X  int
  1548. X  realloc_esd(tesd,maxcb)
  1549. X***************
  1550. X*** 122,127
  1551. X  register maxcb;        /* desired maxcb */
  1552. X  {
  1553. X  register actual_cb;
  1554. X  
  1555. X      if(!tesd)
  1556. X          return(eInternalLogicError);
  1557. X
  1558. X--- 126,132 -----
  1559. X  register maxcb;        /* desired maxcb */
  1560. X  {
  1561. X  register actual_cb;
  1562. X+ char *newpb;
  1563. X  
  1564. X      if(!tesd || (tesd->maxcb > maxcb))
  1565. X          return(eInternalLogicError);
  1566. X***************
  1567. X*** 123,129
  1568. X  {
  1569. X  register actual_cb;
  1570. X  
  1571. X!     if(!tesd)
  1572. X          return(eInternalLogicError);
  1573. X  
  1574. X      /* we get an extra character to ensure room for null past maxcb */
  1575. X
  1576. X--- 128,134 -----
  1577. X  register actual_cb;
  1578. X  char *newpb;
  1579. X  
  1580. X!     if(!tesd || (tesd->maxcb > maxcb))
  1581. X          return(eInternalLogicError);
  1582. X  
  1583. X      /* we get an extra character to ensure room for null past maxcb */
  1584. X***************
  1585. X*** 131,143
  1586. X      if(actual_cb & 1)        /* even allocation */
  1587. X          ++actual_cb;
  1588. X  
  1589. X!     if(!(tesd->pb = realloc(tesd->pb,actual_cb)))
  1590. X!     {
  1591. X!         errno = ENOMEM;
  1592. X!         ff(se,"\r\n\r\nMEMORY REALLOC FAILED. FATAL ERROR. SORRY.\r\n");
  1593. X!         hangup(HANGUP_XMTR_LOGIC_ERROR);
  1594. X!     }
  1595. X! 
  1596. X      return(0);
  1597. X  
  1598. X  }    /* end of realloc_esd */
  1599. X
  1600. X--- 136,148 -----
  1601. X      if(actual_cb & 1)        /* even allocation */
  1602. X          ++actual_cb;
  1603. X  
  1604. X!     if(!(newpb = malloc(actual_cb)))
  1605. X!         return(eNoMemory);
  1606. X!     if(tesd->cb)
  1607. X!         memcpy(newpb,tesd->pb,tesd->cb);
  1608. X!     free(tesd->pb);
  1609. X!     tesd->pb = newpb;
  1610. X!     tesd->maxcb = actual_cb;
  1611. X      return(0);
  1612. X  
  1613. X  }    /* end of realloc_esd */
  1614. SHAR_EOF
  1615. chmod 0644 PATCH5.01 ||
  1616. echo 'restore of PATCH5.01 failed'
  1617. Wc_c="`wc -c < 'PATCH5.01'`"
  1618. test 32621 -eq "$Wc_c" ||
  1619.     echo 'PATCH5.01: original size 32621, current size' "$Wc_c"
  1620. exit 0
  1621.  
  1622. exit 0 # Just in case...
  1623. -- 
  1624. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1625. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1626. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1627. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1628.