home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume16 / ecu3 / part34 < prev    next >
Encoding:
Internet Message Format  |  1991-01-06  |  53.1 KB

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