home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume21 / ecu / part35 < prev    next >
Encoding:
Text File  |  1991-08-05  |  53.4 KB  |  1,910 lines

  1. Newsgroups: comp.sources.misc
  2. From: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
  3. Subject:  v21i087:  ecu - ECU async comm package rev 3.10, Part35/37
  4. Message-ID: <1991Aug5.212037.8543@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: f4ce869e095470761c2c2e1713b08e4c
  6. Date: Mon, 5 Aug 1991 21:20:37 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
  10. Posting-number: Volume 21, Issue 87
  11. Archive-name: ecu/part35
  12. Environment: SCO, XENIX, ISC
  13. Supersedes: ecu3: Volume 16, Issue 25-59
  14.  
  15. ---- Cut Here and feed the following to sh ----
  16. #!/bin/sh
  17. # this is ecu310.35 (part 35 of ecu310)
  18. # do not concatenate these parts, unpack them in order with /bin/sh
  19. # file doc/_p_ifunc.txt continued
  20. #
  21. if touch 2>&1 | fgrep 'amc' > /dev/null
  22.  then TOUCH=touch
  23.  else TOUCH=true
  24. fi
  25. if test ! -r _shar_seq_.tmp; then
  26.     echo 'Please unpack part 1 first!'
  27.     exit 1
  28. fi
  29. (read Scheck
  30.  if test "$Scheck" != 35; then
  31.     echo Please unpack part "$Scheck" next!
  32.     exit 1
  33.  else
  34.     exit 0
  35.  fi
  36. ) < _shar_seq_.tmp || exit 1
  37. if test ! -f _shar_wnt_.tmp; then
  38.     echo 'x - still skipping doc/_p_ifunc.txt'
  39. else
  40. echo 'x - continuing file doc/_p_ifunc.txt'
  41. sed 's/^X//' << 'SHAR_EOF' >> 'doc/_p_ifunc.txt' &&
  42. X
  43. XThe variable $i0 receives the length of the matching
  44. Xstring in str0 if a  match is found.  For this reason,
  45. Xit is not advisable that $i0 otherwise be involved
  46. Xin the operation.  Specifically to be avoided is:
  47. X.DS I
  48. Xset $i0=%instr(...)
  49. X.DE
  50. X.DS L
  51. XExamples:
  52. X
  53. X            00000000001111111
  54. X            01234567890123456
  55. XAssume $s0='abcdefghijklmnabc'
  56. X       $s1='abc'
  57. X       $s2='n.*'
  58. X
  59. X       %match($s0,$s1)        returns 0   $i0=3
  60. X       %match($s0,$s2)        returns 16  $i0=4
  61. X       %match($s0,$s3)        returns -1  $i0 unchanged
  62. X       %match($s0,'de..h')    returns 3   $i0=5
  63. X       %match($s0,'de..H')    returns -1  $i0 unchanged
  64. X.DE
  65. X
  66. X.*s 3 "%mhack"
  67. X
  68. Xusage: %mhack
  69. X
  70. XThis function ("Millisecond time HACK") returns the number of
  71. Xmilliseconds since ecu was started.  It isn't a very useful
  72. Xvalue by itself, but differences between the values
  73. Xreturned by two calls to the function may be used to determine
  74. Xthe time between two events with the maximum accuracy the
  75. Xoperating system can deliver (1/HZ resolution with a bit of
  76. Xlatency).
  77. X
  78. X.DS L
  79. XExamples:
  80. X    $i10 = %mhack
  81. X    send 'test'
  82. X    lookfor -e %chr(0x0A) 100
  83. X    ifi $i0 == 0 echo 'no response in 10 seconds'
  84. X    else echo 'response time '+%itos(%mhack - $i10)+' msec'
  85. X.DE
  86. X
  87. X.*s 3 "%rchr"
  88. X
  89. XThis function returns the number of characters
  90. Xreceived by ECU since the program starrted.
  91. X
  92. X.*s 3 "%rchrc"
  93. X
  94. XThis function returns the number of characters
  95. Xreceived by ECU during the current connection.
  96. X
  97. X.*s 3 "%rinstr"
  98. X
  99. Xusage: %rinstr(str0,str1)
  100. X
  101. XThis function returns the rightmost column position withing str0
  102. Xthat str1 is found (zero relative).  If str1 cannot be found in
  103. Xstring str0, -1 is returned.  However, if str1 is null and str0 is not,
  104. Xzero will be returned (i.e., the null string matches at the left).
  105. X
  106. XThe comparison is made without regard to case. See also
  107. X.B %instr .
  108. X
  109. X.DS I
  110. XExamples:
  111. X
  112. X            00000000001111111
  113. X            01234567890123456
  114. XAssume $s0='abcdefghijklmnabc'
  115. X       $s1='abc'
  116. X       $s2='gHi'
  117. X       $s3='cat'
  118. X
  119. X       %instr($s0,$s1)        returns 14
  120. X       %instr($s0,$s2)        returns 6
  121. X       %instr($s0,$s3)        returns -1
  122. X.DE
  123. X
  124. X.*s 3 "%shmid"
  125. X
  126. XThis function returns the integer shared memory segment id
  127. Xfor the current ECU process.  It may be used to pass the id
  128. Xto a "friend" process so that it may access the shared memory
  129. Xsegment (described in header file ecushm.h).
  130. XFor more details,
  131. Xrefer to an earlier section entitled "Shared Memory 'Friend' Interface."
  132. X
  133. X.DS L
  134. XExample:
  135. X
  136. X     system 'ecufriend '+%itos(%shmid)
  137. X.DE
  138. X
  139. X.*s 3 "%stoi"
  140. X
  141. Xusage: %stoi(str0)
  142. X
  143. XThis function converts the contents of str0 to an
  144. Xinteger and returns  the value.
  145. X
  146. X.*s 3 "%uid"
  147. X
  148. Xusage: %uid
  149. X
  150. XThis function returns the uid of the user.
  151. X
  152. X.*s 3 "%xchr"
  153. X
  154. XThis function returns the number of characters
  155. Xtransmitted by ECU since the program starrted.
  156. X
  157. X.*s 3 "%xchrc"
  158. X
  159. XThis function returns the number of characters
  160. Xtransmitted by ECU during the current connection.
  161. X
  162. X
  163. SHAR_EOF
  164. echo 'File doc/_p_ifunc.txt is complete' &&
  165. $TOUCH -am 0429171591 'doc/_p_ifunc.txt' &&
  166. chmod 0644 doc/_p_ifunc.txt ||
  167. echo 'restore of doc/_p_ifunc.txt failed'
  168. Wc_c="`wc -c < 'doc/_p_ifunc.txt'`"
  169. test 11499 -eq "$Wc_c" ||
  170.     echo 'doc/_p_ifunc.txt: original size 11499, current size' "$Wc_c"
  171. rm -f _shar_wnt_.tmp
  172. fi
  173. # ============= doc/_p_param.txt ==============
  174. if test -f 'doc/_p_param.txt' -a X"$1" != X"-c"; then
  175.     echo 'x - skipping doc/_p_param.txt (File already exists)'
  176.     rm -f _shar_wnt_.tmp
  177. else
  178. > _shar_wnt_.tmp
  179. echo 'x - extracting doc/_p_param.txt (Text)'
  180. sed 's/^X//' << 'SHAR_EOF' > 'doc/_p_param.txt' &&
  181. X.*s 2 "Arguments"
  182. X
  183. XThere are five types of arguments to procedure commands:
  184. X.DS I
  185. XSwitch
  186. XAlphabetic Token
  187. XInteger
  188. XString
  189. XRelational Operators
  190. X.DE
  191. XThis section describes the syntax and construction of each type in turn.
  192. XThere are separate groups of valid of relational operators for integers
  193. Xand strings; thus, they are described under the appropriate sections.
  194. X
  195. X.*s 3 "Switches"
  196. X
  197. XSwitch arguments begin with a hyphen (minus, '-').  The switch
  198. Xargument must be the first argument after the command.  Only
  199. Xone switch argument is allowed on the command line.  If
  200. Xswitches '-a', '-b' and '-c', are available and '-a' and '-b'
  201. Xare desired, '-ab' or '-ba' is entered.
  202. X
  203. X.*s 3 "Alphabetic Tokens"
  204. X
  205. XAlphabetic tokens, for lack of a better term, are non-integer,
  206. Xnon-quoted terms used as arguments for certain commands, such as:
  207. X.DS I
  208. Xplog off
  209. X.DE
  210. XSuch argument types are fairly simple to understand and use; they are
  211. Xdescribed here for completeness.
  212. X
  213. X.*s 3 "Integers"
  214. X
  215. XInteger values are 32-bit quantities ranging between -2147483647
  216. Xand 2147483647.
  217. X
  218. XIn one case, an integer is used to store a 32-bit color mask as
  219. Xdescribed by the
  220. X.B color
  221. Xcommand and the
  222. X.B %colors
  223. Xinteger function.
  224. X
  225. X.*s 4 "Constants"
  226. X
  227. XInteger constants are numeric strings, optionally with an initial
  228. Xminus sign, the absolute value of which must be less than 2147483648.
  229. XIf the constant begins with the string "0x", it is interpreted
  230. Xas hexadecimal. Octal, like FORTRAN and COBOL will be dead soon; until
  231. Xthen, however, octal constants may be denoted by a leading "0o".
  232. X
  233. X.DS L
  234. XExamples:
  235. X    123   --> 123(10)
  236. X    0123  --> 123(10)
  237. X    0x123 --> 291(10)
  238. X    0o123 -->  83(10)
  239. X.DE
  240. X
  241. X.*s 4 "Variables"
  242. X
  243. XThere are 50 numbered, permanent integer variables referenced by
  244. Xthe terms '$i0' through '$i49'.  When ECU is started, the value of each
  245. Xvariable is zero.  Variables retain their
  246. Xvalue until changed, even between procedure executions.
  247. XThe integer variable number may be expressed
  248. Xas an expression by enclosing an integer expression in brackets.
  249. XFor instance:
  250. X.DS L
  251. X     $i[4+5]      refers to $i9
  252. X
  253. X     $i2=5
  254. X     $i[20+$i2]   refers to $i25
  255. X.DE
  256. X
  257. XInteger variables may be created for use as "local" variables or
  258. Xto promote code readability.  Refer to the
  259. X.B mkvar
  260. Xcommand.
  261. X
  262. X.*s 4 "Functions"
  263. X
  264. XECU has many built-in functions which return the value of ecu- or
  265. Xsystem-related information.  A list of the functions appears in a
  266. Xlater section.
  267. X
  268. X.*s 4 "Expressions"
  269. X
  270. XIn almost any place an integer argument is allowed, an expression
  271. Xmay be supplied.  Expressions are composed of two or more integer
  272. Xconstants or variables separated by operators from the group:
  273. X.DS L
  274. X    +     addition
  275. X    -     subtraction
  276. X    *     multiplication
  277. X    /     division
  278. X    |     OR
  279. X    @     MOD
  280. X    ^     XOR
  281. X    &     AND
  282. X.DE
  283. XEvaluation of expressions is left-to-right.  Parentheses are
  284. Xnot allowed.
  285. X
  286. X.*s 4 "Relational Operators"
  287. X
  288. XInteger relational operators are chosen from the following group:
  289. X.DS L
  290. X     =       "is equal to"
  291. X     ==      "is equal to"
  292. X     !=      "is not equal to"
  293. X     <>      "is not equal to"
  294. X     >       "is greater than"
  295. X     <       "is greater than"
  296. X     >=      "is greater than or equal to"
  297. X     <=      "is less than or equal to"
  298. X.DE
  299. X
  300. X.*s 3 "Strings"
  301. X
  302. XStrings are classic concatenations of zero or more eight-bit
  303. Xcharacters.  In general, the maximum size of a string used by
  304. XECU is 256 characters.  The absolute maximum size is 5120 characters.
  305. X
  306. XNull in strings are poorly handled.
  307. XYou may be able to get away with using them, but it is not recommended.
  308. X
  309. X.*s 4 "Constants"
  310. X
  311. XString constants are formed by placing alphanumeric characters
  312. Xbetween single quote characters (apostrophes).  The backslash ('\\')
  313. Xcharacter is used to "escape" certains characters (I am no nroff guru
  314. Xand backslashes give it gas, so):
  315. X.DS L
  316. X    backslash-backslash     one backslash
  317. X    backslash-n             newline
  318. X    backslash-t             tab
  319. X    backslash-apostrophe    apostrophe
  320. X.DE
  321. X
  322. XNOTE: ecu converts every tab in a procedure line to one space when the
  323. Xprocedure file is read in.  Therefore, if you wish to place a tab in a string
  324. Xconstant, you must place it there with the \\t escape sequence.
  325. X
  326. X.*s 4 "Variables"
  327. X
  328. XThere are 50 numbered, permanent string variables referenced by
  329. Xthe terms '$s0' through '$s49',
  330. Xeach possessing a maximum length of 256 characters
  331. XWhen ECU is started, the value of each
  332. Xvariable is null (zero length).  Variables retain their
  333. Xvalue until changed, even between procedure executions.
  334. XThe string variable number may be expressed
  335. Xas an expression by enclosing an string expression in brackets.
  336. XFor instance:
  337. X.DS L
  338. X     $s[4+5]      refers to $s9
  339. X
  340. X     $s2=5
  341. X     $s[20+$s2]   refers to $s25
  342. X.DE
  343. X
  344. XString variables may be created for use as "local" variables or
  345. Xto promote code readability.  Refer to the
  346. X.B mkvar
  347. Xcommand.  
  348. XCreated variables have a life equal to the duration
  349. Xof the procedure which created them.
  350. XRegardless of the declared size of a created string variable,
  351. XECU will automatically grow it to a maximum of 5120 characters
  352. Xas necessary.  Numbered (permanent) string variables have a maximum
  353. Xsize of 256 bytes.
  354. X
  355. X.*s 4 "Functions"
  356. X
  357. XECU has many built-in functions which return the value of ecu- or
  358. Xsystem-related information.  A list of the functions appears in a
  359. Xlater section.
  360. X
  361. X.*s 4 "Expressions"
  362. X
  363. XString expressions are formed by the concatenation of string
  364. Xconstants, variables and function return values using the '+'
  365. Xoperator:
  366. X.DS L
  367. XExample:
  368. X   'The quick brown fox jumped over the '+$s0'+' dog at '+%time
  369. X.DE
  370. X
  371. X.*s 4 "Relational Operators"
  372. X
  373. XString relational operators are chosen from the following group:
  374. X.DS L
  375. X     =       "is equal to"
  376. X     ==      "is equal to"
  377. X     !=      "is not equal to"
  378. X     <>      "is not equal to"
  379. X.DE
  380. X
  381. SHAR_EOF
  382. $TOUCH -am 0525055991 'doc/_p_param.txt' &&
  383. chmod 0644 doc/_p_param.txt ||
  384. echo 'restore of doc/_p_param.txt failed'
  385. Wc_c="`wc -c < 'doc/_p_param.txt'`"
  386. test 5730 -eq "$Wc_c" ||
  387.     echo 'doc/_p_param.txt: original size 5730, current size' "$Wc_c"
  388. rm -f _shar_wnt_.tmp
  389. fi
  390. # ============= doc/_p_sfunc.txt ==============
  391. if test -f 'doc/_p_sfunc.txt' -a X"$1" != X"-c"; then
  392.     echo 'x - skipping doc/_p_sfunc.txt (File already exists)'
  393.     rm -f _shar_wnt_.tmp
  394. else
  395. > _shar_wnt_.tmp
  396. echo 'x - extracting doc/_p_sfunc.txt (Text)'
  397. sed 's/^X//' << 'SHAR_EOF' > 'doc/_p_sfunc.txt' &&
  398. X.*s 2 "String Functions"
  399. X
  400. X.*s 3 "%argv"
  401. X
  402. Xusage: %argv(int0)
  403. X
  404. XThis function returns the string value of an argument passed
  405. Xto the procedure by the 'do' command.  Argument 0 is the
  406. Xname of the procedure itself.
  407. XThe integer function %argc may be used to determine the
  408. Xnumber of arguments passed to the procedure.  Specifying
  409. Xan argument number greater than the number of arguments
  410. Xpassed returns a null string (if procedure tracing is enabled
  411. Xwith the 'ptrace' comand, a warning will be displayed
  412. Xin this case).
  413. X.DS I
  414. XExample:
  415. X    invocation from shell:
  416. X    ecu -p test Quick Brown Fox
  417. X
  418. X    invocation from interactive command line:
  419. X    do test Quick Brown Fox
  420. X
  421. X    invocation from procedure:
  422. X    do 'test' 'Quick' 'Brown' 'Fox'
  423. X    
  424. X    results in:
  425. X    %argv(0) = 'test'
  426. X    %argv(1) = 'Quick'
  427. X    %argv(2) = 'Brown'
  428. X    %argv(3) = 'Fox'
  429. X    %argv(4) = ''
  430. X.DE
  431. X
  432. X.B NOTE:
  433. Xthe interactive
  434. X.B dial
  435. Xcommand, the dialing directory menu and the initial setup menu
  436. Xall can automatically execute a procedure which matches
  437. Xa dialed
  438. X.B
  439. Xlogical telephone number.
  440. X.R
  441. XThere two arguments passed to these procedures, %argv(0) being
  442. Xthe procedure name as always.  %argv(1) is set according to the following
  443. Xtable:
  444. X.DS I
  445. X invoker              %argv(1)
  446. X-------------------  -------------
  447. Xinitial setup menu   !INITIAL
  448. Xinteractive dial     !INTERACTIVE
  449. Xdialing menu         !MENU
  450. X.DE
  451. XThus it is possible for the invoked procedure
  452. Xto determine that it has been automatically executed
  453. Xby testing %argv(1) for an exclamation point, or possibly
  454. Xthe entire argument.
  455. X
  456. X.*s 3 "%basename"
  457. X
  458. XUsage: %basename(str0,str1)
  459. X
  460. XThis function is similar to the UNIX basename(1) utility in
  461. Xthat it returns a filename minus a supplied suffix, if it is present.
  462. XUnlike the UNIX basename(C) program, %basename does not remove
  463. Xthe directory part of the filename.
  464. XSee also
  465. X.B %dirpart
  466. Xand
  467. X.B %filepart .
  468. X
  469. X.DS L
  470. XExamples:
  471. X
  472. X    %basename('/u1/src/ecu/ecu.c','.c') = /u1/src/ecu/ecu
  473. X    %basename('ecu.c','.c') = ecu
  474. X    %basename('ecu.c','.x') = ecu.c
  475. X.DE
  476. X
  477. X.*s 3 "%cgetc"
  478. X
  479. Xusage: %cgetc
  480. X
  481. XThis  function reads one character from the console keyboard
  482. Xand returns it.  The character is not echoed.
  483. X
  484. X.*s 3 "%cgets"
  485. X
  486. Xusage: %cgets
  487. X
  488. XThis function reads a string from the console keyboard
  489. Xand returns it.  Each character is echoed as it is typed
  490. Xand the user's normal erase and kill character is available
  491. Xto edit the input before terminating the read with ENTER.
  492. X
  493. X.*s 3 "%chr"
  494. X
  495. Xusage: %chr(int0)
  496. X
  497. XThis function returns the character value whose ASCII value
  498. Xis supplied in int0.
  499. X
  500. X.DS L
  501. XExample:
  502. X
  503. X    set $s0 = %chr(4)  places a ^D (EOT) character into $s0
  504. X.DE
  505. X
  506. X.*s 3 "%date"
  507. X
  508. Xusage: %date
  509. X
  510. XThis function returns the current date in the form 'mm-dd-yyyy'
  511. Xin the local time zone (daylight time if it applies).
  512. X
  513. X.*s 3 "%datez"
  514. X
  515. Xusage: %datez
  516. X
  517. XThis function returns the current date in the form 'mm-dd-yyyy'
  518. Xin the UTC (Z) time zone.
  519. X
  520. X.*s 3 "%day"
  521. X
  522. Xusage: %day
  523. X
  524. XThis function returns the current day of the week as a three character
  525. Xabbreviation: 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
  526. Xin the local time zone (daylight time if it applies).
  527. X
  528. X.*s 3 "%dayz"
  529. X
  530. Xusage: %dayz
  531. X
  532. XThis function returns the current day of the week as a three character
  533. Xabbreviation: 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
  534. Xin the UTC (Z) time zone.
  535. X
  536. X.*s 3 "%dir"
  537. X
  538. Xusage: %dir
  539. X
  540. XThis function returns the
  541. Xfull pathname of the current working directory.
  542. X
  543. X.*s 3 "%dirpart"
  544. X
  545. Xusage: %dirpart(str0)
  546. X
  547. XThis function returns the
  548. Xdirectory portion of the pathname supplied in str0.
  549. XSee also
  550. X.B %basename
  551. Xand
  552. X.B %filepart .
  553. X
  554. X
  555. X.DS L
  556. XExamples:
  557. X
  558. X%dirpart('/u1/src/src/foo.c') = "/u1/src/src"
  559. X%dirpart('foo.c') = "foo.c"
  560. X%dirpart('/usr') = ""
  561. X.DE
  562. X
  563. X.*s 3 "%edate"
  564. X
  565. Xusage: %edate(int0)
  566. X
  567. XThe value in int0 is expected to be a number of seconds since January 1,
  568. X1970 00:00 UTC (Universal Coordinated Time) as returned by
  569. Xthe integer functions %fatime and %fmtime.
  570. XThis function converts the value into a string representing the
  571. Xequivalent local time in the form 'mm-dd-yyyy hh:mm:ss'.
  572. X.DS L
  573. XExample:
  574. X
  575. Xset $i0=%fmtime('/xenix')
  576. X$i00 = 601178971 (0x23d5435b,04365241533)
  577. X
  578. Xset $s0=%edate($i0)
  579. X$s00 = '01-18-1989 21:09:31'
  580. X.DE
  581. X
  582. X.*s 3 "%envvar"
  583. X
  584. Xusage: %envvar()
  585. X
  586. XThis function returns the string value of an environment
  587. Xvariable.
  588. X
  589. X.DS L
  590. XExample:
  591. X
  592. X    set $s0=%envvar('HOME') might set $s0 '/usr/user'
  593. X.DE
  594. X.DF L
  595. XTypical Environment Variables:
  596. X
  597. X    HOME          pathname of home directory
  598. X    EDITOR        user's preferred editor
  599. X    PATH          program execution searchlist
  600. X    TERM          terminal type
  601. X    SHELL         user's preferred shell
  602. X    MAIL          user's mail box file
  603. X    ECUPROMPT     ECU interactive command prompt
  604. X                  at beginning of execution
  605. X.DE
  606. X
  607. X.*s 3 "%errstr"
  608. X
  609. Xusage: %errstr(int0)
  610. X
  611. XThis function returns the system error message, given int0 as an
  612. X.B errno
  613. Xas returned by a file-related command.
  614. X.B fopen.
  615. X
  616. X.DS L
  617. XExample:
  618. X
  619. X    echo %errstr(1)
  620. X    Not owner
  621. X.DE
  622. X
  623. X.*s 3 "%etime"
  624. X
  625. Xusage: %etime(int0)
  626. X
  627. XThis function returns a string representation of elapsed time
  628. Xin the format 'hh:mm:ss'
  629. Xfor the integer parameter int0, a number of seconds.
  630. X
  631. X.DS L
  632. XExample:
  633. X
  634. X    echo %etime(62)
  635. X    00:01:02
  636. X.DE
  637. X
  638. X.*s 3 "%filepart"
  639. X
  640. Xusage: %filepart(str0)
  641. X
  642. XThis function returns the
  643. Xfilename portion of the pathname supplied in str0.
  644. XSee also
  645. X.B %basename
  646. Xand
  647. X.B %dirpart .
  648. X
  649. X.DS L
  650. XExamples:
  651. X
  652. X%filepart('/u1/src/src/foo.c') = "foo.c"
  653. X%filepart('foo.c') = "foo.c"
  654. X.DE
  655. X
  656. X.*s 3 "%fmodestr"
  657. X
  658. Xusage: %fmodestr(int0)
  659. X
  660. XThis function returns a string representation of the
  661. Xfamiliar file mode string given the file mode integer int0.
  662. X
  663. X.DS L
  664. XExample:
  665. X
  666. X    echo %fmodestr(0100755)
  667. X    -rwxr-xr-x
  668. X
  669. X    echo %fmodestr(%fmode('/usr/lib'))
  670. X    drwxr-xr-x
  671. X.DE
  672. X
  673. X.*s 3 "%itos"
  674. X
  675. Xusage: %itos(int0[,format])
  676. X
  677. XThis function converts integer int0 to a string, optionally
  678. Xcontrolling the format of the conversion.
  679. X
  680. XIf the format parameter is missing, the conversion is to
  681. Xa minimum number of decimal characters necessary to
  682. Xhold the result.
  683. X
  684. XIf the format parameter is present, it must of consist of
  685. Xa non-null string made of one or both optional parts:
  686. X.DS L
  687. X    decimal number of digits to be part of result string
  688. X    (a leading zero indicates leading zeroes are to
  689. X    appear in the string; no leading zero pads with
  690. X    leading spaces
  691. X
  692. X    a lower case letter from the following list:
  693. X        d - decimal conversion
  694. X        x - hexadecimal conversion
  695. X        o - octal conversion
  696. X.DE
  697. X.DS L
  698. XExample:
  699. X
  700. X    %itos(33)           '33'
  701. X    %itos(33,d)         '33'
  702. X    %itos(33,x)         '21'
  703. X    %itos(33,5d)        '   33'
  704. X    %itos(33,010d)      '0000000033'
  705. X    %itos(33,10d)       '        33'
  706. X    %itos(33,x)         '21'
  707. X    %itos(33,04x)       '0021'
  708. X    %itos(33,4x)        '  21'
  709. X    %itos(33,o)         '41'
  710. X    %itos(33,4o)        '    41'
  711. X.DE
  712. X
  713. X.*s 3 "%left"
  714. X
  715. Xusage: %left(str0,int0)
  716. X
  717. XThis function returns the leftmost int0 characters of str0.
  718. XIf the length of the string is less than int0,
  719. Xthe entire str0 is returned.
  720. X.DS L
  721. XExample:
  722. X
  723. X    if $s0 == 'abcdefg'
  724. X    %left($s0,3) returns 'abc'
  725. X.DE
  726. X
  727. X.*s 3 "%line"
  728. X
  729. Xusage: %line
  730. X
  731. XThis function returns the name of the attached communications
  732. Xline in the form "/dev/ttyxx".  If no line is currently
  733. Xattached, the function returns null.
  734. X
  735. X.*s 3 "%logname"
  736. X
  737. Xusage: %logname
  738. X
  739. XThis function returns the login name of the user executing
  740. XECU.  Note: the name returned is the name supplied to a login
  741. Xprompt, not any current su(C) username that may be in effect.
  742. X
  743. X.*s 3 "%mid"
  744. X
  745. Xusage: %mid(str0,int0[,int1])
  746. X
  747. XThis function returns the middle portion of a string str0
  748. Xbeginning with the character at position int0 and for a length
  749. Xof int1 characters.
  750. XIf int0 is greater than or equal to the length of
  751. Xstro, a null string is returned.
  752. XIf the optional argument int1 is not supplied, or
  753. Xif the length of the string is less than int1,
  754. Xthe entire str0 is returned.
  755. X.DS L
  756. XExample:
  757. X
  758. X    if $s0 == '0123456789abc'
  759. X    %mid($s0,3,4)  returns '3456'
  760. X    %mid($s0,3)    returns '3456789abc'
  761. X    %mid($s0,10,2) returns 'ab'
  762. X    %mid($s0,10,5) returns 'abc'
  763. X.DE
  764. X
  765. X.*s 3 "%month"
  766. X
  767. Xusage: %month
  768. X
  769. XThis function returns the current month as a three character
  770. Xabbreviation: 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'.
  771. X
  772. X.*s 3 "%rdesc"
  773. X
  774. Xusage: %rdesc
  775. X
  776. XThis function returns the
  777. Xdescription
  778. Xportion of the
  779. Xdialing directory entry for the currently connected remote.
  780. XIf no connection exists, the function returns null.
  781. X
  782. X.*s 3 "%right"
  783. X
  784. Xusage: %right(str0,int0)
  785. X
  786. XThis function returns the rightmost int0 characters of str0.
  787. XIf the length of the string is less than int0,
  788. Xthe entire str0 is returned.
  789. X.DS L
  790. XExample:
  791. X
  792. X    if $s0 == 'abcdefg'
  793. X    %right($s0,3) returns 'efg'
  794. X.DE
  795. X
  796. X.*s 3 "%rname"
  797. X
  798. Xusage: %rname
  799. X
  800. XThis function returns the
  801. Xlogical name
  802. Xportion of the
  803. Xdialing directory entry for the currently connected remote.
  804. XIf the remote was dialed directly, as in dial 5551212, the
  805. Xreturned value is the phone number.
  806. XIf no connection exists, the function returns null.
  807. X
  808. XThe value returned by this command may be overridden by use of the
  809. X.B rname
  810. Xprocedure command.
  811. X
  812. X.*s 3 "%rtelno"
  813. Xusage: %rtelno
  814. X
  815. XThis function returns the
  816. Xtelephone number
  817. Xportion of the
  818. Xdialing directory entry for the currently connected remote.
  819. XIf no connection exists, the function returns null.
  820. X
  821. X.*s 3 "%time"
  822. X
  823. Xusage: %time
  824. X
  825. XThis function returns the current time in the form 'hh:mm'
  826. Xin the local time zone (daylight time if it applies).
  827. X
  828. X.*s 3 "%times"
  829. X
  830. Xusage: %times
  831. X
  832. XThis function returns the current time in the form 'hh:mm:ss'
  833. Xin the local time zone (daylight time if it applies).
  834. X
  835. X.*s 3 "%timez"
  836. X
  837. Xusage: %timez
  838. X
  839. XThis function returns the current time in the form 'hh:mm'
  840. Xin the UTC (Z) time zone.
  841. X
  842. X.*s 3 "%timezs"
  843. X
  844. Xusage: %timezs
  845. X
  846. XThis function returns the current time in the form 'hh:mm:ss'
  847. Xin the UTC (Z) time zone.
  848. X
  849. X.*s 3 "%tty"
  850. X
  851. Xusage: %tty
  852. X
  853. XThis function returns the console tty name in the form "/dev/ttynn".
  854. X
  855. SHAR_EOF
  856. $TOUCH -am 0429171591 'doc/_p_sfunc.txt' &&
  857. chmod 0644 doc/_p_sfunc.txt ||
  858. echo 'restore of doc/_p_sfunc.txt failed'
  859. Wc_c="`wc -c < 'doc/_p_sfunc.txt'`"
  860. test 9865 -eq "$Wc_c" ||
  861.     echo 'doc/_p_sfunc.txt: original size 9865, current size' "$Wc_c"
  862. rm -f _shar_wnt_.tmp
  863. fi
  864. # ============= doc/_proc.txt ==============
  865. if test -f 'doc/_proc.txt' -a X"$1" != X"-c"; then
  866.     echo 'x - skipping doc/_proc.txt (File already exists)'
  867.     rm -f _shar_wnt_.tmp
  868. else
  869. > _shar_wnt_.tmp
  870. echo 'x - extracting doc/_proc.txt (Text)'
  871. sed 's/^X//' << 'SHAR_EOF' > 'doc/_proc.txt' &&
  872. X.*s 1 "Procedures"
  873. X
  874. XProcedures are "programs" or "scripts" written in an addled but
  875. Xadequate language which ECU executes upon demand.
  876. XAn "initial procedure" may be executed when ECU starts up (see
  877. Xthe description of the -p command line switch).  Certain special
  878. Xprocedures are executed automatically as described below in the
  879. Xsection "Special Procedures."
  880. X
  881. X.*s 2 "Procedures"
  882. X
  883. XThe procedures themselves are source files consisting of
  884. Xthe procedure "name" with an extension of ".ep".
  885. XWhen executing a procedure by name,
  886. X.DS I
  887. Xdo name       interactive
  888. X-or-
  889. Xdo 'name'     from insikde a procedure
  890. X.DE
  891. Xis sufficient if the procedure is in the current directory,
  892. Xthe user's ~/.ecu directory or in the ECU library
  893. Xdirectory (normally /usr/local/lib/ecu).  Procedure files
  894. Xare search for in the above order, so you may have
  895. Xa system default in the lib directory, a user default
  896. Xin the ~/.ecu directory and a specific version in the current
  897. Xdirectory all by the same name.
  898. X
  899. XMany example procedures, some useful, some not so,
  900. Xare found in the models subdirectory of the release.
  901. XThere are also several complrete procedures and many fragments
  902. Xused as examples throughout the following sections.
  903. X
  904. X.*s 2 "Line Syntax (Labels, Commands and Comments)"
  905. XLines in a procedure 
  906. Xconsist of an optional label, followed by optional commands and
  907. Xarguments.  Anything on a line after an octothorpe (#) outside
  908. Xof quote marks is ignored (read "# is the comment character.")
  909. X
  910. XLabels must begin in column one.  Commands must have white space
  911. Xbefore them.  A label may appear on a line by itself or with a comment
  912. Xappended.  A common mistake I make (from writing too much C) is
  913. Xto append a colon to a label derclaration; this does not work unless
  914. Xyou also "goto LABEL:".  Labels are not allowed inside braces
  915. X(inside if compound statements).  You may get away with it sometimes
  916. Xbecause the procedure language processor is written for speed, not
  917. Xpolitical correctness.
  918. X
  919. X.so _p_param.txt
  920. X
  921. X.so _p_cmd.txt
  922. X
  923. X.so _p_ifunc.txt
  924. X
  925. X.so _p_sfunc.txt
  926. X
  927. X.*s 2 "Special Procedures"
  928. X
  929. XECU provides for special "hook" procedures to be executed
  930. Xat certain times.  Their use is encouraged, but you must
  931. Xtake precautions not to excecute any unreasoable commands
  932. Xin them, for the are rather "raw" hooks and it is easily possible
  933. Xto confuse ECU by performing illogical operations in them.  
  934. XJudicious use can, however, be quite productive.
  935. X
  936. XThey are searched for in the same manner
  937. Xas any other procedure, so you can have a
  938. Xcustomised version of them in a working directory and a default
  939. Xin your ~/.ecu subdirectory.  No error is reported if they are not found.
  940. X
  941. X.*s 3 "_rc.ep"
  942. X
  943. XAfer ECU is initialized, but before it presents the setup
  944. Xscreen or executes a -p initial procedure,
  945. Xprocedure '_rc' is executed with no arguments.
  946. X(It is named in the tradition of /etc/rc, .mailrc, etc..)
  947. XThis procedure can be used to customize the ecu environment
  948. Xprior to beginning the usual operation.  This is not a place
  949. Xto do any dialing or long-lived operations, nor is it possible to
  950. Xbypass the setup screen: for this, use the -p initial procedure.
  951. X
  952. XThe %getenv() function may be useful in here (Am I running on an
  953. Xxterm?  Do I want to change the default ECUPROMPT?).
  954. X
  955. XIf _rc.ep returns a non-zero status or fails (due to syntax or
  956. Xother error), ecu terminates immediately.
  957. X
  958. X.*s 3 "_connect.ep"
  959. X
  960. XThis procedure is executed after every connection success
  961. Xafter the CONNECT message ("result code") is printed.
  962. XIt is passed one argument, the "result code" string
  963. Xgenerated by the dialer function (e.g., "CONNECT 19200").
  964. X
  965. XYou may use %rname and other functions and features to customize
  966. Xthis function based on the particular system just reached.  Note
  967. Xthat integer variable $i0 and string variable $s0 set zero prior
  968. Xto executing the function.  This function may modify the behavior
  969. Xof coorperating dialer functions by setting the value of numbered
  970. Xstring or integer variables.  In particular, the dialer function
  971. Xwill inherit the values of $i0 and $s0 when this special function
  972. Xterminates.
  973. X.B
  974. XBe careful of what you do in here since MANY ecu procedure commands
  975. Xaffect $i0 and $s0 as a side effect of their operation.
  976. X.R
  977. XEven if you know what you do in _connect.ep does not modify $i0
  978. Xor $s0, use of the preservation technique shown in the example
  979. Xbelow may save you headaches if you add to the function in the
  980. Xfuture (long after you have forgotten this pedantic admonition).
  981. X
  982. XIf this procedure fails (abnormal procedure termination
  983. Xor non-zero return code), ECU hangs up on the line and proceeds
  984. Xas if the connection failed.
  985. X
  986. X.DS L
  987. XExample:
  988. X#+------------------------------------------------------------------
  989. X#  _connect.ep - post-CONNECT special "hook" procedure
  990. X#-------------------------------------------------------------------
  991. X#+:EDITS:
  992. X#:07-13-1991-14:47-wht@n4hgf-creation
  993. X
  994. X  $iv0_save = $i0  # it is a VERY good idea to save the dialer
  995. X  $sv0_save = $s0  # function return status
  996. X                   # since gobs of functions and commands modify $i0
  997. X                   # and/or $s0 as a side effect of their operation
  998. X
  999. X  $s30 = '_connect '+%rname+' ('+%argv(1)+')'
  1000. X  echo $s30        # this still will also live to be visible by
  1001. X                   # the dialer function
  1002. X
  1003. X  ifi %baud > 2400
  1004. X  {
  1005. X     xon    off    # turn XON/XOFF off first, then ...
  1006. X     rtscts on     # turn on RTS/CTS
  1007. X  }
  1008. X  else
  1009. X  {
  1010. X     rtscts off    # turn off RTS/CTS, then ...
  1011. X     xon    on     # turn XON/XOFF on
  1012. X  }
  1013. X
  1014. X  $i0 = $iv0_save  # restore dialer return status
  1015. X  $s0 = $sv0_save
  1016. X.DE
  1017. X
  1018. X.*s 3 "_connfail.ep"
  1019. X
  1020. XThis procedure is executed after every connection failure after
  1021. Xthe failure message ("result code") is printed.  It is passed two
  1022. Xarguments, the logical system name (the dial directory
  1023. Xentry name or the phone number)
  1024. Xand the "result code" string generated by the dialer
  1025. Xfunction (e.g., "BUSY").  The function is called after $i0 has
  1026. Xbeen set to 1 and $s0 has been set to the result code.  This
  1027. Xfunction may modify the behavior of coorperating dialer functions
  1028. Xby setting the value of numbered string or integer variables.  In
  1029. Xparticular, the dialer function will inherit the values of $i0
  1030. Xand $s0 when this special function terminates.
  1031. X.B
  1032. XBe careful of what you do in here since MANY ecu procedure commands
  1033. Xaffect $i0 and/or $s0 as a side effect of their operation.
  1034. X.R
  1035. XSee _connect.ep above for further screams and moans.
  1036. X
  1037. X]If you get very involved with using this procedure, you'll sooner
  1038. Xor later run into some undocumented $so values.  You'll have to
  1039. Xtake a look at ecuDCE.c and hdbintf.c
  1040. Xfor an authoritative reference, but perhaps
  1041. Xyou can get along by knowing that result codes with an exclamation point
  1042. Xas their first character are generated by ECU.
  1043. X
  1044. XECU ignores any failure (abnormal procedure termination
  1045. Xor non-zero return code) resulting from the execution of this procedure.
  1046. X
  1047. X.*s 3 "_hangup.ep"
  1048. X
  1049. XThis procedure is executed after every connection termination.
  1050. XIt is passed one argument, a string representation
  1051. Xof the number of seconds you were connected.
  1052. XYou may use %rname and other functions and features
  1053. Xto customize this function based on the particular system
  1054. Xjust reached.  ECU ignores any error
  1055. Xreturned by the procedure.
  1056. XECU ignores any failure (abnormal procedure termination
  1057. Xor non-zero return code) resulting from the execution of this procedure.
  1058. SHAR_EOF
  1059. $TOUCH -am 0715141291 'doc/_proc.txt' &&
  1060. chmod 0644 doc/_proc.txt ||
  1061. echo 'restore of doc/_proc.txt failed'
  1062. Wc_c="`wc -c < 'doc/_proc.txt'`"
  1063. test 7302 -eq "$Wc_c" ||
  1064.     echo 'doc/_proc.txt: original size 7302, current size' "$Wc_c"
  1065. rm -f _shar_wnt_.tmp
  1066. fi
  1067. # ============= doc/_startup.txt ==============
  1068. if test -f 'doc/_startup.txt' -a X"$1" != X"-c"; then
  1069.     echo 'x - skipping doc/_startup.txt (File already exists)'
  1070.     rm -f _shar_wnt_.tmp
  1071. else
  1072. > _shar_wnt_.tmp
  1073. echo 'x - extracting doc/_startup.txt (Text)'
  1074. sed 's/^X//' << 'SHAR_EOF' > 'doc/_startup.txt' &&
  1075. X.*s 1 "Starting the Program"
  1076. X
  1077. X.*s 2 "Simple Startup - Initial Setup Menu"
  1078. X
  1079. XECU may be started in a number of ways through use of
  1080. Xcommand line switches, but the easiest is to enter
  1081. X.DS I
  1082. Xecu
  1083. X.DE
  1084. Xby itself.
  1085. XIn this case, the screen is cleared
  1086. Xand the folowing screen will be presented.
  1087. X
  1088. X
  1089. X.DS L
  1090. X
  1091. X  .--[ ecu 1.96 Copyright 1986,1989, W. Tucker ]-----------------.
  1092. X  |                                                              |
  1093. X  |  Name/phone number to call: ___________________              |
  1094. X  |                                                              |
  1095. X  |                                                              |
  1096. X  |  tty: /dev/tty1a                                             |
  1097. X  |                                                              |
  1098. X  |  duplex: F  baud: 2400   parity:N  (data bits 8)             |
  1099. X  |  Add NL to transmitted CR: N                                 |
  1100. X  |  Add NL to received CR:    N                                 |
  1101. X  |                                                              |
  1102. X  |                                                              |
  1103. X  |   TAB:next ^B:prev END:proceed ^D:phone dir  ESC:quit ecu    |
  1104. X  `- logical phone directory entry, phone number or empty -------'
  1105. X
  1106. X
  1107. X.DE
  1108. X
  1109. X.*s 3 "Name/Phone Number Field"
  1110. X
  1111. XIf a dialing directory has been configured,
  1112. Xa literal phone number need not be entered.
  1113. XHowever, on your first invocation,  you'll very likely have
  1114. Xno directory.  Therefore, you have three options:
  1115. X
  1116. X.DS I
  1117. X1.  Enter a literal telephone number, (e.g. 18005551212).
  1118. X    Hyphens and open and close parentheses may also
  1119. X    be entered.
  1120. X
  1121. X2.  Press ENTER to skip the 'Name/phone' field and enter
  1122. X    ^D to enter the telephone directory to enter your
  1123. X    first directory entry.
  1124. X
  1125. X3.  Press END to enter interactive mode and use the Dial
  1126. X    interactive command to dial a literal telephone num-
  1127. X    ber or to enter the dialing directory.
  1128. X.DE
  1129. X
  1130. X.*s 3 "Other Fields"
  1131. X
  1132. XThe 'tty' field may be used to select an
  1133. Xoutgoing line
  1134. Xother than the default
  1135. X/dev/tty1a.
  1136. XNote:  only the last two characters of the tty name
  1137. Xneed be entered.  The remainder of the tty name
  1138. Xis assumed to be '/dev/tty'.
  1139. X
  1140. XThe 'duplex' field may be used to select a
  1141. Xduplex value other than the default 'F' (full).
  1142. X
  1143. XThe 'baud' field may be used to select a
  1144. Xbaud rate value other than the default 2400.
  1145. X
  1146. XThe 'parity' field may be used to select a
  1147. Xparity value other than the default 'N' (none).
  1148. X
  1149. X
  1150. XThe 'Add NL to transmitted CR' and 'Add NL to received CR'
  1151. Xfields are usually left defaulted to 'N' (no).  If you
  1152. Xwill be communicating with a terminal (with a human), you
  1153. Xwill usually need to set both of these fields to 'Y' as
  1154. Xwell as to select 'H'alf duplex.
  1155. X
  1156. X.*s 3 "Special Characters"
  1157. X
  1158. XSpecial keyboard characters while filling in the
  1159. Xstartup screen are:
  1160. X
  1161. X
  1162. X.DS I
  1163. X TAB    move to next field ... if nothing typed in
  1164. X        the field, do not disturb contents
  1165. X
  1166. X ^B     back up to previous field
  1167. X
  1168. X END    proceed with session, dialing remote if
  1169. X        logical directory entry name or literal
  1170. X        telephone number enetered
  1171. X
  1172. X ^D     enter phone directory
  1173. X
  1174. X ESC    quit ecu without any communications
  1175. X.DE
  1176. X
  1177. X.*s 2 "Command Line Arguments and Switches"
  1178. X
  1179. XECU can be started in a number of ways:
  1180. X
  1181. X.DS I
  1182. Xecu [-lxx] [-b<baud>] [-h] [-e|-o] [-t] <tel-number>
  1183. Xecu [-lxx] [-b<baud>] [-h] [-e|-o] [-t]
  1184. Xecu [-t] [-h] <logical>
  1185. Xecu [-lxx] [-b<baud>] [-h] [-e|-o] [-d] [-D] -p <proc> [<arg> ...]
  1186. X.DE
  1187. X
  1188. X.*s 3 "Non-Switch Arguments"
  1189. X
  1190. XOnly one type of non-switch argument may be used on the command line.
  1191. X<tel-number> or <logical> may appear when the -p switch is absent.
  1192. XOne or more <arg> arguments may appear when the -p switch is used.
  1193. X
  1194. X.*s 3 "<tel-number>"
  1195. X
  1196. XThis type of argument has a digit as its initial character and
  1197. Xrepresents an actual telephone number to be passed to a modem
  1198. Xdialer program or Dialers chat script.  The string may contain
  1199. Xnon-numeric characters if appropriate for a dialer program,
  1200. Xsuch as dialTBIT.  For example:
  1201. X.DS L
  1202. X    ecu -l/dev/tty2a -b 19200 -e 5551212UC
  1203. X.DE
  1204. Xuses tty2a (assumed to be connected to a Trailblazer modem) and
  1205. Xestablishes a 19200 baud, even parity PEP Compressed connection
  1206. Xafter dialing 5551212.
  1207. X
  1208. X.*s 3 "<logical>"
  1209. X
  1210. XThis type of argument has an alphabetic initial character and
  1211. Xcauses the dialing directory entry by that name to be dialed.
  1212. XThe line may be specified by '-l', but if the dialing directory
  1213. Xspecifies a line (tty field contaions other than 'Any'), the
  1214. Xdialing directory entry will override it.  The '-b', '-e' and '-o'
  1215. Xswitches are ignored; the values specified by the dialing directory
  1216. Xentry are used.  The '-t' and '-h' switches are valid and honored
  1217. Xif present.
  1218. X
  1219. X.*s 3 "<arg>"
  1220. X
  1221. XThis type of argument is passed to an initial procedure when
  1222. Xthe -p switch is present.
  1223. X
  1224. X.DS L
  1225. Xecu -p unixlogin user pwd ansi43
  1226. X.DE
  1227. Xexecutes unixlogin.ep with arguments 'user' 'pwd' 'ansi43'
  1228. X
  1229. XFor more detail, refer to the description of -p, -d and -D below.
  1230. X
  1231. X.*s 3 "-l"
  1232. X
  1233. XWhen ECU starts up, it normally chooses a line as described later
  1234. Xin the section titled "Choosing a Dialout Line".
  1235. XSpecifying the -l switch can suggest that the program
  1236. Xchoose a specific line.  The argument to the switch is the
  1237. Xlast two charcters of the ttyname; e.g., "-l1a".
  1238. X
  1239. XOn a system with HoneyDanBerr UUCP,
  1240. Xto access a device which does not appear in the Devices file,
  1241. Xit may be necessary to explicitly specify the device with -l.
  1242. X
  1243. X.*s 3 "-f"
  1244. XNormally, ECU starts up in the full duplex mode.
  1245. XIf half duplex is desired, the
  1246. X.B
  1247. X-f switch
  1248. X.R
  1249. Xis used.
  1250. X
  1251. X.*s 3 "-e, -o"
  1252. X
  1253. XNormally, ECU starts up with 8 data bits and no parity.
  1254. XIf even parity is desired, the
  1255. X.B
  1256. X-e switch
  1257. X.R
  1258. Xis specified.
  1259. XIf odd parity is desired, the
  1260. X.B
  1261. X-o switch
  1262. X.R
  1263. Xis specified.
  1264. X
  1265. XThese switches
  1266. X
  1267. X.*s 3 "-p <procname>"
  1268. X
  1269. XThe 
  1270. X.B
  1271. X-p switch
  1272. X.R
  1273. Xcauses ECU to execute the procedure <procname> ("<procname>.ep")
  1274. Ximmediately.  Such a procedure is termed the
  1275. X.B
  1276. Xinitial procedure.
  1277. X.R
  1278. XAll non-switch arguments after <procname> are passed as arguments
  1279. Xto the initial procedure (see the descriptions of the
  1280. Xinteger function
  1281. X.B %argc
  1282. Xand the string function
  1283. X.B %argv ).
  1284. X
  1285. X.*s 3 "-d"
  1286. X
  1287. XThe
  1288. X.B
  1289. X-d switch
  1290. X.R
  1291. Xinstructs ECU to "die" (terminate with error status) if
  1292. Xan initial procedure (-p) fails.  This switch ensures a batch
  1293. XECU execution will hang up any connection and terminate if
  1294. Xa procedure error occurs. See also -D below.
  1295. X
  1296. XAbsence of the
  1297. X.B -d
  1298. Xand
  1299. X.B -D
  1300. Xswitches
  1301. Xcauses ecu (upon any completion of the
  1302. Xinitial procedure) to enter the 1) interactive mode if a line
  1303. Xwas successfully attached by the procedure or 2) the setup menu
  1304. Xif no line was attached.
  1305. X
  1306. X.*s 3 "-D"
  1307. X
  1308. XThe
  1309. X.B
  1310. X-D switch
  1311. X.R
  1312. Xinstructs ECU to unconditionally terminate when an
  1313. Xinitial procedure finishes.
  1314. X
  1315. X.*s 3 "-t"
  1316. X
  1317. XThe
  1318. X.B
  1319. X-t switch
  1320. X.R
  1321. Xinstructs ECU to map incoming and outgoing carriage
  1322. Xreturns to carriage return/line feed pairs.
  1323. XThis is helpful if the remote connection will be to a
  1324. Xterminal with a human operator.  Use of the
  1325. X.B
  1326. X-h switch
  1327. X.R
  1328. Xis probably also necessary.
  1329. X
  1330. X.*s 3 "-A"
  1331. X
  1332. XNormally, ECU reads the terminal type (TERM environment
  1333. Xvariable) to determine whether or not
  1334. Xa terminal is "ANSI"-like or not.  -A forces ECU to treat the
  1335. Xterminal as an ANSI terminal, regardless of the contents
  1336. Xof the $TERM string.
  1337. X
  1338. X.*s 3 "-N"
  1339. X
  1340. XThis switch forces ECU to treat the terminal as a non-ANSI
  1341. Xterminal.  It has the opposite effect of -A.  You must have
  1342. Xa valid function key recognition entry for the $TERM type
  1343. Xif this switch is used.
  1344. X
  1345. X.*s 2 "Environment Variables"
  1346. X
  1347. XPrior to starting ECU, it is useful, but not necessary,
  1348. Xto establish two environment variables, ECUPROMPT and ECUHELP.
  1349. X
  1350. X.*s 3 "ECUPROMPT"
  1351. X
  1352. XThe ECUPROMPT environment variable determines the prompt printed
  1353. Xby ECU when the interactive command key ("HOME") is pressed.
  1354. XWhen you first run ECU, try setting it to your name, e. g.,
  1355. X.DS I
  1356. Xsetenv ECUPROMPT Ralph    if you use csh
  1357. X
  1358. XECUPROMPT=Ralph           if you use sh, ksh, etc.
  1359. Xexport ECUPROMPT
  1360. X.DE
  1361. XThen, when you see how it used, you may wish to
  1362. Xestablish a more permanent choice in your .login or .profile.
  1363. X
  1364. X.*s 3 "ECUHELP"
  1365. X
  1366. XOrdinarily, ECU looks for interactive command help information
  1367. Xin "/usr/lib/ecu/ecuhelp.data".
  1368. XThe ECUHELP environment may be set to the complete
  1369. Xpathname of the ecu help file if an alternate file
  1370. Xis to be used.
  1371. X
  1372. XThe help file is explained later in the section
  1373. Xtitled "Online Command Dictionary".
  1374. X
  1375. SHAR_EOF
  1376. $TOUCH -am 0528125391 'doc/_startup.txt' &&
  1377. chmod 0644 doc/_startup.txt ||
  1378. echo 'restore of doc/_startup.txt failed'
  1379. Wc_c="`wc -c < 'doc/_startup.txt'`"
  1380. test 8276 -eq "$Wc_c" ||
  1381.     echo 'doc/_startup.txt: original size 8276, current size' "$Wc_c"
  1382. rm -f _shar_wnt_.tmp
  1383. fi
  1384. # ============= doc/_top.txt ==============
  1385. if test -f 'doc/_top.txt' -a X"$1" != X"-c"; then
  1386.     echo 'x - skipping doc/_top.txt (File already exists)'
  1387.     rm -f _shar_wnt_.tmp
  1388. else
  1389. > _shar_wnt_.tmp
  1390. echo 'x - extracting doc/_top.txt (Text)'
  1391. sed 's/^X//' << 'SHAR_EOF' > 'doc/_top.txt' &&
  1392. X
  1393. X.de *s
  1394. X.H "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
  1395. X.br
  1396. X..
  1397. X.po 4
  1398. X.ll 7.2i
  1399. X.ls 1
  1400. X.nh
  1401. X.tp
  1402. X.sp 2i
  1403. X.ft B
  1404. X.ce 10
  1405. XECU 3.10
  1406. X
  1407. X(Extended Call Utility)
  1408. X.ce 0
  1409. X.sp 1i
  1410. X.ce 100
  1411. XProfessional and Engineering
  1412. XAsynchronous Communications Package
  1413. Xfor UNIX and XENIX System V
  1414. X.ce 0
  1415. X.ft P
  1416. X.sp 2i
  1417. X.lp
  1418. X.ce 1
  1419. XWarren H. Tucker, III <wht@n4hgf.Mt-Park.GA.US>
  1420. X.sp 1i
  1421. X.ce 100
  1422. XTechnical Description
  1423. XRevision 3.10
  1424. X\n(mo/\n(dy/\n(yr
  1425. X.ce 0
  1426. X.ls 1
  1427. X.PH "'ECU Technical Description''%'"
  1428. X.PF "'Public Domain by wht@n4hgf''\n(mo/\n(dy/\n(yr'"
  1429. X.nr si 2n
  1430. X.nr Cl 9
  1431. X.nr Ej 1
  1432. X.nr U 1
  1433. X.SA 0
  1434. X.ul
  1435. X.bp 1
  1436. X
  1437. SHAR_EOF
  1438. $TOUCH -am 0712142291 'doc/_top.txt' &&
  1439. chmod 0644 doc/_top.txt ||
  1440. echo 'restore of doc/_top.txt failed'
  1441. Wc_c="`wc -c < 'doc/_top.txt'`"
  1442. test 561 -eq "$Wc_c" ||
  1443.     echo 'doc/_top.txt: original size 561, current size' "$Wc_c"
  1444. rm -f _shar_wnt_.tmp
  1445. fi
  1446. # ============= doc/ecu.txt ==============
  1447. if test -f 'doc/ecu.txt' -a X"$1" != X"-c"; then
  1448.     echo 'x - skipping doc/ecu.txt (File already exists)'
  1449.     rm -f _shar_wnt_.tmp
  1450. else
  1451. > _shar_wnt_.tmp
  1452. echo 'x - extracting doc/ecu.txt (Text)'
  1453. sed 's/^X//' << 'SHAR_EOF' > 'doc/ecu.txt' &&
  1454. X.so _top.txt
  1455. X
  1456. X.so _intro.txt
  1457. X
  1458. X.so _basic.txt
  1459. X
  1460. X.so _features.txt
  1461. X
  1462. X.so _startup.txt
  1463. X
  1464. X.so _icmd.txt
  1465. X
  1466. X.so _proc.txt
  1467. X
  1468. X.so _hdb.txt
  1469. X
  1470. X.so _end.txt
  1471. SHAR_EOF
  1472. $TOUCH -am 0718160491 'doc/ecu.txt' &&
  1473. chmod 0644 doc/ecu.txt ||
  1474. echo 'restore of doc/ecu.txt failed'
  1475. Wc_c="`wc -c < 'doc/ecu.txt'`"
  1476. test 140 -eq "$Wc_c" ||
  1477.     echo 'doc/ecu.txt: original size 140, current size' "$Wc_c"
  1478. rm -f _shar_wnt_.tmp
  1479. fi
  1480. # ============= doc/exits.txt ==============
  1481. if test -f 'doc/exits.txt' -a X"$1" != X"-c"; then
  1482.     echo 'x - skipping doc/exits.txt (File already exists)'
  1483.     rm -f _shar_wnt_.tmp
  1484. else
  1485. > _shar_wnt_.tmp
  1486. echo 'x - extracting doc/exits.txt (Text)'
  1487. sed 's/^X//' << 'SHAR_EOF' > 'doc/exits.txt' &&
  1488. X
  1489. X
  1490. X.de *s
  1491. X.H "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
  1492. X.br
  1493. X..
  1494. X.po 4
  1495. X.ll 7.2i
  1496. X.ls 1
  1497. X.nh
  1498. X.tp
  1499. X.sp 2i
  1500. X.ft B
  1501. X.ce 10
  1502. XECU 3.10
  1503. X
  1504. X(Extended Call Utility)
  1505. X.ce 0
  1506. X.sp 1i
  1507. X.ce 100
  1508. XProfessional and Engineering
  1509. XAsynchronous Communications Package
  1510. Xfor UNIX and XENIX System V
  1511. X.ce 0
  1512. X.ft P
  1513. X.sp 2i
  1514. X.lp
  1515. X.ce 1
  1516. XWarren H. Tucker, III <wht@n4hgf.Mt-Park.GA.US>
  1517. X.sp 1i
  1518. X.ce 100
  1519. XExit Codes
  1520. XRevision 3.10
  1521. X\n(mo/\n(dy/\n(yr
  1522. X.ce 0
  1523. X.ls 1
  1524. X.PH "'ECU Exit Codes''%'"
  1525. X.PF "'Public Domain by wht@n4hgf''\n(mo/\n(dy/\n(yr'"
  1526. X.nr si 2n
  1527. X.nr Cl 9
  1528. X.nr Ej 1
  1529. X.nr U 1
  1530. X.SA 0
  1531. X.ul
  1532. X.bp 1
  1533. X
  1534. X.*s 1 "Exit Codes"
  1535. X
  1536. XWhen ECU exits (terminates execution),
  1537. Xit uses a code from the following table:
  1538. X.DS L
  1539. XOK                   0    no error
  1540. XSIG1                 1    SIGHUP (signal 1)
  1541. XSIGN                 64   signal 64 - see below
  1542. XLINE_READ_ERROR      129  could not read from attached line
  1543. XXMTR_WRITE_ERROR     130  could not write to attached line
  1544. XXMTR_LOGIC_ERROR     131  software logic error
  1545. XBSD4_IOCTL           132  not currently used
  1546. XSHM_ABL              133  not currently used
  1547. XSHM_RTL              134  not currently used
  1548. XNO_FORK_FOR_RCVR     135  could not fork receiver process
  1549. XTTYIN_READ_ERROR     136  could not read from console
  1550. XLINE_OPEN_ERROR      137  could not attach (open) requested line
  1551. XPWENT_ERROR          138  error in /etc/passwd processing
  1552. XUSAGE                139  command line syntax error
  1553. XCONFIG_ERROR         140  missing or erroroenous configuration file
  1554. XINIT_PROC_ERROR      192  initial procedure terminated in error
  1555. XUSER1                193  exit procedure command called with 1
  1556. XUSERN                223  exit procedure command called with 31
  1557. X.DE
  1558. X
  1559. XThe logical names 'SIG1' and 'SIGN' refer to a range of error codes
  1560. Xsignifying ecu termination due to a signal.  A larger range (64) is
  1561. Xreserved than is necessary to handle reasonable expansion of
  1562. XSIG values in the OS. Not all signals will be reported
  1563. Xin this manner. ECU will never report status 9 (signal 9, SIGKILL),
  1564. Xfor instance.
  1565. X
  1566. XThe logical names 'USER1' and 'USERN' refer to a range of error
  1567. Xexits codes reserved for use by the 'exit' procedure command.
  1568. XSee the description of this command for more information.
  1569. X
  1570. XFor ecu friend code,
  1571. Xformal C #define identifiers for exit codes may be found in
  1572. Xecuhangup.h and consist of the above logical names prefixed with 'HANGUP_'.
  1573. X
  1574. SHAR_EOF
  1575. $TOUCH -am 0712142291 'doc/exits.txt' &&
  1576. chmod 0644 doc/exits.txt ||
  1577. echo 'restore of doc/exits.txt failed'
  1578. Wc_c="`wc -c < 'doc/exits.txt'`"
  1579. test 2303 -eq "$Wc_c" ||
  1580.     echo 'doc/exits.txt: original size 2303, current size' "$Wc_c"
  1581. rm -f _shar_wnt_.tmp
  1582. fi
  1583. # ============= doc/runoff ==============
  1584. if test -f 'doc/runoff' -a X"$1" != X"-c"; then
  1585.     echo 'x - skipping doc/runoff (File already exists)'
  1586.     rm -f _shar_wnt_.tmp
  1587. else
  1588. > _shar_wnt_.tmp
  1589. echo 'x - extracting doc/runoff (Text)'
  1590. sed 's/^X//' << 'SHAR_EOF' > 'doc/runoff' &&
  1591. X#!/bin/csh
  1592. Xunset noclobber
  1593. Xecho 'nroff -mm ecu.txt | col > ecu.man'
  1594. Xnroff -mm ecu.txt |& col > ecu.man
  1595. X
  1596. Xecho 'nroff -mm exits.txt | col > exits.man'
  1597. Xnroff -mm exits.txt |& col > exits.man
  1598. SHAR_EOF
  1599. $TOUCH -am 0521210291 'doc/runoff' &&
  1600. chmod 0755 doc/runoff ||
  1601. echo 'restore of doc/runoff failed'
  1602. Wc_c="`wc -c < 'doc/runoff'`"
  1603. test 188 -eq "$Wc_c" ||
  1604.     echo 'doc/runoff: original size 188, current size' "$Wc_c"
  1605. rm -f _shar_wnt_.tmp
  1606. fi
  1607. # ============= models/_connect.ep ==============
  1608. if test ! -d 'models'; then
  1609.     echo 'x - creating directory models'
  1610.     mkdir 'models'
  1611. fi
  1612. if test -f 'models/_connect.ep' -a X"$1" != X"-c"; then
  1613.     echo 'x - skipping models/_connect.ep (File already exists)'
  1614.     rm -f _shar_wnt_.tmp
  1615. else
  1616. > _shar_wnt_.tmp
  1617. echo 'x - extracting models/_connect.ep (Text)'
  1618. sed 's/^X//' << 'SHAR_EOF' > 'models/_connect.ep' &&
  1619. X#+------------------------------------------------------------------
  1620. X#  _connect.ep - CONNECT special "hook" procedure
  1621. X#
  1622. X# %argv(1) - result code
  1623. X#-------------------------------------------------------------------
  1624. X#+:EDITS:
  1625. X#:07-13-1991-14:47-wht@n4hgf-creation
  1626. X
  1627. X    return   # skip this unless you want it
  1628. X
  1629. X    $iv0_save = $i0  # it is a VERY good idea to save the dialer
  1630. X    $sv0_save = $s0  # function return status
  1631. X                     # since gobs of functions and commands modify $i0
  1632. X                     # as a side effect of their operation
  1633. X
  1634. X    echo 'connected to '+%rname+' result: "'+%argv(1)+'"'
  1635. X
  1636. X    $i0 = $iv0_save  # restore dialer return status
  1637. X    $s0 = $sv0_save
  1638. SHAR_EOF
  1639. $TOUCH -am 0715135291 'models/_connect.ep' &&
  1640. chmod 0644 models/_connect.ep ||
  1641. echo 'restore of models/_connect.ep failed'
  1642. Wc_c="`wc -c < 'models/_connect.ep'`"
  1643. test 682 -eq "$Wc_c" ||
  1644.     echo 'models/_connect.ep: original size 682, current size' "$Wc_c"
  1645. rm -f _shar_wnt_.tmp
  1646. fi
  1647. # ============= models/_connfail.ep ==============
  1648. if test -f 'models/_connfail.ep' -a X"$1" != X"-c"; then
  1649.     echo 'x - skipping models/_connfail.ep (File already exists)'
  1650.     rm -f _shar_wnt_.tmp
  1651. else
  1652. > _shar_wnt_.tmp
  1653. echo 'x - extracting models/_connfail.ep (Text)'
  1654. sed 's/^X//' << 'SHAR_EOF' > 'models/_connfail.ep' &&
  1655. X#+------------------------------------------------------------------
  1656. X#  _connfail.ep - connection failure special "hook" procedure
  1657. X#
  1658. X# %argv(1) - system name
  1659. X# %argv(2) - result code
  1660. X#
  1661. X# Its is also very likely $s0 will == %argv(1)
  1662. X#-------------------------------------------------------------------
  1663. X#+:EDITS:
  1664. X#:07-13-1991-14:47-wht@n4hgf-creation
  1665. X
  1666. X    return  # skip this unless you want it
  1667. X
  1668. X    $iv0_save = $i0  # it is a VERY good idea to save the dialer
  1669. X    $sv0_save = $s0  # function return status
  1670. X                       # since gobs of functions and commands modify $i0
  1671. X                       # as a side effect of their operation
  1672. X
  1673. X    echo 'failed to connect to '+%argv(1)+' result: "'+%argv(2)+'"'
  1674. X
  1675. X    $i0 = $iv0_save  # restore dialer return status
  1676. X    $s0 = $sv0_save
  1677. SHAR_EOF
  1678. $TOUCH -am 0715135391 'models/_connfail.ep' &&
  1679. chmod 0644 models/_connfail.ep ||
  1680. echo 'restore of models/_connfail.ep failed'
  1681. Wc_c="`wc -c < 'models/_connfail.ep'`"
  1682. test 781 -eq "$Wc_c" ||
  1683.     echo 'models/_connfail.ep: original size 781, current size' "$Wc_c"
  1684. rm -f _shar_wnt_.tmp
  1685. fi
  1686. # ============= models/_hangup.ep ==============
  1687. if test -f 'models/_hangup.ep' -a X"$1" != X"-c"; then
  1688.     echo 'x - skipping models/_hangup.ep (File already exists)'
  1689.     rm -f _shar_wnt_.tmp
  1690. else
  1691. > _shar_wnt_.tmp
  1692. echo 'x - extracting models/_hangup.ep (Text)'
  1693. sed 's/^X//' << 'SHAR_EOF' > 'models/_hangup.ep' &&
  1694. X#+------------------------------------------------------------------
  1695. X#  _hangup.ep - hangup special "hook" procedure
  1696. X#-------------------------------------------------------------------
  1697. X#+:EDITS:
  1698. X#:07-13-1991-14:47-wht@n4hgf-creation
  1699. X
  1700. X    return  # skip this unless you want it
  1701. X
  1702. X    $i0 = %stoi(%argv(1))
  1703. X    $s0 = %etime($i0)
  1704. X    echo '_hangup on '+%rname+' after '+$s0+' connect'
  1705. SHAR_EOF
  1706. $TOUCH -am 0715135391 'models/_hangup.ep' &&
  1707. chmod 0644 models/_hangup.ep ||
  1708. echo 'restore of models/_hangup.ep failed'
  1709. Wc_c="`wc -c < 'models/_hangup.ep'`"
  1710. test 382 -eq "$Wc_c" ||
  1711.     echo 'models/_hangup.ep: original size 382, current size' "$Wc_c"
  1712. rm -f _shar_wnt_.tmp
  1713. fi
  1714. # ============= models/bsd_uname.ep ==============
  1715. if test -f 'models/bsd_uname.ep' -a X"$1" != X"-c"; then
  1716.     echo 'x - skipping models/bsd_uname.ep (File already exists)'
  1717.     rm -f _shar_wnt_.tmp
  1718. else
  1719. > _shar_wnt_.tmp
  1720. echo 'x - extracting models/bsd_uname.ep (Text)'
  1721. sed 's/^X//' << 'SHAR_EOF' > 'models/bsd_uname.ep' &&
  1722. X#  CHK=0xFD46
  1723. X#--------------------------------------------------------------
  1724. X# bsd_uname.ep - get remote username from bsd system
  1725. X# return: $s0 = username
  1726. X#         $i0 = 1 if success, else 0
  1727. X#--------------------------------------------------------------
  1728. X#+:EDITS:*/
  1729. X#:07-11-1989-16:55-wht-get cmd became lgets
  1730. X#:06-28-1989-19:36-wht-use named variables
  1731. X#:06-25-1989-13:56-wht-new do command syntax
  1732. X#:06-25-1989-12:33-wht-new if/while syntax
  1733. X#:06-22-1989-13:30-wht-creation
  1734. X
  1735. X    set $s0='whoami'    # send command
  1736. X    do 'oneline'        # get $s0=username
  1737. X    ifi $i0 == 0         # we bombed?
  1738. X    {
  1739. X        set $i0=%colors; color red
  1740. X        echo 'bsd_uname: get user name failed'
  1741. X        icolor $i0
  1742. X        $i0 = 0
  1743. X    }
  1744. X
  1745. SHAR_EOF
  1746. $TOUCH -am 0429171591 'models/bsd_uname.ep' &&
  1747. chmod 0644 models/bsd_uname.ep ||
  1748. echo 'restore of models/bsd_uname.ep failed'
  1749. Wc_c="`wc -c < 'models/bsd_uname.ep'`"
  1750. test 673 -eq "$Wc_c" ||
  1751.     echo 'models/bsd_uname.ep: original size 673, current size' "$Wc_c"
  1752. rm -f _shar_wnt_.tmp
  1753. fi
  1754. # ============= models/colors ==============
  1755. if test -f 'models/colors' -a X"$1" != X"-c"; then
  1756.     echo 'x - skipping models/colors (File already exists)'
  1757.     rm -f _shar_wnt_.tmp
  1758. else
  1759. > _shar_wnt_.tmp
  1760. echo 'x - extracting models/colors (Text)'
  1761. sed 's/^X//' << 'SHAR_EOF' > 'models/colors' &&
  1762. X#colors - ecu color file
  1763. Xnormal lt_cyan black
  1764. Xreverse red white
  1765. Xnotify black gray
  1766. Xsuccess lt_green black
  1767. Xalert yellow black
  1768. Xerror red black
  1769. SHAR_EOF
  1770. $TOUCH -am 0429171591 'models/colors' &&
  1771. chmod 0644 models/colors ||
  1772. echo 'restore of models/colors failed'
  1773. Wc_c="`wc -c < 'models/colors'`"
  1774. test 140 -eq "$Wc_c" ||
  1775.     echo 'models/colors: original size 140, current size' "$Wc_c"
  1776. rm -f _shar_wnt_.tmp
  1777. fi
  1778. # ============= models/dir ==============
  1779. if test -f 'models/dir' -a X"$1" != X"-c"; then
  1780.     echo 'x - skipping models/dir (File already exists)'
  1781.     rm -f _shar_wnt_.tmp
  1782. else
  1783. > _shar_wnt_.tmp
  1784. echo 'x - extracting models/dir (Text)'
  1785. sed 's/^X//' << 'SHAR_EOF' > 'models/dir' &&
  1786. X/tmp
  1787. X/usr/tmp
  1788. SHAR_EOF
  1789. $TOUCH -am 0429171591 'models/dir' &&
  1790. chmod 0644 models/dir ||
  1791. echo 'restore of models/dir failed'
  1792. Wc_c="`wc -c < 'models/dir'`"
  1793. test 14 -eq "$Wc_c" ||
  1794.     echo 'models/dir: original size 14, current size' "$Wc_c"
  1795. rm -f _shar_wnt_.tmp
  1796. fi
  1797. # ============= models/f.ep ==============
  1798. if test -f 'models/f.ep' -a X"$1" != X"-c"; then
  1799.     echo 'x - skipping models/f.ep (File already exists)'
  1800.     rm -f _shar_wnt_.tmp
  1801. else
  1802. > _shar_wnt_.tmp
  1803. echo 'x - extracting models/f.ep (Text)'
  1804. sed 's/^X//' << 'SHAR_EOF' > 'models/f.ep' &&
  1805. X#  CHK=0x1C17
  1806. X#+------------------------------------------------------
  1807. X# f.eq - colorful finger on remote BSD system
  1808. X#-------------------------------------------------------
  1809. X#+:EDITS:*/
  1810. X#:07-11-1989-16:55-wht-get cmd became lgets
  1811. X#:06-30-1989-18:53-wht-creation
  1812. X
  1813. X    mkvar $icolor; $icolor = %colors
  1814. X    mkvar $itimeout; $itimeout = 50
  1815. X    send %argv(0)
  1816. X    lookfor '\n' 40
  1817. X    $s0 = ''
  1818. X    whilei 1==1
  1819. X    {
  1820. X        lgets $s00 $itimeout 5 '\n'
  1821. X        ifi $i0 == 0 continue
  1822. X        ifi %instr($s0,'% ') >= 0 break # prompt ends it
  1823. X        $itimeout = 20
  1824. X        color cyan
  1825. X        ifi %instr($s0,'Login') == 0 color gray
  1826. X        ifi %instr($s0,' i29 ') > 0 color green
  1827. X        ifi %instr($s0,' i13 ') > 0 color red
  1828. X        ifi %instr($s0,'cma') == 0 color yellow
  1829. X        ifi %instr($s0,'gfp') == 0 color lt_blue
  1830. X        ifi %instr($s0,'jts') == 0 color lt_blue
  1831. X        echo $s0
  1832. X    }
  1833. X    icolor $icolor
  1834. X    send ''
  1835. X
  1836. SHAR_EOF
  1837. $TOUCH -am 0429171591 'models/f.ep' &&
  1838. chmod 0644 models/f.ep ||
  1839. echo 'restore of models/f.ep failed'
  1840. Wc_c="`wc -c < 'models/f.ep'`"
  1841. test 815 -eq "$Wc_c" ||
  1842.     echo 'models/f.ep: original size 815, current size' "$Wc_c"
  1843. rm -f _shar_wnt_.tmp
  1844. fi
  1845. # ============= models/file_test.ep ==============
  1846. if test -f 'models/file_test.ep' -a X"$1" != X"-c"; then
  1847.     echo 'x - skipping models/file_test.ep (File already exists)'
  1848.     rm -f _shar_wnt_.tmp
  1849. else
  1850. > _shar_wnt_.tmp
  1851. echo 'x - extracting models/file_test.ep (Text)'
  1852. sed 's/^X//' << 'SHAR_EOF' > 'models/file_test.ep' &&
  1853. X#  CHK=0xA2AF
  1854. X#------------------------------------------------------------
  1855. X#  ftst.ep - test ecu procedure file functions
  1856. X#------------------------------------------------------------
  1857. X
  1858. X ptrace off         # turn off trace mode
  1859. X fdel 'ftst.log'    # kill any previous file
  1860. X plog 'ftst.log'    # turn on logging
  1861. X
  1862. X echo ''
  1863. X echo 'ftst '+%date+' '+%time
  1864. X echo ''
  1865. X
  1866. X ptrace on                  # turn on trace mode
  1867. X
  1868. X set $s10 = '/tmp/ftst.tmp' # temp file name
  1869. X fdel $s10                  # test proc trace warning
  1870. X fopen -w 0 $s10            # open file 0 for write
  1871. X set i0=%ftell(0)           # should produce 0
  1872. X fputs 0 'abcdefghijk'      # put a line in the file
  1873. X set i0=%ftell(0)           # should produce 12
  1874. X fclose 0 n                 # close the file
  1875. X
  1876. X fopen -r 0 $s10    # open again for reading
  1877. X fgets 0 $s0        # should produce 'abcdefghijk'
  1878. X fseek 0 0          # rewind to read again
  1879. X fgets 0 $s0        # should produce 'abcdefghijk'
  1880. X fgets 0 $s0        # should produce null string
  1881. X set $i0=%fmode(0)  # test file mode function
  1882. X fclose 0           # close the file
  1883. X
  1884. X fchmod 'rw-rw-r-x' $s10 # set mode using string
  1885. X set $i0=%fmode($s10)
  1886. X
  1887. X fchmod 0777 $s10        # set mode using constant
  1888. X set $i0=%fmode($s10)
  1889. X
  1890. X ptrace off              # show file attributes
  1891. X echo ''
  1892. X echo -n $s10+' has '+%itos(%fsize($s10),06d)
  1893. SHAR_EOF
  1894. true || echo 'restore of models/file_test.ep failed'
  1895. fi
  1896. echo 'End of ecu310 part 35'
  1897. echo 'File models/file_test.ep is continued in part 36'
  1898. echo 36 > _shar_seq_.tmp
  1899. exit 0
  1900. --------------------------------------------------------------------
  1901. Warren Tucker, TuckerWare emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
  1902. Hacker Extraordinaire  d' async PADs,  pods,  proteins and protocols
  1903.  
  1904. exit 0 # Just in case...
  1905. -- 
  1906. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1907. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1908. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1909. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1910.