home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume13 / ecu2.80 / patch04 < prev    next >
Encoding:
Text File  |  1990-07-02  |  45.0 KB  |  1,650 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v13i085: ecu 2.80 patch 4
  3. From: wht@gatech.edu@n4hgf.Mt-Park.GA.US.UUCP (Warren Tucker)
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 13, Issue 85
  7. Submitted-by: wht@gatech.edu@n4hgf.Mt-Park.GA.US.UUCP (Warren Tucker)
  8. Archive-name: ecu2.80/patch04
  9.  
  10. Changes since ecu 2.80 patchlevel 3
  11.  
  12. 1.  A problem with passing arguments to an initial procedure was
  13.     fixed.  Getopt() is now used, which requires that all switch
  14.     command arguments must precede the non-switch arguments.
  15.     This was not true in previous revisions of ecu.
  16.  
  17. 2.  A new (non-standard) escape sequence has been added to the
  18.     expresp procedure command.  \m### causes a ### millisecond delay.
  19.     Note this adds an ambiguity to the syntax of the send string:
  20.     you may not follow an \m delay with a literal digit to send.
  21.     For example, suppose you wish to delay 300 missileconds then
  22.     send "4A".  \m3004A will delay for 3004 (approximately) milliseconds,
  23.     then send an "A".  You must, instead, use \m300\034A to achieve
  24.     the desired result.
  25.  
  26. 3.  The method of choosing a shared memory segment key changed.
  27.     Previously, ftok() was used.  Now, the algorithm is 
  28.         0xEC000000L | getpid();
  29.  
  30. 4.  The -D switch has been added to cause ecu to terminate
  31.     unconditionally upon completion of an initial procedure (-p).
  32.  
  33. 5.  Other minor unreported bugs were fixed.
  34.  
  35. #!/bin/sh
  36. # This is ecu2.80/patch03, a shell archive (shar 3.31)
  37. # made 07/02/1990 00:14 UTC by wht@n4hgf.Mt-Park.GA.US
  38. # Source directory /u1/src/ecu
  39. #
  40. # existing files WILL be overwritten
  41. #
  42. # This shar contains:
  43. # length  mode       name
  44. # ------ ---------- ------------------------------------------
  45. #   9366 -rw-r--r-- ecu.c
  46. #   2587 -rw-r--r-- help/lint_args.h
  47. #  28750 -rw-r--r-- ECU280.P04
  48. #    470 -rwxr-xr-x APPLY.P04
  49. #
  50. if touch 2>&1 | fgrep 'mmdd' > /dev/null
  51.  then TOUCH=touch
  52.  else TOUCH=true
  53. fi
  54. # ============= ecu.c ==============
  55. echo "x - extracting ecu.c (Text)"
  56. sed 's/^X//' << 'SHAR_EOF' > ecu.c &&
  57. X/* CHK=0x130C */
  58. X/*+-----------------------------------------------------------------------
  59. X    ecu.c
  60. X    wht%n4hgf@gatech.edu
  61. X
  62. X  Defined functions:
  63. X    main(argc,argv,envp)
  64. X    xmtr()
  65. X
  66. X------------------------------------------------------------------------*/
  67. X/*+:EDITS:*/
  68. X/*:07-01-1990-19:06-wht@n4hgf-add -D switch */
  69. X/*:06-09-1990-02:32-wht@n4hgf-overhaul argv processing */
  70. X/*:05-10-1990-16:44-wht@n4hgf-move patchlevel to hello_str from ecuicmd.c */
  71. X/*:05-07-1990-21:23-wht@n4hgf---- 2.80 --- */
  72. X/*:04-19-1990-03:07-wht@n4hgf-GCC run found unused vars -- rm them */
  73. X/*:03-27-1990-15:18-wht@n4hgf-overhaul for/wait/SIGCLD handling */
  74. X/*:03-26-1990-15:11-wht@n4hgf-better diag when line choice fails with HDB */
  75. X/*:03-25-1990-14:11-wht@n4hgf------ x2.70 ------- */
  76. X/*:03-16-1990-04:30-wht@n4hgf-make ftime call for starting_timeb */
  77. X/*:02-20-1990-03:50-wht-per doc, do not assume timeval unmodified by select */
  78. X/*:10-14-1989-21:10-wht-allow user to change ecu color choices */
  79. X/*:07-03-1989-22:57-wht------ x2.00 ----- */
  80. X/*:06-24-1989-16:52-wht-flush edits --- ecu 1.95 */
  81. X
  82. X#define DECLARE_LINEVARS_PUBLIC
  83. X#include "ecu.h"
  84. X#include "esd.h"
  85. X#include "proc.h"
  86. X#include "ecukey.h"
  87. X#include "ecuxkey.h"
  88. X#include "ecuhangup.h"
  89. X#include "patchlevel.h"
  90. X
  91. Xchar *getenv();
  92. X
  93. Xextern char *makedate;            /* temporary make date */
  94. Xextern char *numeric_revision;    /* ecunumrev.c */
  95. Xextern char *revision_modifier; /* ecunumrev.c */
  96. Xextern ESD *icmd_prompt;
  97. Xextern char kbdeof;            /* current input EOF */
  98. Xextern char kbdeol2;        /* current secondary input EOL */
  99. Xextern char kbdeol;            /* current input EOL */
  100. Xextern char kbderase;        /* current input ERASE */
  101. Xextern char kbdintr;        /* current input INTR */
  102. Xextern char kbdkill;        /* current input KILL */
  103. Xextern char kbdquit;        /* current input QUIT */
  104. Xextern ulong colors_current;
  105. Xextern int there_is_hdb_on_this_machine;
  106. Xextern char lopen_err_str[];
  107. X
  108. Xchar curr_dir[258];        /* current working directory of process */
  109. Xchar hello_str[80];        /* msg printed upon BOJ */
  110. Xchar errmsg[128];
  111. Xchar modem_ctl_fname[128];
  112. Xchar initial_procedure[128] = "";
  113. Xint init_proc_argc = 0;
  114. Xchar *init_proc_argv[MAX_PARGV];
  115. Xint quiet = 0;            /* don't shut up is default */
  116. Xint rcvr_pid = -1;        /* pid for rcvr process (-1 == no proc active) */
  117. X    /* ... -2 == special flag for modem control/timed-read procedures */
  118. Xint xmtr_pid = 0;
  119. Xint quit_on_init_proc_fail = 0;
  120. Xint quit_on_init_proc_done = 0;
  121. Xstruct timeb starting_timeb;
  122. X
  123. X/*-----------------------*/
  124. Xint nice_value = 3;        /* go for hi priority */
  125. Xushort geteuid();
  126. Xushort getuid();
  127. Xushort euid;
  128. Xushort uid;
  129. X/*-----------------------*/
  130. X
  131. X/*+-----------------------------------------------------------------------
  132. X    xmtr() --  copy stdin to comm line
  133. X
  134. X  THE INITIAL PROCESS EXECUTES THIS PROCESS UNTIL PROGRAM TERMINATION
  135. X
  136. X  TTY input lines beginning with % have special significance
  137. X  (see ecuicmd.c)
  138. X------------------------------------------------------------------------*/
  139. Xint
  140. Xxmtr()
  141. X{
  142. Xuchar xmtr_char;
  143. Xuchar nlchar = NL;
  144. Xvoid xmtr_SIGINT_handler();
  145. X
  146. X    ttymode(1);
  147. X    xmtr_signals();
  148. X    while(1)
  149. X    {
  150. X/* bug somewhere ... may be SIGINT too rapidly causing SIG_IGN ????? */
  151. X        signal(SIGINT,xmtr_SIGINT_handler);    /* so make sure */
  152. X        xmtr_char = ttygetc(1);
  153. X
  154. X        if(xmtr_char & 0x80)
  155. X        {
  156. X            kbd_escape(xmtr_char);
  157. X            continue;
  158. X        }
  159. X
  160. X        lputc(xmtr_char);
  161. X        if(shm->Lfull_duplex == 0)        /* echo character if asked */
  162. X            write(TTYERR,&xmtr_char,1);
  163. X
  164. X        if(xmtr_char == CR)
  165. X        {
  166. X            if(shm->Ladd_nl_outgoing)
  167. X                lputc('\n');
  168. X            if(shm->Lfull_duplex == 0)
  169. X                write(TTYERR,&nlchar,1);
  170. X        }
  171. X    }        /* end of while we can read a character */
  172. X    return(HANGUP_XMTR_LOGIC_ERROR);    /* should not have gotten here */
  173. X
  174. X}    /* end of xmtr */
  175. X
  176. X/*+-------------------------------------------------------------------------
  177. X    main(argc,argv,envp)
  178. X
  179. X  main() program forks to create rcvr process; then main()
  180. X  becomes the xmtr process
  181. X------------------------------------------------------------------------*/
  182. Xmain(argc,argv,envp)
  183. Xint argc;
  184. Xchar **argv;
  185. Xchar **envp;
  186. X{
  187. Xint swchar;
  188. Xint itmp;
  189. Xulong colors_save;
  190. Xchar *get_ttyname();
  191. Xextern char *optarg;
  192. Xextern int optind;
  193. X
  194. X    setbuf(stderr,NULL);
  195. X    ttyinit();                /* init console tty mode handler */
  196. X    clear_screen();
  197. X    xmtr_pid = getpid();
  198. X    ftime(&starting_timeb);    /* get startup time */
  199. X
  200. X/* get this off quick, cause we'll be busy for a little while on 286 */
  201. X    sprintf(hello_str,"ecu %s.%02d%s by wht@n4hgf (pid %d)",
  202. X        numeric_revision,PATCHLEVEL,revision_modifier,xmtr_pid);
  203. X    ff(se,"%s\n",hello_str);
  204. X
  205. X/* if we are root (as we should be on 286 versions), nice to very bad
  206. X   and set uid to real uid */
  207. X
  208. X    uid = getuid();
  209. X    euid = geteuid();
  210. X    if((euid == 0) || (uid == 0))    /* if root running or prog text ... */
  211. X    {                                /* ... sets to root, then grab gusto */
  212. X    int old_nice = nice(0) + 20;
  213. X        nice(-old_nice + nice_value);
  214. X        if(uid != euid)                    /* but if user not really root ... */
  215. X        {
  216. X            if(setuid(uid))            /* ... take away the privilege */
  217. X            {
  218. X                ff(se,"\r\n");
  219. X                perror("setuid");
  220. X                ff(se,"\r\n");
  221. X                exit(-1);
  222. X            }
  223. X        }
  224. X    }
  225. X
  226. X    shm_init();                /* open shared segment */
  227. X
  228. X    keyset_init();            /* intialize keyset */
  229. X
  230. X    make_ecu_subdir();        /* needs to be very early before lots of init */
  231. X
  232. X    xmtr_signals();            /* catch xmtr signals */
  233. X
  234. X    get_curr_dir(curr_dir,sizeof(curr_dir));
  235. X    cd_array_init();        /* read %cd directory list */
  236. X
  237. X    hdb_init();
  238. X
  239. X    var_init();                /* initialize procedure variables */
  240. X    poutput_init();            /* initialize procedure output */
  241. X
  242. X    icmd_prompt = make_esd(64);
  243. X    set_default_escape_prompt();
  244. X    ttymode(1);                /* put user console in `raw' mode */
  245. X
  246. X/* init line variables */
  247. X    shm->Lline[0] = 0;                /* no line chosen yet */
  248. X    shm->Liofd = -1;                /* no line open now */
  249. X    shm->Lbaud = DEFAULT_BAUD_RATE;    /* see ecu.h */
  250. X    shm->Lparity = 0;                /* no parity selected ... default NONE */
  251. X    shm->Ltelno[0] = 0;                /* no telephone number for remote yet */
  252. X    shm->Llogical[0] = 0;            /* no logical name for remote yet */
  253. X    shm->Lrname[0] = 0;                /* no logical name for remote yet */
  254. X    shm->Ldescr[0] = 0;                /* no description for remote yet */
  255. X    shm->Lmodem_off_hook = 0;        /* assume modem on hook */
  256. X    shm->Ladd_nl_incoming = 0;        /* dont add nl to incoming cr */
  257. X    shm->Ladd_nl_outgoing = 0;        /* dont add nl to outgoing cr */
  258. X    shm->Lfull_duplex = 1;            /* assume full duplex */
  259. X    shm->Lmodem_already_init = 0;    /* modem has not been initialized */
  260. X    shm->Lxonxoff = IXON | IXOFF;    /* default to xon/xoff protocol */
  261. X    shm->xmtr_pid = getpid();
  262. X    shm->xmtr_ppid = getppid();
  263. X    shm->xmtr_pgrp = getpgrp(0);
  264. X    strcpy(shm->tty_name,get_ttyname());
  265. X    shm->shm_revision = SHM_REV;
  266. X
  267. X    while((swchar = getopt(argc,argv,"c:p:l:b:hfdDteo")) != -1)
  268. X    {
  269. X        switch(swchar)
  270. X        {
  271. X            case 'b':
  272. X                if(valid_baud_rate(shm->Lbaud = atoi(optarg)) < 0)
  273. X                {
  274. X                    ff(se,"invalid baud rate %u\r\n",shm->Lbaud);
  275. X                    usage();
  276. X                }
  277. X                break;
  278. X            case 'c':
  279. X                strcpy(modem_ctl_fname,optarg);
  280. X                break;
  281. X            case 'l':
  282. X                shm->Lline[0] = 0;
  283. X                if(strncmp(optarg,"/dev/tty",8))
  284. X                    strcpy(shm->Lline,"/dev/tty");
  285. X                strcat(shm->Lline,optarg);
  286. X                break;
  287. X            case 'p':
  288. X                strcpy(initial_procedure,optarg);
  289. X                break;
  290. X            case 'h': shm->Lfull_duplex = 0; break;
  291. X            case 'f': shm->Lfull_duplex = 1; break;
  292. X            case 'd': quit_on_init_proc_fail = 1; break;
  293. X            case 'D': quit_on_init_proc_done = 1; break;
  294. X            case 't': shm->Ladd_nl_incoming = 1;
  295. X                      shm->Ladd_nl_outgoing = 1; break;
  296. X            case 'e': shm->Lparity = 'e'; break;
  297. X            case 'o': shm->Lparity = 'o'; break;
  298. X            case '?': usage();
  299. X        }
  300. X    }
  301. X
  302. X/* check out line */
  303. X    if(!shm->Lline[0])
  304. X    {
  305. X        if(!there_is_hdb_on_this_machine)
  306. X            strcpy(shm->Lline,"/dev/tty1a");
  307. X        else
  308. X        {
  309. X            choose_line(shm->Lbaud);
  310. X            if(!shm->Lline[0])
  311. X            {
  312. X                ff(se,"\r\n");
  313. X                ff(se,"\r\n");
  314. X                stand_out();
  315. X                ff(se,"[no available Devices line at %u baud]",shm->Lbaud);
  316. X                stand_end();
  317. X                ff(se,"\r\n");
  318. X                strcpy(shm->Lline,"/dev/tty1a");
  319. X            }
  320. X        }
  321. X    }
  322. X
  323. X    if(initial_procedure[0])
  324. X    {
  325. X        init_proc_argv[0] = initial_procedure;
  326. X        init_proc_argc = 1;
  327. X        for(itmp = optind; itmp < argc; itmp++)
  328. X        {
  329. X            if(*argv[itmp] != '-')
  330. X            {
  331. X                if(init_proc_argc == MAX_PARGV)
  332. X                {
  333. X                    ff(se,"too many arguments to initial procedure\r\n");
  334. X                    hangup(HANGUP_USAGE);
  335. X                }
  336. X                init_proc_argv[init_proc_argc++] = argv[itmp];
  337. X            }
  338. X        }
  339. X
  340. X        /* wierd bug fixed by this ... I know not why */
  341. X        windows_start();
  342. X        windows_end2();
  343. X        fflush(so);
  344. X
  345. X        ttymode(2);
  346. X        if(do_proc(init_proc_argc,init_proc_argv))
  347. X        {
  348. X            if(quit_on_init_proc_fail || quit_on_init_proc_done)
  349. X                hangup(HANGUP_INIT_PROC_ERROR);
  350. X        }
  351. X        proc_file_reset();
  352. X        colors_save = colors_current;
  353. X        setcolor(colors_notify);
  354. X        fputs("[procedure finished]",se);
  355. X        setcolor(colors_save);
  356. X        ff(se,"\r\n");
  357. X        if(quit_on_init_proc_done)
  358. X            hangup(0);
  359. X        if(shm->Liofd < 0)
  360. X        {
  361. X            ff(se,"\r\n");
  362. X            ff(se,"\r\n");
  363. X            stand_out();
  364. X            ff(se, "[no line attached by initial procedure]");
  365. X            stand_end();
  366. X            ff(se,"\r\n");
  367. X            if(quit_on_init_proc_fail)
  368. X                hangup(HANGUP_INIT_PROC_ERROR);
  369. X            stand_out();
  370. X            ff(se, "[press ESC to exit or SPACE for setup menu]");
  371. X            stand_end();
  372. X            itmp = ttygetc(0);
  373. X            ff(se,"\r\n");
  374. X            if(itmp == ESC)
  375. X                hangup(1);
  376. X            ttymode(1);    
  377. X            setup_screen((char *)0);
  378. X        }
  379. X        else
  380. X        {
  381. X
  382. X            ttymode(1);
  383. X            start_rcvr_process(0);
  384. X        }
  385. X    }
  386. X    else        /* no initial procedure */
  387. X    {
  388. X        ttymode(1);    
  389. X        setup_screen((optind < argc) ? argv[optind] : (char *)0);
  390. X    }
  391. X
  392. X    hangup(xmtr());            /* enter xmtr operation */
  393. X    /*NOTREACHED*/
  394. X}    /* end of main */
  395. X
  396. X/* end of ecu.c */
  397. X/* vi: set tabstop=4 shiftwidth=4: */
  398. SHAR_EOF
  399. $TOUCH -am 0701191590 ecu.c &&
  400. chmod 0644 ecu.c ||
  401. echo "restore of ecu.c failed"
  402. set `wc -c ecu.c`;Wc_c=$1
  403. if test "$Wc_c" != "9366"; then
  404.     echo original size 9366, current size $Wc_c
  405. fi
  406. # ============= help/lint_args.h ==============
  407. if test ! -d 'help'; then
  408.     echo "x - creating directory help"
  409.     mkdir 'help'
  410. fi
  411. echo "x - extracting help/lint_args.h (Text)"
  412. sed 's/^X//' << 'SHAR_EOF' > help/lint_args.h &&
  413. X/* CHK=0x83EF */
  414. X/*+-----------------------------------------------------------------------
  415. X    lint_args.h
  416. X------------------------------------------------------------------------*/
  417. X/*+:EDITS:*/
  418. X/*:07-01-1990-19:18-afterlint-creation */
  419. X
  420. X#ifndef BUILDING_LINT_ARGS
  421. X#ifdef LINT_ARGS
  422. X
  423. X/* helpgen.c */
  424. Xint cmd_baud(void );
  425. Xint cmd_break(void );
  426. Xint cmd_cd(void );
  427. Xint cmd_clrx(void );
  428. Xint cmd_cls(void );
  429. Xint cmd_color(void );
  430. Xint cmd_continue(void );
  431. Xint cmd_cursor(void );
  432. Xint cmd_delline(void );
  433. Xint cmd_dial(void );
  434. Xint cmd_do(void );
  435. Xint cmd_duplex(void );
  436. Xint cmd_echo(void );
  437. Xint cmd_eeol(void );
  438. Xint cmd_else(void );
  439. Xint cmd_exit(void );
  440. Xint cmd_expresp(void );
  441. Xint cmd_fchmod(void );
  442. Xint cmd_fclose(void );
  443. Xint cmd_fdel(void );
  444. Xint cmd_fgetc(void );
  445. Xint cmd_fgets(void );
  446. Xint cmd_fkey(void );
  447. Xint cmd_flush(void );
  448. Xint cmd_fopen(void );
  449. Xint cmd_fputc(void );
  450. Xint cmd_fputs(void );
  451. Xint cmd_fread(void );
  452. Xint cmd_fseek(void );
  453. Xint cmd_fwrite(void );
  454. Xint cmd_getf(void );
  455. Xint cmd_goto(void );
  456. Xint cmd_gotob(void );
  457. Xint cmd_hangup(void );
  458. Xint cmd_hexdump(void );
  459. Xint cmd_home(void );
  460. Xint cmd_icolor(void );
  461. Xint cmd_ifi(void );
  462. Xint cmd_ifs(void );
  463. Xint cmd_insline(void );
  464. Xint cmd_lbreak(void );
  465. Xint cmd_lgets(void );
  466. Xint cmd_logevent(void );
  467. Xint cmd_lookfor(void );
  468. Xint cmd_mkvar(void );
  469. Xint cmd_nap(void );
  470. Xint cmd_parity(void );
  471. Xint cmd_pclose(void );
  472. Xint cmd_plog(void );
  473. Xint cmd_popen(void );
  474. Xint cmd_prompt(void );
  475. Xint cmd_ptrace(void );
  476. Xint cmd_putf(void );
  477. Xint cmd_return(void );
  478. Xint cmd_rk(void );
  479. Xint cmd_rname(void );
  480. Xint cmd_rs(void );
  481. Xint cmd_rx(void );
  482. Xint cmd_ry(void );
  483. Xint cmd_rz(void );
  484. Xint cmd_scrdump(void );
  485. Xint cmd_send(void );
  486. Xint cmd_set(void );
  487. Xint cmd_sk(void );
  488. Xint cmd_ss(void );
  489. Xint cmd_sx(void );
  490. Xint cmd_sy(void );
  491. Xint cmd_system(void );
  492. Xint cmd_sz(void );
  493. Xint cmd_vidcolor(void );
  494. Xint cmd_vidnorm(void );
  495. Xint cmd_vidrev(void );
  496. Xint cmd_whilei(void );
  497. Xint cmd_whiles(void );
  498. Xint cmd_xon(void );
  499. Xint main(int ,char **,char **);
  500. Xint usage(void );
  501. Xstruct p_cmd *search_cmd_list(char *);
  502. Xvoid build_ecudoc(void );
  503. Xvoid build_ecuhelp(void );
  504. Xvoid build_ecutxt(void );
  505. Xvoid show_cmds(void );
  506. Xvoid test_help(void );
  507. X/* util.c */
  508. Xchar to_lower(char );
  509. Xchar to_upper(char );
  510. Xvoid pad_zstr_to_len(char *,int );
  511. X
  512. X#else        /* compiler doesn't know about prototyping */
  513. X
  514. X/* helpgen.c */
  515. Xstruct p_cmd *search_cmd_list();
  516. Xvoid build_ecudoc();
  517. Xvoid build_ecuhelp();
  518. Xvoid build_ecutxt();
  519. Xvoid show_cmds();
  520. Xvoid test_help();
  521. X/* util.c */
  522. Xchar to_lower();
  523. Xchar to_upper();
  524. Xvoid pad_zstr_to_len();
  525. X
  526. X#endif /* LINT_ARGS */
  527. X#endif /* BUILDING_LINT_ARGS */
  528. X
  529. X/* end of lint_args.h */
  530. SHAR_EOF
  531. $TOUCH -am 0701191890 help/lint_args.h &&
  532. chmod 0644 help/lint_args.h ||
  533. echo "restore of help/lint_args.h failed"
  534. set `wc -c help/lint_args.h`;Wc_c=$1
  535. if test "$Wc_c" != "2587"; then
  536.     echo original size 2587, current size $Wc_c
  537. fi
  538. # ============= ECU280.P04 ==============
  539. echo "x - extracting ECU280.P04 (Text)"
  540. sed 's/^X//' << 'SHAR_EOF' > ECU280.P04 &&
  541. X#-------------------------------------------------------
  542. X# ECU280.P04
  543. X# miscellaneous (see README)
  544. X# created by gendiff x1.03 on 02 Jul 1990 00:09 UTC
  545. X#-------------------------------------------------------
  546. X*** /u4/ecurel/Make.ecu    Sun Jul  1 20:08:15 1990
  547. X--- Make.ecu    Mon Jun 25 02:37:50 1990
  548. X***************
  549. X*** 81,87
  550. X  .c.o:;    /bin/time cc -c $(CFLAGS) $*.c 
  551. X  
  552. X  SHARFLS = README Make.ecu *.c *.h \
  553. X! help/Makefile  help/*.{c,src} \
  554. X  ecufriend/{Makefile,*.{c,h}} \
  555. X  ecuungetty/Makefile ecuungetty/*.{c,h} \
  556. X  mapkey/README mapkey/keys.usa.ecu.d\
  557. X
  558. X--- 81,87 -----
  559. X  .c.o:;    /bin/time cc -c $(CFLAGS) $*.c 
  560. X  
  561. X  SHARFLS = README Make.ecu *.c *.h \
  562. X! help/Makefile  help/*.{h,c,src} \
  563. X  ecufriend/{Makefile,*.{c,h}} \
  564. X  ecuungetty/Makefile ecuungetty/*.{c,h} \
  565. X  mapkey/README mapkey/keys.usa.ecu.d\
  566. X*** /u4/ecurel/README    Sun Jul  1 20:08:16 1990
  567. X--- README    Sun Jul  1 19:46:21 1990
  568. X***************
  569. X*** 341,343
  570. X  
  571. X  2.  The built-in help file (ecuhelp.data) was revised.
  572. X  
  573. X
  574. X--- 341,374 -----
  575. X  
  576. X  2.  The built-in help file (ecuhelp.data) was revised.
  577. X  
  578. X+ Changes since ecu 2.80 patchlevel 2
  579. X+ 
  580. X+ 1.  Patch 3 added a window mode selection to the sz file transfer menu;
  581. X+     also, the unacknowledged data quantity (called "window") was
  582. X+     added to the sz file transfer display.
  583. X+ 
  584. X+ Changes since ecu 2.80 patchlevel 3
  585. X+ 
  586. X+ 1.  A problem with passing arguments to an initial procedure was
  587. X+     fixed.  Getopt() is now used, which requires that all switch
  588. X+     command arguments must precede the non-switch arguments.
  589. X+     This was not true in previous revisions of ecu.
  590. X+ 
  591. X+ 2.  A new (non-standard) escape sequence has been added to the
  592. X+     expresp procedure command.  \m### causes a ### millisecond delay.
  593. X+     Note this adds an ambiguity to the syntax of the send string:
  594. X+     you may not follow an \m delay with a literal digit to send.
  595. X+     For example, suppose you wish to delay 300 missileconds then
  596. X+     send "4A".  \m3004A will delay for 3004 (approximately) milliseconds,
  597. X+     then send an "A".  You must, instead, use \m300\034A to achieve
  598. X+     the desired result.
  599. X+ 
  600. X+ 3.  The method of choosing a shared memory segment key changed.
  601. X+     Previously, ftok() was used.  Now, the algorithm is 
  602. X+         0xEC000000L | getpid();
  603. X+ 
  604. X+ 4.  The -D switch has been added to cause ecu to terminate
  605. X+     unconditionally upon completion of an initial procedure (-p).
  606. X+ 
  607. X+ 5.  Other minor unreported bugs were fixed.
  608. X+ 
  609. X*** /u4/ecurel/doc/_features.txt    Fri Apr 20 00:43:00 1990
  610. X--- doc/_features.txt    Sun Jun 10 13:35:44 1990
  611. X***************
  612. X*** 262,268
  613. X  process concept through commands and functions which allow
  614. X  .BL
  615. X  .LI
  616. X! passing the ECU shared memory segment id (shmid) to a called
  617. X  program,
  618. X  .LI
  619. X  reading a single character or string of characters from
  620. X
  621. X--- 262,268 -----
  622. X  process concept through commands and functions which allow
  623. X  .BL
  624. X  .LI
  625. X! passing the ECU shared memory segment id (%shmid) to a called
  626. X  program,
  627. X  .LI
  628. X  reading a single character or string of characters from
  629. X***************
  630. X*** 273,278
  631. X  reading and writing of characters, short or long integers and
  632. X  strings in the 1024-byte "friend" shared memory data area.
  633. X  .LE
  634. X  
  635. X  This facility allows batch and interactive applications
  636. X  to be developed with C programs which would be
  637. X
  638. X--- 273,295 -----
  639. X  reading and writing of characters, short or long integers and
  640. X  strings in the 1024-byte "friend" shared memory data area.
  641. X  .LE
  642. X+ 
  643. X+ The algorithm for obtaining the shared memory segment key is
  644. X+ .DS L
  645. X+ 0xEC000000L + transmitter process id
  646. X+ .DE
  647. X+ Thus a "friend" process may either use a %shmid 
  648. X+ .B
  649. X+ shared memory key
  650. X+ .R
  651. X+ passed as an argument or obtain the 
  652. X+ .B
  653. X+ shared memory key
  654. X+ .R
  655. X+ by using:
  656. X+ .DS L
  657. X+ key_t shmkey = 0xEC000000L | getppid();
  658. X+ .DE
  659. X  
  660. X  This facility allows batch and interactive applications
  661. X  to be developed with C programs which would be
  662. X*** /u4/ecurel/doc/_p_cmd.txt    Sun Jul  1 20:07:13 1990
  663. X--- doc/_p_cmd.txt    Sun Jun 10 14:00:30 1990
  664. X***************
  665. X*** 455,460
  666. X     \\\c - no new-line
  667. X     \\\n - send new-line
  668. X     \\\nnn - send octal number
  669. X     Speed - Hayes-specific speed-adaptive connect handler
  670. X  .DE
  671. X  
  672. X
  673. X--- 455,462 -----
  674. X     \\\c - no new-line
  675. X     \\\n - send new-line
  676. X     \\\nnn - send octal number
  677. X+    \\\m## - delay ## milliseconds (NOT SUPPORTED BY DIALERS;
  678. X+             SEE BELOW)
  679. X     Speed - Hayes-specific speed-adaptive connect handler
  680. X  .DE
  681. X  
  682. X***************
  683. X*** 464,469
  684. X  The resolution for timeouts is limited to the basic tick time of
  685. X  your system (HZ, 10 msec for UNIX/386, 20 msec for XENIX/386 and XENIX/286).
  686. X  The timeout for 'Speed' expects is fixed at 90 seconds.
  687. X  
  688. X  .*s 3 "fchmod"
  689. X  
  690. X
  691. X--- 466,480 -----
  692. X  The resolution for timeouts is limited to the basic tick time of
  693. X  your system (HZ, 10 msec for UNIX/386, 20 msec for XENIX/386 and XENIX/286).
  694. X  The timeout for 'Speed' expects is fixed at 90 seconds.
  695. X+ 
  696. X+ 
  697. X+ \\\m### causes a ### millisecond delay.  Note this adds an ambiguity to
  698. X+ the syntax of the send string: you may not follow an \m delay with a
  699. X+ literal digit to send.  For example, suppose you wish to delay 300
  700. X+ missileconds then send "4A".  \\\m3004A will delay for 3004
  701. X+ (approximately) milliseconds, then send an "A".  You must, instead, use
  702. X+ \\\m300\\\034A to achieve the desired result.
  703. X+ 
  704. X  
  705. X  .*s 3 "fchmod"
  706. X  
  707. X*** /u4/ecurel/doc/_startup.txt    Sat Apr 14 23:24:00 1990
  708. X--- doc/_startup.txt    Sun Jul  1 19:12:17 1990
  709. X***************
  710. X*** 107,114
  711. X  .DS I
  712. X  ecu [-lxx] [-b<baud>] [-h] [-e|-o] [-t] <tel-number>
  713. X  ecu [-lxx] [-b<baud>] [-h] [-e|-o] [-t]
  714. X! ecu [-t] <logical>
  715. X! ecu [-lxx] [-b<baud>] [-h] [-e|-o] [-d] -p <proc> [<arg> ...]
  716. X  .DE
  717. X  
  718. X  .*s 3 "-l"
  719. X
  720. X--- 107,114 -----
  721. X  .DS I
  722. X  ecu [-lxx] [-b<baud>] [-h] [-e|-o] [-t] <tel-number>
  723. X  ecu [-lxx] [-b<baud>] [-h] [-e|-o] [-t]
  724. X! ecu [-t] [-h] <logical>
  725. X! ecu [-lxx] [-b<baud>] [-h] [-e|-o] [-d] [-D] -p <proc> [<arg> ...]
  726. X  .DE
  727. X  
  728. X  .*s 3 "Non-Switch Arguments"
  729. X***************
  730. X*** 111,116
  731. X  ecu [-lxx] [-b<baud>] [-h] [-e|-o] [-d] -p <proc> [<arg> ...]
  732. X  .DE
  733. X  
  734. X  .*s 3 "-l"
  735. X  
  736. X  When ECU starts up, it normally chooses a line as described later
  737. X
  738. X--- 111,159 -----
  739. X  ecu [-lxx] [-b<baud>] [-h] [-e|-o] [-d] [-D] -p <proc> [<arg> ...]
  740. X  .DE
  741. X  
  742. X+ .*s 3 "Non-Switch Arguments"
  743. X+ 
  744. X+ Only one type of non-switch argument may be used on the command line.
  745. X+ <tel-number> or <logical> may appear when the -p switch is absent.
  746. X+ One or more <arg> arguments may appear when the -p switch is used.
  747. X+ 
  748. X+ .*s 3 "<tel-number>"
  749. X+ 
  750. X+ This type of argument has a digit as its initial character and
  751. X+ represents an actual telephone number to be passed to a modem
  752. X+ dialer program or Dialers chat script.  The string may contain
  753. X+ non-numeric characters if appropriate for a dialer program,
  754. X+ such as dialTBIT.  For example:
  755. X+ .DS L
  756. X+     ecu -l/dev/tty2a -b 19200 -e 5551212UC
  757. X+ .DE
  758. X+ uses tty2a (assumed to be connected to a Trailblazer modem) and
  759. X+ establishes a 19200 baud, even parity PEP Compressed connection
  760. X+ after dialing 5551212.
  761. X+ 
  762. X+ .*s 3 "<logical>"
  763. X+ 
  764. X+ This type of argument has an alphabetic initial character and
  765. X+ causes the dialing directory entry by that name to be dialed.
  766. X+ The line may be specified by '-l', but if the dialing directory
  767. X+ specifies a line (tty field contaions other than 'Any'), the
  768. X+ dialing directory entry will override it.  The '-b', '-e' and '-o'
  769. X+ switches are ignored; the values specified by the dialing directory
  770. X+ entry are used.  The '-t' and '-h' switches are valid and honored
  771. X+ if present.
  772. X+ 
  773. X+ .*s 3 "<arg>"
  774. X+ 
  775. X+ This type of argument is passed to an initial procedure when
  776. X+ the -p switch is present.
  777. X+ 
  778. X+ .DS L
  779. X+ ecu -p unixlogin user pwd ansi43
  780. X+ .DE
  781. X+ executes unixlogin.ep with arguments 'user' 'pwd' 'ansi43'
  782. X+ 
  783. X+ For more detail, refer to the description of -p, -d and -D below.
  784. X+ 
  785. X  .*s 3 "-l"
  786. X  
  787. X  When ECU starts up, it normally chooses a line as described later
  788. X***************
  789. X*** 172,178
  790. X  -d switch
  791. X  .R
  792. X  instructs ECU to "die" (terminate with error status) if
  793. X! any specified initial procedure fails.  This switch ensures a batch
  794. X  ECU execution will hang up any connection and terminate if
  795. X  a procedure error occurs.
  796. X  
  797. X
  798. X--- 215,221 -----
  799. X  -d switch
  800. X  .R
  801. X  instructs ECU to "die" (terminate with error status) if
  802. X! an initial procedure (-p) fails.  This switch ensures a batch
  803. X  ECU execution will hang up any connection and terminate if
  804. X  a procedure error occurs. See also -D below.
  805. X  
  806. X***************
  807. X*** 174,180
  808. X  instructs ECU to "die" (terminate with error status) if
  809. X  any specified initial procedure fails.  This switch ensures a batch
  810. X  ECU execution will hang up any connection and terminate if
  811. X! a procedure error occurs.
  812. X  
  813. X  Absence of the
  814. X  .B
  815. X
  816. X--- 217,223 -----
  817. X  instructs ECU to "die" (terminate with error status) if
  818. X  an initial procedure (-p) fails.  This switch ensures a batch
  819. X  ECU execution will hang up any connection and terminate if
  820. X! a procedure error occurs. See also -D below.
  821. X  
  822. X  Absence of the
  823. X  .B -d
  824. X***************
  825. X*** 177,185
  826. X  a procedure error occurs.
  827. X  
  828. X  Absence of the
  829. X! .B
  830. X! -d switch
  831. X! .R
  832. X  causes ecu (upon any completion of the
  833. X  initial procedure) to enter the 1) interactive mode if a line
  834. X  was successfully attached by the procedure or 2) the setup menu
  835. X
  836. X--- 220,229 -----
  837. X  a procedure error occurs. See also -D below.
  838. X  
  839. X  Absence of the
  840. X! .B -d
  841. X! and
  842. X! .B -D
  843. X! switches
  844. X  causes ecu (upon any completion of the
  845. X  initial procedure) to enter the 1) interactive mode if a line
  846. X  was successfully attached by the procedure or 2) the setup menu
  847. X***************
  848. X*** 183,189
  849. X  causes ecu (upon any completion of the
  850. X  initial procedure) to enter the 1) interactive mode if a line
  851. X  was successfully attached by the procedure or 2) the setup menu
  852. X! if not line was attached.
  853. X  
  854. X  .*s 3 "-t"
  855. X  
  856. X
  857. X--- 227,242 -----
  858. X  causes ecu (upon any completion of the
  859. X  initial procedure) to enter the 1) interactive mode if a line
  860. X  was successfully attached by the procedure or 2) the setup menu
  861. X! if no line was attached.
  862. X! 
  863. X! .*s 3 "-D"
  864. X! 
  865. X! The
  866. X! .B
  867. X! -D switch
  868. X! .R
  869. X! instructs ECU to unconditionally terminate when an
  870. X! initial procedure finishes.
  871. X  
  872. X  .*s 3 "-t"
  873. X  
  874. X*** /u4/ecurel/doc/_top.txt    Sun Jul  1 20:07:14 1990
  875. X--- doc/_top.txt    Sun Jun 10 13:57:32 1990
  876. X***************
  877. X*** 27,33
  878. X  .sp 1i
  879. X  .ce 100
  880. X  Technical Description
  881. X! Revision 1.23 (ecu 2.80.01)
  882. X  \n(mo/\n(dy/\n(yr
  883. X  .ce 0
  884. X  .ls 1
  885. X
  886. X--- 27,33 -----
  887. X  .sp 1i
  888. X  .ce 100
  889. X  Technical Description
  890. X! Revision 1.24 (ecu 2.80.04)
  891. X  \n(mo/\n(dy/\n(yr
  892. X  .ce 0
  893. X  .ls 1
  894. X*** /u4/ecurel/ecufork.c    Wed May  9 09:16:00 1990
  895. X--- ecufork.c    Sat Jun  9 01:37:06 1990
  896. X***************
  897. X*** 174,180
  898. X  static int path_count = 0;
  899. X  char *cptr;
  900. X  char *getenv();
  901. X- char *str_token();
  902. X  
  903. X      if(path_buf == (char *)0)
  904. X      {
  905. X
  906. X--- 174,179 -----
  907. X  static int path_count = 0;
  908. X  char *cptr;
  909. X  char *getenv();
  910. X  
  911. X      if(path_buf == (char *)0)
  912. X      {
  913. X*** /u4/ecurel/ecuicmd.c    Sun Jul  1 20:08:17 1990
  914. X--- ecuicmd.c    Mon Jun  4 17:16:15 1990
  915. X***************
  916. X*** 10,15
  917. X  
  918. X  ------------------------------------------------------------------------*/
  919. X  /*+:EDITS:*/
  920. X  /*:05-10-1990-16:44-wht@n4hgf-move patchlevel to ecu.c hello_str */
  921. X  /*:05-07-1990-21:23-wht@n4hgf---- 2.80 --- */
  922. X  /*:04-17-1990-15:26-wht@n4hgf-add icmd call to icmd_history_add */
  923. X
  924. X--- 10,16 -----
  925. X  
  926. X  ------------------------------------------------------------------------*/
  927. X  /*+:EDITS:*/
  928. X+ /*:05-30-1990-01:04-wht@n4hgf-split stat "Connected" line into two lines */
  929. X  /*:05-10-1990-16:44-wht@n4hgf-move patchlevel to ecu.c hello_str */
  930. X  /*:05-07-1990-21:23-wht@n4hgf---- 2.80 --- */
  931. X  /*:04-17-1990-15:26-wht@n4hgf-add icmd call to icmd_history_add */
  932. X***************
  933. X*** 512,520
  934. X              (shm->Lparity) ? to_upper(shm->Lparity) : 'N');
  935. X          if(shm->Lmodem_off_hook)
  936. X          {
  937. X!             ff(se,"Connected to %s: %s (%s) at %s (elapsed %s)\r\n",
  938. X!                 shm->Lrname,
  939. X!                 shm->Ldescr,shm->Ltelno,
  940. X                  epoch_secs_to_str(shm->Loff_hook_time,1,s80),
  941. X                  get_elapsed_time(time((long *)0) - shm->Loff_hook_time));
  942. X          }
  943. X
  944. X--- 513,521 -----
  945. X              (shm->Lparity) ? to_upper(shm->Lparity) : 'N');
  946. X          if(shm->Lmodem_off_hook)
  947. X          {
  948. X!             ff(se,"Connected to %s: %s (%s)\r\n",
  949. X!                 shm->Lrname,shm->Ldescr,shm->Ltelno);
  950. X!             ff(se,"at %s (elapsed %s)\r\n",
  951. X                  epoch_secs_to_str(shm->Loff_hook_time,1,s80),
  952. X                  get_elapsed_time(time((long *)0) - shm->Loff_hook_time));
  953. X          }
  954. X*** /u4/ecurel/eculine.c    Sun Jul  1 20:07:33 1990
  955. X--- eculine.c    Sun Jun 24 19:31:11 1990
  956. X***************
  957. X*** 8,13
  958. X      lbreak()
  959. X      lclear_xmtr_xoff()
  960. X      lclose()
  961. X      lflush(flush_type)
  962. X      lget_xon_xoff(ixon,ixoff)
  963. X      lgetc_timeout(msec)
  964. X
  965. X--- 8,14 -----
  966. X      lbreak()
  967. X      lclear_xmtr_xoff()
  968. X      lclose()
  969. X+     ldraino(inflush_flag)
  970. X      lflush(flush_type)
  971. X      lget_xon_xoff(ixon,ixoff)
  972. X      lgetc_timeout(msec)
  973. X***************
  974. X*** 35,40
  975. X  
  976. X  ------------------------------------------------------------------------*/
  977. X  /*+:EDITS:*/
  978. X  /*:05-07-1990-21:23-wht@n4hgf---- 2.80 --- */
  979. X  /*:04-19-1990-03:07-wht@n4hgf-GCC run found unused vars -- rm them */
  980. X  /*:04-10-1990-17:34-wht@n4hgf-provisions for ecu xmtr logging when rcvr dead */
  981. X
  982. X--- 36,42 -----
  983. X  
  984. X  ------------------------------------------------------------------------*/
  985. X  /*+:EDITS:*/
  986. X+ /*:05-31-1990-15:56-wht@n4hgf-add ldraino */
  987. X  /*:05-07-1990-21:23-wht@n4hgf---- 2.80 --- */
  988. X  /*:04-19-1990-03:07-wht@n4hgf-GCC run found unused vars -- rm them */
  989. X  /*:04-10-1990-17:34-wht@n4hgf-provisions for ecu xmtr logging when rcvr dead */
  990. X***************
  991. X*** 556,561
  992. X      ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);
  993. X  
  994. X  }    /* end of lreset_ksr */
  995. X  
  996. X  /*+-----------------------------------------------------------------------
  997. X      lputc(lchar) -- write lchar to comm line
  998. X
  999. X--- 558,576 -----
  1000. X      ioctl(shm->Liofd,TCSETA,(char *)&Ltermio);
  1001. X  
  1002. X  }    /* end of lreset_ksr */
  1003. X+ 
  1004. X+ /*+-------------------------------------------------------------------------
  1005. X+     ldraino(inflush_flag) - wait for output to drain
  1006. X+ 
  1007. X+ If inflush_flag is set, also flush input after output drains
  1008. X+ --------------------------------------------------------------------------*/
  1009. X+ void
  1010. X+ ldraino(inflush_flag)
  1011. X+ int inflush_flag;
  1012. X+ {
  1013. X+     ioctl(shm->Liofd,(inflush_flag) ? TCSETAF : TCSETAW,(char *)&Ltermio);
  1014. X+ 
  1015. X+ }    /* end of ldraino */
  1016. X  
  1017. X  /*+-----------------------------------------------------------------------
  1018. X      lputc(lchar) -- write lchar to comm line
  1019. X*** /u4/ecurel/ecunumrev.c    Sun Jul  1 20:08:19 1990
  1020. X--- ecunumrev.c    Sun Jun 24 19:13:17 1990
  1021. X***************
  1022. X*** 16,22
  1023. X  #endif
  1024. X  
  1025. X  #ifdef WHT
  1026. X! char *numeric_revision = "twx280.07";
  1027. X  #else
  1028. X  #ifdef SCO
  1029. X  char *numeric_revision = "sco2.80";
  1030. X
  1031. X--- 16,22 -----
  1032. X  #endif
  1033. X  
  1034. X  #ifdef WHT
  1035. X! char *numeric_revision = "twx280.14";
  1036. X  #else
  1037. X  #ifdef SCO
  1038. X  char *numeric_revision = "sco2.80";
  1039. X*** /u4/ecurel/ecushm.c    Mon May  7 23:33:00 1990
  1040. X--- ecushm.c    Sun Jun 10 15:47:12 1990
  1041. X***************
  1042. X*** 19,24
  1043. X  
  1044. X  --------------------------------------------------------------------------*/
  1045. X  /*+:EDITS:*/
  1046. X  /*:05-07-1990-21:23-wht@n4hgf---- 2.80 --- */
  1047. X  /*:04-19-1990-03:07-wht@n4hgf-GCC run found unused vars -- rm them */
  1048. X  /*:03-25-1990-14:11-wht@n4hgf------ x2.70 ------- */
  1049. X
  1050. X--- 19,25 -----
  1051. X  
  1052. X  --------------------------------------------------------------------------*/
  1053. X  /*+:EDITS:*/
  1054. X+ /*:06-02-1990-11:51-wht@n4hgf-new key determination */
  1055. X  /*:05-07-1990-21:23-wht@n4hgf---- 2.80 --- */
  1056. X  /*:04-19-1990-03:07-wht@n4hgf-GCC run found unused vars -- rm them */
  1057. X  /*:03-25-1990-14:11-wht@n4hgf------ x2.70 ------- */
  1058. X***************
  1059. X*** 56,63
  1060. X  extern int rcvr_log_gen_title;
  1061. X  
  1062. X  ECU_SDS FAR *shm;                /* shared segment pointer */
  1063. X! char shm_name[130] = "";        /* filename from which to derive key */
  1064. X! key_t    shm_key;
  1065. X  int shm_shmid;
  1066. X  
  1067. X  /*+-------------------------------------------------------------------------
  1068. X
  1069. X--- 57,63 -----
  1070. X  extern int rcvr_log_gen_title;
  1071. X  
  1072. X  ECU_SDS FAR *shm;                /* shared segment pointer */
  1073. X! key_t shm_key;
  1074. X  int shm_shmid;
  1075. X  
  1076. X  /*+-------------------------------------------------------------------------
  1077. X***************
  1078. X*** 66,73
  1079. X  --------------------------------------------------------------------------*/
  1080. X  shm_init()
  1081. X  {
  1082. X- uint old_umask = umask(0);
  1083. X- int fd;
  1084. X  char FAR *shmat();
  1085. X  
  1086. X      sprintf(shm_name,"/tmp/ecu%05d.shm",getpid());
  1087. X
  1088. X--- 66,71 -----
  1089. X  --------------------------------------------------------------------------*/
  1090. X  shm_init()
  1091. X  {
  1092. X  char FAR *shmat();
  1093. X  
  1094. X      shm_key = 0xEC000000L | getpid();
  1095. X***************
  1096. X*** 70,84
  1097. X  int fd;
  1098. X  char FAR *shmat();
  1099. X  
  1100. X!     sprintf(shm_name,"/tmp/ecu%05d.shm",getpid());
  1101. X!     if((fd = open(shm_name,O_CREAT | O_RDWR,0600)) < 0)
  1102. X!     {
  1103. X!         fputs("creation of ",se);
  1104. X!         perror(shm_name);
  1105. X!         umask(old_umask);
  1106. X!         exit(11);
  1107. X!     }
  1108. X!     close(fd);
  1109. X  
  1110. X      if((shm_key = ftok(shm_name,1)) < 0)
  1111. X      {
  1112. X
  1113. X--- 68,74 -----
  1114. X  {
  1115. X  char FAR *shmat();
  1116. X  
  1117. X!     shm_key = 0xEC000000L | getpid();
  1118. X  
  1119. X      if((shm_shmid = shmget(shm_key,sizeof(ECU_SDS),IPC_CREAT | 0600)) < 0)
  1120. X      {
  1121. X***************
  1122. X*** 80,95
  1123. X      }
  1124. X      close(fd);
  1125. X  
  1126. X-     if((shm_key = ftok(shm_name,1)) < 0)
  1127. X-     {
  1128. X-         fputs("ftok of ",se);
  1129. X-         perror(shm_name);
  1130. X-         umask(old_umask);
  1131. X-         unlink(shm_name);
  1132. X-         exit(11);
  1133. X-     }
  1134. X-     unlink(shm_name);
  1135. X- 
  1136. X      if((shm_shmid = shmget(shm_key,sizeof(ECU_SDS),IPC_CREAT | 0600)) < 0)
  1137. X      {
  1138. X          perror("shmget");
  1139. X
  1140. X--- 70,75 -----
  1141. X  
  1142. X      shm_key = 0xEC000000L | getpid();
  1143. X  
  1144. X      if((shm_shmid = shmget(shm_key,sizeof(ECU_SDS),IPC_CREAT | 0600)) < 0)
  1145. X      {
  1146. X          perror("shmget");
  1147. X***************
  1148. X*** 93,99
  1149. X      if((shm_shmid = shmget(shm_key,sizeof(ECU_SDS),IPC_CREAT | 0600)) < 0)
  1150. X      {
  1151. X          perror("shmget");
  1152. X-         umask(old_umask);
  1153. X          exit(11);
  1154. X      }
  1155. X  
  1156. X
  1157. X--- 73,78 -----
  1158. X      if((shm_shmid = shmget(shm_key,sizeof(ECU_SDS),IPC_CREAT | 0600)) < 0)
  1159. X      {
  1160. X          perror("shmget");
  1161. X          exit(11);
  1162. X      }
  1163. X  
  1164. X***************
  1165. X*** 100,106
  1166. X      if(((char FAR *)shm = shmat(shm_shmid,(char FAR *)0,0)) == (char FAR *)-1)
  1167. X      {
  1168. X          perror("shmat");
  1169. X-         umask(old_umask);
  1170. X          exit(11);
  1171. X      }
  1172. X  
  1173. X
  1174. X--- 79,84 -----
  1175. X      if(((char FAR *)shm = shmat(shm_shmid,(char FAR *)0,0)) == (char FAR *)-1)
  1176. X      {
  1177. X          perror("shmat");
  1178. X          exit(11);
  1179. X      }
  1180. X  
  1181. X***************
  1182. X*** 103,110
  1183. X          umask(old_umask);
  1184. X          exit(11);
  1185. X      }
  1186. X- 
  1187. X-     umask(old_umask);
  1188. X  
  1189. X      shm->xcmd = 0;    /* signal from xmtr to rcvr SIGUSR2 */
  1190. X      shm->xi1 = 0;    /* parameters */
  1191. X
  1192. X--- 81,86 -----
  1193. X          perror("shmat");
  1194. X          exit(11);
  1195. X      }
  1196. X  
  1197. X      shm->xcmd = 0;    /* signal from xmtr to rcvr SIGUSR2 */
  1198. X      shm->xi1 = 0;    /* parameters */
  1199. X*** /u4/ecurel/ecuusage.c    Mon May  7 23:33:00 1990
  1200. X--- ecuusage.c    Sun Jul  1 19:06:42 1990
  1201. X***************
  1202. X*** 10,15
  1203. X  
  1204. X  ------------------------------------------------------------------------*/
  1205. X  /*+:EDITS:*/
  1206. X  /*:05-07-1990-21:24-wht@n4hgf---- 2.80 --- */
  1207. X  /*:03-25-1990-14:11-wht@n4hgf------ x2.70 ------- */
  1208. X  /*:07-03-1989-22:57-wht------ x2.00 ----- */
  1209. X
  1210. X--- 10,16 -----
  1211. X  
  1212. X  ------------------------------------------------------------------------*/
  1213. X  /*+:EDITS:*/
  1214. X+ /*:07-01-1990-19:06-wht@n4hgf-add -D usage information */
  1215. X  /*:05-07-1990-21:24-wht@n4hgf---- 2.80 --- */
  1216. X  /*:03-25-1990-14:11-wht@n4hgf------ x2.70 ------- */
  1217. X  /*:07-03-1989-22:57-wht------ x2.00 ----- */
  1218. X***************
  1219. X*** 26,32
  1220. X  
  1221. X  char *usage_text[] = 
  1222. X  {
  1223. X! "usage: ecu [-l /dev/tty<ttynum>] [-b <baud_rate>] [-e] [-o]\r\n",
  1224. X  "           [-c <filename>] [-h] [-k] [-t] [-v[vv...]]\r\n",
  1225. X  "           [-p <initial_proc> | <phone_number>]\r\n",
  1226. X  "Default: 2400,N,8 (use -e for even parity, -o for odd 7 data bits)\r\n",
  1227. X
  1228. X--- 27,33 -----
  1229. X  
  1230. X  char *usage_text[] = 
  1231. X  {
  1232. X! "usage: ecu [-l /dev/tty<ttynum>] [-b <baud_rate>] [-e] [-o] [-d]\r\n",
  1233. X  "           [-c <filename>] [-h] [-k] [-t] [-v[vv...]]\r\n",
  1234. X  "           [-p <initial_proc> | <phone_number>]\r\n",
  1235. X  "Default: 2400,N,8 (use -e for even parity, -o for odd 7 data bits)\r\n",
  1236. X***************
  1237. X*** 33,38
  1238. X  "-c <filename> use this file rather than ~/.ecumodem\r\n",
  1239. X  "-h half duplex ... default is full duplex\r\n",
  1240. X  "-v verbosity ... the more 'v's the more verbosity.\r\n",
  1241. X  "\r\n",
  1242. X  "For a list of built in commands, type HOME?<ENTER> once program started\r\n",
  1243. X  "\r\n",
  1244. X
  1245. X--- 34,41 -----
  1246. X  "-c <filename> use this file rather than ~/.ecumodem\r\n",
  1247. X  "-h half duplex ... default is full duplex\r\n",
  1248. X  "-v verbosity ... the more 'v's the more verbosity.\r\n",
  1249. X+ "-d stop execution if -p initial procedure fails\r\n",
  1250. X+ "-D unconditionally stop execution when -p initial procedure is done\r\n",
  1251. X  "\r\n",
  1252. X  "For a list of built in commands, type HOME?<ENTER> once program started\r\n",
  1253. X  "\r\n",
  1254. X*** /u4/ecurel/ecuutil.c    Mon May  7 23:33:00 1990
  1255. X--- ecuutil.c    Thu Jun  7 15:38:52 1990
  1256. X***************
  1257. X*** 31,36
  1258. X  
  1259. X  ------------------------------------------------------------------------*/
  1260. X  /*+:EDITS:*/
  1261. X  /*:05-07-1990-21:24-wht@n4hgf---- 2.80 --- */
  1262. X  /*:05-02-1990-13:25-wht@n4hgf-added double quote to shell metachar list */
  1263. X  /*:04-19-1990-14:56-wht@n4hgf-my GCC is uses XENIX libs/turn on mkdir for it */
  1264. X
  1265. X--- 31,37 -----
  1266. X  
  1267. X  ------------------------------------------------------------------------*/
  1268. X  /*+:EDITS:*/
  1269. X+ /*:06-07-1990-15:38-wht@n4hgf-^? w/o true incl_3_char left gg unterminated */
  1270. X  /*:05-07-1990-21:24-wht@n4hgf---- 2.80 --- */
  1271. X  /*:05-02-1990-13:25-wht@n4hgf-added double quote to shell metachar list */
  1272. X  /*:04-19-1990-14:56-wht@n4hgf-my GCC is uses XENIX libs/turn on mkdir for it */
  1273. X***************
  1274. X*** 404,409
  1275. X              gg[1] = '?';
  1276. X              if(incl_3char)
  1277. X                  strcpy(&gg[2]," DEL");
  1278. X          }
  1279. X          else
  1280. X          {
  1281. X
  1282. X--- 405,412 -----
  1283. X              gg[1] = '?';
  1284. X              if(incl_3char)
  1285. X                  strcpy(&gg[2]," DEL");
  1286. X+             else
  1287. X+                 gg[2] = 0;
  1288. X          }
  1289. X          else
  1290. X          {
  1291. X*** /u4/ecurel/ecuxenix.c    Wed May  9 09:49:00 1990
  1292. X--- ecuxenix.c    Thu May 31 17:04:48 1990
  1293. X***************
  1294. X*** 545,550
  1295. X      if(narg < 3)
  1296. X      {
  1297. X          fputs("   usage: sgr mode cmd\r\n",se);
  1298. X          return;
  1299. X      }
  1300. X      if((fplog = fopen(fname,"a")) == NULL)
  1301. X
  1302. X--- 545,552 -----
  1303. X      if(narg < 3)
  1304. X      {
  1305. X          fputs("   usage: sgr mode cmd\r\n",se);
  1306. X+         fputs("mode = 0 for sanitized response, 1 == raw\r\n",se);
  1307. X+         fputs("cmd = 'Send' style string (see /usr/lib/uucp/Dialers)\r\n",se);
  1308. X          return;
  1309. X      }
  1310. X      if((fplog = fopen(fname,"a")) == NULL)
  1311. X***************
  1312. X*** 570,587
  1313. X  
  1314. X      fputs("\r\n",se);
  1315. X  
  1316. X!     fprintf(fplog,"\nMode: %d ",mode);
  1317. X!     fputs("Stimulus: ",fplog);
  1318. X!     for(iarg = 2; iarg < narg; iarg++)
  1319. X!     {
  1320. X!         fputs(arg[iarg],fplog);
  1321. X!         lputs_paced(20,arg[iarg]);
  1322. X!         if(iarg != (narg - 1))
  1323. X!         {
  1324. X!             fputc(' ',fplog);
  1325. X!             lputc_paced(20,' ');
  1326. X!         }
  1327. X!     }
  1328. X      fputs("\nResponse: \n",fplog);
  1329. X      lputc_paced(20,'\r');
  1330. X  
  1331. X
  1332. X--- 572,579 -----
  1333. X  
  1334. X      fputs("\r\n",se);
  1335. X  
  1336. X!     fprintf(fplog,"\nMode: %d Stimulus: %s",mode,arg[2]);
  1337. X!     fputs("Response: \r\n",se);
  1338. X      fputs("\nResponse: \n",fplog);
  1339. X      respond(arg[2]);
  1340. X      lgets_timeout(&lr);
  1341. X***************
  1342. X*** 583,590
  1343. X          }
  1344. X      }
  1345. X      fputs("\nResponse: \n",fplog);
  1346. X!     lputc_paced(20,'\r');
  1347. X! 
  1348. X      lgets_timeout(&lr);
  1349. X      itmp = lr.count;
  1350. X      cptr = strchr(buf,'\n') + 1;
  1351. X
  1352. X--- 575,581 -----
  1353. X      fprintf(fplog,"\nMode: %d Stimulus: %s",mode,arg[2]);
  1354. X      fputs("Response: \r\n",se);
  1355. X      fputs("\nResponse: \n",fplog);
  1356. X!     respond(arg[2]);
  1357. X      lgets_timeout(&lr);
  1358. X      itmp = lr.count;
  1359. X      cptr = strchr(buf,'\n') + 1;
  1360. X***************
  1361. X*** 589,595
  1362. X      itmp = lr.count;
  1363. X      cptr = strchr(buf,'\n') + 1;
  1364. X      itmp -= (int)(cptr - buf);
  1365. X!     hex_dump_fp(fplog,cptr,itmp,(char *)0,1);
  1366. X  
  1367. X      itmp = lr.count;
  1368. X      cptr = buf;
  1369. X
  1370. X--- 580,587 -----
  1371. X      itmp = lr.count;
  1372. X      cptr = strchr(buf,'\n') + 1;
  1373. X      itmp -= (int)(cptr - buf);
  1374. X!     hex_dump_fp(fplog,cptr,itmp,(char *)0,(itmp <= 16));
  1375. X!     fclose(fplog);
  1376. X  
  1377. X      itmp = lr.count;
  1378. X      cptr = buf;
  1379. X***************
  1380. X*** 600,606
  1381. X          fputc(*cptr++,se);
  1382. X      }
  1383. X          
  1384. X-     fclose(fplog);
  1385. X      if(rcvr_alive)
  1386. X          start_rcvr_process(0);
  1387. X  }    /* end of send_get_response */
  1388. X
  1389. X--- 592,597 -----
  1390. X          fputc(*cptr++,se);
  1391. X      }
  1392. X          
  1393. X      if(rcvr_alive)
  1394. X          start_rcvr_process(0);
  1395. X  }    /* end of send_get_response */
  1396. X*** /u4/ecurel/ecuxfer.c    Sun Jul  1 20:08:20 1990
  1397. X--- ecuxfer.c    Wed May 30 15:17:42 1990
  1398. X***************
  1399. X*** 466,471
  1400. X      p_overwrite = 1;    /* assume overwrite */
  1401. X      p_xfernew = 0;        /* assume send only newer */
  1402. X      p_filelist[0] = 0;    /* no filenames yet */
  1403. X      zwindw_size = 0;    /* assume full streaming sz */
  1404. X  
  1405. X      switch(to_lower(*(argv[0] + 1)))
  1406. X
  1407. X--- 466,474 -----
  1408. X      p_overwrite = 1;    /* assume overwrite */
  1409. X      p_xfernew = 0;        /* assume send only newer */
  1410. X      p_filelist[0] = 0;    /* no filenames yet */
  1411. X+ #ifdef WHT
  1412. X+     zwindw_size = 16384;    /* my preference */
  1413. X+ #else
  1414. X      zwindw_size = 0;    /* assume full streaming sz */
  1415. X  #endif
  1416. X  
  1417. X***************
  1418. X*** 467,472
  1419. X      p_xfernew = 0;        /* assume send only newer */
  1420. X      p_filelist[0] = 0;    /* no filenames yet */
  1421. X      zwindw_size = 0;    /* assume full streaming sz */
  1422. X  
  1423. X      switch(to_lower(*(argv[0] + 1)))
  1424. X      {
  1425. X
  1426. X--- 470,476 -----
  1427. X      zwindw_size = 16384;    /* my preference */
  1428. X  #else
  1429. X      zwindw_size = 0;    /* assume full streaming sz */
  1430. X+ #endif
  1431. X  
  1432. X      switch(to_lower(*(argv[0] + 1)))
  1433. X      {
  1434. X*** /u4/ecurel/expresp.c    Mon May  7 23:33:00 1990
  1435. X--- expresp.c    Thu May 31 16:23:32 1990
  1436. X***************
  1437. X*** 16,21
  1438. X   \c - no new-line
  1439. X   \n - send new-line
  1440. X   \nnn - send octal number
  1441. X   Speed - Hayes-specific speed-adaptive connect handler
  1442. X  
  1443. X    Defined functions:
  1444. X
  1445. X--- 16,22 -----
  1446. X   \c - no new-line
  1447. X   \n - send new-line
  1448. X   \nnn - send octal number
  1449. X+  \m### - sleep ### (decimal) milliseconds (non-standard)
  1450. X   Speed - Hayes-specific speed-adaptive connect handler
  1451. X  
  1452. X    Defined functions:
  1453. X***************
  1454. X*** 26,31
  1455. X  
  1456. X  --------------------------------------------------------------------------*/
  1457. X  /*+:EDITS:*/
  1458. X  /*:05-07-1990-21:24-wht@n4hgf---- 2.80 --- */
  1459. X  /*:04-02-1990-02:17-wht@n4hgf-Dialers support appears to work */
  1460. X  /*:04-01-1990-19:28-wht@n4hgf-more work */
  1461. X
  1462. X--- 27,33 -----
  1463. X  
  1464. X  --------------------------------------------------------------------------*/
  1465. X  /*+:EDITS:*/
  1466. X+ /*:05-31-1990-15:59-wht@n4hgf-add 'm'illisec pause and ldraino use */
  1467. X  /*:05-07-1990-21:24-wht@n4hgf---- 2.80 --- */
  1468. X  /*:04-02-1990-02:17-wht@n4hgf-Dialers support appears to work */
  1469. X  /*:04-01-1990-19:28-wht@n4hgf-more work */
  1470. X***************
  1471. X*** 46,51
  1472. X  #define ERDEBUG(verb,str,arg) if(expresp_verbosity >= verb) \
  1473. X      pprintf(str,arg);
  1474. X  
  1475. X  extern int proctrace;
  1476. X  extern int interrupt;
  1477. X  
  1478. X
  1479. X--- 48,55 -----
  1480. X  #define ERDEBUG(verb,str,arg) if(expresp_verbosity >= verb) \
  1481. X      pprintf(str,arg);
  1482. X  
  1483. X+ long atol();
  1484. X+ 
  1485. X  extern int proctrace;
  1486. X  extern int interrupt;
  1487. X  
  1488. X***************
  1489. X*** 175,180
  1490. X  register char *str;
  1491. X  {
  1492. X  int itmp;
  1493. X  char s4[4];
  1494. X  int send_no_cr = 0;
  1495. X  
  1496. X
  1497. X--- 179,185 -----
  1498. X  register char *str;
  1499. X  {
  1500. X  int itmp;
  1501. X+ long ltmp;
  1502. X  char s4[4];
  1503. X  int send_no_cr = 0;
  1504. X  
  1505. X***************
  1506. X*** 189,195
  1507. X                  strncpy(s4,str,3);
  1508. X                  s4[3] = 0;
  1509. X                  sscanf(s4,"%o",&itmp);
  1510. X!                 str += strspn(s4,"01234567");
  1511. X                  lputc((char)itmp);
  1512. X              }
  1513. X              else switch(*str)
  1514. X
  1515. X--- 194,200 -----
  1516. X                  strncpy(s4,str,3);
  1517. X                  s4[3] = 0;
  1518. X                  sscanf(s4,"%o",&itmp);
  1519. X!                 str += strspn(s4,"01234567") - 1;    /* -1 cause str++ later */
  1520. X                  lputc((char)itmp);
  1521. X              }
  1522. X              else switch(*str)
  1523. X***************
  1524. X*** 195,200
  1525. X              else switch(*str)
  1526. X              {
  1527. X                  case 'p':  /* pause (approximately 1/4-1/2 second delay) */
  1528. X                      nap(400L);
  1529. X                      break;
  1530. X                  case 'd':  /* delay (2 seconds) */
  1531. X
  1532. X--- 200,206 -----
  1533. X              else switch(*str)
  1534. X              {
  1535. X                  case 'p':  /* pause (approximately 1/4-1/2 second delay) */
  1536. X+                     ldraino(0);    /* wait for output to drain */
  1537. X                      nap(400L);
  1538. X                      break;
  1539. X                  case 'm':  /* nap a while (non-standard) */
  1540. X***************
  1541. X*** 197,202
  1542. X                  case 'p':  /* pause (approximately 1/4-1/2 second delay) */
  1543. X                      nap(400L);
  1544. X                      break;
  1545. X                  case 'd':  /* delay (2 seconds) */
  1546. X                      nap(2000L);
  1547. X                      break;
  1548. X
  1549. X--- 203,214 -----
  1550. X                      ldraino(0);    /* wait for output to drain */
  1551. X                      nap(400L);
  1552. X                      break;
  1553. X+                 case 'm':  /* nap a while (non-standard) */
  1554. X+                     ltmp = atol(str + 1);
  1555. X+                     str += strspn(str + 1,"0123456789");
  1556. X+                     ldraino(0);    /* wait for output to drain */
  1557. X+                     nap(ltmp);
  1558. X+                     break;
  1559. X                  case 'd':  /* delay (2 seconds) */
  1560. X                      ldraino(0);    /* wait for output to drain */
  1561. X                      nap(2000L);
  1562. X***************
  1563. X*** 198,203
  1564. X                      nap(400L);
  1565. X                      break;
  1566. X                  case 'd':  /* delay (2 seconds) */
  1567. X                      nap(2000L);
  1568. X                      break;
  1569. X                  case 'D':  /* phone number/token */
  1570. X
  1571. X--- 210,216 -----
  1572. X                      nap(ltmp);
  1573. X                      break;
  1574. X                  case 'd':  /* delay (2 seconds) */
  1575. X+                     ldraino(0);    /* wait for output to drain */
  1576. X                      nap(2000L);
  1577. X                      break;
  1578. X                  case 'D':  /* phone number/token */
  1579. X***************
  1580. X*** 242,247
  1581. X  
  1582. X          if(expresp_echo_check)
  1583. X          {
  1584. X              nap(40L);        /* fake it */
  1585. X              lflush(0);        /* flush input */
  1586. X          }
  1587. X
  1588. X--- 255,261 -----
  1589. X  
  1590. X          if(expresp_echo_check)
  1591. X          {
  1592. X+             ldraino(1);        /* wait for output to drain, then flush input */
  1593. X              nap(40L);        /* fake it */
  1594. X          }
  1595. X          str++;
  1596. X***************
  1597. X*** 243,249
  1598. X          if(expresp_echo_check)
  1599. X          {
  1600. X              nap(40L);        /* fake it */
  1601. X-             lflush(0);        /* flush input */
  1602. X          }
  1603. X          str++;
  1604. X      }
  1605. X
  1606. X--- 257,262 -----
  1607. X          {
  1608. X              ldraino(1);        /* wait for output to drain, then flush input */
  1609. X              nap(40L);        /* fake it */
  1610. X          }
  1611. X          str++;
  1612. X      }
  1613. SHAR_EOF
  1614. $TOUCH -am 0701201490 ECU280.P04 &&
  1615. chmod 0644 ECU280.P04 ||
  1616. echo "restore of ECU280.P04 failed"
  1617. set `wc -c ECU280.P04`;Wc_c=$1
  1618. if test "$Wc_c" != "28750"; then
  1619.     echo original size 28750, current size $Wc_c
  1620. fi
  1621. # ============= APPLY.P04 ==============
  1622. echo "x - extracting APPLY.P04 (Text)"
  1623. sed 's/^X//' << 'SHAR_EOF' > APPLY.P04 &&
  1624. X:
  1625. X#--------------------------------------------------------------
  1626. X# APPLY.P04 - ensure patch 3 already applied and apply patch 4
  1627. X#--------------------------------------------------------------
  1628. Xif fgrep 'PATCHLEVEL 3' patchlevel.h > /dev/null 2>&1
  1629. X   then
  1630. X       echo 'Applying patch 4';
  1631. X   else
  1632. X       echo 'You must apply patch 3 first (or patch 4 already applied)';
  1633. X       exit 1;
  1634. Xfi
  1635. Xpatch -p < ECU280.P04
  1636. Xcat > patchlevel.h << PLEOF
  1637. X#define PATCHLEVEL 4
  1638. XPLEOF
  1639. Xexit 0
  1640. SHAR_EOF
  1641. $TOUCH -am 0701200190 APPLY.P04 &&
  1642. chmod 0755 APPLY.P04 ||
  1643. echo "restore of APPLY.P04 failed"
  1644. set `wc -c APPLY.P04`;Wc_c=$1
  1645. if test "$Wc_c" != "470"; then
  1646.     echo original size 470, current size $Wc_c
  1647. fi
  1648. exit 0
  1649.  
  1650.