home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sources / misc / 3965 < prev    next >
Encoding:
Text File  |  1992-09-15  |  57.2 KB  |  2,146 lines

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