home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume42 / ecu / part31 < prev    next >
Encoding:
Internet Message Format  |  1994-05-25  |  64.5 KB

  1. From: wht@n4hgf.atl.ga.us (Warren Tucker)
  2. Newsgroups: comp.sources.misc
  3. Subject: v42i129:  ecu - ECU Asynchronous Communications v3.30, Part31/37
  4. Date: 25 May 1994 14:59:36 -0500
  5. Organization: Sterling Software
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <2s0an8$9ui@sparky.sterling.com>
  9. X-Md4-Signature: 96f2f14eacffd0d7857b01825ae66118
  10.  
  11. Submitted-by: wht@n4hgf.atl.ga.us (Warren Tucker)
  12. Posting-number: Volume 42, Issue 129
  13. Archive-name: ecu/part31
  14. Environment: SCO,SCOXENIX,MOTOROLA,HP-UX,LINUX,NetBSD,SUNOS,SYSVR4,SOLARIS2
  15. Supersedes: ecu: Volume 32, Issue 36-75
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  ecu330/doc/_hdb.txt ecu330/doc/proc.txt
  22. #   ecu330/ecufinsert.c ecu330/ecuicmhelp.c ecu330/eculock.c
  23. #   ecu330/fasiintf.c ecu330/mapkey/keys.usa.ecu
  24. # Wrapped by kent@sparky on Mon May 23 13:41:03 1994
  25. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  26. echo If this archive is complete, you will see the following message:
  27. echo '          "shar: End of archive 31 (of 37)."'
  28. if test -f 'ecu330/doc/_hdb.txt' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'ecu330/doc/_hdb.txt'\"
  30. else
  31.   echo shar: Extracting \"'ecu330/doc/_hdb.txt'\" \(7542 characters\)
  32.   sed "s/^X//" >'ecu330/doc/_hdb.txt' <<'END_OF_FILE'
  33. X.*s 1 "HoneyDanBer UUCP Interface"
  34. X
  35. X.*s 2 "Control Files"
  36. X
  37. XThis section describes how ecu uses verious HDB UUCP control
  38. Xfiles found in the UUCP library directory (e.g., /usr/lib/uucp on
  39. XSCO and ISC or /etc/uucp on SunOS and SVR4).
  40. X
  41. X.*s 3 "Devices"
  42. X
  43. XECU reads this file to determine what tty devices are available
  44. Xfor outgoing calls. The fourth field must contain a baud rate or
  45. Xrange of baud rates acceptable for the line.  The fifth field of
  46. Xeach entry must contain either the full pathname of an (SCO)
  47. Xmodem dialer program (with leading slash) or the name of an entry
  48. Xin the HDB Dialers file (no leading slash).  For more
  49. Xinformation, consult the UUCP documentation for your system and
  50. Xsee "Dialers" and "Choosing a Dialout Line" below.
  51. X
  52. X.*s 3 "Dialers"
  53. X
  54. X.B Dialers
  55. Xentries may be specified in the Devices entry. 
  56. XECU provides Dialers support that is largely compatible
  57. Xwith most System V HDB uucico programs.  Refer to
  58. Xyour system's UUCP documentation for general
  59. Xusage instructions.  Refer to the procedure command
  60. X.B expresp
  61. Xfor a precise list of escape sequences supported by ECU.
  62. X
  63. X.*s 3 "Sysfiles"
  64. X
  65. XSysfiles support is not yet provided.  The Devices and
  66. XDialers files must have their default names.
  67. X
  68. X.*s 3 "Systems"
  69. X
  70. XNo use is made of the
  71. X.B Systems
  72. Xfile at this time.  ECU provides the
  73. Xequivalent function with its dialing directory.
  74. X
  75. X.*s 2 "Choosing a Dialout Line"
  76. X
  77. XWhen using the interactive
  78. X.B dial
  79. Xcommand, or when dialing from the initial menu,
  80. Xif a logical or system name is specified, the directory
  81. Xentry is fetched and examined.  If the tty field specifies
  82. Xa value other than "Any", the specific line requested is
  83. Xopened, if available, and dialing commences. 
  84. XIf the specified line is not available, the dial attempt
  85. Xfails.
  86. X
  87. XIf "Any" is found in the dialing directory entry tty field, then
  88. XECU finds an available Devices line which matches the baud rate
  89. Xspecified in the entry. 
  90. X
  91. XOther special tty field entries allow regular expression or
  92. Xliteral matching of Devices types.  See the description of the  dialing
  93. Xdirectory for more details.
  94. X
  95. XA line is selected only if its class begins with the three
  96. Xcharacters "ACU."  UUCP will only select a line whose Devices
  97. Xentry class matches the active Systems entry class (usually
  98. X"ACU"), so usually you may make a modem accessible to ECU, but not
  99. Xto UUCP, by setting it's class to ACUECU.
  100. X
  101. XOn systems employing ecuungetty, if a line being considered for
  102. Xselection is found to be a line enabled for login, but
  103. Xcurrently idle, the ecuungetty interface, described below,
  104. Xis used to acquire the line for outgoing use.
  105. X
  106. XThe DCD watcher (see the interactive and procedure commands
  107. X.B dcdwatch )
  108. Xdepends upon the tty driver to return zero
  109. Xon a read when DCD is low when the termio flag CLOCAL is reset.
  110. XThe tty driver must ignore DCD if CLOCAL is set.
  111. XIf your system offers a "modem" and "direct" choice (by choice
  112. Xof filename), you probably need to use the "modem" choice for
  113. Xthis to work properly.  However, the choice depends upon
  114. Xthe needs of the underlying driver you are using.
  115. XFor instance, if you are using FAS in a shared modem application,
  116. Xyour getty should use the "modem" choice and ECU should
  117. Xuse the "direct" choice.  Some experimentation may be required.
  118. X
  119. XOne of the symptoms of an incorrect line choice is ECU hangs,
  120. Xline errors such as EIO and EBUSY.  These problems may
  121. Xbe caused by other problems, but incorrect line choice is
  122. Xthe most frequent cause.
  123. X
  124. X
  125. X.*s 2 "SCO Tty Naming"
  126. X
  127. XOn SCO,
  128. XTTY devices must be named in the style of:
  129. X.DS I
  130. X/dev/tty#N
  131. X        ^^
  132. X        ||
  133. X        |`------ uppercase letter for modem control
  134. X        |        lowercase for non-modem control
  135. X        `--------digit (1-4)
  136. X.DE
  137. X
  138. XIf you are using FAS or other third-party driver, you may
  139. Xuse ECU with ports not normally named in the /dev/tty#N
  140. Xstyle in one of two ways under UNIX and one way under XENIX:
  141. X
  142. X.DS I
  143. X1.  Under XENIX or UNIX, create a link to the port
  144. X    with a compatible name:
  145. X
  146. X          ln /dev/ttyF00 /dev/tty1a
  147. X          ln /dev/ttyFM00 /dev/tty1A
  148. X
  149. X2.  Under UNIX, add additional lines to the
  150. X    /etc/conf/node.d file and rebuild the kernel
  151. X    environment (this is the recommended approach
  152. X    for UNIX):
  153. X
  154. Xfas ttyF00  c   48
  155. Xfas tty1a   c   48
  156. Xfas ttyF01  c   49
  157. Xfas tty1b   c   49
  158. Xfas ttyFM00 c   208
  159. Xfas tty1A   c   208
  160. Xfas ttyFM01 c   209
  161. Xfas tty1B   c   209
  162. X.DE
  163. X
  164. XNote the device numbers are examples only.  Consult the driver
  165. Xdocumentation for proper choices.
  166. X
  167. XIf you cannot live within this restriction, search for the #define
  168. XSCO_TTY_NAMING in ecu.h (that depends on SCO's M_SYSV) and disable it.
  169. X
  170. X.*s 2 "Ecuungetty (Getty Interface)"
  171. X
  172. XThis section applies to the SCO version of the program.  It
  173. Xmay also apply to others in part.  Specifically, as of this
  174. Xwriting, this section does not apply to the SunOS version
  175. Xdue to the differences in utmp arrangement.  In some versions,
  176. Xthe mechanism may execute and do no harm, yet essentially be a no-op.
  177. X
  178. XWhen an idle dialin (enabled) line is chosen for dialout,
  179. XECU makes use of
  180. X.B ecuungetty
  181. X(in the ecu library directory, normally /usr/local/lib/ecu)
  182. Xto signal the line's getty to release the line (via SIGUSR1).
  183. X.B Ecuungetty
  184. Xis again employed to signal the getty to reacquire the
  185. Xline when outgoing communication is complete (via SIGUSR2).
  186. X
  187. XEcuungetty is a privileged program, which must be owned by root
  188. Xand have the setuid-on-execute bit set.  An encrypted id is passed
  189. Xby ecu to ecuungetty to validate requests and to prevent abuse of
  190. Xecuungetty by crackers, malcontents and other twentieth-century
  191. Xphenomena.
  192. X
  193. X.*s 2 "SCO Dialer Programs"
  194. X
  195. XThe concept of a dialer program (an executable binary
  196. Xas opposed to a Dialers entry) is an SCO enhancement and
  197. Xis unlikely to be of benefit to users of other versions (too bad!).
  198. XECU will support dialer programs under any version, but other
  199. Xusers of the Devices file (read "your vendor-supplied uucico")
  200. Xwill most likely barf on non-SCO systems.
  201. X
  202. XIf the
  203. X.B Devices
  204. Xfile can be found in /usr/lib/uucp,
  205. Xand a valid entry for the attached line can be found,
  206. XECU will use the Dialers script or dialer program specified in the
  207. X.B Devices
  208. Xentry.
  209. X
  210. X.*s 2 "Gendial Dialer Package"
  211. X
  212. XSample SCO-style modem dialer program sources may be found
  213. Xin the gendial/ subdirectory of the distribution.
  214. XSome of them, particularly dialgHA24 and dialgT2500, are very
  215. Xrobust and succeed where other programs may fail.  They retry
  216. Xmodem initialization and reset/hangup commands .
  217. X
  218. XThe code is divided into one general module and several modem-
  219. Xand DCE-specific modules.  A program is built by combining
  220. Xthe gendial.o with the appropriate dceFOO.o module to produce
  221. Xa dialgFOO executable.
  222. X
  223. XTo write a dialer for a modem not already in the gendial package,
  224. Xcopy template.c to dceMYMODEM.c and edit it to contain the
  225. Xnecessary variable assignments and initialization, dialing and hangup
  226. Xcode.  The existing dce*.c modules provide examples.
  227. XEdit the gendial/Make.src file to add rule lines for your program.
  228. X(Do not modify Makefile alone
  229. Xsince a "Configure" will overwrite Makefile.)
  230. X
  231. X.DS L
  232. XdialgMYMODEM: gendial.o dceMYMODEM.o
  233. X    $(CC) $(LDFLAGS) gendial.o dceMYMODEM.o $(LIBS) -o $@
  234. X.DE
  235. X
  236. XTo be "correct," you should run the Configure procedure
  237. Xin the main ecu directory to make a new Makefile,
  238. Xbut this has the unfortunate side effect of rebuilding all
  239. Xof the Makefiles which are built from Make.src files.
  240. XIf this happens, the next make will rebuild all of the
  241. Xobjects.
  242. X
  243. XIn this case, it is "OK" to cheat and copy the new Make.src lines to
  244. XMakefile.  A later Configure will not cause loss of the new lines.
  245. END_OF_FILE
  246.   if test 7542 -ne `wc -c <'ecu330/doc/_hdb.txt'`; then
  247.     echo shar: \"'ecu330/doc/_hdb.txt'\" unpacked with wrong size!
  248.   fi
  249.   # end of 'ecu330/doc/_hdb.txt'
  250. fi
  251. if test -f 'ecu330/doc/proc.txt' -a "${1}" != "-c" ; then 
  252.   echo shar: Will not clobber existing file \"'ecu330/doc/proc.txt'\"
  253. else
  254.   echo shar: Extracting \"'ecu330/doc/proc.txt'\" \(9382 characters\)
  255.   sed "s/^X//" >'ecu330/doc/proc.txt' <<'END_OF_FILE'
  256. X
  257. X.de *s
  258. X.H "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
  259. X.br
  260. X..
  261. X.po 4
  262. X.ll 7.2i
  263. X.ls 1
  264. X.nh
  265. X.tp
  266. X.sp 2i
  267. X.ft B
  268. X.ce 10
  269. XECU
  270. X
  271. X(Extended Call Utility)
  272. X.ce 0
  273. X.sp 1i
  274. X.ce 100
  275. XResearch and Engineering
  276. XAsynchronous Communications Package
  277. Xfor SCO UNIX 3.2 and XENIX System V,
  278. XHP-UX, Motorola Delta SVR32 and SVR41, Linux,
  279. XNetBSD, SunOS 4.1, Solaris 2.x,
  280. XISC 386/ix, ISC System V Release 4,
  281. Xand ESIX System V Release 4
  282. X.ce 0
  283. X.ft P
  284. X.sp 2i
  285. X.lp
  286. X.ce 1
  287. XWarren H. Tucker, III <wht@n4hgf.atl.ga.us>
  288. X.sp 1i
  289. X.ce 100
  290. XProcedure Language
  291. XRevision 3.30
  292. X\n(mo/\n(dy/\n(yr
  293. X.ce 0
  294. X.sp 1i
  295. X.ls 1
  296. XNOTE: Many sections of the manual are likely to be obsolete at any given
  297. Xtime until the writer get lots of free time.  Much of it was written when
  298. Xthe program was supported only on SCO XENIX and UNIX. 
  299. X
  300. X.PH "'ECU Procedure Language''%'"
  301. X.PF "'wht@n4hgf.atl.ga.us''\n(mo/\n(dy/\n(yr'"
  302. X.nr si 2n
  303. X.nr Cl 9
  304. X.nr Ej 1
  305. X.nr U 1
  306. X.SA 0
  307. X.ul
  308. X.bp 2
  309. X
  310. X.*s 1 Introduction
  311. X
  312. XProcedures are "programs" or "scripts" written in an addled but
  313. Xadequate language which ECU executes upon demand.
  314. XThe documentation refers to procedures as files on the disk
  315. Xor as in-memory copies under execution.
  316. X
  317. XAn "initial procedure" may be executed when ECU starts up (see
  318. Xthe description of the -p command line switch).  Certain special
  319. Xprocedures are executed automatically as described below in the
  320. Xsection "Special Procedures."
  321. X
  322. XThe procedures themselves are source files consisting of
  323. Xthe procedure "name" with an extension of ".ep".
  324. XWhen executing a procedure by name,
  325. X.DS I
  326. Xdo name       interactive
  327. X-or-
  328. Xdo 'name'     from inside a procedure
  329. X.DE
  330. Xis sufficient if the procedure is in the current directory,
  331. Xthe user's ~/.ecu directory or in the ECU library
  332. Xsubdirectory "ep" (normally /usr/local/lib/ecu/ep).
  333. XProcedure files
  334. Xare searched for in the above order, so you may have
  335. Xa system default in the lib directory, a user default
  336. Xin the ~/.ecu directory and a specific version in the current
  337. Xdirectory all by the same name.
  338. X
  339. XYou may execute a procedure by specifying it's full pathname
  340. X(minus the .ep extension).  For example:
  341. X.DS I
  342. Xdo /tmp/doit       interactive invocation of /tmp/doit.ep
  343. X-or-
  344. Xdo '/tmp/doit'     from inside a procedure
  345. X.DE
  346. X
  347. XMany example procedures, some quite useful, some not so,
  348. Xare found in the models subdirectory of the release.
  349. XThere are also many fragments
  350. Xused as examples throughout the following sections.
  351. X
  352. X.*s 1 "Line Syntax (Labels, Commands and Comments)"
  353. XLines in a procedure 
  354. Xconsist of an optional label, followed by optional commands and
  355. Xarguments.  Anything on a line after an octothorpe (#) outside
  356. Xof quote marks is ignored (read "# is the comment character").
  357. X
  358. X.DS L
  359. XExample:
  360. X----------------------------------------------------------------------
  361. X# example procedure
  362. X    echo 'Hello.  Please tell me your name.'
  363. X    $s0 = %cgets  # read string from console into string variable $s0
  364. X    ifs $s0 == 'foo' goto label
  365. X    echo 'Hello there, '+$s0
  366. X    return
  367. X
  368. Xlabel echo 'You must be kidding.'
  369. X----------------------------------------------------------------------
  370. X.DE
  371. X
  372. XLabels must begin in column one.
  373. XA label may appear on a line by itself or with a comment
  374. Xappended.  A common mistake I make (from writing too much C) is
  375. Xto append a colon to a label declaration; this does not work unless
  376. Xyou also "goto label:".  
  377. XLabels are not allowed inside braces
  378. X(inside of compound statements); you may get away with it sometimes
  379. Xbecause the procedure language processor is written for speed, not
  380. Xpolitical correctness.
  381. X
  382. XCommands must have white space before them and
  383. Xwhite space before each argument.
  384. X
  385. X.so _p_param.txt
  386. X
  387. X.so _p_ifunc.txt
  388. X
  389. X.so _p_sfunc.txt
  390. X
  391. X.so _p_cmd.txt
  392. X
  393. X.*s 1 "Special Procedures"
  394. X
  395. XECU provides for special "hook" procedures to be executed
  396. Xat certain times.  Their use is encouraged, but you must
  397. Xtake precautions not to excecute any unreasoable commands
  398. Xin them, for the are rather "raw" hooks and it is easily possible
  399. Xto confuse ECU by performing illogical operations in them.  
  400. XJudicious use can, however, be quite productive.
  401. X
  402. XThey are searched for in the same manner
  403. Xas any other procedure, so you can have a
  404. Xcustomised version of them in a working directory and a default
  405. Xin your ~/.ecu subdirectory.  No error is reported if they are not found.
  406. X
  407. X.*s 2 "_rc.ep"
  408. X
  409. XAfer ECU is initialized, but before it presents the setup
  410. Xscreen or executes a -p initial procedure,
  411. Xprocedure '_rc' is executed with no arguments.
  412. X(It is named in the tradition of /etc/rc, .mailrc, etc..)
  413. XThis procedure can be used to customize the ecu environment
  414. Xprior to beginning the usual operation.  This is not a place
  415. Xto do any dialing or long-lived operations, nor is it possible to
  416. Xbypass the setup screen: for this, use the -p initial procedure.
  417. X
  418. XThe %getenv() function may be useful in here (Am I running on an
  419. Xxterm?  Do I want to change the prompt string from
  420. Xthe default environment variable $ECUPROMPT?).
  421. X
  422. XProcedure commands likely to be of interest here:
  423. X.DS I
  424. X  autorz
  425. X* baud
  426. X  color
  427. X  dcdwatch
  428. X* duplex
  429. X  prompt
  430. X  rtscts
  431. X* setline
  432. X.DE
  433. X
  434. XCommands marked with an asterisk affect the initial (default)
  435. Xvalues presented on the setup screen.
  436. X
  437. XIf _rc.ep returns a non-zero status or fails (due to syntax or
  438. Xother error), ecu terminates immediately.
  439. X
  440. X.*s 2 "_connect.ep"
  441. X
  442. XThis procedure is executed after every connection success
  443. Xafter the CONNECT message ("result code") is printed.
  444. XIt is passed one argument, the "result code" string
  445. Xgenerated by the dialer function (e.g., "CONNECT 19200").
  446. X
  447. XYou may use %rname and other functions and features to customize
  448. Xthis function based on the particular system just reached.  Note
  449. Xthat integer variable $i0 and string variable $s0 set zero prior
  450. Xto executing the function.  This function may modify the behavior
  451. Xof coorperating dialer functions by setting the value of numbered
  452. Xstring or integer variables.  In particular, the dialer function
  453. Xwill inherit the values of $i0 and $s0 when this special function
  454. Xterminates.
  455. X.B
  456. XBe careful of what you do in here since MANY ecu procedure commands
  457. Xaffect $i0 and $s0 as a side effect of their operation.
  458. X.R
  459. XEven if you know what you do in _connect.ep does not modify $i0
  460. Xor $s0, use of the preservation technique shown in the example
  461. Xbelow may save you headaches if you add to the function in the
  462. Xfuture (long after you have forgotten this pedantic admonition).
  463. X
  464. XIf this procedure fails (abnormal procedure termination
  465. Xor non-zero return code), ECU hangs up on the line and proceeds
  466. Xas if the connection failed.
  467. X
  468. X.DS L
  469. XExample:
  470. X#+------------------------------------------------------------------
  471. X#  _connect.ep - post-CONNECT special "hook" procedure
  472. X#-------------------------------------------------------------------
  473. X#+:EDITS:
  474. X#:05-04-1994-04:38-wht@n4hgf-ECU release 3.30
  475. X#:09-10-1992-13:58-wht@n4hgf-ECU release 3.20
  476. X#:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA
  477. X#:07-13-1991-14:47-wht@n4hgf-creation
  478. X
  479. X  $iv0_save = $i0  # it is a VERY good idea to save the dialer
  480. X  $sv0_save = $s0  # function return status
  481. X                   # since gobs of functions and commands modify $i0
  482. X                   # and/or $s0 as a side effect of their operation
  483. X
  484. X  $s30 = '_connect '+%rname+' ('+%argv(1)+')'
  485. X  echo $s30        # this still will also live to be visible by
  486. X                   # the dialer function
  487. X
  488. X  ifi %baud > 2400
  489. X  {
  490. X     xon    off    # turn XON/XOFF off first, then ...
  491. X     rtscts on     # turn on RTS/CTS
  492. X  }
  493. X  else
  494. X  {
  495. X     rtscts off    # turn off RTS/CTS, then ...
  496. X     xon    on     # turn XON/XOFF on
  497. X  }
  498. X
  499. X  $i0 = $iv0_save  # restore dialer return status
  500. X  $s0 = $sv0_save
  501. X.DE
  502. X
  503. X.*s 2 "_connfail.ep"
  504. X
  505. XThis procedure is executed after every connection failure after
  506. Xthe failure message ("result code") is printed.  It is passed two
  507. Xarguments, the logical system name (the dial directory
  508. Xentry name or the phone number)
  509. Xand the "result code" string generated by the dialer
  510. Xfunction (e.g., "BUSY").  The function is called after $i0 has
  511. Xbeen set to 1 and $s0 has been set to the result code.  This
  512. Xfunction may modify the behavior of coorperating dialer functions
  513. Xby setting the value of numbered string or integer variables.  In
  514. Xparticular, the dialer function will inherit the values of $i0
  515. Xand $s0 when this special function terminates.
  516. X.B
  517. XBe careful of what you do in here since MANY ecu procedure commands
  518. Xaffect $i0 and/or $s0 as a side effect of their operation.
  519. X.R
  520. XSee _connect.ep above for further screams and moans.
  521. X
  522. X]If you get very involved with using this procedure, you'll sooner
  523. Xor later run into some undocumented $so values.  You'll have to
  524. Xtake a look at ecuDCE.c and hdbintf.c
  525. Xfor an authoritative reference, but perhaps
  526. Xyou can get along by knowing that result codes with an exclamation point
  527. Xas their first character are generated by ECU.
  528. X
  529. XECU ignores any failure (abnormal procedure termination
  530. Xor non-zero return code) resulting from the execution of this procedure.
  531. X
  532. X.*s 2 "_hangup.ep"
  533. X
  534. XThis procedure is executed after every connection termination.
  535. XIt is passed one argument, a string representation
  536. Xof the number of seconds you were connected.
  537. XYou may use %rname and other functions and features
  538. Xto customize this function based on the particular system
  539. Xjust reached.  ECU ignores any error
  540. Xreturned by the procedure.
  541. XECU ignores any failure (abnormal procedure termination
  542. Xor non-zero return code) resulting from the execution of this procedure.
  543. X
  544. X.br
  545. X.nr si 0n
  546. X.af % i
  547. X.ls 1
  548. X.TC 1 1 3
  549. END_OF_FILE
  550.   if test 9382 -ne `wc -c <'ecu330/doc/proc.txt'`; then
  551.     echo shar: \"'ecu330/doc/proc.txt'\" unpacked with wrong size!
  552.   fi
  553.   # end of 'ecu330/doc/proc.txt'
  554. fi
  555. if test -f 'ecu330/ecufinsert.c' -a "${1}" != "-c" ; then 
  556.   echo shar: Will not clobber existing file \"'ecu330/ecufinsert.c'\"
  557. else
  558.   echo shar: Extracting \"'ecu330/ecufinsert.c'\" \(7453 characters\)
  559.   sed "s/^X//" >'ecu330/ecufinsert.c' <<'END_OF_FILE'
  560. X#define USE_XON_XOFF
  561. X/*+-------------------------------------------------------------------------
  562. X    ecufinsert.c -- insert file onto comm line
  563. X    wht@n4hgf.atl.ga.us
  564. X
  565. X  Defined functions:
  566. X    expand_filename(fname,maxlen)
  567. X    file_insert_clear_xoff()
  568. X    file_insert_to_line(narg,arg)
  569. X
  570. X--------------------------------------------------------------------------*/
  571. X/*+:EDITS:*/
  572. X/*:05-04-1994-04:38-wht@n4hgf-ECU release 3.30 */
  573. X/*:09-10-1992-13:58-wht@n4hgf-ECU release 3.20 */
  574. X/*:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA */
  575. X/*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
  576. X/*:07-17-1991-07:04-wht@n4hgf-avoid SCO UNIX nap bug */
  577. X/*:07-14-1991-18:18-wht@n4hgf-new ttygets functions */
  578. X/*:04-27-1991-01:24-wht@n4hgf-expand_filename was NFG */
  579. X/*:03-30-1991-12:40-wht@n4hgf-redi!donovan found q does not restart receiver */
  580. X/*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  581. X
  582. X#include "ecu.h"
  583. X#include "ecukey.h"
  584. X#include "ecutty.h"
  585. X
  586. Xextern char kbdintr;         /* current input INTR */
  587. Xextern ulong colors_current;
  588. Xextern ulong colors_alert;
  589. Xextern ulong colors_errors;
  590. X
  591. X/*+-------------------------------------------------------------------------
  592. X    expand_filename(fname) - convert fnames with shell chars
  593. X
  594. Xreturn 0 if no shell characters found
  595. X       -1 if shell expansion match found
  596. X       1 if shell expansion found
  597. X--------------------------------------------------------------------------*/
  598. Xint
  599. Xexpand_filename(fname, maxlen)
  600. Xchar *fname;
  601. Xint maxlen;
  602. X{
  603. X    char *expcmd;
  604. X
  605. X    if (!find_shell_chars(fname))
  606. X        return (0);
  607. X
  608. X    if (expand_wildcard_list(fname, &expcmd))
  609. X    {
  610. X        fputs("\r\n", se);
  611. X        fputs(expcmd, se);
  612. X        fputs("\r\n", se);
  613. X        return (-1);
  614. X    }
  615. X    strncpy(fname, expcmd, maxlen);
  616. X    fname[maxlen - 1] = 0;
  617. X    if (strchr(expcmd, ' '))
  618. X    {
  619. X        fputs("\r\nToo many files:\r\n", se);
  620. X        fputs(expcmd, se);
  621. X        fputs("\r\n", se);
  622. X        free(expcmd);
  623. X        return (-1);
  624. X    }
  625. X    strncpy(fname, expcmd, maxlen - 1);
  626. X    *(fname + maxlen - 1) = 0;
  627. X    free(expcmd);
  628. X    return (0);
  629. X
  630. X}                             /* end of expand_filename */
  631. X
  632. X/*+-------------------------------------------------------------------------
  633. X    file_insert_clear_xoff()
  634. X--------------------------------------------------------------------------*/
  635. Xvoid
  636. Xfile_insert_clear_xoff()
  637. X{
  638. X#ifdef USE_XON_XOFF
  639. X#ifdef SAY_CLEARED_XOFF
  640. X    ulong colors_at_entry = colors_current;
  641. X
  642. X    setcolor(colors_alert);
  643. X    fputs("--> local XOFF cleared\r", se);
  644. X    setcolor(colors_at_entry);
  645. X#endif
  646. X    lclear_xmtr_xoff();
  647. X#endif
  648. X}                             /* end of file_insert_clear_xoff */
  649. X
  650. X/*+-------------------------------------------------------------------------
  651. X    file_insert_to_line(narg,arg)
  652. X--------------------------------------------------------------------------*/
  653. Xfile_insert_to_line(narg, arg)
  654. Xint narg;
  655. Xchar **arg;
  656. X{
  657. X    int itmp;
  658. X    register rchar;
  659. X    int old_ttymode = get_ttymode();
  660. X    long total_chars = 0L;
  661. X    long total_lines = 0L;
  662. X    ulong colors_at_entry = colors_current;
  663. X    long timeout_msecs;
  664. X    FILE *fp;
  665. X    char file_string[256];
  666. X    char s256[256];
  667. X    char xmit_mode;
  668. X    uchar delim;
  669. X
  670. X#ifdef USE_XON_XOFF
  671. X    int ixon;
  672. X    int ixoff;
  673. X
  674. X#endif
  675. X    char *make_char_graphic();
  676. X
  677. X    sigint = 0;
  678. X
  679. X    if (narg > 1)
  680. X    {
  681. X        strncpy(s256, arg[1], sizeof(s256));
  682. X        s256[sizeof(s256) - 1] = 0;
  683. X    }
  684. X    else
  685. X    {
  686. X        ff(se, "\r\n--> File to insert on comm line: ");
  687. X        ttygets(s256, sizeof(s256), TG_CRLF, &delim, (int *)0);
  688. X        if ((delim == ESC) || !strlen(s256))
  689. X        {
  690. X            ff(se, " --> transmission aborted\r\n");
  691. X            return (0);
  692. X        }
  693. X    }
  694. X    if ((itmp = expand_filename(s256, sizeof(s256))) < 0)
  695. X        return (-1);
  696. X    else if (itmp)
  697. X        ff(se, "\r\n--> wild card match: %s", s256);
  698. X
  699. X    if ((fp = fopen(s256, "r")) == (FILE *) 0)
  700. X    {
  701. X        ff(se, "\r\n--> ");
  702. X        pperror(s256);         /* print error if we get one */
  703. X        return (-1);
  704. X    }
  705. X
  706. X    if (narg > 1)
  707. X        ff(se, "\r\n");
  708. X
  709. X    if (narg > 2)
  710. X        xmit_mode = *arg[2];
  711. X    else
  712. X    {
  713. X      ASK_OPTION:
  714. X        ff(se, "(S)ingle line at a time\r\n");
  715. X        ff(se, "(E)cho pacing\r\n");
  716. X        ff(se, "(F)ull speed transmission\r\n");
  717. X        ff(se, "(P)aced transmission (20 msec/char)\r\n");
  718. X        ff(se, "(Q)uit (or ESC)          press a key:   ");
  719. X        xmit_mode = ttygetc(0) & 0x7F;
  720. X        if (xmit_mode > 0x20)
  721. X            fputs(make_char_graphic(xmit_mode, 0), se);
  722. X        fputs("\r\n", se);
  723. X    }
  724. X
  725. X    kill_rcvr_process(SIGUSR1);
  726. X
  727. X    switch (xmit_mode = to_lower(xmit_mode))
  728. X    {
  729. X        case 's':
  730. X            setcolor(colors_alert);
  731. X            fputs("--> press SPACE to continue or ESC/'s' to stop\r\n", se);
  732. X            setcolor(colors_at_entry);
  733. X            break;
  734. X
  735. X        case 'e':
  736. X            /* fall through */
  737. X
  738. X        case 'f':
  739. X        case 'p':
  740. X            setcolor(colors_alert);
  741. X            ff(se, "--> press %s to abort\r\n", make_char_graphic(kbdintr, 0));
  742. X            setcolor(colors_at_entry);
  743. X            ttymode(2);
  744. X            break;
  745. X
  746. X        case 'q':
  747. X        case ESC:
  748. X            goto INSERT_DONE2;
  749. X
  750. X        default:
  751. X            ring_bell();
  752. X            fputs("\r\n", se);
  753. X            goto ASK_OPTION;
  754. X    }
  755. X
  756. X#ifdef USE_XON_XOFF
  757. X    lget_xon_xoff(&ixon, &ixoff);    /* get current line xon/xoff status */
  758. X    lxon_xoff(IXON);         /* set it for us */
  759. X#endif
  760. X
  761. X    while (fgets(file_string, sizeof(file_string), fp))
  762. X    {
  763. X        int xmit_len = strlen(file_string);
  764. X        int xmit_cr = xmit_len && (file_string[xmit_len - 1] == NL);
  765. X
  766. X        if (xmit_cr)
  767. X        {
  768. X            xmit_len--;
  769. X            file_string[xmit_len] = 0;
  770. X        }
  771. X        total_chars += xmit_len;
  772. X        total_lines++;
  773. X
  774. X/* some destinations, like BBS msg entry, take a blank line to mean
  775. Xend of message, so do not send completely blank lines */
  776. X        if (!xmit_len && xmit_cr)
  777. X        {
  778. X            lputc(' ');
  779. X            xmit_len = 1;
  780. X        }
  781. X        else if (xmit_mode == 'p')
  782. X        {
  783. X            register char *cptr = file_string;
  784. X
  785. X            while (*cptr)
  786. X            {
  787. X                lputc(*cptr++);
  788. X                Nap(20L);
  789. X                while (rdchk(shm->Liofd))
  790. X                {
  791. X                    rchar = lgetc_xmtr();
  792. X                    process_xmtr_rcvd_char((char)rchar, 1);
  793. X                }
  794. X            }
  795. X        }
  796. X        else
  797. X            lputs(file_string);
  798. X        if (xmit_cr)
  799. X        {
  800. X            if (xmit_mode == 'p')
  801. X                Nap(20L);
  802. X            lputc('\r');
  803. X            xmit_len++;
  804. X        }
  805. X
  806. X        if (sigint)
  807. X            break;
  808. X
  809. X        switch (xmit_mode)
  810. X        {
  811. X            case 's':
  812. X                while (1)
  813. X                {
  814. X                    if (ttyrdchk())
  815. X                        break;
  816. X                    rchar = lgetc_timeout(5 * 1000L);
  817. X                    if (rchar < 0)
  818. X                        file_insert_clear_xoff();
  819. X                    else
  820. X                        process_xmtr_rcvd_char((char)rchar, 1);
  821. X                    if (rchar == 0x0A)
  822. X                        break;
  823. X                }
  824. X                rchar = to_lower(ttygetc(1));
  825. X                if ((rchar == 's') || (rchar == ESC))
  826. X                    goto INSERT_DONE;
  827. X                break;
  828. X
  829. X            case 'e':
  830. X                timeout_msecs = 5 * 1000L;
  831. X                while (1)
  832. X                {
  833. X                    if (sigint)
  834. X                        break;
  835. X                    rchar = lgetc_timeout(timeout_msecs);
  836. X                    if (rchar < 0)
  837. X                    {
  838. X                        if (!xmit_len)
  839. X                            break;
  840. X                        file_insert_clear_xoff();
  841. X                        timeout_msecs = 1 * 1000L;
  842. X                    }
  843. X                    else
  844. X                    {
  845. X                        process_xmtr_rcvd_char((char)rchar, 1);
  846. X                        timeout_msecs = 100L;
  847. X                        if (xmit_len)
  848. X                            xmit_len--;
  849. X                    }
  850. X                    if (rchar == 0x0A)
  851. X                        break;
  852. X                }
  853. X                break;
  854. X
  855. X            case 'f':
  856. X            case 'p':
  857. X                while (rdchk(shm->Liofd))
  858. X                {
  859. X                    rchar = lgetc_xmtr();
  860. X                    process_xmtr_rcvd_char((char)rchar, 1);
  861. X                }
  862. X                break;
  863. X        }
  864. X        if (sigint)
  865. X            break;
  866. X    }
  867. X
  868. X  INSERT_DONE:
  869. X
  870. X    if (sigint)
  871. X    {
  872. X        sigint = 0;
  873. X        setcolor(colors_error);
  874. X        ff(se, "--> Interrupted\r\n");
  875. X        setcolor(colors_at_entry);
  876. X    }
  877. X
  878. X  INSERT_DONE2:
  879. X
  880. X    fclose(fp);
  881. X
  882. X    ttymode(old_ttymode);     /* restore old console mode */
  883. X    sigint = 0;                 /* reset SIGINT flag */
  884. X
  885. X    while (((rchar = lgetc_timeout(200L)) >= 0) && !sigint)
  886. X        process_xmtr_rcvd_char((char)rchar, 1);
  887. X
  888. X    setcolor(colors_success);
  889. X    ff(se, "\r\n-->  done ... sent %ld lines, %ld characters\r\n",
  890. X        total_lines, total_chars);
  891. X    setcolor(colors_at_entry);
  892. X    lclear_xmtr_xoff();
  893. X#ifdef USE_XON_XOFF
  894. X    lxon_xoff(ixon | ixoff); /* restore old line xon/xoff status */
  895. X#endif
  896. X    start_rcvr_process(1);
  897. X    return (0);
  898. X
  899. X}                             /* end of file_insert_to_line */
  900. X
  901. X/* vi: set tabstop=4 shiftwidth=4: */
  902. X/* end of ecufinsert.c */
  903. END_OF_FILE
  904.   if test 7453 -ne `wc -c <'ecu330/ecufinsert.c'`; then
  905.     echo shar: \"'ecu330/ecufinsert.c'\" unpacked with wrong size!
  906.   fi
  907.   # end of 'ecu330/ecufinsert.c'
  908. fi
  909. if test -f 'ecu330/ecuicmhelp.c' -a "${1}" != "-c" ; then 
  910.   echo shar: Will not clobber existing file \"'ecu330/ecuicmhelp.c'\"
  911. else
  912.   echo shar: Extracting \"'ecu330/ecuicmhelp.c'\" \(9756 characters\)
  913.   sed "s/^X//" >'ecu330/ecuicmhelp.c' <<'END_OF_FILE'
  914. X/*+-------------------------------------------------------------------------
  915. X    ecuicmhelp.c -- help for interactive commands
  916. X    wht@n4hgf.atl.ga.us
  917. X
  918. X  Defined functions:
  919. X    help_category_menu()
  920. X    help_choose_cmd()
  921. X    help_cmd_line_setup(prompt)
  922. X    help_display_on_stderr(cmd)
  923. X    help_interactively()
  924. X    help_right_column()
  925. X    help_search_pcmds(cmd)
  926. X    help_show_category(category)
  927. X    icmd_help(narg,arg)
  928. X
  929. X  Whenever the literary German dives into a sentence, that is the
  930. X  last you are going to see of him until he emerges on the other
  931. X  side of his Atlantic with his verb in his mouth.  -- Mark Twain
  932. X
  933. X--------------------------------------------------------------------------*/
  934. X/*+:EDITS:*/
  935. X/*:05-04-1994-04:38-wht@n4hgf-ECU release 3.30 */
  936. X/*:09-10-1992-13:58-wht@n4hgf-ECU release 3.20 */
  937. X/*:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA */
  938. X/*:01-11-1992-16:01-wht@n4hgf-bug in help + F1 reverts to cat menu */
  939. X/*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  940. X/*:08-01-1991-03:52-wht@n4hgf-when editing string, set cursor to end */
  941. X/*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  942. X/*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  943. X
  944. X#include "ecucurses.h"
  945. X#define OMIT_TERMIO_REFERENCES
  946. X#define STDIO_H_INCLUDED
  947. X#include "ecu.h"
  948. X#define NEED_P_CMD
  949. X#include "ecucmd.h"
  950. X#include "ecukey.h"
  951. X#include "ecuxkey.h"
  952. X#include "pc_scr.h"
  953. X
  954. X#define PDAT    "ecuhelp.data"
  955. X
  956. Xvoid help_right_column();
  957. X
  958. Xstatic long start_pos[TOKEN_QUAN];
  959. Xstatic int start_pos_has_been_read = 0;
  960. Xstatic char ecuhelpdata_name[256] = "";
  961. Xstatic FILE *fpdat;             /* help data file */
  962. Xstatic int right_column = 0; /* right column for help_interactively */
  963. Xstatic int longest_cmd = 0;
  964. Xstatic int longest_descr = 0;
  965. X
  966. X/*+-------------------------------------------------------------------------
  967. X    help_search_pcmds(cmd)
  968. X--------------------------------------------------------------------------*/
  969. XP_CMD *
  970. Xhelp_search_pcmds(cmd)
  971. Xregister char *cmd;
  972. X{
  973. X    register P_CMD *cmd_list = icmd_cmds;
  974. X
  975. X    while (cmd_list->token != -1)
  976. X    {
  977. X        if (minunique(cmd_list->cmd, cmd, cmd_list->min_ch))
  978. X            break;
  979. X        cmd_list++;
  980. X    }
  981. X    if (cmd_list->token == -1)
  982. X        return ((P_CMD *) 0);
  983. X    else
  984. X        return (cmd_list);
  985. X
  986. X}                             /* end of help_search_pcmds */
  987. X
  988. X/*+-------------------------------------------------------------------------
  989. X    help_display_on_stderr(cmd)
  990. X--------------------------------------------------------------------------*/
  991. Xvoid
  992. Xhelp_display_on_stderr(cmd)
  993. Xchar *cmd;
  994. X{
  995. X    register itmp;
  996. X    P_CMD *pcmd;
  997. X    char buf[128];
  998. X
  999. X    if (!(pcmd = help_search_pcmds(cmd)))
  1000. X    {
  1001. X        ff(se, "'%s' is not a valid command\r\n", cmd);
  1002. X        return;
  1003. X    }
  1004. X
  1005. X    if (!start_pos[pcmd->token])
  1006. X    {
  1007. X        ff(se, "no help available for '%s'\r\n", cmd);
  1008. X        return;
  1009. X    }
  1010. X
  1011. X    fseek(fpdat, start_pos[pcmd->token], 0);
  1012. X    ff(se, "\r\n");
  1013. X    while (fgets(buf, sizeof(buf), fpdat))
  1014. X    {
  1015. X        itmp = strlen(buf);
  1016. X        buf[--itmp] = 0;
  1017. X        if (itmp == 0)
  1018. X            break;
  1019. X        ff(se, "%s\r\n", buf);
  1020. X    }
  1021. X
  1022. X}                             /* end of help_display_on_stderr */
  1023. X
  1024. X/*+-------------------------------------------------------------------------
  1025. X    help_right_column()
  1026. X--------------------------------------------------------------------------*/
  1027. Xvoid
  1028. Xhelp_right_column()
  1029. X{
  1030. X    register itmp;
  1031. X    register P_CMD *pcmd = icmd_cmds;
  1032. X
  1033. X    if (right_column)         /* already bee thru here? */
  1034. X        return;                 /* ... seems so */
  1035. X
  1036. X    while (pcmd->token != -1)
  1037. X    {
  1038. X        if (!*pcmd->descr)
  1039. X        {
  1040. X            pcmd++;
  1041. X            continue;
  1042. X        }
  1043. X        itmp = strlen(pcmd->cmd);
  1044. X        if (itmp > longest_cmd)
  1045. X            longest_cmd = itmp;
  1046. X        itmp = strlen(pcmd->descr);
  1047. X        if (itmp > longest_descr)
  1048. X            longest_descr = itmp;
  1049. X        pcmd++;
  1050. X    }
  1051. X    right_column = 1 + longest_cmd + 2 + longest_descr + 3;
  1052. X
  1053. X}                             /* end of help_right_column */
  1054. X
  1055. X/*+-------------------------------------------------------------------------
  1056. X    help_cmd_line_setup(prompt)
  1057. X--------------------------------------------------------------------------*/
  1058. Xvoid
  1059. Xhelp_cmd_line_setup(prompt)
  1060. Xchar *prompt;
  1061. X{
  1062. X    register icol;
  1063. X    int y;
  1064. X    int x;
  1065. X
  1066. X    touchwin(stdscr);
  1067. X    wmove(stdscr, LINES - 1, 0);
  1068. X    wstandout(stdscr);
  1069. X    waddstr(stdscr, prompt);
  1070. X    getyx(stdscr, y, x);
  1071. X    for (icol = x; icol < COLS - 1; icol++)
  1072. X        waddch(stdscr, ' ');
  1073. X    wmove(stdscr, y, x);
  1074. X    wstandend(stdscr);
  1075. X    wrefresh(stdscr);
  1076. X}                             /* end of help_cmd_line_setup */
  1077. X
  1078. X/*+-------------------------------------------------------------------------
  1079. X    help_choose_cmd() - choose command from category
  1080. X--------------------------------------------------------------------------*/
  1081. Xchar *
  1082. Xhelp_choose_cmd()
  1083. X{
  1084. X    register y;
  1085. X    register x;
  1086. X    static char cmd[15];
  1087. X    uchar delim = 0;
  1088. X    int wgpos = -1;
  1089. X    int edit = 0;
  1090. X
  1091. X    help_cmd_line_setup(
  1092. X        "Enter command name (F1 for category menu, ESC to exit):  ");
  1093. X    getyx(stdscr, y, x);
  1094. X    wstandout(stdscr);
  1095. X    while ((delim != ESC) && (delim != XF1) && (delim != NL))
  1096. X    {
  1097. X        wingets(stdscr, y, x, cmd, sizeof(cmd) - 1, &delim, edit, &wgpos);
  1098. X        edit = 1;
  1099. X    }
  1100. X    wstandend(stdscr);
  1101. X    if (delim == XF1)
  1102. X        return ("");
  1103. X    else if ((delim == ESC) || (!cmd[0]))
  1104. X        return ((char *)0);
  1105. X    else
  1106. X        return (cmd);
  1107. X
  1108. X}                             /* end of help_choose_cmd */
  1109. X
  1110. X/*+-------------------------------------------------------------------------
  1111. X    help_category_menu() - get user command category choice
  1112. X--------------------------------------------------------------------------*/
  1113. Xint
  1114. Xhelp_category_menu()
  1115. X{
  1116. X    register itmp;
  1117. X    int y;
  1118. X    int x;
  1119. X    char **cpptr;
  1120. X    static char keylist[] =
  1121. X    {'g', 'c', 't', 'p', ESC, 0};
  1122. X    static char *list[] =
  1123. X    {
  1124. X        "g   - general commands",
  1125. X        "c   - communications-related commands",
  1126. X        "t   - transfer-related commands",
  1127. X        "p   - procedure-related commands",
  1128. X        "Esc - exit help",
  1129. X        (char *)0
  1130. X    };
  1131. X
  1132. X    tcap_clear_screen();
  1133. X    wclear(stdscr);
  1134. X    wmove(stdscr, 0, 0);
  1135. X    wstandout(stdscr);
  1136. X    waddstr(stdscr, "-- Interactive Command Help Menu ");
  1137. X    getyx(stdscr, y, x);
  1138. X    for (itmp = x; itmp < COLS - 1; itmp++)
  1139. X        waddch(stdscr, '-');
  1140. X    wstandend(stdscr);
  1141. X
  1142. X    itmp = 2;
  1143. X    cpptr = list;
  1144. X    while (*cpptr)
  1145. X    {
  1146. X        wmove(stdscr, itmp++, 4);
  1147. X        waddstr(stdscr, *cpptr++);
  1148. X    }
  1149. X    wmove(stdscr, 9, 4);
  1150. X    waddstr(stdscr, "---- choose a category -------");
  1151. X    return (winget_single(stdscr, "", keylist));
  1152. X
  1153. X}                             /* end of help_category_menu */
  1154. X
  1155. X/*+-------------------------------------------------------------------------
  1156. X    help_show_category(category) - display category and let user choose
  1157. X--------------------------------------------------------------------------*/
  1158. Xint
  1159. Xhelp_show_category(category)
  1160. Xint category;
  1161. X{
  1162. X    register itmp;
  1163. X    register P_CMD *pcmd;
  1164. X    register y = 1;
  1165. X    register x = 0;
  1166. X    short cmdclass = 0;
  1167. X    char s80[80];
  1168. X    char *class_descr = "?";
  1169. X
  1170. X    switch (category)
  1171. X    {
  1172. X        case 'g':
  1173. X            cmdclass = ccG;
  1174. X            class_descr = "General";
  1175. X            break;
  1176. X        case 'c':
  1177. X            cmdclass = ccC;
  1178. X            class_descr = "Communications";
  1179. X            break;
  1180. X        case 't':
  1181. X            cmdclass = ccT;
  1182. X            class_descr = "File Transfer";
  1183. X            break;
  1184. X        case 'p':
  1185. X            cmdclass = ccP;
  1186. X            class_descr = "Procedure Related";
  1187. X            break;
  1188. X    }
  1189. X
  1190. X    tcap_clear_screen();
  1191. X    wclear(stdscr);
  1192. X    wmove(stdscr, 0, 0);
  1193. X    wstandout(stdscr);
  1194. X    waddstr(stdscr, "-- ");
  1195. X    waddstr(stdscr, class_descr);
  1196. X    waddstr(stdscr, " Commands ");
  1197. X    getyx(stdscr, y, x);
  1198. X    for (itmp = x; itmp < COLS - 1; itmp++)
  1199. X        waddch(stdscr, '-');
  1200. X    wstandend(stdscr);
  1201. X
  1202. X    pcmd = icmd_cmds;
  1203. X    y = 2;
  1204. X    x = 0;
  1205. X    wmove(stdscr, y, x);
  1206. X    while (pcmd->token != -1)
  1207. X    {
  1208. X        if (!*pcmd->descr || (pcmd->cmdclass != cmdclass))
  1209. X        {
  1210. X            pcmd++;
  1211. X            continue;
  1212. X        }
  1213. X        wmove(stdscr, y, x);
  1214. X        strcpy(s80, pcmd->cmd);
  1215. X        pad_zstr_to_len(s80, longest_cmd + 2);
  1216. X        for (itmp = 0; itmp < pcmd->min_ch; itmp++)
  1217. X            s80[itmp] = to_upper(s80[itmp]);
  1218. X        waddstr(stdscr, s80);
  1219. X
  1220. X        strcpy(s80, pcmd->descr);
  1221. X        if (!x)
  1222. X            pad_zstr_to_len(s80, longest_descr + 1);
  1223. X        waddstr(stdscr, s80);
  1224. X
  1225. X        if (!x)
  1226. X        {
  1227. X#if defined(SVR4)
  1228. X            wvline(stdscr, sVR & 0x00ff, 1);
  1229. X#else
  1230. X            waddch(stdscr, sVR);
  1231. X#endif
  1232. X        }
  1233. X        y++;
  1234. X        if (y >= LINES - 3)
  1235. X        {
  1236. X            y = 2;
  1237. X            x = right_column;
  1238. X        }
  1239. X        pcmd++;
  1240. X    }
  1241. X    wmove(stdscr, LINES - 2, 0);
  1242. X    wstandout(stdscr);
  1243. X    waddstr(stdscr,
  1244. X        "Capitalized portion of listed command sufficient for command recognition");
  1245. X    getyx(stdscr, y, x);
  1246. X    for (itmp = x; itmp < COLS - 1; itmp++)
  1247. X        waddch(stdscr, ' ');
  1248. X    wstandend(stdscr);
  1249. X    return (0);
  1250. X
  1251. X}                             /* end of help_show_category */
  1252. X
  1253. X/*+-------------------------------------------------------------------------
  1254. X    help_interactively()
  1255. Xcommands with null descriptions are "undocumented"
  1256. X--------------------------------------------------------------------------*/
  1257. Xvoid
  1258. Xhelp_interactively()
  1259. X{
  1260. X    register char *cptr;
  1261. X    int restart_rcvr = need_rcvr_restart();
  1262. X    char category;
  1263. X
  1264. X    kill_rcvr_process(SIGUSR1);
  1265. X
  1266. X    windows_start();
  1267. X    help_right_column();
  1268. X
  1269. X  DISPLAY_MENU:
  1270. X    if ((category = help_category_menu()) != ESC)
  1271. X    {
  1272. X        help_show_category(category);
  1273. X        while (cptr = help_choose_cmd())
  1274. X        {
  1275. X            if (!*cptr)
  1276. X                goto DISPLAY_MENU;
  1277. X            wmove(stdscr, LINES - 1, 0);
  1278. X            wclrtoeol(stdscr);
  1279. X            wrefresh(stdscr);
  1280. X            help_display_on_stderr(cptr);
  1281. X            ff(se, "\r\npress return:  ");
  1282. X            ttygetc(1);
  1283. X            help_show_category(category);
  1284. X        }
  1285. X    }
  1286. X    wrefresh(stdscr);
  1287. X    windows_end(1);
  1288. X    redisplay_rcvr_screen();
  1289. X    if (restart_rcvr)
  1290. X        start_rcvr_process(0);
  1291. X
  1292. X}                             /* end of help_interactively */
  1293. X
  1294. X/*+-------------------------------------------------------------------------
  1295. X    icmd_help(narg,arg)
  1296. X--------------------------------------------------------------------------*/
  1297. Xvoid
  1298. Xicmd_help(narg, arg)
  1299. Xint narg;
  1300. Xchar **arg;
  1301. X{
  1302. X    register char *cptr;
  1303. X    char *getenv();
  1304. X
  1305. X    ff(se, "\r\n");
  1306. X    if (!ecuhelpdata_name[0])
  1307. X    {
  1308. X        if (!(cptr = getenv("ECUHELP")))
  1309. X            sprintf(ecuhelpdata_name, "%s/%s", ECULIBDIR, PDAT);
  1310. X        else
  1311. X            strcpy(ecuhelpdata_name, cptr);
  1312. X    }
  1313. X
  1314. X    if (!(fpdat = fopen(ecuhelpdata_name, "r")))
  1315. X    {
  1316. X        pperror(ecuhelpdata_name);
  1317. X        return;
  1318. X    }
  1319. X
  1320. X    if (!start_pos_has_been_read)
  1321. X    {
  1322. X        fread((char *)start_pos, sizeof(long), TOKEN_QUAN, fpdat);
  1323. X
  1324. X        start_pos_has_been_read = 1;
  1325. X    }
  1326. X
  1327. X    if (narg > 1)
  1328. X        help_display_on_stderr(arg[1]);
  1329. X    else
  1330. X        help_interactively();
  1331. X
  1332. X    fclose(fpdat);
  1333. X}                             /* end of icmd_help */
  1334. X
  1335. X/* vi: set tabstop=4 shiftwidth=4: */
  1336. END_OF_FILE
  1337.   if test 9756 -ne `wc -c <'ecu330/ecuicmhelp.c'`; then
  1338.     echo shar: \"'ecu330/ecuicmhelp.c'\" unpacked with wrong size!
  1339.   fi
  1340.   # end of 'ecu330/ecuicmhelp.c'
  1341. fi
  1342. if test -f 'ecu330/eculock.c' -a "${1}" != "-c" ; then 
  1343.   echo shar: Will not clobber existing file \"'ecu330/eculock.c'\"
  1344. else
  1345.   echo shar: Extracting \"'ecu330/eculock.c'\" \(5306 characters\)
  1346.   sed "s/^X//" >'ecu330/eculock.c' <<'END_OF_FILE'
  1347. X/*+-----------------------------------------------------------------------
  1348. X    eculock.c -- ECU lock file management (creation)
  1349. X    wht@n4hgf.atl.ga.us
  1350. X
  1351. X  Defined functions:
  1352. X    create_lock_file(name)
  1353. X    lock_tty(line)
  1354. X    unlock_tty(line)
  1355. X
  1356. X  This module provides the functions for creating lock files.
  1357. X  A companion module, ecuLCK.c, has functions for testing lock files.
  1358. X  This module is included by ECU alone. It uses ecuLCK.c functions.
  1359. X------------------------------------------------------------------------*/
  1360. X/*+:EDITS:*/
  1361. X/*:05-04-1994-04:38-wht@n4hgf-ECU release 3.30 */
  1362. X/*:01-25-1994-17:36-wht@n4hgf-better name USE_DECIMAL_PIDS->CFG_BinaryUucpPids */
  1363. X/*:12-18-1993-18:12-wht@n4hgf-use CFG_BinaryUucpPids in place of HONEYDANBER */
  1364. X/*:11-14-1993-12:33-wht@n4hgf-HP-UX port by Carl Wuebker at HP */
  1365. X/*:05-29-1993-21:17-wht@n4hgf-better debug */
  1366. X/*:09-10-1992-13:58-wht@n4hgf-ECU release 3.20 */
  1367. X/*:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA */
  1368. X/*:07-19-1992-22:09-wht@n4hgf-rename check_utmp to reserve_line and move it */
  1369. X/*:07-19-1992-21:54-wht@n4hgf-lock_tty does not effect ungetty_get anymore */
  1370. X/*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  1371. X/*:08-10-1991-17:39-wht@n4hgf-US_WEGOTIT handling */
  1372. X/*:08-09-1991-11:07-wht@n4hgf-configurable lock directory */
  1373. X/*:07-25-1991-12:56-wht@n4hgf-ECU release 3.10 */
  1374. X/*:10-16-1990-20:43-wht@n4hgf-add SHARE_DEBUG */
  1375. X/*:09-19-1990-19:36-wht@n4hgf-ecu_log_event now gets pid for log from caller */
  1376. X/*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  1377. X
  1378. X#include "ecu.h"
  1379. X
  1380. Xextern int errno;
  1381. Xextern char ungetty_ttyname[];
  1382. X
  1383. X/*+-------------------------------------------------------------------------
  1384. X    create_lock_file(name)
  1385. X--------------------------------------------------------------------------*/
  1386. Xint
  1387. Xcreate_lock_file(name)
  1388. Xchar *name;
  1389. X{
  1390. X    register fd;
  1391. X    int rtn_val = -2;         /* flag if not explicitly set below */
  1392. X    int pid = getpid();
  1393. X    char LTMP_fname[64];
  1394. X
  1395. X#if !defined(CFG_BinaryUucpPids)
  1396. X    char s32[32];
  1397. X
  1398. X#endif
  1399. X
  1400. X    errno = 0;
  1401. X    sprintf(LTMP_fname, "%s/LTMP.%05d", lock_dir_name, pid);
  1402. X    if ((fd = creat(LTMP_fname, 0444)) < 0)
  1403. X    {
  1404. X        if (errno == EACCES)
  1405. X        {
  1406. X            strcpy(lopen_err_str, "lock error - try chmod 0777 ");
  1407. X            strcat(lopen_err_str, lock_dir_name);
  1408. X        }
  1409. X        unlink(LTMP_fname);
  1410. X        rtn_val = -1;
  1411. X        goto RETURN_STATUS;
  1412. X    }
  1413. X
  1414. X#if defined(CFG_BinaryUucpPids)
  1415. X    write(fd, (char *)&pid, sizeof(int));
  1416. X
  1417. X#else
  1418. X    sprintf(s32, "%10d\n", getpid());
  1419. X    write(fd, s32, 11);
  1420. X#endif
  1421. X
  1422. X    chmod(LTMP_fname, 0444); /* some programs seem to think writable lock
  1423. X                              * file is game for killing */
  1424. X    close(fd);
  1425. X
  1426. X    /*
  1427. X     * this is the real lock ... if this link does not succeed, then the
  1428. X     * file already exists; if the link suceeds, we have locked the device
  1429. X     * with no chance of a race
  1430. X     */
  1431. X    errno = 0;
  1432. X    rtn_val = link(LTMP_fname, name);
  1433. X    unlink(LTMP_fname);
  1434. X    chmod(name, 0444);
  1435. X
  1436. X  RETURN_STATUS:
  1437. X
  1438. X#if defined(LOCK_DEBUG)
  1439. X    {
  1440. X        char s512[512];
  1441. X        char *cptr;
  1442. X
  1443. X        if (cptr = strrchr(name, '/'))
  1444. X            cptr++;
  1445. X        else
  1446. X            cptr = name;
  1447. X        sprintf(s512, "CREATE %s %s (%s)", cptr,
  1448. X            (rtn_val) ? "FAIL" : "SUCCEED",
  1449. X            (rtn_val) ? errno_text(errno) : "No error");
  1450. X        ecu_log_event(getpid(), s512);
  1451. X    }
  1452. X#endif
  1453. X
  1454. X    return (rtn_val);
  1455. X
  1456. X}                             /* end of create_lock_file */
  1457. X
  1458. X/*+-------------------------------------------------------------------------
  1459. X    lock_tty(line) - create lock files for tty line in 'line'
  1460. X
  1461. Xreturn LINST_OK (0) if locked else LINST_... error
  1462. X--------------------------------------------------------------------------*/
  1463. Xenum linst
  1464. Xlock_tty(line)
  1465. Xchar *line;
  1466. X{
  1467. X    enum linst linst = LINST_OK;
  1468. X    char name[256];
  1469. X
  1470. X    name[0] = 0;
  1471. X    errno = 0;
  1472. X
  1473. X    if (linst = make_lock_name(line, name))
  1474. X        goto FUNC_RETURN;
  1475. X
  1476. X#if defined(LOCK_DEBUG)
  1477. X    {
  1478. X        char s512[512];
  1479. X        char *cptr = strrchr(name, '/');
  1480. X
  1481. X        if (cptr)
  1482. X            cptr++;
  1483. X        else
  1484. X            cptr = name;
  1485. X        sprintf(s512, "LOCK TTY REQUEST %s %s %s %s", line, name,
  1486. X            (linst) ? LINST_text(linst) : "",
  1487. X            (linst) ? errno_text(errno) : "");
  1488. X        ecu_log_event(getpid(), s512);
  1489. X    }
  1490. X#endif
  1491. X
  1492. X    if (create_lock_file(name))
  1493. X    {
  1494. X        if (linst = is_active_lock(name))
  1495. X        {
  1496. X            if (linst == LINST_WEGOTIT)
  1497. X            {
  1498. X                linst = LINST_OK;
  1499. X                goto FUNC_RETURN;
  1500. X            }
  1501. X            ungetty_return_line(line, "lock_tty 1");
  1502. X            errno = EACCES;     /* for termecu() */
  1503. X            goto FUNC_RETURN;
  1504. X        }
  1505. X        if (create_lock_file(name))
  1506. X        {
  1507. X            ungetty_return_line(line, "lock_tty 2");
  1508. X            errno = EACCES;     /* for termecu() */
  1509. X            {
  1510. X                linst = LINST_LCKERR;
  1511. X                goto FUNC_RETURN;
  1512. X            }
  1513. X        }
  1514. X    }
  1515. X
  1516. X  FUNC_RETURN:
  1517. X
  1518. X#if defined(LOCK_DEBUG)
  1519. X    {
  1520. X        char s512[512];
  1521. X        char *cptr = strrchr(name, '/');
  1522. X
  1523. X        if (cptr)
  1524. X            cptr++;
  1525. X        else
  1526. X            cptr = name;
  1527. X        sprintf(s512, "LOCK TTY RESULT %s %s (%s)", cptr,
  1528. X            (linst) ? LINST_text(linst) : "SUCCESS",
  1529. X            (linst) ? errno_text(errno) : "No error");
  1530. X        ecu_log_event(getpid(), s512);
  1531. X    }
  1532. X#endif
  1533. X
  1534. X    return (linst);
  1535. X
  1536. X}                             /* end of lock_tty */
  1537. X
  1538. X/*+-----------------------------------------------------------------------
  1539. X    void unlock_tty(line)
  1540. X------------------------------------------------------------------------*/
  1541. Xvoid
  1542. Xunlock_tty(line)
  1543. Xchar *line;
  1544. X{
  1545. X    char lockname[512];
  1546. X
  1547. X    if (make_lock_name(line, lockname))
  1548. X    {
  1549. X        ff(se, "unlock_tty cannot build lock file for %s\r\n", line);
  1550. X        termecu(TERMECU_LOGIC_ERROR);
  1551. X    }
  1552. X
  1553. X    ungetty_return_line(line, "unlock_tty");
  1554. X    unlink(lockname);
  1555. X
  1556. X}                             /* end of unlock_tty */
  1557. X
  1558. X/* end of eculock.c */
  1559. X/* vi: set tabstop=4 shiftwidth=4: */
  1560. END_OF_FILE
  1561.   if test 5306 -ne `wc -c <'ecu330/eculock.c'`; then
  1562.     echo shar: \"'ecu330/eculock.c'\" unpacked with wrong size!
  1563.   fi
  1564.   # end of 'ecu330/eculock.c'
  1565. fi
  1566. if test -f 'ecu330/fasiintf.c' -a "${1}" != "-c" ; then 
  1567.   echo shar: Will not clobber existing file \"'ecu330/fasiintf.c'\"
  1568. else
  1569.   echo shar: Extracting \"'ecu330/fasiintf.c'\" \(9772 characters\)
  1570.   sed "s/^X//" >'ecu330/fasiintf.c' <<'END_OF_FILE'
  1571. X/*+-------------------------------------------------------------------------
  1572. X    fasiintf.c - FAS/i interface
  1573. X    wht@n4hgf.atl.ga.us
  1574. X
  1575. X  Defined functions:
  1576. X    display_fasi(fip)
  1577. X    fasi_breaks_detected()
  1578. X    fasi_line_errors()
  1579. X    fasi_msr()
  1580. X    fasi_rings_detected()
  1581. X    icmd_fasi(narg,arg)
  1582. X    ier_text(ier)
  1583. X    lcr_text(lcr)
  1584. X    mcr_text(mcr)
  1585. X    msr_text(msr)
  1586. X    pcmd_fasi(param)
  1587. X
  1588. X--------------------------------------------------------------------------*/
  1589. X/*+:EDITS:*/
  1590. X/*:05-04-1994-04:39-wht@n4hgf-ECU release 3.30 */
  1591. X/*:09-10-1992-13:59-wht@n4hgf-ECU release 3.20 */
  1592. X/*:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA */
  1593. X/*:07-25-1991-12:57-wht@n4hgf-ECU release 3.10 */
  1594. X/*:04-29-1991-18:52-wht@n4hgf-FAS/i 2.08.0 official release */
  1595. X/*:12-24-1990-00:51-wht-creation */
  1596. X
  1597. X#include "ecu.h"
  1598. X
  1599. X#if    defined(FASI)
  1600. X#include "ecuerror.h"
  1601. X#include "esd.h"
  1602. X#if defined(NULL)
  1603. X#undef NULL
  1604. X#endif
  1605. X#include <local/fas.h>
  1606. X
  1607. Xextern int proc_trace;
  1608. X
  1609. X/*+-------------------------------------------------------------------------
  1610. X    msr_text(msr)
  1611. X--------------------------------------------------------------------------*/
  1612. Xchar *
  1613. Xmsr_text(msr)
  1614. Xuchar msr;
  1615. X{
  1616. X    static char txt[50];
  1617. X
  1618. X    txt[0] = '*';
  1619. X    txt[1] = 0;
  1620. X    if (!msr)
  1621. X    {
  1622. X        strcat(txt, "NULL*");
  1623. X        return (txt);
  1624. X    }
  1625. X    if (msr & MS_CTS_DELTA)
  1626. X        strcat(txt, "dCTS*");
  1627. X    if (msr & MS_DSR_DELTA)
  1628. X        strcat(txt, "dDSR*");
  1629. X    if (msr & MS_RING_TEDGE)
  1630. X        strcat(txt, "dRI*");
  1631. X    if (msr & MS_DCD_DELTA)
  1632. X        strcat(txt, "dDCD*");
  1633. X    if (msr & MS_CTS_PRESENT)
  1634. X        strcat(txt, "CTS*");
  1635. X    if (msr & MS_DSR_PRESENT)
  1636. X        strcat(txt, "DSR*");
  1637. X    if (msr & MS_RING_PRESENT)
  1638. X        strcat(txt, "RING*");
  1639. X    if (msr & MS_DCD_PRESENT)
  1640. X        strcat(txt, "DCD*");
  1641. X    return (txt);
  1642. X
  1643. X}                             /* end of msr_text */
  1644. X
  1645. X/*+-------------------------------------------------------------------------
  1646. X    mcr_text(mcr)
  1647. X--------------------------------------------------------------------------*/
  1648. Xchar *
  1649. Xmcr_text(mcr)
  1650. Xuchar mcr;
  1651. X{
  1652. X    static char txt[32];
  1653. X
  1654. X    txt[0] = '*';
  1655. X    txt[1] = 0;
  1656. X    if (!mcr)
  1657. X    {
  1658. X        strcat(txt, "NULL*");
  1659. X        return (txt);
  1660. X    }
  1661. X    if (mcr & MC_SET_DTR)
  1662. X        strcat(txt, "DTR*");
  1663. X    if (mcr & MC_SET_RTS)
  1664. X        strcat(txt, "RTS*");
  1665. X    if (mcr & MC_SET_OUT1)
  1666. X        strcat(txt, "OUT1*");
  1667. X    if (mcr & MC_SET_OUT2)
  1668. X        strcat(txt, "OUT2*");
  1669. X    if (mcr & MC_SET_LOOPBACK)
  1670. X        strcat(txt, "LOOPBACK*");
  1671. X    return (txt);
  1672. X
  1673. X}                             /* end of mcr_text */
  1674. X
  1675. X/*+-------------------------------------------------------------------------
  1676. X    lcr_text(lcr)
  1677. X--------------------------------------------------------------------------*/
  1678. Xchar *
  1679. Xlcr_text(lcr)
  1680. Xuchar lcr;
  1681. X{
  1682. X    static char txt[64];
  1683. X
  1684. X    sprintf(txt, "*%ddb*", (lcr & LC_WORDLEN_MASK) + 5);
  1685. X    strcat(txt, (lcr & LC_STOPBITS_LONG) ? "2" : "1");
  1686. X    strcat(txt, "sb*");
  1687. X    if (lcr & LC_ENABLE_PARITY)
  1688. X    {
  1689. X        strcat(txt, "PARITY*");
  1690. X        if (lcr & LC_STICK_PARITY)
  1691. X            strcat(txt, (lcr & LC_EVEN_PARITY) ? "MARK*" : "SPACE*");
  1692. X        else
  1693. X            strcat(txt, (lcr & LC_EVEN_PARITY) ? "EVEN*" : "ODD*");
  1694. X    }
  1695. X    else
  1696. X        strcat(txt, "NOPAR*");
  1697. X    if (lcr & LC_SET_BREAK_LEVEL)
  1698. X        strcat(txt, "SETBREAK*");
  1699. X    if (lcr & LC_ENABLE_DIVISOR)
  1700. X        strcat(txt, "ENABDIV*");
  1701. X    return (txt);
  1702. X
  1703. X}                             /* end of lcr_text */
  1704. X
  1705. X/*+-------------------------------------------------------------------------
  1706. X    ier_text(ier)
  1707. X--------------------------------------------------------------------------*/
  1708. Xchar *
  1709. Xier_text(ier)
  1710. Xuchar ier;
  1711. X{
  1712. X    static char txt[32];
  1713. X
  1714. X    txt[0] = '*';
  1715. X    txt[1] = 0;
  1716. X    if (!ier)
  1717. X    {
  1718. X        strcat(txt, "NULL*");
  1719. X        return (txt);
  1720. X    }
  1721. X    if (ier & IE_RECV_DATA_AVAILABLE)
  1722. X        strcat(txt, "RDAV*");
  1723. X    if (ier & IE_XMIT_HOLDING_BUFFER_EMPTY)
  1724. X        strcat(txt, "TBMT*");
  1725. X    if (ier & IE_LINE_STATUS)
  1726. X        strcat(txt, "LS*");
  1727. X    if (ier & IE_MODEM_STATUS)
  1728. X        strcat(txt, "MS*");
  1729. X    return (txt);
  1730. X
  1731. X}                             /* end of ier_text */
  1732. X
  1733. X/*+-------------------------------------------------------------------------
  1734. X    display_fasi(fip)
  1735. X--------------------------------------------------------------------------*/
  1736. Xvoid
  1737. Xdisplay_fasi(fip)
  1738. Xstruct fas_info *fip;
  1739. X{
  1740. X
  1741. X    pprintf("base address: %04x irq=%u ", fip->port_0.addr, fip->vec);
  1742. X    pputs("device is ");
  1743. X    if (fip->device_flags.s & DF_DEVICE_IS_NS16550A)
  1744. X        pputs("16550\n");
  1745. X    else if (fip->device_flags.s & DF_DEVICE_IS_I82510)
  1746. X        pputs("82510\n");
  1747. X    else
  1748. X        pputs("16450\n");
  1749. X    pprintf("MSR=%s   ", msr_text(fip->msr));
  1750. X    pprintf("MCR=%s\n", mcr_text(fip->mcr));
  1751. X    pprintf("LCR=%s   ", lcr_text(fip->lcr));
  1752. X    pprintf("IER=%s\n", ier_text(fip->ier));
  1753. X    pprintf("recv ring cnt=%u  ", fip->recv_ring_cnt);
  1754. X    pprintf("xmit ring cnt=%u  ", fip->xmit_ring_cnt);
  1755. X    pprintf("xmit fifo size=%u\n", fip->xmit_fifo_size);
  1756. X    pprintf("characters received    =%12lu\n", fip->characters_received);
  1757. X    pprintf("characters transmitted =%12lu\n", fip->characters_transmitted);
  1758. X    pprintf("modem status events    =%12lu\n", fip->modem_status_events);
  1759. X    pprintf("overrun errors=%lu  ", fip->overrun_errors);
  1760. X    pprintf("framing errors=%lu  ", fip->framing_errors);
  1761. X    pprintf("parity errors=%lu\n", fip->parity_errors);
  1762. X    pprintf("rings detected=%lu  ", fip->rings_detected);
  1763. X    pprintf("breaks detected=%lu\n", fip->breaks_detected);
  1764. X    pprintf("xmtr flow off XON/XOFF=%lu  RTS/CTS=%lu\n",
  1765. X        fip->xmtr_sw_flow_count, fip->xmtr_hw_flow_count);
  1766. X    pprintf("rcvr flow off XON/XOFF=%lu  RTS/CTS=%lu\n",
  1767. X        fip->rcvr_sw_flow_count, fip->rcvr_hw_flow_count);
  1768. X
  1769. X}                             /* end of display_fasi */
  1770. X
  1771. X/*+-------------------------------------------------------------------------
  1772. X    fasi_msr() - return modem status register contents
  1773. X--------------------------------------------------------------------------*/
  1774. Xuchar
  1775. Xfasi_msr()
  1776. X{
  1777. X    ulong ltmp = 0;
  1778. X
  1779. X    return ((uchar) ioctl(shm->Liofd, FASIC_MCR, (char *)<mp));
  1780. X    return (ltmp);
  1781. X}                             /* end of fasi_msr */
  1782. X
  1783. X/*+-------------------------------------------------------------------------
  1784. X    fasi_line_errors() - return UART error count
  1785. X--------------------------------------------------------------------------*/
  1786. Xulong
  1787. Xfasi_line_errors()
  1788. X{
  1789. X    struct fas_info finfo, *fip = &finfo;
  1790. X
  1791. X    memset((char *)fip, 0, sizeof(*fip));
  1792. X
  1793. X    if ((ioctl(shm->Liofd, FASIC_SIP, (char *)fip)) < 0)
  1794. X        return (0);
  1795. X    return (fip->parity_errors + fip->framing_errors + fip->overrun_errors);
  1796. X
  1797. X}                             /* end of fasi_line_errors */
  1798. X
  1799. X/*+-------------------------------------------------------------------------
  1800. X    fasi_rings_detected() - return number of RI trailing edges
  1801. X--------------------------------------------------------------------------*/
  1802. Xulong
  1803. Xfasi_rings_detected()
  1804. X{
  1805. X    struct fas_info finfo, *fip = &finfo;
  1806. X
  1807. X    memset((char *)fip, 0, sizeof(*fip));
  1808. X
  1809. X    if ((ioctl(shm->Liofd, FASIC_SIP, (char *)fip)) < 0)
  1810. X        return (0);
  1811. X    return (fip->rings_detected);
  1812. X
  1813. X}                             /* end of fasi_rings_detected */
  1814. X
  1815. X/*+-------------------------------------------------------------------------
  1816. X    fasi_breaks_detected() - return number of BREAKs detected
  1817. X--------------------------------------------------------------------------*/
  1818. Xulong
  1819. Xfasi_breaks_detected()
  1820. X{
  1821. X    struct fas_info finfo, *fip = &finfo;
  1822. X
  1823. X    memset((char *)fip, 0, sizeof(*fip));
  1824. X
  1825. X    if ((ioctl(shm->Liofd, FASIC_SIP, (char *)fip)) < 0)
  1826. X        return (0);
  1827. X    return (fip->breaks_detected);
  1828. X
  1829. X}                             /* end of fasi_breaks_detected */
  1830. X
  1831. X/*+-------------------------------------------------------------------------
  1832. X    pcmd_fasi(param)
  1833. Xfasi [-switches] <str-cmd>>
  1834. X
  1835. Xwhere <str-cmd> is 'd[isplay]'
  1836. X                or 'r[eset]'
  1837. X
  1838. Xfasi 'd'
  1839. Xfasi 'r'
  1840. X--------------------------------------------------------------------------*/
  1841. Xint
  1842. Xpcmd_fasi(param)
  1843. XESD *param;
  1844. X{
  1845. X    int erc;
  1846. X    char switches[8];
  1847. X    ESD *tesd = (ESD *) 0;
  1848. X    struct fas_info finfo, *fip = &finfo;
  1849. X    char ident_str[128];
  1850. X
  1851. X    memset((char *)fip, 0, sizeof(*fip));
  1852. X
  1853. X    get_switches(param, switches, sizeof(switches));
  1854. X    if (!(tesd = esdalloc(64)))
  1855. X        return (eNoMemory);
  1856. X    if (!(erc = gstr(param, tesd, 1)))
  1857. X    {
  1858. X        skip_cmd_break(tesd);
  1859. X        switch (to_lower(*(tesd->pb + tesd->index)))
  1860. X        {
  1861. X            case 'd':         /* display */
  1862. X                if ((ioctl(shm->Liofd, FASIC_SIP, (char *)fip)) < 0)
  1863. X                {
  1864. X                    pperror("ioctl FASIC_SIP");
  1865. X                    erc = eFATAL_ALREADY;
  1866. X                }
  1867. X                else
  1868. X                    display_fasi(fip);
  1869. X                if ((ioctl(shm->Liofd, FASIC_DVR_IDENT, ident_str)) < 0)
  1870. X                {
  1871. X                    pperror("ioctl FASIC_DVR_IDENT");
  1872. X                    erc = eFATAL_ALREADY;
  1873. X                }
  1874. X                else
  1875. X                    pprintf("driver:  '%s'\n", ident_str);
  1876. X                if ((ioctl(shm->Liofd, FASIC_SPACE_IDENT, ident_str)) < 0)
  1877. X                {
  1878. X                    pperror("ioctl FASIC_SPACE_IDENT");
  1879. X                    erc = eFATAL_ALREADY;
  1880. X                }
  1881. X                else
  1882. X                    pprintf("space.c: '%s'\n", ident_str);
  1883. X                break;
  1884. X
  1885. X            case 'r':         /* reset */
  1886. X                if ((ioctl(shm->Liofd, FASIC_RESET_STAT, (char *)0)) < 0)
  1887. X                {
  1888. X                    pperror("ioctl FASIC_RESET_STAT");
  1889. X                    erc = eFATAL_ALREADY;
  1890. X                }
  1891. X                else if (proc_trace)
  1892. X                    pputs("statistics reset\n");
  1893. X                break;
  1894. X
  1895. X            default:
  1896. X                pputs("invalid subcommand '");
  1897. X                pputs(tesd->pb);
  1898. X                pputs("'\n");
  1899. X                erc = eFATAL_ALREADY;
  1900. X                break;
  1901. X        }
  1902. X    }
  1903. X
  1904. X    if (tesd)
  1905. X        esdfree(tesd);
  1906. X    return (erc);
  1907. X
  1908. X}                             /* end of pcmd_fasi */
  1909. X
  1910. X/*+-------------------------------------------------------------------------
  1911. X    icmd_fasi(narg,arg)
  1912. X--------------------------------------------------------------------------*/
  1913. Xvoid
  1914. Xicmd_fasi(narg, arg)
  1915. Xint narg;
  1916. Xchar **arg;
  1917. X{
  1918. X    struct fas_info finfo, *fip = &finfo;
  1919. X    char ident_str[128];
  1920. X
  1921. X    memset((char *)fip, 0, sizeof(*fip));
  1922. X
  1923. X    if ((narg > 1) && (to_lower(*arg[1]) == 'r'))
  1924. X    {
  1925. X        if ((ioctl(shm->Liofd, FASIC_RESET_STAT, (char *)0)) < 0)
  1926. X        {
  1927. X            pperror("   ioctl FASIC_RESET_STAT");
  1928. X            return;
  1929. X        }
  1930. X        ff(se, "  fasi statistics reset\r\n");
  1931. X    }
  1932. X    else
  1933. X    {
  1934. X        if ((ioctl(shm->Liofd, FASIC_SIP, (char *)fip)) < 0)
  1935. X        {
  1936. X            pperror("   ioctl FASIC_SIP");
  1937. X            return;
  1938. X        }
  1939. X        ff(se, "\r\n");
  1940. X        display_fasi(fip);
  1941. X        if ((ioctl(shm->Liofd, FASIC_DVR_IDENT, ident_str)) < 0)
  1942. X            pperror("ioctl FASIC_DVR_IDENT");
  1943. X        else
  1944. X            pprintf("driver:  '%s'\n", ident_str);
  1945. X        if ((ioctl(shm->Liofd, FASIC_SPACE_IDENT, ident_str)) < 0)
  1946. X            pperror("ioctl FASIC_SPACE_IDENT");
  1947. X        else
  1948. X            pprintf("space.c: '%s'\n", ident_str);
  1949. X    }
  1950. X
  1951. X}                             /* end of icmd_fasi */
  1952. X
  1953. X#endif /* FASI */
  1954. X
  1955. X/* vi: set tabstop=4 shiftwidth=4: */
  1956. X/* end of fasiintf.c */
  1957. END_OF_FILE
  1958.   if test 9772 -ne `wc -c <'ecu330/fasiintf.c'`; then
  1959.     echo shar: \"'ecu330/fasiintf.c'\" unpacked with wrong size!
  1960.   fi
  1961.   # end of 'ecu330/fasiintf.c'
  1962. fi
  1963. if test -f 'ecu330/mapkey/keys.usa.ecu' -a "${1}" != "-c" ; then 
  1964.   echo shar: Will not clobber existing file \"'ecu330/mapkey/keys.usa.ecu'\"
  1965. else
  1966.   echo shar: Extracting \"'ecu330/mapkey/keys.usa.ecu'\" \(10032 characters\)
  1967.   sed "s/^X//" >'ecu330/mapkey/keys.usa.ecu' <<'END_OF_FILE'
  1968. X#+----------------------------------------------------------------------------
  1969. X# keys.usa.ecu
  1970. X# SCO keys file for ECU alt-[a-z] support
  1971. X#-----------------------------------------------------------------------------
  1972. X#+:EDITS:
  1973. X#:05-04-1994-04:39-wht@n4hgf-ECU release 3.30
  1974. X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
  1975. X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
  1976. X#:05-02-1991-01:57-wht@n4hgf-alt-[a-z] range moved from 0x80-0x99 to 0xe0-0xf9
  1977. X
  1978. X# scan                      cntrl          alt    alt   cntrl  lock
  1979. X# code  base  shift  cntrl  shift   alt   shift  cntrl  shift  state
  1980. X     0  nop    nop    nop    nop    nop    nop    nop    nop     O
  1981. X     1  esc    esc    esc    esc    esc    esc    esc    esc     O
  1982. X     2  '1'    '!'    nop    nop    '1'    '!'    nop    nop     O
  1983. X     3  '2'    '@'    nul    nul    '2'    '@'    nul    nul     O
  1984. X     4  '3'    '#'    nop    nop    '3'    '#'    nop    nop     O
  1985. X     5  '4'    '$'    nop    nop    '4'    '$'    nop    nop     O
  1986. X     6  '5'    '%'    nop    nop    '5'    '%'    nop    nop     O
  1987. X     7  '6'    '^'    rs     rs     '6'    '^'    rs     rs      O
  1988. X     8  '7'    '&'    nop    nop    '7'    '&'    nop    nop     O
  1989. X     9  '8'    '*'    nop    nop    '8'    '*'    nop    nop     O
  1990. X    10  '9'    '('    nop    nop    '9'    '('    nop    nop     O
  1991. X    11  '0'    ')'    nop    nop    '0'    ')'    nop    nop     O
  1992. X    12  '-'    '_'    ns     ns     '-'    '_'    ns     ns      O
  1993. X    13  '='    '+'    nop    nop    '='    '+'    nop    nop     O
  1994. X    14  bs     bs     del    del    bs     bs     del    del     O
  1995. X    15  ht     btab   nop    nop    ht     btab   nop    nop     O
  1996. X    16  'q'    'Q'    dc1    dc1    0xf1   'Q'    dc1    dc1     C
  1997. X    17  'w'    'W'    etb    etb    0xf7   'W'    etb    etb     C
  1998. X    18  'e'    'E'    enq    enq    0xe5   'E'    enq    enq     C
  1999. X    19  'r'    'R'    dc2    dc2    0xf2   'R'    dc2    dc2     C
  2000. X    20  't'    'T'    dc4    dc4    0xf4   'T'    dc4    dc4     C
  2001. X    21  'y'    'Y'    em     em     0xf9   'Y'    em     em      C
  2002. X    22  'u'    'U'    nak    nak    0xf5   'U'    nak    nak     C
  2003. X    23  'i'    'I'    ht     ht     0xe9   'I'    ht     ht      C
  2004. X    24  'o'    'O'    si     si     0xef   'O'    si     si      C
  2005. X    25  'p'    'P'    dle    dle    0xf0   'P'    dle    dle     C
  2006. X    26  '['    '{'    esc    esc    '['    '{'    esc    esc     O
  2007. X    27  ']'    '}'    gs     gs     ']'    '}'    gs     gs      O
  2008. X    28  cr     cr     nl     nl     cr     cr     nl     nl      O
  2009. X    29  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl   O
  2010. X    30  'a'    'A'    soh    soh    0xe1   'A'    soh    soh     C
  2011. X    31  's'    'S'    dc3    dc3    0xf3   'S'    dc3    dc3     C
  2012. X    32  'd'    'D'    eot    eot    0xe4   'D'    eot    eot     C
  2013. X    33  'f'    'F'    ack    ack    0xe6   'F'    ack    ack     C
  2014. X    34  'g'    'G'    bel    bel    0xe7   'G'    bel    bel     C
  2015. X    35  'h'    'H'    bs     bs     0xe8   'H'    bs     bs      C
  2016. X    36  'j'    'J'    nl     nl     0xea   'J'    nl     nl      C
  2017. X    37  'k'    'K'    vt     vt     0xeb   'K'    vt     vt      C
  2018. X    38  'l'    'L'    np     np     0xec   'L'    np     np      C
  2019. X    39  ';'    ':'    nop    nop    ';'    ':'    nop    nop     O
  2020. X    40  '\''   '"'    nop    nop    '\''   '"'    nop    nop     O
  2021. X    41  '`'    '~'    nop    nop    '`'    '~'    nop    nop     O
  2022. X    42  lshift lshift lshift lshift lshift lshift lshift lshift  O
  2023. X    43  '\\'   '|'    fs     fs     '\\'   '|'    fs     fs      O
  2024. X    44  'z'    'Z'    sub    sub    0xfa   'Z'    sub    sub     C
  2025. X    45  'x'    'X'    can    can    0xf8   'X'    can    can     C
  2026. X    46  'c'    'C'    etx    etx    0xe3   'C'    etx    etx     C
  2027. X    47  'v'    'V'    syn    syn    0xf6   'V'    syn    syn     C
  2028. X    48  'b'    'B'    stx    stx    0xe2   'B'    stx    stx     C
  2029. X    49  'n'    'N'    so     so     0xee   'N'    so     so      C
  2030. X    50  'm'    'M'    cr     cr     0xed   'M'    cr     cr      C
  2031. X    51  ','    '<'    nop    nop    ','    '<'    nop    nop     O
  2032. X    52  '.'    '>'    nop    nop    '.'    '>'    nop    nop     O
  2033. X    53  '/'    '?'    nop    nop    '/'    '?'    nop    nop     O
  2034. X    54  rshift rshift rshift rshift rshift rshift rshift rshift  O
  2035. X    55  '*'    '*'    nscr   nscr   '*'    '*'    nscr   nscr    O
  2036. X    56  lalt   lalt   lalt   lalt   lalt   lalt   lalt   lalt    O
  2037. X    57  ' '    ' '    ' '    ' '    ' '    ' '    ' '    ' '     O
  2038. X    58  clock  clock  clock  clock  clock  clock  clock  clock   O
  2039. X    59  fkey1  fkey13 fkey25 fkey37 scr1   scr11  scr1   scr11   O
  2040. X    60  fkey2  fkey14 fkey26 fkey38 scr2   scr12  scr2   scr12   O
  2041. X    61  fkey3  fkey15 fkey27 fkey39 scr3   scr13  scr3   scr13   O
  2042. X    62  fkey4  fkey16 fkey28 fkey40 scr4   scr14  scr4   scr14   O
  2043. X    63  fkey5  fkey17 fkey29 fkey41 scr5   scr15  scr5   scr15   O
  2044. X    64  fkey6  fkey18 fkey30 fkey42 scr6   scr16  scr6   scr16   O
  2045. X    65  fkey7  fkey19 fkey31 fkey43 scr7   scr7   scr7   scr7    O
  2046. X    66  fkey8  fkey20 fkey32 fkey44 scr8   scr8   scr8   scr8    O
  2047. X    67  fkey9  fkey21 fkey33 fkey45 scr9   scr9   scr9   scr9    O
  2048. X    68  fkey10 fkey22 fkey34 fkey46 scr10  scr10  scr10  scr10   O
  2049. X    69  nlock  nlock  dc3    dc3    nlock  nlock  dc3    dc3     O
  2050. X    70  slock  slock  del    del    slock  slock  del    del     O
  2051. X    71  fkey49 '7'    '7'    '7'    '7'    '7'    '7'    '7'     N
  2052. X    72  fkey50 '8'    '8'    '8'    '8'    '8'    '8'    '8'     N
  2053. X    73  fkey51 '9'    '9'    '9'    '9'    '9'    '9'    '9'     N
  2054. X    74  fkey52 '-'    '-'    '-'    '-'    '-'    '-'    '-'     N
  2055. X    75  fkey53 '4'    '4'    '4'    '4'    '4'    '4'    '4'     N
  2056. X    76  fkey54 '5'    '5'    '5'    '5'    '5'    '5'    '5'     N
  2057. X    77  fkey55 '6'    '6'    '6'    '6'    '6'    '6'    '6'     N
  2058. X    78  fkey56 '+'    '+'    '+'    '+'    '+'    '+'    '+'     N
  2059. X    79  fkey57 '1'    '1'    '1'    '1'    '1'    '1'    '1'     N
  2060. X    80  fkey58 '2'    '2'    '2'    '2'    '2'    '2'    '2'     N
  2061. X    81  fkey59 '3'    '3'    '3'    '3'    '3'    '3'    '3'     N
  2062. X    82  fkey60 '0'    '0'    '0'    '0'    '0'    '0'    '0'     N
  2063. X    83  del    '.'    del    del    del    del    del    del     N
  2064. X    84  0x1f   0x1f   0x1f   0x1f   0x1f   0x1f   0x1f   0x1f    O
  2065. X    85  nop    nop    nop    nop    nop    nop    nop    nop     O
  2066. X    86  nop    nop    nop    nop    nop    nop    nop    nop     O
  2067. X    87  fkey11 fkey23 fkey35 fkey47 scr11  scr11  scr11  scr11   O
  2068. X    88  fkey12 fkey24 fkey36 fkey48 scr12  scr12  scr12  scr12   O
  2069. X    89  nop    nop    nop    nop    nop    nop    nop    nop     O
  2070. X    90  nop    nop    nop    nop    nop    nop    nop    nop     O
  2071. X    91  nop    nop    nop    nop    nop    nop    nop    nop     O
  2072. X    92  nop    nop    nop    nop    nop    nop    nop    nop     O
  2073. X    93  nop    nop    nop    nop    nop    nop    nop    nop     O
  2074. X    94  nop    nop    nop    nop    nop    nop    nop    nop     O
  2075. X    95  nop    nop    nop    nop    nop    nop    nop    nop     O
  2076. X    96  fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50  O
  2077. X    97  fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53  O
  2078. X    98  fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58  O
  2079. X    99  fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55  O
  2080. X   100  fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49  O
  2081. X   102  fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57  O
  2082. X   103  fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59  O
  2083. X   104  fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60  O
  2084. X   105  del    del    del    del    del    del    del    del     N
  2085. X   106  fkey54 fkey54 fkey54 fkey54 fkey54 fkey54 fkey54 fkey54  O
  2086. X   107  nop    nop    nop    nop    nop    nop    nop    nop     O
  2087. X   108  nop    nop    nop    nop    nop    nop    nop    nop     O
  2088. X   109  nop    nop    nop    nop    nop    nop    nop    nop     O
  2089. X   110  nop    nop    nop    nop    nop    nop    nop    nop     O
  2090. X   111  fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51  O
  2091. X   111  nop    nop    nop    nop    nop    nop    nop    nop     O
  2092. X   112  nop    nop    nop    nop    nop    nop    nop    nop     O
  2093. X   113  nop    nop    nop    nop    nop    nop    nop    nop     O
  2094. X   114  nop    nop    nop    nop    nop    nop    nop    nop     O
  2095. X   116  nop    nop    nop    nop    nop    nop    nop    nop     O
  2096. X   117  nop    nop    nop    nop    nop    nop    nop    nop     O
  2097. X   118  nop    nop    nop    nop    nop    nop    nop    nop     O
  2098. X   119  nop    nop    nop    nop    nop    nop    nop    nop     O
  2099. X   120  nop    nop    nop    nop    nop    nop    nop    nop     O
  2100. X   121  nop    nop    nop    nop    nop    nop    nop    nop     O
  2101. X   122  nop    nop    nop    nop    nop    nop    nop    nop     O
  2102. X   123  nop    nop    nop    nop    nop    nop    nop    nop     O
  2103. X   124  nop    nop    nop    nop    nop    nop    nop    nop     O
  2104. X   125  nop    nop    nop    nop    nop    nop    nop    nop     O
  2105. X   126  nop    nop    nop    nop    nop    nop    nop    nop     O
  2106. X   127  nop    nop    nop    nop    nop    nop    nop    nop     O
  2107. X   128  rctrl  rctrl  rctrl  rctrl  rctrl  rctrl  rctrl  rctrl   O
  2108. X   129  ralt   ralt   ralt   ralt   ralt   ralt   ralt   ralt    O
  2109. X   130  fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60  O
  2110. X   131  del    del    del    del    del    del    del    del     N
  2111. X   132  fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49  O
  2112. X   133  fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57  O
  2113. X   134  fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51  O
  2114. X   135  fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59  O
  2115. X   136  fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55  O
  2116. X   137  fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53  O
  2117. X   138  fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50  O
  2118. X   139  fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58  O
  2119. X   140  '/'    nop    nop    nop    '/'    nop    nop    nop     O
  2120. X   141  cr     cr     nl     nl     cr     cr     nl     nl      O
  2121. END_OF_FILE
  2122.   if test 10032 -ne `wc -c <'ecu330/mapkey/keys.usa.ecu'`; then
  2123.     echo shar: \"'ecu330/mapkey/keys.usa.ecu'\" unpacked with wrong size!
  2124.   fi
  2125.   # end of 'ecu330/mapkey/keys.usa.ecu'
  2126. fi
  2127. echo shar: End of archive 31 \(of 37\).
  2128. cp /dev/null ark31isdone
  2129. MISSING=""
  2130. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ; do
  2131.     if test ! -f ark${I}isdone ; then
  2132.     MISSING="${MISSING} ${I}"
  2133.     fi
  2134. done
  2135. if test "${MISSING}" = "" ; then
  2136.     echo You have unpacked all 37 archives.
  2137.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2138. else
  2139.     echo You still must unpack the following archives:
  2140.     echo "        " ${MISSING}
  2141. fi
  2142. exit 0
  2143. exit 0 # Just in case...
  2144.