home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume32 / ecu / part38 < prev    next >
Encoding:
Text File  |  1992-09-14  |  57.0 KB  |  2,140 lines

  1. Newsgroups: comp.sources.misc
  2. From: wht@n4hgf.Mt-Park.GA.US (Warren Tucker)
  3. Subject:  v32i073:  ecu - ECU Asynchronous Communications v3.20, Part38/40
  4. Message-ID: <1992Sep15.153810.20991@sparky.imd.sterling.com>
  5. X-Md4-Signature: 68abcd8f565b28dbb1bc0e110bcd24b8
  6. Date: Tue, 15 Sep 1992 15:38:10 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: wht@n4hgf.Mt-Park.GA.US (Warren Tucker)
  10. Posting-number: Volume 32, Issue 73
  11. Archive-name: ecu/part38
  12. Environment: SCO,XENIX,ISC,SUNOS,SYSVR4,HDB,Curses
  13. Supersedes: ecu: Volume 21, Issue 53-89
  14.  
  15. ---- Cut Here and feed the following to sh ----
  16. #!/bin/sh
  17. # this is ecu320.38 (part 38 of ecu320)
  18. # do not concatenate these parts, unpack them in order with /bin/sh
  19. # file doc/_p_cmd.txt continued
  20. #
  21. if test ! -r _shar_seq_.tmp; then
  22.     echo 'Please unpack part 1 first!'
  23.     exit 1
  24. fi
  25. (read Scheck
  26.  if test "$Scheck" != 38; then
  27.     echo Please unpack part "$Scheck" next!
  28.     exit 1
  29.  else
  30.     exit 0
  31.  fi
  32. ) < _shar_seq_.tmp || exit 1
  33. if test ! -f _shar_wnt_.tmp; then
  34.     echo 'x - still skipping doc/_p_cmd.txt'
  35. else
  36. echo 'x - continuing file doc/_p_cmd.txt'
  37. sed 's/^X//' << 'SHAR_EOF' >> 'doc/_p_cmd.txt' &&
  38. X.DS L
  39. XExample:
  40. X
  41. X    mkvar s_logname(128)
  42. X    $s_logname = %dir+'logname'
  43. X    plog $s_logname
  44. X    echo 'Test'
  45. X    plog off;cd 'somewhere_else';plog $s_logname
  46. X    echo 'Test'
  47. X.DE
  48. X
  49. X.*s 2 "popd"
  50. X
  51. X.DS L
  52. Xusage: popd [ | <#> | all]
  53. X.DE
  54. X
  55. XThis command returns to a previous directory after a
  56. X.B pushd
  57. Xcommand has been previously executed.
  58. X
  59. XIf no argument is supplied, the directory at the immediately previous
  60. Xlevel is restored.  
  61. X
  62. XIf a numeric argument is supplied, the directory
  63. Xat the specified level is restored; the level numbers may be obtained by
  64. Xissuing a
  65. X.B pushd
  66. Xcommand with no arguments.
  67. X
  68. XIf the 'all' argument is supplied, it is treated as a numeric argument of 0;
  69. Xthat is the directory stack is cleared and the directory at level 0 is
  70. Xrestored.
  71. X
  72. XThe directory stack is shared between interactive and procedure
  73. Xcommands.  Neither beginning nor ending a procedure affects the
  74. Xdirectory stack level.
  75. X
  76. X.DS L
  77. XExamples:
  78. X   popd
  79. X   popd 3
  80. X   popd all
  81. X.DE
  82. X
  83. X.*s 2 "popen"
  84. X
  85. Xusage: popen [-switches] <filenum> <command>
  86. X
  87. XThis command executes a shell command defined by the string argument <command>
  88. Xand associates it with the user-chosen file number <filenum> (which
  89. Xmust be an integer value between 0 and 4, inclusive).
  90. X
  91. XThe argument switches govern whether the command is
  92. Xto receive input from ECU or output to ECU and must be chosen
  93. Xfrom this list:
  94. X.VL 15 4
  95. X.LI -r
  96. XThe command will output to ECU.
  97. X.LI -w
  98. XThe command will receive input from ECU.
  99. X.LE
  100. X
  101. XThe switches argument may be omitted; in such cases,
  102. Xthe file is opened as though '-r' had been supplied.  However,
  103. Xif procedure tracing is enabled (see the description of the
  104. Xinteractive and procedure command
  105. X.B ptrace ),
  106. Xa warning message will be issued.
  107. X
  108. XThe command sets $i0 = 0 if successful, else to the
  109. X.B errno
  110. Xfrom the associated system call (refer to the 
  111. X.B %errstr
  112. Xstring function and/or /usr/include/sys/errno.h).
  113. X.DS L
  114. XExample:
  115. X
  116. X    popen 0 -r 'ls -l *.log'
  117. X    popen 1 -w 'cat | sort > /tmp/sorted'
  118. X.DE
  119. X
  120. X
  121. X.*s 2 "prompt"
  122. X
  123. Xusage: prompt <str>
  124. X
  125. XThis command allows selection of an alternate prompt to the interactive
  126. Xmode HOME command trigger.
  127. XRefer to the section titled "ECUPROMPT"
  128. Xfor more information on the interactive mode prompt.
  129. X
  130. XNote: the interactive and procedure
  131. X.B hangup
  132. Xcommands both cause the default prompt to be reestablished.
  133. X
  134. X.DS L
  135. XExample:
  136. X
  137. X     prompt %rname+' >'    use remote name in prompt
  138. X.DE
  139. X
  140. X.*s 2 "ptrace"
  141. X
  142. X.DS L
  143. Xusage: ptrace [ <str> | off ]
  144. X.DE
  145. X
  146. XThis command controls procedure execution tracing.  Trace
  147. Xoutput is written to the screen and varys in its nature depending upon
  148. Xthe command being traced.  Specifically, any change to a string or
  149. Xinteger variable is noted.  If tracing is enabled, the output will also
  150. Xbe written to any active procedure log file (see the
  151. X.B plog
  152. Xinteractive and procedure commands).
  153. X
  154. XThe majority of procedure tracing features use the current trace
  155. Xstate as a binary condition.  That is, either tracing is done
  156. Xor not.  However, the procedure command
  157. X.B expresp
  158. Xemits varying levels of debugging output in a manner similar to
  159. Xthe uucico -x flag.
  160. X
  161. X.*s 2 "pushd"
  162. X
  163. X.DS L
  164. Xusage: pushd [ | <dir>]
  165. X.DE
  166. X
  167. XThis command either 1) saves the current directory pathname on
  168. Xa stack and establishes a new current directory or
  169. X2) displays the current stack and current directory.
  170. XThe stack size is 10.
  171. X
  172. XIf no argument is supplied, the directory stack is displayed.
  173. X
  174. XThe directory stack is shared between interactive and procedure
  175. Xcommands.  Neither beginning nor ending a procedure affects the
  176. Xdirectory stack level.
  177. X
  178. X.DS L
  179. XExamples:
  180. X   pushd
  181. X   pushd '/tmp'
  182. X.DE
  183. X
  184. X.*s 2 "putf"
  185. X
  186. XNot yet implemented.
  187. X
  188. X.*s 2 "return"
  189. X
  190. Xusage: return [<int>]
  191. X
  192. XThis command serves two functions: to return from a gosub to or
  193. Xreturn from a procedure execution.  If <int> is supplied, it must be in the
  194. Xrange 0 to 255.  Other values result in a return value of 255.
  195. X
  196. XIf no gosub is active,
  197. X.B return
  198. Xcauses the currently executing procedure to terminate,
  199. Xreturning either to a calling procedure or to the interactive mode.
  200. XIf <int> is supplied and it's value is nonzero, then all procedure execution is
  201. Xterminated and the integer status is printed
  202. Xon the screen along with the name of the executing procedure.
  203. X
  204. XIf a gosub is active,
  205. X.B return
  206. Xor
  207. X.B return
  208. X0 causes control to return to the statement immediately following the
  209. X.B gosub
  210. Xwhich invoked the subroutine.
  211. XIf <int> is supplied and it's value is nonzero, then all procedure execution is
  212. Xterminated and the integer status is printed
  213. Xon the screen along with the name of the executing procedure.
  214. X
  215. XIt is not possible to terminate a procedure with normal status from
  216. Xwithin a subroutine.
  217. X
  218. X.DS L
  219. XExample:
  220. X
  221. X#---------------------
  222. X# gosub.ep
  223. X#---------------------
  224. X    echo 'main'; gosub SUB; echo 'back to main'
  225. X    return
  226. X
  227. XSUB
  228. X    echo 'sub'
  229. X    gosub SUB2
  230. X    echo 'back to sub'
  231. X    return
  232. X
  233. X
  234. XSUB2
  235. X    echo 'sub2'
  236. X    return
  237. X
  238. X.DE
  239. X
  240. X.*s 2 "rk"
  241. X
  242. Xusage: rk [-a]
  243. X
  244. XThis command invokes C-Kermit to
  245. Xreceive
  246. Xfiles. ECU searches the PATH list for 'kermit' or 'ckermit',
  247. Xexpecting to find Columbia University C-Kermit version 5A(173)
  248. Xor later.  The file ~/.kermrc must be set up to have any desired
  249. Xinitialization parameters you desire (refer to C-Kermit
  250. Xdocumentation for more information).
  251. XThe remote protocol must have been started prior to the
  252. Xexecution of this command.
  253. X
  254. XWARNING: until further notice, avoid suspending Kermit
  255. Xwith ^\Z.  ECU is totally unprepared to act as a job control
  256. Xprocess group leader.
  257. X
  258. XIf switch '-a'
  259. Xis omitted, the received files are stored as received; otherwise
  260. Xcarriage return/linefeed pairs are converted to newlines.
  261. X
  262. X.*s 2 "rlog"
  263. X
  264. X.DS L
  265. Xusage: rlog [-srf] <str>
  266. X       rlog 'off'
  267. X.DE
  268. X
  269. XThis command controls receiver logging.  It's function is the same as
  270. Xthe interactive
  271. X.B log
  272. Xcommand.
  273. X
  274. XThe first form of the command enables logging. The
  275. X.B -s switch causes the file to be
  276. X.B s cratched
  277. Xwhen it is opened (otherwise the file is opened for append).  The
  278. X.B -r
  279. Xswitch causes raw logging, else filter logging is performed.  The
  280. X.B -f
  281. Xswitch causes the log file to be flushed  each time it is written to
  282. X(unbuffered I/O); this switch is useful if you are logging to
  283. Xa terminal or hard copy device and wish to see output as soon as it
  284. Xis produced.
  285. X
  286. X.*s 2 "rname"
  287. X
  288. Xusage: rname <str>
  289. X
  290. XNormally, the %rname string function returns the same string
  291. Xas the logical dialing directory entry.  This command allows
  292. Xthe default value to be overridden with a user-selected
  293. Xvalue (63-character maximum).
  294. X
  295. XThis feature is useful in situations where one system is initially
  296. Xdialed, but a connection is made to yet another system from the dialed
  297. Xsystem via networking.
  298. X
  299. X.*s 2 "rs"
  300. X
  301. Xusage: rs
  302. X
  303. XThis command invokes the SEAlink file receive protocol.
  304. XThere
  305. Xis no provision in the SEAlink protocol to convert
  306. Xcarriage return/linefeed pairs to newlines,
  307. Xso the received files are stored as received.
  308. XThe remote sender must have been started prior to the
  309. Xexecution of this command.
  310. X
  311. X.*s 2 "rtscts"
  312. X.DS L
  313. Xusage: rtscts [ off | on | no | yes | 0..7 ]
  314. X.DE
  315. X
  316. XThis command controls the RTS/CTS flow control feature of
  317. Xthe line driver (which may or may not work).
  318. XThis is a very confusing area though it should not be.
  319. X
  320. XIf no argument is supplied, the current setting is
  321. Xdisplayed.  Specifying 0 or n disables the facility;
  322. X1 or y causes RTS/CTS flow control to be enabled.
  323. X
  324. XWhat the command does is to manipulate the RTSFLOW and CTSFLOW
  325. Xbits of the termio c_cflag word (see 
  326. X.B termio(S) ).
  327. X
  328. XSCO's sio driver before UNIX 3.2v4/ODT 2.0
  329. Xdoes half duplex flow control.
  330. XFAS does hardware flow control based on the device magic
  331. Xnumber, but if you use a device number specifying no hardware flow
  332. Xcontrol, RTSFLOW and CTSFLOW can be used to specify SCO-style flow
  333. Xcontrol.
  334. XCRTSFL offers full duplex line control
  335. Xon 3.2v4 and later ONLY for SCO's sio driver.
  336. X
  337. X.DS I
  338. X arg | RTSFLOW | CTSFLOW    arg | RTSFLOW | CTSFLOW | CRTSFL
  339. X-----+---------+---------  -----+---------+---------+--------
  340. X off |   0     |   0         0  |   0     |   0     |
  341. X on  |   0     |   1         1  |   0     |   1     |
  342. X no  |   0     |   0         2  |   1     |   0     |
  343. X yes |   0     |   1         3  |   1     |   1     |
  344. X                             4  |   0     |   0     |   1
  345. X.DE
  346. XChoice 4 only works on SCO 3.2v4 and ODT 2.0.
  347. XAs you can see, numeric values are masks.
  348. XIf the 4 bit is present in the numeric value, it
  349. Xoverrides the lower-order bits:  Specifying 7 as an argument
  350. Xspecifies CRTSFL is to be used if it is supported, otherwise
  351. XRTSFLOW and CTSFLOW.
  352. X
  353. XUnder System V Release 4, an TCGETX/TCSETX manipulation
  354. Xis performed, modifying the x_hflag bits as follows:
  355. X.DS I
  356. Xargument | RTSXOFF | CTSXON    argument | RTSXOFF | CTSXON 
  357. X---------+---------+---------  ---------+---------+---------
  358. X  off    |   0     |   0         0      |   0     |   0
  359. X  on     |   0     |   1         1      |   0     |   1
  360. X  no     |   0     |   0         2      |   1     |   0
  361. X  yes    |   0     |   1         3      |   1     |   1
  362. X.DE
  363. XUnder SunOS 4.1, only CTS support is provided.  You should read
  364. Xthe termio and zs man pages.  Arguments result in the stated
  365. Xmanipulations of the termio element c_cflag:
  366. X.DS I
  367. Xargument | CRTSCTS    argument | CRTSCTS
  368. X---------+---------  ----------+---------
  369. X  off    |   0           0     |   0
  370. X  on     |   1           1     |   1
  371. X  no     |   0     
  372. X  yes    |   1    
  373. X.DE
  374. X
  375. X.DS L
  376. XExamples:
  377. X
  378. X    ifi %baud >= 9600
  379. X        rtscts 7 | use CRTSFL if available, otherwise whatever
  380. X.DE
  381. X
  382. X.*s 2 "rx"
  383. X
  384. Xusage: rx [-a] <str>
  385. X
  386. XThis command invokes the XMODEM file receive protocol
  387. Xto receive file <str>.  If switch '-a'
  388. Xis omitted, the received file is stored as received; otherwise
  389. Xcarriage return/linefeed pairs are converted to newlines.
  390. XThe remote sender must have been started prior to the
  391. Xexecution of this command.
  392. X
  393. X.*s 2 "ry"
  394. X
  395. Xusage: ry
  396. X
  397. XThis command invokes the YMODEM Batch (not to be confused with
  398. XXMODEM-1K) protocol to receive files from a remote system.  The remote
  399. Xsender must have been started prior to the execution of this command.
  400. X
  401. X.*s 2 "rz"
  402. X
  403. Xusage: rz
  404. X
  405. XThis command receives files with ZMODEM/CRC-32.
  406. XThe remote sender must have been started prior to the
  407. Xexecution of this command.  
  408. XAutomatic ZMODEM frame detection is NOT supported during
  409. Xprocedure execution.
  410. X
  411. X.*s 2 "scrdump"
  412. X
  413. Xusage: scrdump [<str>]
  414. X
  415. XThis command causes the current screen contents to be
  416. Xstored in a file.  If <str> is supplied, it is used as a pathname.
  417. XIf <str> is not supplied, "~/.ecu/screen.dump".
  418. XThe actions of the interactive
  419. X.B sdname
  420. Xcommand have no effect on the execution of this command.
  421. X
  422. XSee the section titled "Screen Dump" for more information.
  423. XThe subsection titled "Multiscreen and Non-Multiscreen" will be
  424. Xof particular interest when using screen dumps in an
  425. Xautomated environment.
  426. X
  427. X.*s 2 "send"
  428. X
  429. Xusage: send [-n] <str>
  430. X
  431. XThis command sends <str> to the communications line.  If the '-n'
  432. Xswitch is omitted, a carriage return (0x0D) is transmitted after <str>.
  433. XIf '-n' is supplied, no carriage return is transmitted.
  434. X
  435. X.DS L
  436. XExamples:
  437. X
  438. X    send 'ps -au'
  439. X    send -n %chr(0x02)+'START'+%chr(0x03)
  440. X.DE
  441. X
  442. X.*s 2 "set"
  443. X
  444. X.DS L
  445. Xusage: set [$]i<name>=<int-expression>[, ...]
  446. X       set [$]s<name>=<str-expression>[, ...]
  447. X.DE
  448. X
  449. XThis command sets an integer or string variable
  450. Xto an expression.  The 'set' verb may be omitted provided the
  451. Xotherwise optional '$' is supplied.  There are many examples of
  452. Xhow the set statement is performed throughout this document.
  453. XThe examples here are to further clarify the statement's syntax.
  454. X
  455. XIf the '=<expression>' is omitted, the value of the variable is
  456. Xdisplayed (useful when debugging).   If procedure tracing is
  457. Xenabled with the
  458. X.B ptrace
  459. Xcommand, all variables referenced by the
  460. X.B
  461. Xset
  462. Xcommand, whether a value is assigned or not, are displayed.
  463. X
  464. X.DS L
  465. XExamples:
  466. X
  467. X    set i0=0
  468. X    set $s0='brown',s1='The quick '+$s0+' fox'
  469. X    set $S0              with no '=', displays contents
  470. X    set i0,$i1,s0='abc',s1
  471. X    $s0 = 'abc'          legal
  472. X    set s0='abc'         legal
  473. X    s0 = 'abc'           illegal
  474. X.DE
  475. X.*s 2 "setline"
  476. X
  477. X.DS L
  478. Xusage: setline <filename>
  479. X.DE
  480. XThis command is an exact analog of the -l command line switch.
  481. X<filename> is used on the setup screen (if it is presented)
  482. Xas the default filename. If you do not edit this name, ECU will
  483. Xattempt to open the line when you press End or ^D. 
  484. X<filename> has the format of a complete pathanme in /dev or simple
  485. Xtty name. 
  486. X
  487. X.B setline
  488. Xmay only be used in _rc.ep.  Using the
  489. X.B setline
  490. Xcommand with the
  491. X.B baud
  492. Xcommand gives you programatic control over the actual
  493. Xchoice of the line and rate or the defaults for the setup screen,
  494. Xdepending upon other options.
  495. X
  496. XNOTE: using the setline command will override any command line -l
  497. Xspecification.
  498. X
  499. XNOTE: For important considerations on line choice, see the
  500. XECU manual sections titled "Choosing a Dialout Line" and "DCDwatch".
  501. X
  502. X.DS L
  503. XExample:
  504. X  setline '/dev/tty1a'
  505. X  setline 'tty1a'
  506. X  setline 'cua0'
  507. X.DE
  508. X.*s 2 "sk"
  509. X
  510. Xusage: sk [-a] <str>
  511. X
  512. XThis command invokes C-Kermit to
  513. Xsend
  514. Xfiles. ECU searches the PATH list for 'kermit' or 'ckermit',
  515. Xexpecting to find Columbia University C-Kermit version 5A(173)
  516. Xor later.  The file ~/.kermrc must be set up to have any desired
  517. Xinitialization parameters you desire (refer to C-Kermit
  518. Xdocumentation for more information).
  519. XThe remote protocol must have been started prior to the
  520. Xexecution of this command.
  521. X
  522. XWARNING: until further notice, avoid suspending Kermit
  523. Xwith ^\Z.  ECU is totally unprepared to act as a job control
  524. Xprocess group leader.
  525. X
  526. XIf switch '-a' is supplied,
  527. Xnewlines are converted to carriage return/linefeed pairs.
  528. XIf '-a' is omitted, the file(s) are transmitted without modification.
  529. X
  530. XInteger variable $i0 receives the exit status from the transfer.  If 0,
  531. Xtransfer was normal.
  532. XNote:
  533. Xprocedure execution IS terminated by a SIGINT to the spawned file
  534. Xtransfer process.  This is different than for versions prior to 3.10.
  535. XIf $i0 is set to -1, the file transfer program did not begin.
  536. X
  537. X.*s 2 "ss"
  538. X
  539. Xusage: ss <str>
  540. X
  541. XThis command invokes the SEAlink file transfer protocol to send
  542. Xone or more files.
  543. XThere is no provision in the SEAlink protocol to convert
  544. Xnewlines to carriage return/linefeed pairs.
  545. Xso the received files are stored as received.
  546. X
  547. XInteger variable $i0 receives the exit status from the transfer. If 0,
  548. Xtransfer was normal.
  549. XNote:
  550. Xprocedure execution IS terminated by a SIGINT to the spawned file
  551. Xtransfer process.  This is different than for versions prior to 3.10.
  552. XIf $i0 is set to -1, the file transfer program did not begin.
  553. X
  554. X.*s 2 "sx"
  555. X
  556. Xusage: sx [-ak[l]] [<label-str>] <filename-str>
  557. X
  558. XThis command invokes the XMODEM or XMODEM-1K file transfer protocol
  559. Xto send a file.  If '-k' is supplied, XMODEM-1K is used, else XMODEM.
  560. XIf switch '-a' is supplied,
  561. Xnewlines are converted to carriage return/linefeed pairs.
  562. XIf '-a' is omitted, the file(s) are transmitted without modification.
  563. XIf '-l' is supplied, then <label-str> specifies a string to
  564. Xdisplay on the bottom of the file transfer screen.  If '-l' is
  565. Xomitted, then <label_str> must also be omitted.
  566. X
  567. XInteger variable $i0 receives the exit status from the transfer. If 0,
  568. Xtransfer was normal.
  569. XNote:
  570. Xprocedure execution IS terminated by a SIGINT to the spawned file
  571. Xtransfer process.  This is different than for versions prior to 3.10.
  572. XIf $i0 is set to -1, the file transfer program did not begin.
  573. X
  574. X.DS L
  575. XExamples:
  576. X
  577. X    sx -al 'sending log file' '/tmp/log.file'
  578. X    sx -
  579. X.DE
  580. X
  581. X.*s 2 "sy"
  582. X
  583. Xusage: sy [-a[l]] [<label-str>] <filelist-str>
  584. X
  585. XThis command invokes the YMODEM Batch (not 
  586. Xto be confused with XMODEM-1K) file transfer protocol
  587. Xto send one or more files. 
  588. X
  589. XIf switch '-a' is supplied,
  590. Xnewlines are converted to carriage return/linefeed pairs.
  591. XIf '-a' is omitted, the file(s) are transmitted without modification.
  592. XIf '-l' is supplied, then <label-str> specifies a string to
  593. Xdisplay on the bottom of the file transfer screen.  If '-l' is
  594. Xomitted, then <label_str> must also be omitted.
  595. X
  596. XInteger variable $i0 receives the exit status from the transfer. If 0,
  597. Xtransfer was normal.
  598. XNote:
  599. Xprocedure execution IS terminated by a SIGINT to the spawned file
  600. Xtransfer process.  This is different than for versions prior to 3.10.
  601. XIf $i0 is set to -1, the file transfer program did not begin.
  602. X
  603. X.*s 2 "system"
  604. X
  605. Xusage: system [-ls] <cmdstr>
  606. X
  607. X<cmdstr> is passed to the Bourne shell.
  608. X
  609. XIf switch '-l', is supplied, the attached communications line 
  610. Xbecomes the stdin and stdout for the command.
  611. X
  612. XIf switch '-s', is supplied, all ECU file descriptors remain
  613. Xopen.  The -s option is important to include if you pass the
  614. XECU line file descriptor to another process.
  615. X
  616. XInteger variable $i0 is set to
  617. Xthe spawned process' exit status if the process exits "normally",
  618. Xor 0x100 if the process is killed, dumps core or interrupted.
  619. X
  620. XNote:  procedure execution is NOT terminated by a SIGINT to
  621. Xthe spawned process.  It is the responsibility of the procedure
  622. Xto process the exit status returned in $i0.
  623. XIf $i0 is set to -1, the file transfer program did not begin.
  624. X
  625. X.DS L
  626. XExamples:
  627. X
  628. X    $s2 = '/tmp/ecu'+%itos(%pid,05)
  629. X    system ' fgrep foo bar > '+$s2
  630. X
  631. X    system -s '/etc/NBSsetclk -i '+%itos(%conn)
  632. X.DE
  633. X
  634. X.*s 2 "sz"
  635. X
  636. Xusage: sz [-anf[l]r] [<label-str>] <filelist-str>
  637. X
  638. XThis command sends files using ZMODEM/CRC-32.
  639. XThe remote protocol must have been started prior to the
  640. Xexecution of this command unless the remote has automatic
  641. XZMODEM frame detection.
  642. X
  643. XSwitch '-a' specifies an ASCII transfer; the default is binary.
  644. X
  645. XSwitch '-f'  causes the full pathname of each file to be sent;
  646. Xotherwise, the simple filename is transmitted.
  647. X
  648. XSwitch '-l' with the <label-str> argument specifies a string to
  649. Xdisplay on the bottom of the file transfer screen.  If '-l' is
  650. Xomitted, then <label_str> must also be omitted.
  651. X
  652. XSwitch '-n' causes the receiver to accept files with do not
  653. Xalready exist at the remote system or which have older
  654. Xtimes of  last access that at the sending system.
  655. XNot all remote protocol software will accept or obey this option.
  656. X
  657. XSwitch '-r' causes an interrupted file transfer to be resumed.
  658. Xif the remote receiver supports the ZMODEM protocol feature.
  659. X
  660. XInteger variable $i0 receives the exit status from the transfer. 
  661. XIf 0, transfer was normal.  Other $i0 values possible:
  662. X.DS L
  663. X  1-126:   count of files not transmitted (see ~/.ecu/log)
  664. X  127:     127 or more files not transmitted (see ~/.ecu/log)
  665. X.DE
  666. XOther ecusz error codes are shown here for refernce, but
  667. Xthey are converted by ECU to printed messages and result in procedure
  668. Xtermination.
  669. X.DS L
  670. X  128-192: process terminated with signal==code-128
  671. X           signal 0 == program logic error
  672. X  253:     could not open any files
  673. X  254:     protocol failed (bad line conditions,brain dead remote)
  674. X  255:     usage
  675. X.DE
  676. X
  677. XNote:
  678. Xprocedure execution IS terminated by a SIGINT to the spawned file
  679. Xtransfer process.  This is different than for versions prior to 3.10.
  680. XIf $i0 is set to -1, the file transfer program did not begin.
  681. X
  682. X.*s 2 "vidcolor"
  683. X
  684. Xusage: vidcolor <type> <fcolor> [<bcolor>]
  685. X
  686. XThis command allows control over the internal color choices
  687. XECU makes.  <type> must be one of the following:
  688. X
  689. X.DS I
  690. Xnormal   - normal video color
  691. Xreverse  - reverse video color
  692. Xnotify   - color used for low key notifications such as
  693. X           "[interactive mode]" and "[procedure finished]"
  694. Xsuccess  - color used for modem CONNECT messages and other
  695. X           "success" notifications
  696. Xalert    - color used to alert user for warning or caution
  697. X           purposes
  698. Xerror    - color used to display error status or messages
  699. X.DE
  700. X
  701. X<fcolor> and <bcolor> are color names as described in the description of the
  702. X.B color
  703. Xcommand. <fcolor> choses the foreground color and must be supplied.
  704. X<bcolor> choses the background color and is optional; if not supplied,
  705. Xthe background color is black.
  706. X
  707. XNote: The vidcolor normal and reverse options are analogs of the
  708. X.B color
  709. Xand
  710. X.B
  711. Xcolor -r
  712. X.R
  713. Xcommand.
  714. X
  715. X.DS L
  716. XExamples:  (showing ECU default internal color list)
  717. X
  718. X    vidcolor normal lt_green 
  719. X    vidcolor reverse red white
  720. X    vidcolor notify gray
  721. X    vidcolor success lt_green 
  722. X    vidcolor alert yellow 
  723. X    vidcolor error red 
  724. X.DE
  725. X
  726. X.*s 2 "vidnorm"
  727. X
  728. Xusage: vidnorm
  729. X
  730. XThis command causes later screen output to appear in the
  731. Xnormal, as opposed to reverse video mode.
  732. XThe
  733. X.B color
  734. Xcommand forces normal video mode.
  735. X
  736. X.*s 2 "vidrev"
  737. X
  738. Xusage: vidrev
  739. X
  740. XThis command causes later screen output to appear in the
  741. Xreverse, as opposed to normal video mode.
  742. XThe
  743. X.B color
  744. Xcommand forces normal video mode.
  745. X
  746. X.*s 2 "whilei"
  747. X
  748. X.DS L
  749. Xusage: whilei <int> <rel-op> <int> <statement>
  750. X       whilei <int> <rel-op> <int>
  751. X           <statement>
  752. X       whilei <int> <rel-op> <int>
  753. X       {
  754. X           any kind or number of statements
  755. X           (labels are not allowed inside braces)
  756. X       }
  757. X.DE
  758. X
  759. XThis command executes a loop one or more statements
  760. Xbased on a test of two integer quantities.
  761. XThe <rel-op> argument is descibed in a earlier subsection
  762. Xtitled "Relational Operators."
  763. XSee the
  764. Xdescription of the
  765. X.B break ,
  766. X.B continue ,
  767. Xand
  768. X.B else
  769. Xcommmands
  770. Xand many other examples throughout the document,
  771. Xfor examples of how the command is used.
  772. X.*s 2 "whiles"
  773. X
  774. X.DS L
  775. Xusage: whiles <str> <rel-op> <str> <statement>
  776. X       whiles <int> <rel-op> <int>
  777. X           <statement>
  778. X       whiles <int> <rel-op> <int>
  779. X       {
  780. X           any kind or number of statements
  781. X           (labels are not allowed inside braces)
  782. X       }
  783. X.DE
  784. X
  785. XThis command executes a loop of one or more statements
  786. Xbased on a test of two string values.  
  787. XThe <rel-op> argument is descibed in a earlier subsection
  788. Xtitled "Relational Operators."
  789. XSee the
  790. Xdescription of the
  791. X.B break ,
  792. X.B continue ,
  793. Xand
  794. X.B else
  795. Xcommmands
  796. Xand many other examples throughout the document,
  797. Xfor examples of how the command is used.
  798. X.*s 2 "xon"
  799. X
  800. X.DS L
  801. Xusage: xon <arg>
  802. Xwhere <arg> is on    input and output flow control
  803. X               off   no flow control
  804. X               in    input flow control
  805. X               out   output flow control
  806. X.DE
  807. X
  808. XThis command enables or disables xon/xoff flow control.
  809. X
  810. X.DS L
  811. XExamples:
  812. X
  813. X    hangup
  814. X    dial 'mysys'
  815. X    ifi %conn != 0 parity none;xon on
  816. X.DE
  817. SHAR_EOF
  818. echo 'File doc/_p_cmd.txt is complete' &&
  819. chmod 0644 doc/_p_cmd.txt ||
  820. echo 'restore of doc/_p_cmd.txt failed'
  821. Wc_c="`wc -c < 'doc/_p_cmd.txt'`"
  822. test 60249 -eq "$Wc_c" ||
  823.     echo 'doc/_p_cmd.txt: original size 60249, current size' "$Wc_c"
  824. rm -f _shar_wnt_.tmp
  825. fi
  826. # ============= doc/_p_ifunc.txt ==============
  827. if test -f 'doc/_p_ifunc.txt' -a X"$1" != X"-c"; then
  828.     echo 'x - skipping doc/_p_ifunc.txt (File already exists)'
  829.     rm -f _shar_wnt_.tmp
  830. else
  831. > _shar_wnt_.tmp
  832. echo 'x - extracting doc/_p_ifunc.txt (Text)'
  833. sed 's/^X//' << 'SHAR_EOF' > 'doc/_p_ifunc.txt' &&
  834. X.*s 1 "Integer Functions"
  835. X
  836. X.*s 2 "%argc"
  837. X
  838. XThis function returns the number of arguments passes to the current
  839. Xprocedure.
  840. X
  841. X.*s 2 "%baud"
  842. X
  843. XThis function returns the baud rate of the communications line.
  844. XIf no line is currently attached, the baud rate returned
  845. Xis the value of the last line attached.  If no line has been attached
  846. Xduring the current session, the default baud rate is returned.
  847. X
  848. X.*s 2 "%colors"
  849. X
  850. XThis function returns the state of the normal and reverse video
  851. Xforeground and background colors in the 32-bit value:
  852. X.DS I
  853. X00000000001111111111222222222233
  854. X01234567890123456789012345678901
  855. X0000|--|0000|--|0000|--|0000|--|
  856. X     fg      bk      fg      bk
  857. X      reverse          normal
  858. X.DE
  859. X
  860. XThe color values are obtained from the following lists:
  861. X.DS L
  862. X.B
  863. X    Alphabetic Order
  864. X.R
  865. X    black        0
  866. X    blue         1
  867. X    brown        6
  868. X    cyan         3
  869. X    gray         8
  870. X    green        2
  871. X    hi_white    15
  872. X    lt_blue      9
  873. X    lt_cyan     11
  874. X    lt_green    10
  875. X    lt_magenta  13
  876. X    lt_red      12
  877. X    magenta      5
  878. X    red          4
  879. X    white        7
  880. X    yellow      14
  881. X.DE
  882. X
  883. X.DS L
  884. X.B
  885. X    Numeric Order
  886. X.R
  887. X    black        0
  888. X    blue         1
  889. X    green        2
  890. X    cyan         3
  891. X    red          4
  892. X    magenta      5
  893. X    brown        6
  894. X    white        7
  895. X    gray         8
  896. X    lt_blue      9
  897. X    lt_green    10
  898. X    lt_cyan     11
  899. X    lt_red      12
  900. X    lt_magenta  13
  901. X    yellow      14
  902. X    hi_white    15
  903. X.DE
  904. X
  905. X.*s 2 "%cols"
  906. X
  907. XThis function returns the screen width in columns.
  908. XIf running non-interactively, the value will always be 80.
  909. X
  910. X.*s 2 "%conn"
  911. X
  912. XThis function returns the (positive) communications
  913. Xline file descriptor if a connection is in effect.
  914. XIf there is no connection, but there is a line opened,
  915. X0 is returned.  If no line is open (as may be the case in
  916. Xan _rc.ep procedure), -1 is returned.
  917. XNOTE:  if carrier is lost abnormally, %conn will return a
  918. Xpositive number
  919. Xincorrectly if the DCD watcher is disabled or if a procedure
  920. Xwas being executed at the time of carrier loss. (See the sections
  921. Xon the 
  922. X.B dcdwatch
  923. Xinteractive and procedure commands).
  924. X
  925. X.*s 2 "%curx"
  926. X
  927. XThis function returns the display cursor column position last set by the
  928. Xremote system.  This value does not reflect the actual hardware cursor.
  929. X
  930. X.*s 2 "%cury"
  931. X
  932. XThis function returns the display cursor row position last set by the
  933. Xremote system.  This value does not reflect the actual hardware cursor.
  934. X
  935. X.*s 2 "%csec"
  936. X
  937. XThis function returns the number of seconds ECU has been
  938. Xconnected to a remote system.  If ECU is not connected,
  939. Xzero is returned.
  940. X
  941. X.*s 2 "%ctoi"
  942. X
  943. Xusage: %ctoi(str0)
  944. X
  945. XThis function returns the integer value of the first
  946. Xcharacter in string str0.  If str0 is non-empty, the return value
  947. Xwill be between 0 and 255, inclusive.  if str0 is empty,
  948. Xthen -1 is returned.
  949. X
  950. X.*s 2 "%esecs"
  951. X
  952. Xusage: %esecs
  953. X
  954. XThis function, "Epoch SECondS,"
  955. Xreturns the number of seconds since January 1, 1970 00:00 UTC
  956. X(GMT).
  957. X
  958. X.*s 2 "%fatime"
  959. X.DS L
  960. Xusage: %fatime(int0)
  961. X       %fatime(str0)
  962. X.DE
  963. X
  964. XThis function returns the time of last access of the file referenced
  965. Xby the argument.
  966. XIf the argument is an integer, the file referenced is the file
  967. Xopened by that number with the
  968. X.B fopen
  969. Xcommand.
  970. XIf the argument is a string, it is the literal filename.
  971. X
  972. XIf int0 does not refer to an open file, the procedure
  973. Xterminates with an error.
  974. XIf the file specified by str0 does not exist, -1 is returned.
  975. X
  976. XThe return value is the number of seconds since January 1, 1970
  977. Xat 0000 UTC.
  978. XThe
  979. X.B %edate
  980. Xstring function may be used to convert the integer
  981. Xvalue to a string representation of the date and time
  982. Xexpressed relative to the current time zone.
  983. X
  984. X.*s 2 "%fmode"
  985. X.DS L
  986. Xusage: %fmode(int0)
  987. X       %fmode(str0)
  988. X.DE
  989. X
  990. XThis function returns the file mode value ("rwxrwx---" == 077)
  991. Xof the file referenced
  992. Xby the argument.
  993. XIf the argument is an integer, the file referenced is the file
  994. Xopened by that number with the
  995. X.B fopen
  996. Xcommand.
  997. XIf the argument is a string, it is the literal filename.
  998. X
  999. XIf int0 does not refer to an open file, the procedure
  1000. Xterminates with an error.
  1001. XIf the file specified by str0 does not exist, -1 is returned.
  1002. X
  1003. X.*s 2 "%fmtime"
  1004. X.DS L
  1005. Xusage: %fmtime(int0)
  1006. X       %fmtime(str0)
  1007. X.DE
  1008. X
  1009. XThis function returns the time of last modified of the file referenced
  1010. Xby the argument.
  1011. XIf the argument is an integer, the file referenced is the file
  1012. Xopened by that number with the
  1013. X.B fopen
  1014. Xcommand.
  1015. XIf the argument is a string, it is the literal filename.
  1016. X
  1017. XIf int0 does not refer to an open file, the procedure
  1018. Xterminates with an error.
  1019. XIf the file specified by str0 does not exist, -1 is returned.
  1020. X
  1021. XThe return value is the number of seconds since January 1, 1970
  1022. Xat 0000 UTC.
  1023. XThe
  1024. X.B %edate
  1025. Xstring function may be used to convert the integer
  1026. Xvalue to a string representation of the date and time
  1027. Xexpressed relative to the current time zone.
  1028. X
  1029. X.*s 2 "%fmode"
  1030. X.DS L
  1031. Xusage: %fmode(int0)
  1032. X       %fmode(str0)
  1033. X.DE
  1034. X
  1035. XThis function returns the size
  1036. Xof the file referenced
  1037. Xby the argument.
  1038. XIf the argument is an integer, the file referenced is the file
  1039. Xopened by that number with the
  1040. X.B fopen
  1041. Xcommand.
  1042. XIf the argument is a string, it is the literal filename.
  1043. X
  1044. XIf int0 does not refer to an open file, the procedure
  1045. Xterminates with an error.
  1046. XIf the file specified by str0 does not exist, -1 is returned.
  1047. X
  1048. X.*s 2 "%ftell"
  1049. X
  1050. Xusage: ftell(int0)
  1051. X
  1052. XThis function returns the current file position
  1053. Xof the the file
  1054. Xopened by int0 with the
  1055. X.B fopen
  1056. Xcommand.
  1057. X
  1058. XIf int0 does not refer to an open file, the procedure
  1059. Xterminates with an error.
  1060. X
  1061. X.*s 2 "%instr"
  1062. X
  1063. Xusage: %instr(str0,str1)
  1064. X
  1065. XThis function returns the leftmost column position withing str0
  1066. Xthat str1 is found (zero relative).  If str1 cannot be found in
  1067. Xstring str0, -1 is returned.  However, if str1 is null and str0 is not,
  1068. Xzero will be returned (i.e., the null string matches at the left).
  1069. X
  1070. XThe comparison is made without regard to case. See also
  1071. X.B %instr .
  1072. X
  1073. X.DS I
  1074. XExamples:
  1075. X
  1076. X            00000000001111111
  1077. X            01234567890123456
  1078. XAssume $s0='abcdefghijklmnabc'
  1079. X       $s1='abc'
  1080. X       $s2='gHi'
  1081. X       $s3='cat'
  1082. X
  1083. X       %instr($s0,$s1)        returns 0
  1084. X       %instr($s0,$s2)        returns 6
  1085. X       %instr($s0,$s3)        returns -1
  1086. X       %instr($s0,'bcd')      returns 2
  1087. X       %instr($s0,'bad')      returns -1
  1088. X.DE
  1089. X
  1090. X.*s 2 "%ischr"
  1091. X.DS L
  1092. Xusage: %ischr(int0)
  1093. X       %ischr(str0)
  1094. X.DE
  1095. X
  1096. XThis function returns 1 if the file referenced by the argument is a
  1097. Xcharacter special file,
  1098. Xelse 0.
  1099. XIf the argument is an integer, the file referenced is the file
  1100. Xopened by that number with the
  1101. X.B fopen
  1102. Xcommand.
  1103. XIf the argument is a string, it is the literal filename.
  1104. X
  1105. XIf int0 does not refer to an open file, the procedure
  1106. Xterminates with an error.
  1107. XIf the file specified by str0 does not exist, -1 is returned.
  1108. X
  1109. XExamples:
  1110. X
  1111. X.DS I
  1112. X%ischr('/dev/tty')    returns 1
  1113. X%ischr('/usr/bin')    returns 0
  1114. X%ischr('/xenix')      returns 0
  1115. X.DE
  1116. X
  1117. X.*s 2 "%isdir"
  1118. X.DS L
  1119. Xusage: %isdir(int0)
  1120. X       %isdir(str0)
  1121. X.DE
  1122. X
  1123. XThis function returns 1 if the file referenced by the argument is a
  1124. Xdirectory file,
  1125. Xelse 0.
  1126. XIf the argument is an integer, the file referenced is the file
  1127. Xopened by that number with the
  1128. X.B fopen
  1129. Xcommand.
  1130. XIf the argument is a string, it is the literal filename.
  1131. X
  1132. XIf int0 does not refer to an open file, the procedure
  1133. Xterminates with an error.
  1134. XIf the file specified by str0 does not exist, -1 is returned.
  1135. X
  1136. XExamples:
  1137. X
  1138. X.DS I
  1139. X%isdir('/dev/tty')    returns 0
  1140. X%isdir('/usr/bin')    returns 1
  1141. X%isdir('/xenix')      returns 0
  1142. X.DE
  1143. X
  1144. X.*s 2 "%isreg"
  1145. X.DS L
  1146. Xusage: %isreg(int0)
  1147. X       %isreg(str0)
  1148. X.DE
  1149. X
  1150. XThis function returns 1 if the file referenced by the argument is a
  1151. Xregular file,
  1152. Xelse 0.
  1153. XIf the argument is an integer, the file referenced is the file
  1154. Xopened by that number with the
  1155. X.B fopen
  1156. Xcommand.
  1157. XIf the argument is a string, it is the literal filename.
  1158. X
  1159. XIf int0 does not refer to an open file, the procedure
  1160. Xterminates with an error.
  1161. XIf the file specified by str0 does not exist, -1 is returned.
  1162. X
  1163. XExamples:
  1164. X
  1165. X.DS I
  1166. X%isreg('/dev/tty')    returns 0
  1167. X%isreg('/usr/bin')    returns 0
  1168. X%isreg('/xenix')      returns 1
  1169. X.DE
  1170. X
  1171. X.*s 2 "%len"
  1172. X
  1173. Xusage: %len(str0)
  1174. X
  1175. XThis function returns the length of str0.
  1176. X.DS I
  1177. XExample:
  1178. X
  1179. Xset str0='abcdef',i0=%len(str0),i1=%len('1234')
  1180. Xstr00 = 'abcdef'
  1181. Xint00 = 6
  1182. Xint01 = 4
  1183. X.DE
  1184. X
  1185. X.*s 2 "%lgetc"
  1186. X
  1187. Xusage: %lgetc(int0)
  1188. X
  1189. XReads a character from the line and returns it.
  1190. XArgument int0 is the number of milliseconds to wait
  1191. Xfor a character.  Use a large positive number if you want
  1192. Xto wait "forever."  The function returns the character
  1193. Xvalue between 0 and 255 or -1 if the timeout period is exceeded.
  1194. X
  1195. X.*s 2 "%lines"
  1196. X
  1197. XThis function returns the screen height in lines.
  1198. XIf running non-interactively, the value will always be 25.
  1199. X
  1200. X.*s 2 "%nice"
  1201. X
  1202. Xusage: %nice
  1203. X
  1204. XThis function returns the nice value of the ECU process.
  1205. X
  1206. X.*s 2 "%pid"
  1207. X
  1208. XThis function returns the process id (pid) of ECU.
  1209. X
  1210. X.*s 2 "%match"
  1211. X
  1212. Xusage: %match(str0,str1)
  1213. X
  1214. XThis function searches string str0 for a match with the regular
  1215. Xexpression in str1 (for information on regular expressions,
  1216. Xrefer to the ed(C) manual pages).
  1217. XThe function returns the index into str0 where the
  1218. Xmatch is found or -1 if no match can be found.
  1219. XThe matching process is case sensitive.
  1220. X
  1221. XThe variable $i0 receives the length of the matching
  1222. Xstring in str0 if a  match is found.  For this reason,
  1223. Xit is not advisable that $i0 otherwise be involved
  1224. Xin the operation.  Specifically to be avoided is:
  1225. X.DS I
  1226. Xset $i0=%instr(...)
  1227. X.DE
  1228. X.DS L
  1229. XExamples:
  1230. X
  1231. X            00000000001111111
  1232. X            01234567890123456
  1233. XAssume $s0='abcdefghijklmnabc'
  1234. X       $s1='abc'
  1235. X       $s2='n.*'
  1236. X
  1237. X       %match($s0,$s1)        returns 0   $i0=3
  1238. X       %match($s0,$s2)        returns 16  $i0=4
  1239. X       %match($s0,$s3)        returns -1  $i0 unchanged
  1240. X       %match($s0,'de..h')    returns 3   $i0=5
  1241. X       %match($s0,'de..H')    returns -1  $i0 unchanged
  1242. X.DE
  1243. X
  1244. X.*s 2 "%mhack"
  1245. X
  1246. Xusage: %mhack
  1247. X
  1248. XThis function ("Millisecond time HACK") returns the number of
  1249. Xmilliseconds since ecu was started.  It isn't a very useful
  1250. Xvalue by itself, but differences between the values
  1251. Xreturned by two calls to the function may be used to determine
  1252. Xthe time between two events with the maximum accuracy the
  1253. Xoperating system can deliver (1/HZ resolution with a bit of
  1254. Xlatency).
  1255. X
  1256. X.DS L
  1257. XExamples:
  1258. X    $i10 = %mhack
  1259. X    send 'test'
  1260. X    lookfor -e %chr(0x0A) 100
  1261. X    ifi $i0 == 0 echo 'no response in 10 seconds'
  1262. X    else echo 'response time '+%itos(%mhack - $i10)+' msec'
  1263. X.DE
  1264. X
  1265. X.*s 2 "%rchr"
  1266. X
  1267. XThis function returns the number of characters
  1268. Xreceived by ECU since the program starrted.
  1269. X
  1270. X.*s 2 "%rchrc"
  1271. X
  1272. XThis function returns the number of characters
  1273. Xreceived by ECU during the current connection.
  1274. X
  1275. X.*s 2 "%rinstr"
  1276. X
  1277. Xusage: %rinstr(str0,str1)
  1278. X
  1279. XThis function returns the rightmost column position withing str0
  1280. Xthat str1 is found (zero relative).  If str1 cannot be found in
  1281. Xstring str0, -1 is returned.  However, if str1 is null and str0 is not,
  1282. Xzero will be returned (i.e., the null string matches at the left).
  1283. X
  1284. XThe comparison is made without regard to case. See also
  1285. X.B %instr .
  1286. X
  1287. X.DS I
  1288. XExamples:
  1289. X
  1290. X            00000000001111111
  1291. X            01234567890123456
  1292. XAssume $s0='abcdefghijklmnabc'
  1293. X       $s1='abc'
  1294. X       $s2='gHi'
  1295. X       $s3='cat'
  1296. X
  1297. X       %instr($s0,$s1)        returns 14
  1298. X       %instr($s0,$s2)        returns 6
  1299. X       %instr($s0,$s3)        returns -1
  1300. X.DE
  1301. X
  1302. X.*s 2 "%shmid"
  1303. X
  1304. XThis function returns the integer shared memory segment id
  1305. Xfor the current ECU process.  It may be used to pass the id
  1306. Xto a "friend" process so that it may access the shared memory
  1307. Xsegment (described in header file ecushm.h).
  1308. XFor more details,
  1309. Xrefer to an earlier section entitled "Shared Memory 'Friend' Interface."
  1310. X
  1311. X.DS L
  1312. XExample:
  1313. X
  1314. X     system 'ecufriend '+%itos(%shmid)
  1315. X.DE
  1316. X
  1317. X.*s 2 "%stoi"
  1318. X
  1319. Xusage: %stoi(str0)
  1320. X
  1321. XThis function converts the contents of str0 to an
  1322. Xinteger and returns  the value.
  1323. X
  1324. X.*s 2 "%uid"
  1325. X
  1326. Xusage: %uid
  1327. X
  1328. XThis function returns the uid of the user.
  1329. X
  1330. X.*s 2 "%xchr"
  1331. X
  1332. XThis function returns the number of characters
  1333. Xtransmitted by ECU since the program starrted.
  1334. X
  1335. X.*s 2 "%xchrc"
  1336. X
  1337. XThis function returns the number of characters
  1338. Xtransmitted by ECU during the current connection.
  1339. X
  1340. X
  1341. SHAR_EOF
  1342. chmod 0644 doc/_p_ifunc.txt ||
  1343. echo 'restore of doc/_p_ifunc.txt failed'
  1344. Wc_c="`wc -c < 'doc/_p_ifunc.txt'`"
  1345. test 12064 -eq "$Wc_c" ||
  1346.     echo 'doc/_p_ifunc.txt: original size 12064, current size' "$Wc_c"
  1347. rm -f _shar_wnt_.tmp
  1348. fi
  1349. # ============= doc/_p_param.txt ==============
  1350. if test -f 'doc/_p_param.txt' -a X"$1" != X"-c"; then
  1351.     echo 'x - skipping doc/_p_param.txt (File already exists)'
  1352.     rm -f _shar_wnt_.tmp
  1353. else
  1354. > _shar_wnt_.tmp
  1355. echo 'x - extracting doc/_p_param.txt (Text)'
  1356. sed 's/^X//' << 'SHAR_EOF' > 'doc/_p_param.txt' &&
  1357. X.*s 1 "Arguments"
  1358. X
  1359. XThere are five types of arguments to procedure commands:
  1360. X.DS I
  1361. XSwitch
  1362. XAlphabetic Token
  1363. XInteger
  1364. XString
  1365. XRelational Operators
  1366. X.DE
  1367. XThis section describes the syntax and construction of each type in turn.
  1368. XThere are separate groups of valid of relational operators for integers
  1369. Xand strings; thus, they are described under the appropriate sections.
  1370. X
  1371. X.*s 2 "Switches"
  1372. X
  1373. XSwitch arguments begin with a hyphen (minus, '-').  The switch
  1374. Xargument must be the first argument after the command.  Only
  1375. Xone switch argument is allowed on the command line.  If
  1376. Xswitches '-a', '-b' and '-c', are available and '-a' and '-b'
  1377. Xare desired, '-ab' or '-ba' is entered.
  1378. X
  1379. X.*s 2 "Alphabetic Tokens"
  1380. X
  1381. XAlphabetic tokens, for lack of a better term, are non-integer,
  1382. Xnon-quoted terms used as arguments for certain commands, such as:
  1383. X.DS I
  1384. Xplog off
  1385. X.DE
  1386. XSuch argument types are fairly simple to understand and use; they are
  1387. Xdescribed here for completeness.
  1388. X
  1389. X.*s 2 "Integers"
  1390. X
  1391. XInteger values are 32-bit quantities ranging between -2147483647
  1392. Xand 2147483647.
  1393. X
  1394. XIn one case, an integer is used to store a 32-bit color mask as
  1395. Xdescribed by the
  1396. X.B color
  1397. Xcommand and the
  1398. X.B %colors
  1399. Xinteger function.
  1400. X
  1401. X.*s 3 "Constants"
  1402. X
  1403. XInteger constants are numeric strings, optionally with an initial
  1404. Xminus sign, the absolute value of which must be less than
  1405. X2147483648.  If the constant begins with the string "0x", it is
  1406. Xinterpreted as hexadecimal.  Octal, like FORTRAN and COBOL will
  1407. Xbe dead soon (heh heh); until then, however, octal constants may
  1408. Xbe denoted by a leading "0o".  This differs from the usual
  1409. Xconvention so as to allow decimal strings with leading zeroes to
  1410. Xbe correctly interpreted.
  1411. X
  1412. X.DS L
  1413. XExamples:
  1414. X    123   --> 123(10)
  1415. X    0123  --> 123(10)
  1416. X    0x123 --> 291(10)
  1417. X    0o123 -->  83(10)
  1418. X.DE
  1419. X
  1420. X.*s 3 "Variables"
  1421. X
  1422. XThere are 50 numbered, permanent integer variables referenced by
  1423. Xthe terms '$i0' through '$i49'.  When ECU is started, the value of each
  1424. Xvariable is zero.  Variables retain their
  1425. Xvalue until changed, even between procedure executions.
  1426. XThe integer variable number may be expressed
  1427. Xas an expression by enclosing an integer expression in brackets.
  1428. XFor instance:
  1429. X.DS L
  1430. X     $i[4+5]      refers to $i9
  1431. X
  1432. X     $i2=5
  1433. X     $i[20+$i2]   refers to $i25
  1434. X.DE
  1435. X
  1436. XInteger variables may be created for use as "local" variables or
  1437. Xto promote code readability.  Refer to the
  1438. X.B mkvar
  1439. Xcommand.
  1440. X
  1441. X.*s 3 "Functions"
  1442. X
  1443. XECU has many built-in functions which return the value of ecu- or
  1444. Xsystem-related information.  A list of the functions appears in a
  1445. Xlater section.
  1446. X
  1447. X.*s 3 "Expressions"
  1448. X
  1449. XIn almost any place an integer argument is allowed, an expression
  1450. Xmay be supplied.  Expressions are composed of two or more integer
  1451. Xconstants or variables separated by operators from the group:
  1452. X.DS L
  1453. X    +     addition
  1454. X    -     subtraction
  1455. X    *     multiplication
  1456. X    /     division
  1457. X    |     OR
  1458. X    @     MOD
  1459. X    ^     XOR
  1460. X    &     AND
  1461. X.DE
  1462. XEvaluation of expressions is left-to-right.  Parentheses are
  1463. Xnot allowed.
  1464. X
  1465. X.*s 3 "Relational Operators"
  1466. X
  1467. XInteger relational operators are chosen from the following group:
  1468. X.DS L
  1469. X     =       "is equal to"
  1470. X     ==      "is equal to"
  1471. X     !=      "is not equal to"
  1472. X     <>      "is not equal to"
  1473. X     >       "is greater than"
  1474. X     <       "is greater than"
  1475. X     >=      "is greater than or equal to"
  1476. X     <=      "is less than or equal to"
  1477. X.DE
  1478. X
  1479. X.*s 2 "Strings"
  1480. X
  1481. XStrings are classic concatenations of zero or more eight-bit
  1482. Xcharacters.  In general, the maximum size of a string used by
  1483. XECU is 256 characters.  The absolute maximum size is 16384 characters.
  1484. X
  1485. XNull in strings are poorly handled.
  1486. XYou may be able to get away with using them, but it is not recommended.
  1487. X
  1488. X.*s 3 "Constants"
  1489. X
  1490. XString constants are formed by placing alphanumeric characters
  1491. Xbetween single quote characters (apostrophes).  The backslash ('\e')
  1492. Xcharacter is used to "escape" certains characters:
  1493. X.DS L
  1494. X    \e\e             one backslash
  1495. X    \en             newline
  1496. X    \et             tab
  1497. X    \e'             apostrophe
  1498. X.DE
  1499. X
  1500. XNOTE: ecu converts every tab in a procedure line to one space when the
  1501. Xprocedure file is read in.  Therefore, IF YOU WISH TO PLACE A TAB IN A STRING
  1502. XCONSTANT, you 
  1503. X.B must
  1504. Xplace it there with the \et escape sequence.
  1505. X
  1506. X.*s 3 "Variables"
  1507. X
  1508. XThere are 50 numbered, permanent string variables referenced by
  1509. Xthe terms '$s0' through '$s49',
  1510. Xeach possessing a maximum length of 256 characters
  1511. XWhen ECU is started, the value of each
  1512. Xvariable is null (zero length).  Variables retain their
  1513. Xvalue until changed, even between procedure executions.
  1514. XThe string variable number may be expressed
  1515. Xas an expression by enclosing an string expression in brackets.
  1516. XFor instance:
  1517. X.DS L
  1518. X     $s[4+5]      refers to $s9
  1519. X
  1520. X     $s2=5
  1521. X     $s[20+$s2]   refers to $s25
  1522. X.DE
  1523. X
  1524. XString variables may be created for use as "local" variables or
  1525. Xto promote code readability.  Refer to the
  1526. X.B mkvar
  1527. Xcommand.  
  1528. XCreated variables have a life equal to the duration
  1529. Xof the procedure which created them.
  1530. XRegardless of the declared size of a created string variable,
  1531. XECU will automatically grow it to a maximum of 16384 characters
  1532. Xas necessary.  Numbered (permanent) string variables have a maximum
  1533. Xsize of 256 bytes.
  1534. X
  1535. X.*s 3 "Functions"
  1536. X
  1537. XECU has many built-in functions which return the value of ecu- or
  1538. Xsystem-related information.  A list of the functions appears in a
  1539. Xlater section.
  1540. X
  1541. X.*s 3 "Expressions"
  1542. X
  1543. XString expressions are formed by the concatenation of string
  1544. Xconstants, variables and function return values using the '+'
  1545. Xoperator:
  1546. X.DS L
  1547. XExample:
  1548. X   'The quick brown fox jumped over the '+$s0'+' dog at '+%time
  1549. X.DE
  1550. X
  1551. X.*s 3 "Relational Operators"
  1552. X
  1553. XString relational operators are chosen from the following group:
  1554. X.DS L
  1555. X     =       "is equal to"
  1556. X     ==      "is equal to"
  1557. X     !=      "is not equal to"
  1558. X     <>      "is not equal to"
  1559. X.DE
  1560. X
  1561. SHAR_EOF
  1562. chmod 0644 doc/_p_param.txt ||
  1563. echo 'restore of doc/_p_param.txt failed'
  1564. Wc_c="`wc -c < 'doc/_p_param.txt'`"
  1565. test 5784 -eq "$Wc_c" ||
  1566.     echo 'doc/_p_param.txt: original size 5784, current size' "$Wc_c"
  1567. rm -f _shar_wnt_.tmp
  1568. fi
  1569. # ============= doc/_p_sfunc.txt ==============
  1570. if test -f 'doc/_p_sfunc.txt' -a X"$1" != X"-c"; then
  1571.     echo 'x - skipping doc/_p_sfunc.txt (File already exists)'
  1572.     rm -f _shar_wnt_.tmp
  1573. else
  1574. > _shar_wnt_.tmp
  1575. echo 'x - extracting doc/_p_sfunc.txt (Text)'
  1576. sed 's/^X//' << 'SHAR_EOF' > 'doc/_p_sfunc.txt' &&
  1577. X.*s 1 "String Functions"
  1578. X
  1579. X.*s 2 "%argv"
  1580. X
  1581. Xusage: %argv(int0)
  1582. X
  1583. XThis function returns the string value of an argument passed
  1584. Xto the procedure by the 'do' command.  Argument 0 is the
  1585. Xname of the procedure itself.
  1586. XThe integer function %argc may be used to determine the
  1587. Xnumber of arguments passed to the procedure.  Specifying
  1588. Xan argument number greater than the number of arguments
  1589. Xpassed returns a null string (if procedure tracing is enabled
  1590. Xwith the 'ptrace' comand, a warning will be displayed
  1591. Xin this case).
  1592. X.DS I
  1593. XExample:
  1594. X    invocation from shell:
  1595. X    ecu -p test Quick Brown Fox
  1596. X
  1597. X    invocation from interactive command line:
  1598. X    do test Quick Brown Fox
  1599. X
  1600. X    invocation from procedure:
  1601. X    do 'test' 'Quick' 'Brown' 'Fox'
  1602. X    
  1603. X    results in:
  1604. X    %argv(0) = 'test'
  1605. X    %argv(1) = 'Quick'
  1606. X    %argv(2) = 'Brown'
  1607. X    %argv(3) = 'Fox'
  1608. X    %argv(4) = ''
  1609. X.DE
  1610. X
  1611. X.B NOTE:
  1612. Xthe interactive
  1613. X.B dial
  1614. Xcommand, the dialing directory menu and the initial setup menu
  1615. Xall can automatically execute a procedure which matches
  1616. Xa dialed
  1617. X.B
  1618. Xlogical telephone number.
  1619. X.R
  1620. XThere two arguments passed to these procedures, %argv(0) being
  1621. Xthe procedure name as always.  %argv(1) is set according to the following
  1622. Xtable:
  1623. X.DS I
  1624. X invoker              %argv(1)
  1625. X-------------------  -------------
  1626. Xinitial setup menu   !INITIAL
  1627. Xinteractive dial     !INTERACTIVE
  1628. Xdialing menu         !MENU
  1629. X.DE
  1630. XThus it is possible for the invoked procedure
  1631. Xto determine that it has been automatically executed
  1632. Xby testing %argv(1) for an exclamation point, or possibly
  1633. Xthe entire argument.
  1634. X
  1635. X.*s 2 "%basename"
  1636. X
  1637. XUsage: %basename(str0,str1)
  1638. X
  1639. XThis function is similar to the UNIX basename(1) utility in
  1640. Xthat it returns a filename minus a supplied suffix, if it is present.
  1641. XUnlike the UNIX basename(C) program, %basename does not remove
  1642. Xthe directory part of the filename.
  1643. XSee also
  1644. X.B %dirpart
  1645. Xand
  1646. X.B %filepart .
  1647. X
  1648. X.DS L
  1649. XExamples:
  1650. X
  1651. X    %basename('/u1/src/ecu/ecu.c','.c') = /u1/src/ecu/ecu
  1652. X    %basename('ecu.c','.c') = ecu
  1653. X    %basename('ecu.c','.x') = ecu.c
  1654. X.DE
  1655. X
  1656. X.*s 2 "%cgetc"
  1657. X
  1658. Xusage: %cgetc
  1659. X
  1660. XThis  function reads one character from the console keyboard
  1661. Xand returns it.  The character is not echoed.
  1662. X
  1663. X.*s 2 "%cgets"
  1664. X
  1665. Xusage: %cgets
  1666. X
  1667. XThis function reads a string from the console keyboard
  1668. Xand returns it.  Each character is echoed as it is typed
  1669. Xand the user's normal erase and kill character is available
  1670. Xto edit the input before terminating the read with ENTER.
  1671. X
  1672. X.*s 2 "%chr"
  1673. X
  1674. Xusage: %chr(int0)
  1675. X
  1676. XThis function returns the character value whose ASCII value
  1677. Xis supplied in int0.
  1678. X
  1679. X.DS L
  1680. XExample:
  1681. X
  1682. X    set $s0 = %chr(4)  places a ^D (EOT) character into $s0
  1683. X.DE
  1684. X
  1685. X.*s 2 "%date"
  1686. X
  1687. Xusage: %date
  1688. X
  1689. XThis function returns the current date in the form 'mm-dd-yyyy'
  1690. Xin the local time zone (daylight time if it applies).
  1691. X
  1692. X.*s 2 "%datez"
  1693. X
  1694. Xusage: %datez
  1695. X
  1696. XThis function returns the current date in the form 'mm-dd-yyyy'
  1697. Xin the UTC (Z) time zone.
  1698. X
  1699. X.*s 2 "%day"
  1700. X
  1701. Xusage: %day
  1702. X
  1703. XThis function returns the current day of the week as a three character
  1704. Xabbreviation: 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
  1705. Xin the local time zone (daylight time if it applies).
  1706. X
  1707. X.*s 2 "%dayz"
  1708. X
  1709. Xusage: %dayz
  1710. X
  1711. XThis function returns the current day of the week as a three character
  1712. Xabbreviation: 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
  1713. Xin the UTC (Z) time zone.
  1714. X
  1715. X.*s 2 "%dir"
  1716. X
  1717. Xusage: %dir
  1718. X
  1719. XThis function returns the
  1720. Xfull pathname of the current working directory.
  1721. X
  1722. X.*s 2 "%dirpart"
  1723. X
  1724. Xusage: %dirpart(str0)
  1725. X
  1726. XThis function returns the
  1727. Xdirectory portion of the pathname supplied in str0.
  1728. XSee also
  1729. X.B %basename
  1730. Xand
  1731. X.B %filepart .
  1732. X
  1733. X
  1734. X.DS L
  1735. XExamples:
  1736. X
  1737. X%dirpart('/u1/src/src/foo.c') = "/u1/src/src"
  1738. X%dirpart('foo.c') = "foo.c"
  1739. X%dirpart('/usr') = ""
  1740. X.DE
  1741. X
  1742. X.*s 2 "%edate"
  1743. X
  1744. Xusage: %edate(int0)
  1745. X
  1746. XThe value in int0 is expected to be a number of seconds since January 1,
  1747. X1970 00:00 UTC (Universal Coordinated Time) as returned by
  1748. Xthe integer functions %fatime and %fmtime.
  1749. XThis function converts the value into a string representing the
  1750. Xequivalent local time in the form 'mm-dd-yyyy hh:mm:ss'.
  1751. X.DS L
  1752. XExample:
  1753. X
  1754. Xset $i0=%fmtime('/xenix')
  1755. X$i00 = 601178971 (0x23d5435b,04365241533)
  1756. X
  1757. Xset $s0=%edate($i0)
  1758. X$s00 = '01-18-1989 21:09:31'
  1759. X.DE
  1760. X
  1761. X.*s 2 "%envvar"
  1762. X
  1763. Xusage: %envvar()
  1764. X
  1765. XThis function returns the string value of an environment
  1766. Xvariable.
  1767. X
  1768. X.DS L
  1769. XExample:
  1770. X
  1771. X    set $s0=%envvar('HOME') might set $s0 '/usr/user'
  1772. X.DE
  1773. X.DF L
  1774. XTypical Environment Variables:
  1775. X
  1776. X    HOME          pathname of home directory
  1777. X    EDITOR        user's preferred editor
  1778. X    PATH          program execution searchlist
  1779. X    TERM          terminal type
  1780. X    SHELL         user's preferred shell
  1781. X    MAIL          user's mail box file
  1782. X    ECUPROMPT     ECU interactive command prompt
  1783. X                  at beginning of execution
  1784. X.DE
  1785. X
  1786. X.*s 2 "%errstr"
  1787. X
  1788. Xusage: %errstr(int0)
  1789. X
  1790. XThis function returns the system error message, given int0 as an
  1791. X.B errno
  1792. Xas returned by a file-related command.
  1793. X.B fopen.
  1794. X
  1795. X.DS L
  1796. XExample:
  1797. X
  1798. X    echo %errstr(1)
  1799. X    Not owner
  1800. X.DE
  1801. X
  1802. X.*s 2 "%etime"
  1803. X
  1804. Xusage: %etime(int0)
  1805. X
  1806. XThis function returns a string representation of elapsed time
  1807. Xin the format 'hh:mm:ss'
  1808. Xfor the integer parameter int0, a number of seconds.
  1809. X
  1810. X.DS L
  1811. XExample:
  1812. X
  1813. X    echo %etime(62)
  1814. X    00:01:02
  1815. X.DE
  1816. X
  1817. X.*s 2 "%filepart"
  1818. X
  1819. Xusage: %filepart(str0)
  1820. X
  1821. XThis function returns the
  1822. Xfilename portion of the pathname supplied in str0.
  1823. XSee also
  1824. X.B %basename
  1825. Xand
  1826. X.B %dirpart .
  1827. X
  1828. X.DS L
  1829. XExamples:
  1830. X
  1831. X%filepart('/u1/src/src/foo.c') = "foo.c"
  1832. X%filepart('foo.c') = "foo.c"
  1833. X.DE
  1834. X
  1835. X.*s 2 "%fmodestr"
  1836. X
  1837. Xusage: %fmodestr(int0)
  1838. X
  1839. XThis function returns a string representation of the
  1840. Xfamiliar file mode string given the file mode integer int0.
  1841. X
  1842. X.DS L
  1843. XExample:
  1844. X
  1845. X    echo %fmodestr(0100755)
  1846. X    -rwxr-xr-x
  1847. X
  1848. X    echo %fmodestr(%fmode('/usr/lib'))
  1849. X    drwxr-xr-x
  1850. X.DE
  1851. X
  1852. X.*s 2 "%itos"
  1853. X
  1854. Xusage: %itos(int0[,format])
  1855. X
  1856. XThis function converts integer int0 to a string, optionally
  1857. Xcontrolling the format of the conversion.
  1858. X
  1859. XIf the format parameter is missing, the conversion is to
  1860. Xa minimum number of decimal characters necessary to
  1861. Xhold the result.
  1862. X
  1863. XIf the format parameter is present, it must of consist of
  1864. Xa non-null string made of one or both optional parts:
  1865. X.DS L
  1866. X    decimal number of digits to be part of result string
  1867. X    (a leading zero indicates leading zeroes are to
  1868. X    appear in the string; no leading zero pads with
  1869. X    leading spaces
  1870. X
  1871. X    a lower case letter from the following list:
  1872. X        d - decimal conversion
  1873. X        x - hexadecimal conversion
  1874. X        o - octal conversion
  1875. X.DE
  1876. X.DS L
  1877. XExample:
  1878. X
  1879. X    %itos(33)           '33'
  1880. X    %itos(33,d)         '33'
  1881. X    %itos(33,x)         '21'
  1882. X    %itos(33,5d)        '   33'
  1883. X    %itos(33,010d)      '0000000033'
  1884. X    %itos(33,10d)       '        33'
  1885. X    %itos(33,x)         '21'
  1886. X    %itos(33,04x)       '0021'
  1887. X    %itos(33,4x)        '  21'
  1888. X    %itos(33,o)         '41'
  1889. X    %itos(33,4o)        '    41'
  1890. X.DE
  1891. X
  1892. X.*s 2 "%left"
  1893. X
  1894. Xusage: %left(str0,int0)
  1895. X
  1896. XThis function returns the leftmost int0 characters of str0.
  1897. XIf the length of the string is less than int0,
  1898. Xthe entire str0 is returned.
  1899. X.DS L
  1900. XExample:
  1901. X
  1902. X    if $s0 == 'abcdefg'
  1903. X    %left($s0,3) returns 'abc'
  1904. X.DE
  1905. X
  1906. X.*s 2 "%line"
  1907. X
  1908. Xusage: %line
  1909. X
  1910. XThis function returns the name of the attached communications
  1911. Xline in the form "/dev/ttyxx".  If no line is currently
  1912. Xattached, the function returns null.
  1913. X
  1914. X.*s 2 "%logname"
  1915. X
  1916. Xusage: %logname
  1917. X
  1918. XThis function returns the login name of the user executing
  1919. XECU.  Note: the name returned is the name supplied to a login
  1920. Xprompt, not any current su(C) username that may be in effect.
  1921. X
  1922. X.*s 2 "%mid"
  1923. X
  1924. Xusage: %mid(str0,int0[,int1])
  1925. X
  1926. XThis function returns the middle portion of a string str0
  1927. Xbeginning with the character at position int0 and for a length
  1928. Xof int1 characters.
  1929. XIf int0 is greater than or equal to the length of
  1930. Xstro, a null string is returned.
  1931. XIf the optional argument int1 is not supplied, or
  1932. Xif the length of the string is less than int1,
  1933. Xthe entire str0 is returned.
  1934. X.DS L
  1935. XExample:
  1936. X
  1937. X    if $s0 == '0123456789abc'
  1938. X    %mid($s0,3,4)  returns '3456'
  1939. X    %mid($s0,3)    returns '3456789abc'
  1940. X    %mid($s0,10,2) returns 'ab'
  1941. X    %mid($s0,10,5) returns 'abc'
  1942. X.DE
  1943. X
  1944. X.*s 2 "%month"
  1945. X
  1946. Xusage: %month
  1947. X
  1948. XThis function returns the current month as a three character
  1949. Xabbreviation: 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'.
  1950. X
  1951. X.*s 2 "%rdesc"
  1952. X
  1953. Xusage: %rdesc
  1954. X
  1955. XThis function returns the
  1956. Xdescription
  1957. Xportion of the
  1958. Xdialing directory entry for the currently connected remote.
  1959. XIf no connection exists, the function returns null.
  1960. X
  1961. X.*s 2 "%right"
  1962. X
  1963. Xusage: %right(str0,int0)
  1964. X
  1965. XThis function returns the rightmost int0 characters of str0.
  1966. XIf the length of the string is less than int0,
  1967. Xthe entire str0 is returned.
  1968. X.DS L
  1969. XExample:
  1970. X
  1971. X    if $s0 == 'abcdefg'
  1972. X    %right($s0,3) returns 'efg'
  1973. X.DE
  1974. X
  1975. X.*s 2 "%rname"
  1976. X
  1977. Xusage: %rname
  1978. X
  1979. XThis function returns the
  1980. Xlogical name
  1981. Xportion of the
  1982. Xdialing directory entry for the currently connected remote.
  1983. XIf the remote was dialed directly, as in dial 5551212, the
  1984. Xreturned value is the phone number.
  1985. XIf no connection exists, the function returns null.
  1986. X
  1987. XThe value returned by this command may be overridden by use of the
  1988. X.B rname
  1989. Xprocedure command.
  1990. X
  1991. X.*s 2 "%rtelno"
  1992. Xusage: %rtelno
  1993. X
  1994. XThis function returns the
  1995. Xtelephone number
  1996. Xportion of the
  1997. Xdialing directory entry for the currently connected remote.
  1998. XIf no connection exists, the function returns null.
  1999. X
  2000. X.*s 2 "%time"
  2001. X
  2002. Xusage: %time
  2003. X
  2004. XThis function returns the current time in the form 'hh:mm'
  2005. Xin the local time zone (daylight time if it applies).
  2006. X
  2007. X.*s 2 "%times"
  2008. X
  2009. Xusage: %times
  2010. X
  2011. XThis function returns the current time in the form 'hh:mm:ss'
  2012. Xin the local time zone (daylight time if it applies).
  2013. X
  2014. X.*s 2 "%timez"
  2015. X
  2016. Xusage: %timez
  2017. X
  2018. XThis function returns the current time in the form 'hh:mm'
  2019. Xin the UTC (Z) time zone.
  2020. X
  2021. X.*s 2 "%timezs"
  2022. X
  2023. Xusage: %timezs
  2024. X
  2025. XThis function returns the current time in the form 'hh:mm:ss'
  2026. Xin the UTC (Z) time zone.
  2027. X
  2028. X.*s 2 "%tty"
  2029. X
  2030. Xusage: %tty
  2031. X
  2032. XThis function returns the console tty name in the form "/dev/ttynn".
  2033. X
  2034. X.*s 2 "%uname"
  2035. X
  2036. Xusage: %uname
  2037. X
  2038. XThis function returns the system name you are executing ECU on as
  2039. Xreported by uname(2)/uname(S).  On SCO systems, if /etc/systemid
  2040. Xexists and is readable, the name in that file isused in place of
  2041. Xthe name from uname.
  2042. SHAR_EOF
  2043. chmod 0644 doc/_p_sfunc.txt ||
  2044. echo 'restore of doc/_p_sfunc.txt failed'
  2045. Wc_c="`wc -c < 'doc/_p_sfunc.txt'`"
  2046. test 10113 -eq "$Wc_c" ||
  2047.     echo 'doc/_p_sfunc.txt: original size 10113, current size' "$Wc_c"
  2048. rm -f _shar_wnt_.tmp
  2049. fi
  2050. # ============= doc/_startup.txt ==============
  2051. if test -f 'doc/_startup.txt' -a X"$1" != X"-c"; then
  2052.     echo 'x - skipping doc/_startup.txt (File already exists)'
  2053.     rm -f _shar_wnt_.tmp
  2054. else
  2055. > _shar_wnt_.tmp
  2056. echo 'x - extracting doc/_startup.txt (Text)'
  2057. sed 's/^X//' << 'SHAR_EOF' > 'doc/_startup.txt' &&
  2058. X.*s 1 "Starting the Program"
  2059. X
  2060. X.*s 2 "Simple Startup - Initial Setup Menu"
  2061. X
  2062. XECU may be started in a number of ways through use of
  2063. Xcommand line switches, but the easiest is to enter
  2064. X.DS I
  2065. Xecu
  2066. X.DE
  2067. Xby itself.
  2068. XIn this case, the screen is cleared
  2069. Xand the following screen, called the
  2070. X.B setup
  2071. X.B screen ,
  2072. Xwill be presented.
  2073. X.DS L
  2074. X        .--[ ecu 3.20-386u wht@n4hgf ]---------------------------------.
  2075. X        |                                                              |
  2076. X        |  Destination   ________________________________________      |
  2077. X        |                                                              |
  2078. X        |                                                              |
  2079. X        |                                                              |
  2080. X        |  tty: /dev/tty2b                                             |
  2081. X        |                                                              |
  2082. X        |  duplex: F  baud: 9600   parity:N  (data bits 8)             |
  2083. X        |  add NL to transmitted CR: N                                 |
  2084. X        |  add NL to received CR:    N                                 |
  2085. X        |                                                              |
  2086. X        |                                                              |
  2087. X        |   TAB:next ^B:prev END:proceed ^D:phone dir  ESC:quit ecu    |
  2088. X        `- logical phone directory entry, phone number or empty -------'
  2089. X
  2090. X.DE
  2091. XSeveral choices may be made by navigating the setup screen.
  2092. XWhen you position to a field, helpful text is displayed
  2093. Xon the bottom line of the form.
  2094. X
  2095. XIt is important to note that you may not exit this screen
  2096. Xinto ECU operation without opening a communications line.
  2097. X
  2098. XThe initial (default) values for some of the fields may be modified
  2099. Xby command line switches or by the special procedure "_rc.ep".
  2100. XAlso, entering a dialing directory entry name in the 'Destination'
  2101. Xfield and pressing Return will override the defaults with the values
  2102. Xin the directory entry.
  2103. XSee the sections related to dialing
  2104. Xand the section in the Procedure Language manual titled "_rc.ep".
  2105. X
  2106. X.*s 3 "Destination"
  2107. X
  2108. XIf a dialing directory has been configured,
  2109. Xa literal phone number need not be entered.
  2110. XHowever, on your first invocation,  you'll very likely have
  2111. Xno directory.  Therefore, you have three options:
  2112. X
  2113. X.DS I
  2114. X1.  Enter a literal telephone number, (e.g. 18005551212).
  2115. X    Hyphens and open and close parentheses may also
  2116. X    be entered.
  2117. X
  2118. X2.  Press ENTER to skip the 'Destination' field and enter
  2119. X    ^D to enter the telephone directory to enter your
  2120. X    first directory entry.
  2121. X
  2122. X3.  Press END to enter interactive mode to communicate
  2123. X    directly with the attached DCE (modem).
  2124. X.DE
  2125. X
  2126. X.*s 3 "Other Fields"
  2127. X
  2128. XThe 'tty' field may be used to select an outgoing line
  2129. Xother than the default.
  2130. XFor important considerations on line choice, see the sections
  2131. SHAR_EOF
  2132. true || echo 'restore of doc/_startup.txt failed'
  2133. fi
  2134. echo 'End of ecu320 part 38'
  2135. echo 'File doc/_startup.txt is continued in part 39'
  2136. echo 39 > _shar_seq_.tmp
  2137. exit 0
  2138.  
  2139. exit 0 # Just in case...
  2140.