home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume21
/
ecu
/
part34
< prev
next >
Wrap
Text File
|
1991-08-05
|
55KB
|
2,024 lines
Newsgroups: comp.sources.misc
From: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
Subject: v21i086: ecu - ECU async comm package rev 3.10, Part34/37
Message-ID: <1991Aug5.212024.8480@sparky.IMD.Sterling.COM>
X-Md4-Signature: 564556a6c250d740253db18a02b344df
Date: Mon, 5 Aug 1991 21:20:24 GMT
Approved: kent@sparky.imd.sterling.com
Submitted-by: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
Posting-number: Volume 21, Issue 86
Archive-name: ecu/part34
Environment: SCO, XENIX, ISC
Supersedes: ecu3: Volume 16, Issue 25-59
---- Cut Here and feed the following to sh ----
#!/bin/sh
# this is ecu310.34 (part 34 of ecu310)
# do not concatenate these parts, unpack them in order with /bin/sh
# file doc/_p_cmd.txt continued
#
if touch 2>&1 | fgrep 'amc' > /dev/null
then TOUCH=touch
else TOUCH=true
fi
if test ! -r _shar_seq_.tmp; then
echo 'Please unpack part 1 first!'
exit 1
fi
(read Scheck
if test "$Scheck" != 34; then
echo Please unpack part "$Scheck" next!
exit 1
else
exit 0
fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
echo 'x - still skipping doc/_p_cmd.txt'
else
echo 'x - continuing file doc/_p_cmd.txt'
sed 's/^X//' << 'SHAR_EOF' >> 'doc/_p_cmd.txt' &&
X
X !Interrupted call interrupted by signal
X !Modem Error modem did not respond
X.DE
X
X.*s 3 "do"
X
Xusage: do <procname> [<arg> ...]
X
XThis command executes a procedure whose name appears as the command's
Xfirst (string) argument. One or more arguments (up to 19) may be passed
Xto the called procedure; an argument may consist of any valid string
Xexpression, provided, that, when expanded, the argument does not
Xexceed 256 characters in length.
X
XThe called procedure may read its arguments using the
X.B %argv
Xstring function. %argv(0) is the name of the procedure.
XThe quantity of arguments may be obtained using the
X.B %argc
Xinteger function.
X
X.DS L
XExample:
X
X do 'proc' %rname %date+' '+%time %argv(0)
X
XNote: in this example, the called procedure is passed the name
Xof the calling procedure as the last argument.
X.DE
X
X.*s 3 "duplex"
X
X.DS L
Xusage: duplex full | half
X duplex 'full' | 'half'
X.DE
X
XThis command specifies whether or not ECU is to locally echo
Xcharacters typed by you at the keyboard. The overwhelming
Xmajority of remote systems provide the echo function, in
Xwhich case full duplex must be used. For the rare occasions
Xwhen the remote system does not echo your keyboard input,
Xsetting half duplex will allow you to see what you are
Xtyping.
X
XWhen communicating with another terminal in a "teletype
Xconversation", setting half duplex is generally required.
XIn such cases, use of the interactive
X.B nl ,
X.B nlin
Xand
X.B nlout
Xcommands may also be required.
X.DS L
XExample:
X
X duplex full
X $s0 = 'full'; duplex $s0
X.DE
X
X
X.*s 3 "echo"
X
Xusage: echo [-n] <string>
X
XThis command prints the contents of the string argument <string>
Xon the screen. If the -n switch is not present, a newline follows
Xthe output of <string>.
X.DS L
XExample:
X
X echo 'Procedure '+%argv(0)+' executing at '+%time
X echo -n 'Enter your first name: '; $s0 = %cgets
X.DE
X
X.*s 3 "eeol"
X
Xusage: eeol
X
XThis command erases the video display to the end of the line.
X
X.*s 3 "else"
X
X.DF L
Xusage: else <statement>
X
X else
X <statement>
X
X else
X {
X any kind and number of statements
X }
X
X else <if> <statement>
X
X else <if>
X {
X any kind and number of statements
X }
X
X.DE
X
XThis statement may follow an
X.B ifi
Xor
X.B ifs
Xcommand to specify one or more statements to be executed if
Xthe if-type command condition is false. Else commands may be
Xchained together in the traditional structured language manner.
X
XFor the purposes of describing this command, <statement> is
Xany single or compound statement
X.B NOT
Xcontaining a
X.B whilei
Xor
X.B whiles
Xcommand.
XIf you wish to have a while-type command executed as part of an
X.B else
Xcondition, the while must occur within braces ("{}").
X
X<if> is an
X.B ifi
Xor
X.B ifs
Xcommand followed by an <if-condition> (see the description of the
X.B ifi
Xor
X.B ifs
Xcommands below).
X.DS L
XExample:
X
X#+------------------------------------------------------
X# finger.ep - procedure to send 'finger' to remote
X# BSD Unix system; print resulting lines in different
X# colors: uucp logins green, root red, others cyan
X#-------------------------------------------------------
X
X mkvar $icolor; $icolor = %colors
X mkvar $itimeout
X $itimeout = 50 # timeout for first line 5 secs
X send 'ps -aux' # send command, but do not echo
X lookfor '\n' 40 # swallow command
X whilei 1==1 # forever, or until break
X {
X lgets 0 $itimeout 1 '\n' #get a line
X ifi $i0 = 0 break #if no chaacters read
X $itimeout = 10 #wait 1 sec for later lines
X
X ifi %instr($s0,'% ') >= 0 # if csh prompt seen
X break # exit while loop
X else ifi %instr($s0,'Login') >= 0
X color gray
X else ifi %instr($s0,'root') >= 0
X color red
X else ifi %instr($s0,'uucp') >= 0
X color green
X else color cyan
X echo $s0
X }
X icolor $icolor #restore entry colors
X send '' #force a new prompt from remote
X
X.DE
X
X.*s 3 "exit"
X
Xusage: exit [<status>]
X
XThis command causes an abrupt termination of the ECU program.
XAny existing connection with a remote system
Xis terminated immediately.
XIf no integer argument <status> is found, ECU exits
Xwith a program exit status of 0.
XIf <status> is found and the value is zero, then ECU exits
Xwith a program exit status of 0.
XIf <status> non-zero,its value must be in the range of 1 to 31,
Xand ECU exits
Xwith a program exit status of 192 plus <status>.
XThis feature allows batch executions of ECU by shell script
Xdetect user-determined ECU execution status.
XSee the section titled "Exit Codes".
X
X.*s 3 "expresp"
X
Xusage: expresp [-v[v...]] <exp-resp-str> [<timeout_msecs>]
X
XThis command emulates the uuchat function as described in the
XSCO HDB UUCP documentation and in the /usr/lib/uucp/Dialers
Xfile.
X
X-v causes the expect-respond conversation between ECU and the
Xremote system to be displayed on the screen. This switch is
Xautomatically enabled if procdedure tracing is enabled.
X
Xmultiple v's (e.g., -vv, -vvv) up to 3 'v's produce
Xmore verbose debug output. -vv causes each base level
Xexpect and respond string to be displayed. -vvv causes
Xa hexadecimal dump of each interpreted expect string to be
Xdisplayed.
X
X<exp-resp-str> is as defined in /usr/lib/ecu/Dialers.
X.DS L
X Meaning of some of the escape characters:
X \\\p - pause (approximately 1/4-1/2 second delay)
X \\\d - delay (2 seconds)
X \\\D - phone number/token
X \\\T - phone number with Dialcodes and character translation
X \\\N - null byte
X \\\K - insert a BREAK
X \\\E - turn on echo checking (for slow devices)
X \\\e - turn off echo checking
X \\\r - carriage return
X \\\c - no new-line
X \\\n - send new-line
X \\\nnn - send octal number
X \\\m## - delay ## milliseconds (NOT SUPPORTED BY DIALERS;
X SEE BELOW)
X ~t[##] - set timeout to ## seconds (see below)
X ~m[##] - set timeout to ## milliseconds (see below)
X Speed - Hayes-specific speed-adaptive connect handler
X.DE
X
X<timeout_msecs> specifies an optional timeout in milliseconds
Xfor waiting on expect strings; it defaults to 10,000 milliseconds
X(10 seconds).
XThe resolution for timeouts is limited to the basic tick time of
Xyour system (HZ, 10 msec for UNIX/386 3.2.0,
X16 (1000/60) msec for 3.2.1 and later or any ODT
X20 msec for XENIX/386 and XENIX/286).
XThe timeout for 'Speed' expects is fixed at 90 seconds.
X
X\\\m### causes a ### millisecond delay. Note this adds an ambiguity to
Xthe syntax of the send string: you may not follow an \m delay with a
Xliteral digit to send. For example, suppose you wish to delay 300
Xmissileconds then send "4A". \\\m3004A will delay for 3004
X(approximately) milliseconds, then send an "A".
X
XInteger variable $i0 is set to one if the expect-respond script
Xfails, else it is set to 0.
X
X
X.*s 3 "fchmod"
X
Xusage: fchmod <mode> <file>
X
XThis command sets the mode of <file> to <mode>.
XThe <mode> argument takes one of two forms, a nine-character
Xmode string (e.g., 'rwxr-xr-x') or an integer value (0755).
XThe <file> argument is either a string value forming a
Xfilename or an integer file number representing a file opened with the
X.B fopen
Xcommand.
X
XThe command sets $i0 = 0 if successful, else to the
X.B errno
Xfrom the associated system call (refer to the
X.B %errstr
Xstring function and/or /usr/include/sys/errno.h).
X
X.DS L
XExample:
X
X fopen 1 '/tmp/123'; fchmod 'rwxrwxrwx' 1
X fchmod 'rwxrwxrwx' '/tmp/123'
X fopen 1 '/tmp/123'; fchmod 0777 1
X $i0 = 0777; fchmod $i0 '/tmp/123'
X
XAll of the above example result in the same result.
X.DE
X
X.*s 3 "fclose"
X
Xusage: fclose <file>
X
XThis command closes <file>.
XThe <file> argument is an
Xinteger file number representing a file opened with the
X.B fopen
Xcommand.
X
XThe command is ignored if <file> is not open.
XNo integer variable is modified by
X.I fclose .
X
X.DS L
XExample:
X
X fclose 1
X.DE
X
X.*s 3 "fdel"
X
Xusage: fdel <file>
X
XThis command removes a file.
X
XThe command sets $i0 = 0 if successful, else to the
X.B errno
Xfrom the associated system call (refer to the
X.B %errstr
Xstring function and/or /usr/include/sys/errno.h).
X
X.DS L
XExample:
X
X fdel '/tmp/123'
X.DE
X
X.*s 3 "fgetc"
X
Xusage: fgetc <file> <destination>
X
XThis command reads a character from <file>.
XThe <file> argument is an
Xinteger file number representing a file opened with the
X.B fopen
Xcommand.
X
XThe argument <destination> is either a string variable
Xor an integer variable.
XIf the file has reached end of file: an integer variable
Xreceives -1; a string variable is returned null.
XOtherwise, the character's numeric value (0-255) is placed
Xin an integer variable or a string variable is returned with a
Xlength of one with the file character as its only character.
X
X.DS L
XExample:
X
X fgetc 1 $s0
X fgetc 1 $i_input
X.DE
X
X.*s 3 "fgets"
X
Xusage: fgets <file> <strvar>
X
XThis command reads a character from <file>.
XThe <file> argument is an
Xinteger file number representing a file opened with the
X.B fopen
Xcommand.
X
XThe argument <strvar> is a string variable.
XIf the file has reached end of file, <strvar> is returned null and
Xinteger variable $i0 is set to 1.
XOtherwise, the <strvar> receives input from the file minus
Xthe trailing newline and $i0 is returned zero.
X
X.DS L
XExample:
X
X fgets 1 $s0
X.DE
X
X.*s 3 "fkey"
X
Xusage: fkey <str>
X
XThis command selects a function key definition from the ~/.ecu/keys
Xfile.
X
X.*s 3 "flush"
X
Xusage: flush
X
XThis command causes any characters received by the system
Xfrom the line, but not yet read by the procedure to be "forgotten"
Xor flushed.
X
X.*s 3 "fopen"
Xusage: fopen [-switches] <filenum> <filename>
X
XThis command opens a file named by the string argument <filename>
Xand associates it with the user-chosen file number <filenum> (which
Xmust be an integer value between 0 and 4, inclusive).
X
XThe argument switches govern how a file is opened and must be chosen
Xfrom this list:
X.VL 15 4
X.LI -r
XThe file is opened read-only; if it does not
Xexist, an error occurs.
X.LI -r+
XThe file is opened for reading and writing; if it does not
Xexist, an error occurs.
X.LI -w
XThe file is opened for writing (any previous contents
Xof the file are lost); if it does not
Xexist, it is created.
X.LI -w+
XThe file is opened for reading and writing (any previous contents
Xof the file are lost); if it does not
Xexist, it is created.
X.LI -a
XThe file is opened for appending (writes to the file
Xare added to the previous file contents); if it does not
Xexist, it is created.
XAll writes are appended to the file (the
X.B fseek
Xcommand has no effect).
X.LE
X
XThe switches parameter may be omitted; in such cases,
Xthe file is opened as though '-r' had been supplied. However,
Xif procedure tracing is enabled (see the description of the
Xinteractive and procedure command
X.B ptrace ),
Xa warning message will be issued.
X
XThe command sets $i0 = 0 if successful, else to the
X.B errno
Xfrom the associated system call (refer to the
X.B %errstr
Xstring function and/or /usr/include/sys/errno.h).
X.DS L
XExample:
X
X fopen 0 -r '/etc/passwd'
X fopen 1 -w+ '/tmp/123'
X fopen 2 -a 'tranact.log'
X.DE
X
X.*s 3 "fputc"
X
Xusage: fputc <file> <char>
X
XThis command writes character <char> into <file>.
XThe <file> argument is an
Xinteger file number representing a file opened with the
X.B fopen
Xcommand.
XArgument <char> is a integer value of which the lower eight
Xbits are used or a string value of which the first character is used.
X
XIf a write error occurs, procedure execution is terminated.
X.DS L
XExample:
X
X $s0='abc'; fputc 1 $s0 writes 'a'
X $i0=0x30 ; fputc 1 $i0 writes '0'
X.DE
X
X.*s 3 "fputs"
X
Xusage: fputs [-n] <file> <str>
X
XThis command writes the string <str> into <file>.
XThe <file> argument is an
Xinteger file number representing a file opened with the
X.B fopen
Xcommand.
X
XIf the switch '-n' is omitted, a newline is appended after <str>
Xin the file; if present, no newline is written.
X
XIf a write error occurs, procedure execution is terminated.
X.DS L
XExample:
X
X $s0='abc'; fputc 1 $s0 writes 'a'
X.DE
X
X.*s 3 "fseek"
X
Xusage: fseek <file> <position>
X
XThis command sets the file position of <file> to <position.
XThe corresponding integer function
X.B %ftell
Xmay be used to determine the current file position.
X
X.B Note :
Xif <file> is open for append ('-a'), then the
X.B fseek
Xcommand will have no effect.
X
X.*s 3 "getf"
X
X.DS L
Xusage: getf -x <int-var-spec> <offset>
X
Xwhere: -x ==
X -b byte
X -w word (little-endian)
X -W word (big-endian)
X -l 32-bits (little-endian)
X -L 32-bits (big-endian)
X.DE
X
X.*s 3 "gosub"
X
Xusage: gosub <label>
X
XThis command transfers control of procedure to a statement
Xother than the one immediately following. The <label>
Xargument may be literal text or may be a string, allowing
Xa "computed gosub" feature.
X
XWhen the next return statement is executed, control is
Xreturned to the
Xnext statement after the gosub.
X
X.DS L
XExample:
X
X gosub GET_NEXT
X gosub 'GET_NEXT'
X gosub 'GET'+'_NEXT'
X $s0 = 'GET_NEXT'; gosub $s0
X $s0 = 'NEXT'; gosub 'GET_'+$s0
X
XNote: all the above examples cause transfer to the label GET_NEXT.
X.DE
X.DS L
XA switch or case function of sorts may be implimented by something like:
X
X #$i0 has been set to the "switch" value
X ifi $i0 < 0 || $i0 > 2 # avoid gosub label not found
X {
X echo 'bad my_case state value'+%itos($i0)
X DO SOMETHING LIKE DIE OR DUMP VARS AND DIE
X }
X $s0 = 'my_case_'+%itos($i0,03)
X gosub $s0
X
Xmy_case_000
X echo 'handle case 0'
X return
X
Xmy_case_001
X echo 'handle case 1'
X return
X
Xmy_case_002
X ifi $i_already_did_002
X {
X echo 'whoops'
X return
X }
X echo 'handle case 2'
X $i_already_did_002 = 1
X return
X.DE
X
X.*s 3 "gosubb"
X
Xusage: gosubb <label>
X
XThis command serves the same function as the
X.B gosub
Xcommand except the programmer is signifying that the label
Xis
X.B b ehind
Xthe current statement, resulting in slightly faster execution.
X(The label is not REQUIRED to be at any specific location
Xin the procedure relative to the
X.B gosubb
Xstatement.)
X
X.*s 3 "goto"
X
Xusage: goto <label>
X
XThis command transfers control of procedure to a statement
Xother than the one immediately following. The <label>
Xargument may be literal text or may be a string, allowing
Xa "computed goto" feature.
X.DS L
XExample:
X
X goto GET_NEXT
X goto 'GET_NEXT'
X goto 'GET'+'_NEXT'
X $s0 = 'GET_NEXT'; goto $s0
X $s0 = 'NEXT'; goto 'GET_'+$s0
X.DE
XNote: all the above examples cause transfer to the label GET_NEXT.
X
X.*s 3 "gotob"
X
Xusage: gotob <label>
X
XThis command serves the same function as the
X.B goto
Xcommand except the programmer is signifying that the label
Xis
X.B b ehind
Xthe current statement, resulting in slightly faster execution.
X(The label is not REQUIRED to be at any specific location
Xin the procedure relative to the
X.B gotob
Xstatement.)
X
X.*s 3 "hangup"
X
Xusage: hangup
X
XThis command causes Data Terminal Ready (DTR)
Xto be dropped momentarily, causing (hopefully)
Xthe termination of any current connection
Xto a remote system.
XThis command is only effective if the attached Data Communications
XEquipment is configured
Xto terminate its connection on loss of DTR.
X
XIf no line is attached, the command is ignored (a warning
Xis generated if procedure tracing is enabled).
X
X.*s 3 "hexdump"
X.DS L
Xusage: hexdump [-s] <str>
X hexdump -t[s] <str1> <str>
X.DE
X
X<str> buf to dump
X<str1> title (if -t)
X-s short (terse) dump
X
XThis command prints a hexadecimal dump of <str> on the screen
X(and to the procedure log file, if logging enabled with the
X.B ptrace
Xcommand).
X
XThe switch '-t' signifies that <str1> is a title to be printed
X.DS L
XExample:
X
X $s0='The quick brown fox jumped over the lazy dog\'s back'
X hexdump -t 'Example hex dump' $s0
X---------------------------- Example hex dump ----------------------------
X0000 54 68 65 20 71 75 69 63 6B 20 62 72 6F 77 6E 20 | The quick brown |
X0010 66 6F 78 20 6A 75 6D 70 65 64 20 6F 76 65 72 20 | fox jumped over |
X0020 74 68 65 20 6C 61 7A 79 20 64 6F 67 27 73 20 62 | the lazy dog's b |
X0030 61 63 6B | ack |
X.DE
X.DS L
X hexdump %left($s0,9)
X0000 54 68 65 20 71 75 69 63 6B | The quick |
X.DE
X.DS L
X hexdump -ts 'Example hex dump' %left($s0,9)
XExample hex dump
X0000 54 68 65 20 71 75 69 63 6B | The quick |
X.DE
X.DS L
X hexdump -s %left($s0,9)
X0000 54 68 65 20 71 75 69 63 6B | The quick |
X.DE
X
X.*s 3 "home"
X
Xusage: home
X
XThis command homes the video cursor.
X
X.*s 3 "icolor"
X
Xusage: icolor <int-colors>
X
XThis command sets the normal and reverse foreground
Xand background colors according to <int-colors>, an integer
Xvalue in the format as that returned by the
X.B %colors
Xinteger function.
X
XThis command is provided primarily to be able to save the color
Xstate, modify it temporarily and then restore it.
X.DS L
XExample:
X
X mkvar $icolor_save; $icolor_save = %colors
X color red; echo 'Connection seems to be dead'
X icolor $icolor_save # restore previous colors
X.DE
X
X.*s 3 "ifi"
X.DS L
Xusage: ifi <int> <rel-op> <int> <statement>
X ifi <int> <rel-op> <int>
X <statement>
X ifi <int> <rel-op> <int>
X {
X any kind or number of statements
X }
X.DE
X
XThis command selectively executes one or more statements
Xbased on a test of two integer quantities. See the
Xdescription of the
X.B break ,
X.B continue ,
Xand
X.B else
Xcommmands for examples of how the command is used.
X
X.*s 3 "ifs"
X.DS L
Xusage: ifs <str> <rel-op> <str> <statement>
X ifs <int> <rel-op> <int>
X <statement>
X ifs <int> <rel-op> <int>
X {
X any kind or number of statements
X }
X.DE
X
XThis command selectively executes one or more statements
Xbased on a test of two string values. See the
Xdescription of the
X.B break ,
X.B continue ,
Xand
X.B else
Xcommmands
Xand many other examples throughout the document,
Xfor examples of how the command is used.
X
X.*s 3 "lbreak"
X
Xusage: lbreak
X
XThis command transmits a break to the remote system.
X
X.*s 3 "lgets"
X
X.DS L
Xusage: lgets [-er] <strvar> <t1-int> <t2-int> [<stop-str>]
X
X-e echo received characters to screen
X-r raw read (retain carriage returns)
X.DE
X
XThis command reads a string from the attached communications
Xline.
X<t1-int> is the number of tenths of seconds before
Xtiming out waiting for the first character to be received.
X<t2-int> is the number of tenths of seconds before
Xtiming out on later characters.
X<stop-str> is an optional argument, which if received, immediately
Xterminates the read.
XInteger variable $i0 is set to the count of characters received.
X
XIf the specified string variable is filled with characters
Xbefore the <stop-str> has been encountered or before a timeout
Xoccurs, then the command returns with $i0 set to the maximum
Xsize of the variable. Refer to the section on string variables
Xabove and the section describing the
X.B mkvar
Xcommand below for information on the size of string variables.
X
X.*s 3 "insline"
X
Xusage: insline
X
XThis command inserts a line onto the video screen at the current line.
X
X.*s 3 "logevent"
X.DS L
Xusage: logevent <str>
X.DE
X
XThis command writes a log item to ~/.ecu/log.
X
X.DS L
XExample:
X
X $s0='/tmp/alm.log'
X log 'appending alarm info to '+$s0
X
Xwrites:
X10-02-1989-17:39-01261-PROC appending alarm info to /tmp/alm.log
X.DE
Xassuming the transmitter process pid is 1261 and you are living in
X1989.
X.*s 3 "lookfor"
X.DS L
Xlookfor [-e] [quiet | <str>] [<timeout-int>]
X
X-e echo to screen while "looking"
X.DE
XThis command is used to read from the attached commuications line
Xuntil one of two user-specified conditions occurs.
X
XThe 'quiet' option waits for the line to become
Xquiet for the number of tenths of seconds specified by <timeout-int>.
X
XThe other option reads the line until <str> is read from the line
Xor until <timeout-int> tenths of seconds elapses. With this option,
Xinteger variable $i0 is set to 1 if <str> is found within the
Xtimeout period or 0 if not.
X
X.DS L
XExamples:
X
X lookfor -e quiet 20 wait for quiet line for 2 secs
X lookfor 'word:' 50 wait for 'word:' for up to 5 secs
X.DE
X.*s 3 "mkvar"
X.DS L
Xusage: mkvar [$]i<name>
X mkvar [$]s<name>(<size>)
X.DE
X
XThis command creates one or more named (temporary)
Xinteger or string variables.
XThe variable type is determines by the first character
Xof the variable, which must be 'i' or 's'. The size of a string
Xvariable must be specified via the <size> argument. An optional '$'
Xmay be supplies for neatness, but may be omitted if desired.
X
X.*s 4 "Variable Names"
X
XThe names for created (named, temporary) variables consist of
Xa dollar sign ('$'), an 'i' for integer or 's' for string and
Xup to fifteen characters from the set [A-Za-z0-9_].
X
XThe first character after the 'i' or 's' in <name>
Xmust be non-numeric. '$sxyz' and '$s_3xyz' are legal, but '$s3xyz'
Xis not (it would be interpreted as '$s3' followed by the illegal
Xcommand sequence 'xyz').
X
XThe <name> space for integer and string variables are separate.
XIt is possible to have an integer variable named '$ixyz' and a string
Xvariable named '$sxyz'.
X
X.*s 4 "Variable Life and Scope"
X
XThe life and scope of created variables is for
Xthe duration of the execution
Xof the creating procedure. Procedures called
Xby the creating procedure (by 'do') can reference
Xtemporary variables declared by a
Xprevious procedure. When created, integer variables are set
Xto zero and string variables are set to zero length.
XThese features differ from numbered variables
Xwhich retain their scope and values at all times, even when
Xprocedure execution terminates and ECU returns to interactive mode.
X
XVariables may be created by the same name more than once.
XThe latest mkvar execution specifies the variable referenced.
XThus if proc1 declares '$ixx' and calls proc2 which also declares '$ixx',
Xproc2's variable is distinct from proc1's and disappears when proc2
Xterminates, thus making proc1's available to it again, containing
Xthe same value as it had at the time proc2 was called.
X
X.*s 4 "String Variable Size"
X
XThe maximum value for <size> is 5120.
XRegardless of the size specified in the creation of a string
Xvariable, ECU will expand it's size as necessary up to the 5120
Xcharacter maximum.
X
X.DS L
XExamples:
X
X mkvar i_count
X mkvar $i_count
X mkvar s20(20),s80(80),i_timeout,$i_colors
X.DE
X
X.*s 3 "nap"
Xusage: nap <int>
X nap -m <int>
X
XThis command suspends procedure execution for <int> tenths of
Xseconds if
X.B -m
Xis not specified.
XIf -m is used, execution is suspended for <int> milliseconds.
XNote: the actual period execution is suspended depends, as usual,
Xon the scheduling load of the system. For small -m values, be aware
Xthat the granularity of the nap duration is set by the system,
X20 milliseconds for XENIX 286 and 386, 10 milliseconds for UNIX.
X
XIf you need to know the frequency of the system clock,
Xsomething like
X.DS L
X $i0 = %stoi(%getenv("HZ"))
X.DE
Xwill obtain the value for you (provided HZ is in the process' environment).
X
X
X.DS L
XExamples:
X
X nap 30
X nap $i0*$i2
X nap -m 50
X.DE
X
X.*s 3 "nice"
Xusage: nice <int>
X
XThis command sets the nice value of the process. It behaves
Xexactly like the nice(S) or nice(2) system call. The <int> parameter
Xmust be in the range 0 through 39, inclusive. If the call
Xfails, a warning is printed and the procedure continues to
Xexecute. The current nice value may be obtained using the
X.B %nice
Xinteger function. See also the description of the
X.B nice
Xinteractive command.
X
X.*s 3 "parity"
X.DS L
Xusage: parity [even | odd | none]
X parity <str>
X.DE
X
XThis command sets the parity for the attached communications line.
XIf <str> is supplied, the first character must be 'e', 'o' or 'n'.
XUppercase equivalents are also accepted.
X
X.DS L
XExamples:
X
X parity even
X parity 'e'
X parity 'Even now as we speak'
X.DE
X
X.*s 3 "pclose"
Xusage: pclose <filenum>
X
XThis command should be issued when a command started by the
Xinteractive
X.B popen
Xcommandf completes.
X
X.*s 3 "plog"
X.DS L
Xusage: plog
X plog <str>
X plog off
X.DE
X
XThis command controls logging to a file of the screen output during
Xprocedure execution. With no argument, the command displays the status
Xof logging. <str> specifies a log file pathname, while the 'off'
Xargument turns logging off.
X
XIf procedure execution terminates due to an error, procedure logging
Xis turned off. However, if procedure execution terminates
Xnormally while logging is active, erratic and unpredictable portions
Xof interactive mode screen output will continue to be logged to
Xthe current log file.
X
XThe interactive mode command
X.B plog
Xmay also be used to control procedure logging.
X.DS L
XExample:
X
X mkvar s_logname(128)
X $s_logname = %dir+'logname'
X plog $s_logname
X echo 'Test'
X plog off;cd 'somewhere_else';plog $s_logname
X echo 'Test'
X.DE
X
X.*s 3 "popd"
X.DS L
Xusage: popd [ | <#> | all]
X.DE
X
XThis command returns to a previous directory after a
X.B pushd
Xcommand has been previously executed.
X
XIf no argument is supplied, the directory at the immediately previous
Xlevel is restored.
X
XIf a numeric argument is supplied, the directory
Xat the specified level is restored; the level numbers may be obtained by
Xissuing a
X.B pushd
Xcommand with no arguments.
X
XIf the 'all' argument is supplied, it is treated as a numeric argument of 0;
Xthat is the directory stack is cleared and the directory at level 0 is
Xrestored.
X
XThe directory stack is shared between interactive and procedure
Xcommands. Neither beginning nor ending a procedure affects the
Xdirectory stack level.
X
X.DS L
XExamples:
X popd
X popd 3
X popd all
X.DE
X
X.*s 3 "popen"
Xusage: popen [-switches] <filenum> <command>
X
XThis command executes a shell command defined by the string argument <command>
Xand associates it with the user-chosen file number <filenum> (which
Xmust be an integer value between 0 and 4, inclusive).
X
XThe argument switches govern whether the command is
Xto receive input from ECU or output to ECU and must be chosen
Xfrom this list:
X.VL 15 4
X.LI -r
XThe command will output to ECU.
X.LI -w
XThe command will receive input from ECU.
X.LE
X
XThe switches parameter may be omitted; in such cases,
Xthe file is opened as though '-r' had been supplied. However,
Xif procedure tracing is enabled (see the description of the
Xinteractive and procedure command
X.B ptrace ),
Xa warning message will be issued.
X
XThe command sets $i0 = 0 if successful, else to the
X.B errno
Xfrom the associated system call (refer to the
X.B %errstr
Xstring function and/or /usr/include/sys/errno.h).
X.DS L
XExample:
X
X popen 0 -r 'ls -l *.log'
X popen 1 -w 'cat | sort > /tmp/sorted'
X.DE
X
X
X.*s 3 "prompt"
Xusage: prompt <str>
X
XThis command allows selection of an alternate prompt to the interactive
Xmode HOME command trigger.
XRefer to the section titled "ECUPROMPT"
Xfor more information on the interactive mode prompt.
X
XNote: the interactive and procedure
X.B hangup
Xcommands both cause the default prompt to be reestablished.
X
X.DS L
XExample:
X
X prompt %rname+' >' use remote name in prompt
X.DE
X
X.*s 3 "ptrace"
X.DS L
Xusage: ptrace [ <str> | off ]
X.DE
X
XThis command controls procedure execution tracing. Trace
Xoutput is written to the screen and varys in its nature depending upon
Xthe command being traced. Specifically, any change to a string or
Xinteger variable is noted. If tracing is enabled, the output will also
Xbe written to any active procedure log file (see the
X.B plog
Xinteractive and procedure commands).
X
X.*s 3 "pushd"
X.DS L
Xusage: pushd [ | <dir>]
X.DE
X
XThis command either 1) saves the current directory pathname on
Xa stack and establishes a new current directory or
X2) displays the current stack and current directory.
XThe stack size is 10.
X
XIf no argument is supplied, the directory stack is displayed.
X
XThe directory stack is shared between interactive and procedure
Xcommands. Neither beginning nor ending a procedure affects the
Xdirectory stack level.
X
X.DS L
XExamples:
X pushd
X pushd '/tmp'
X.DE
X
X.*s 3 "putf"
X
XNot yet implemented.
X
X.*s 3 "return"
Xusage: return [<int>]
X
XThis command serves two functions: to return from a gosub to or
Xreturn from a procedure execution. If <int> is supplied, it must be in the
Xrange 0 to 255. Other values result in a return value of 255.
X
XIf no gosub is active,
X.B return
Xcauses the currently executing procedure to terminate,
Xreturning either to a calling procedure or to the interactive mode.
XIf <int> is supplied and it's value is nonzero, then all procedure execution is
Xterminated and the integer status is printed
Xon the screen along with the name of the executing procedure.
X
XIf a gosub is active,
X.B return
Xor
X.B return
X0 causes control to return to the statement immediately following the
X.B gosub
Xwhich invoked the subroutine.
XIf <int> is supplied and it's value is nonzero, then all procedure execution is
Xterminated and the integer status is printed
Xon the screen along with the name of the executing procedure.
X
XIt is not possible to terminate a procedure with normal status from
Xwithin a subroutine.
X
X.DS L
XExample:
X
X#---------------------
X# gosub.ep
X#---------------------
X echo 'main'; gosub SUB; echo 'back to main'
X return
X
XSUB
X echo 'sub'
X gosub SUB2
X echo 'back to sub'
X return
X
X
XSUB2
X echo 'sub2'
X return
X
X.DE
X
X.*s 3 "rk"
Xusage: rk [-a]
X
XThis command invokes the Kermit file receive protocol. If switch '-a'
Xis omitted, the received files are stored as received; otherwise
Xcarriage return/linefeed pairs are converted to newlines.
XThe remote sender must have been started prior the the
Xexecution of this command.
X
X.*s 3 "rlog"
X.DS L
Xusage: rlog [-srf] <str>
X rlog 'off'
X.DE
X
XThis command controls receiver logging. It's function is the same as
Xthe interactive
X.B log
Xcommand.
X
XThe first form of the command enables logging. The
X.B -s switch causes the file to be
X.B s cratched
Xwhen it is opened (otherwise the file is opened for append). The
X.B -r
Xswitch causes raw logging, else filter logging is performed. The
X.B -f
Xswitch causes the log file to be flushed each time it is written to
X(unbuffered I/O); this switch is useful if you are logging to
Xa terminal or hard copy device and wish to see output as soon as it
Xis produced.
X
X.*s 3 "rname"
Xusage: rname <str>
X
XNormally, the %rname string function returns the same string
Xas the logical dialing directory entry. This command allows
Xthe default value to be overridden with a user-selected
Xvalue (63-character maximum).
X
XThis feature is useful in situations where one system is initially
Xdialed, but a connection is made to yet another system from the dialed
Xsystem via networking.
X
X.*s 3 "rs"
Xusage: rs
X
XThis command invokes the SEAlink file receive protocol.
XThere
Xis no provision in the SEAlink protocol to convert
Xcarriage return/linefeed pairs to newlines,
Xso the received files are stored as received.
XThe remote sender must have been started prior the the
Xexecution of this command.
X
X.*s 3 "rtscts"
Xusage: rtscts [ off| on | no | yes | 0 | 1 | 2 | 3 ]
X
XThis SCO-only command control RTS/CTS hardware flow control,
Xwhich may or may not work with your serial driver.
XWhat the command does is to manipulate the RTSFLOW and CTSFLOW
Xbits of the termio c_cflag word (see
X.B termio(S) ).
X
X.so __rtscts.txt
X
X.DS L
XExamples:
X
X ifi %baud >= 9600
X rtscts on
X else ifi $i_do_both_flow_control_anyway != 0
X rtscts on
X else ifi $i_do_input_flow_control_anyway != 0
X rtscts 2
X else ifi $i_do_output_flow_control_anyway != 0
X rtscts 3
X else
X rtscts off
X.DE
X
X.*s 3 "rx"
Xusage: rx [-a] <str>
X
XThis command invokes the XMODEM file receive protocol
Xto receive file <str>. If switch '-a'
Xis omitted, the received file is stored as received; otherwise
Xcarriage return/linefeed pairs are converted to newlines.
XThe remote sender must have been started prior the the
Xexecution of this command.
X
X.*s 3 "ry"
Xusage: ry
X
XThis command invokes the YMODEM Batch (not to be confused with
XXMODEM-1K) protocol to receive files from a remote system. The remote
Xsender must have been started prior the the execution of this command.
X
X.*s 3 "rz"
Xusage: rz
X
XThis command invokes the ZMODEM protocol to receive
Xfiles from a remote system.
XThe remote sender must have been started prior the the
Xexecution of this command.
X
X.*s 3 "scrdump"
Xusage: scrdump [<str>]
X
XThis command causes the current screen contents to be
Xstored in a file. If <str> is supplied, it is used as a pathname.
XIf <str> is not supplied, "~/.ecu/screen.dump".
XThe actions of the interactive
X.B sdname
Xcommand have no effect on the execution of this command.
X
XSee the section titled "Screen Dump" for more information.
XThe subsection titled "Multiscreen and Non-Multiscreen" will be
Xof particular interest when using screen dumps in an
Xautomated environment.
X
X.*s 3 "send"
Xusage: send [-n] <str>
X
XThis command sends <str> to the communications line. If the '-n'
Xswitch is omitted, a carriage return (0x0D) is transmitted after <str>.
XIf '-n' is supplied, no carriage return is transmitted.
X
X.DS L
XExamples:
X
X send 'ps -au'
X send -n %chr(0x02)+"START'+%chr(0x03)
X.DE
X
X.*s 3 "set"
X.DS L
Xusage: set [$]i<name>=<int-expression>[, ...]
X set [$]s<name>=<str-expression>[, ...]
X.DE
X
XThis command sets an integer or string variable
Xto an expression. The 'set' verb may be omitted provided the
Xotherwise optional '$' is supplied. There are many examples of
Xhow the set statement is performed throughout this document.
XThe examples here are to further clarify the statement's syntax.
X
XIf the '=<expression>' is omitted, the value of the variable is
Xdisplayed (useful when debugging). If procedure tracing is
Xenabled with the
X.B ptrace
Xcommand, all variables referenced by the
X.B
Xset
Xcommand, whether a value is assigned or not, are displayed.
X
X.DS L
XExamples:
X
X set i0=0
X set $s0='brown',s1='The quick '+$s0+' fox'
X set $S0 with no '=', displays contents
X set i0,$i1,s0='abc',s1
X $s0 = 'abc' legal
X set s0='abc' legal
X s0 = 'abc' illegal
X.DE
X.*s 3 "sk"
Xusage: sk [-a] <str>
X
XThis command invokes the Kermit file transfer protocol to send
Xone or more files.
XIf switch '-a' is supplied,
Xnewlines are converted to carriage return/linefeed pairs.
XIf '-a' is omitted, the file(s) are transmitted without modification.
X
XInteger variable $i0 receives the exit status from the transfer. If 0,
Xtransfer was normal.
XNote:
Xprocedure execution IS terminated by a SIGINT to the spawned file
Xtransfer process. This is different than for versions prior to 3.10.
XIf $i0 is set to -1, the file transfer program did not begin.
X
X.*s 3 "ss"
Xusage: ss <str>
X
XThis command invokes the SEAlink file transfer protocol to send
Xone or more files.
XThere is no provision in the SEAlink protocol to convert
Xnewlines to carriage return/linefeed pairs.
Xso the received files are stored as received.
X
XInteger variable $i0 receives the exit status from the transfer. If 0,
Xtransfer was normal.
XNote:
Xprocedure execution IS terminated by a SIGINT to the spawned file
Xtransfer process. This is different than for versions prior to 3.10.
XIf $i0 is set to -1, the file transfer program did not begin.
X
X.*s 3 "sx"
Xusage: sx [-ak[l]] [<label-str>] <filename-str>
X
XThis command invokes the XMODEM or XMODEM-1K file transfer protocol
Xto send a file. If '-k' is supplied, XMODEM-1K is used, else XMODEM.
XIf switch '-a' is supplied,
Xnewlines are converted to carriage return/linefeed pairs.
XIf '-a' is omitted, the file(s) are transmitted without modification.
XIf '-l' is supplied, then <label-str> specifies a string to
Xdisplay on the bottom of the file transfer screen. If '-l' is
Xomitted, then <label_str> must also be omitted.
X
XInteger variable $i0 receives the exit status from the transfer. If 0,
Xtransfer was normal.
XNote:
Xprocedure execution IS terminated by a SIGINT to the spawned file
Xtransfer process. This is different than for versions prior to 3.10.
XIf $i0 is set to -1, the file transfer program did not begin.
X
X.DS L
XExamples:
X
X sx -al 'sending log file' '/tmp/log.file'
X sx -
X.DE
X
X.*s 3 "sy"
Xusage: sy [-a[l]] [<label-str>] <filelist-str>
X
XThis command invokes the YMODEM Batch (not
Xto be confused with XMODEM-1K) file transfer protocol
Xto send one or more files.
X
XIf switch '-a' is supplied,
Xnewlines are converted to carriage return/linefeed pairs.
XIf '-a' is omitted, the file(s) are transmitted without modification.
XIf '-l' is supplied, then <label-str> specifies a string to
Xdisplay on the bottom of the file transfer screen. If '-l' is
Xomitted, then <label_str> must also be omitted.
X
XInteger variable $i0 receives the exit status from the transfer. If 0,
Xtransfer was normal.
XNote:
Xprocedure execution IS terminated by a SIGINT to the spawned file
Xtransfer process. This is different than for versions prior to 3.10.
XIf $i0 is set to -1, the file transfer program did not begin.
X
X.*s 3 "system"
Xusage: system [-l] <cmdstr>
X
XIf switch '-l', is supplied, the attached communications line
Xbecomes the stdin and stdout for the command.
X
XInteger variable $i0 is set to
Xthe spawned process' exit status if the process exits "normally",
Xor 0x100 if the process is killed, dumps core or interrupted.
X
XNote: procedure execution is NOT terminated by a SIGINT to
Xthe spawned process. It is the responsibility of the procedure
Xto process the exit status returned in $i0.
XIf $i0 is set to -1, the file transfer program did not begin.
X
X.*s 3 "sz"
Xusage: sz [-anf[l]] [<label-str>] <filelist-str>
X
XThis command invokes the ZMODEM (CRC-32 capable)
Xfile transfer protocol to send one or more files.
X
XSwitch '-n' causes the receiver to accept files with do not
Xalready exist at the remote system or which have older
Xtimes of last access that at the sending system.
X
XSwitch '-f' causes the full pathname of each file to be sent;
Xotherwise, the simple filename is transmitted.
X
XIf switch '-a' is supplied,
Xnewlines are converted to carriage return/linefeed pairs.
XIf '-a' is omitted, the file(s) are transmitted without modification.
X
XIf '-l' is supplied, then <label-str> specifies a string to
Xdisplay on the bottom of the file transfer screen. If '-l' is
Xomitted, then <label_str> must also be omitted.
X
XInteger variable $i0 receives the exit status from the transfer.
XIf 0, transfer was normal. Other $i0 values possible:
X.DS L
X 1-126: count of files not transmitted (see ~/.ecu/log)
X 127: 127 or more files not transmitted (see ~/.ecu/log)
X.DE
XOther ecusz error codes are shown here for refernce, but
Xthey are converted by ECU to printed messages and result in procedure
Xtermination.
X.DS L
X 128-192: process terminated with signal==code-128
X signal 0 == program logic error
X 253: could not open any files
X 254: protocol failed (bad line conditions,brain dead remote)
X 255: usage
X.DE
X
XNote:
Xprocedure execution IS terminated by a SIGINT to the spawned file
Xtransfer process. This is different than for versions prior to 3.10.
XIf $i0 is set to -1, the file transfer program did not begin.
X
X.*s 3 "vidcolor"
Xusage: vidcolor <type> <fcolor> [<bcolor>]
X
XThis command allows control over the internal color choices
XECU makes. <type> must be one of the following:
X
X.DS I
Xnormal - normal video color
Xreverse - reverse video color
Xnotify - color used for low key notifications such as
X "[interactive mode]" and "[procedure finished]"
Xsuccess - color used for modem CONNECT messages and other
X "success" notifications
Xalert - color used to alert user for warning or caution
X purposes
Xerror - color used to display error status or messages
X.DE
X
X<fcolor> and <bcolor> are color names as described in the description of the
X.B color
Xcommand. <fcolor> choses the foreground color and must be supplied.
X<bcolor> choses the background color and is optional; if not supplied,
Xthe background color is black.
X
XNote: The vidcolor normal and reverse options are analogs of the
X.B color
Xand
X.B
Xcolor -r
X.R
Xcommand.
X
X.DS L
XExamples: (showing ECU default internal color list)
X
X vidcolor normal lt_green
X vidcolor reverse red white
X vidcolor notify gray
X vidcolor success lt_green
X vidcolor alert yellow
X vidcolor error red
X.DE
X
X.*s 3 "vidnorm"
Xusage: vidnorm
X
XThis command causes later screen output to appear in the
Xnormal, as opposed to reverse video mode.
XThe
X.B color
Xcommand forces normal video mode.
X
X.*s 3 "vidrev"
Xusage: vidrev
X
XThis command causes later screen output to appear in the
Xreverse, as opposed to normal video mode.
XThe
X.B color
Xcommand forces normal video mode.
X
X.*s 3 "whilei"
X.DS L
Xusage: whilei <int> <rel-op> <int> <statement>
X whilei <int> <rel-op> <int>
X <statement>
X whilei <int> <rel-op> <int>
X {
X any kind or number of statements
X }
X.DE
X
XThis command executes a loop one or more statements
Xbased on a test of two integer quantities. See the
Xdescription of the
X.B break ,
X.B else ,
X.B whilei ,
Xand
X.B whiles
Xcommmands for examples of how the command is used.
X
X.*s 3 "whiles"
X.DS L
Xusage: whiles <str> <rel-op> <str> <statement>
X whiles <int> <rel-op> <int>
X <statement>
X whiles <int> <rel-op> <int>
X {
X any kind or number of statements
X }
X.DE
X
XThis command executes a loop of one or more statements
Xbased on a test of two string values. See the
Xdescription of the
X.B break ,
X.B continue ,
Xand
X.B else
Xcommmands
Xand many other examples throughout the document,
Xfor examples of how the command is used.
X
X.*s 3 "xon"
X.DS L
Xusage: xon <arg>
Xwhere <arg> is on input and output flow control
X off no flow control
X in input flow control
X out output flow control
X.DE
X
XThis command enables or disables xon/xoff flow control.
X
X.DS L
XExamples:
X
X hangup
X dial 'mysys'
X ifi %conn != 0 parity none;xon on
X.DE
SHAR_EOF
echo 'File doc/_p_cmd.txt is complete' &&
$TOUCH -am 0718163391 'doc/_p_cmd.txt' &&
chmod 0644 doc/_p_cmd.txt ||
echo 'restore of doc/_p_cmd.txt failed'
Wc_c="`wc -c < 'doc/_p_cmd.txt'`"
test 47681 -eq "$Wc_c" ||
echo 'doc/_p_cmd.txt: original size 47681, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= doc/_p_ifunc.txt ==============
if test -f 'doc/_p_ifunc.txt' -a X"$1" != X"-c"; then
echo 'x - skipping doc/_p_ifunc.txt (File already exists)'
rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting doc/_p_ifunc.txt (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'doc/_p_ifunc.txt' &&
X.*s 2 "Integer Functions"
X
X.*s 3 "%argc"
X
XThis function returns the number of arguments passes to the current
Xprocedure.
X
X
X
X.*s 3 "%baud"
X
XThis function returns the baud rate of the communications line.
XIf no line is currently attached, the baud rate returned
Xis the value of the last line attached. If no line has been attached
Xduring the current session, the default baud rate is returned.
X
X.*s 3 "%colors"
X
XThis function returns the state of the normal and reverse video
Xforeground and background colors in the 32-bit value:
X.DS I
X00000000001111111111222222222233
X01234567890123456789012345678901
X0000|--|0000|--|0000|--|0000|--|
X fg bk fg bk
X reverse normal
X.DE
X
XThe color values are obtained from the following lists:
X.DS L
X.B
X Alphabetic Order
X.R
X black 0
X blue 1
X brown 6
X cyan 3
X gray 8
X green 2
X hi_white 15
X lt_blue 9
X lt_cyan 11
X lt_green 10
X lt_magenta 13
X lt_red 12
X magenta 5
X red 4
X white 7
X yellow 14
X.DE
X
X.DS L
X.B
X Numeric Order
X.R
X black 0
X blue 1
X green 2
X cyan 3
X red 4
X magenta 5
X brown 6
X white 7
X gray 8
X lt_blue 9
X lt_green 10
X lt_cyan 11
X lt_red 12
X lt_magenta 13
X yellow 14
X hi_white 15
X.DE
X
X.*s 3 "%cols"
X
XThis function returns the screen width in columns.
XIf running non-interactively, the value will always be 80.
X
X.*s 3 "%conn"
X
XThis function returns the communications
Xline file descriptor if a connection is in progress, else 0.
XNOTE: if carrier is lost abnormally, %conn will return non-zero
Xincorrectly.
X
X.*s 3 "%curx"
X
XThis function returns the display cursor column position last set by the
Xremote system. This value does not reflect the actual hardware cursor.
X
X.*s 3 "%cury"
X
XThis function returns the display cursor row position last set by the
Xremote system. This value does not reflect the actual hardware cursor.
X
X.*s 3 "%csec"
X
XThis function returns the number of seconds ECU has been
Xconnected to a remote system. If ECU is not connected,
Xzero is returned.
X
X.*s 3 "%ctoi"
X
Xusage: %ctoi(str0)
X
XThis function returns the integer value of the first
Xcharacter in string str0. If str0 is non-empty, the return value
Xwill be between 0 and 255, inclusive. if str0 is empty,
Xthen -1 is returned.
X
X.*s 3 "%esecs"
X
Xusage: %esecs
X
XThis function , "Epoch SECondS,"
Xreturns the number of seconds since January 1, 1970 00:00 UTC
X(GMT).
X
X.*s 3 "%fatime"
X.DS L
Xusage: %fatime(int0)
X %fatime(str0)
X.DE
X
XThis function returns the time of last access of the file referenced
Xby the argument.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
XThe return value is the number of seconds since January 1, 1970
Xat 0000 UTC.
XThe
X.B %edate
Xstring function may be used to convert the integer
Xvalue to a string representation of the date and time
Xexpressed relative to the current time zone.
X
X.*s 3 "%fmode"
X.DS L
Xusage: %fmode(int0)
X %fmode(str0)
X.DE
X
XThis function returns the file mode value ("rwxrwx---" == 077)
Xof the file referenced
Xby the argument.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
X.*s 3 "%fmtime"
X.DS L
Xusage: %fmtime(int0)
X %fmtime(str0)
X.DE
X
XThis function returns the time of last modified of the file referenced
Xby the argument.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
XThe return value is the number of seconds since January 1, 1970
Xat 0000 UTC.
XThe
X.B %edate
Xstring function may be used to convert the integer
Xvalue to a string representation of the date and time
Xexpressed relative to the current time zone.
X
X.*s 3 "%fmode"
X.DS L
Xusage: %fmode(int0)
X %fmode(str0)
X.DE
X
XThis function returns the size
Xof the file referenced
Xby the argument.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
X.*s 3 "%ftell"
X
Xusage: ftell(int0)
X
XThis function returns the current file position
Xof the the file
Xopened by int0 with the
X.B fopen
Xcommand.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
X
X.*s 3 "%instr"
X
Xusage: %instr(str0,str1)
X
XThis function returns the leftmost column position withing str0
Xthat str1 is found (zero relative). If str1 cannot be found in
Xstring str0, -1 is returned. However, if str1 is null and str0 is not,
Xzero will be returned (i.e., the null string matches at the left).
X
XThe comparison is made without regard to case. See also
X.B %instr .
X
X.DS I
XExamples:
X
X 00000000001111111
X 01234567890123456
XAssume $s0='abcdefghijklmnabc'
X $s1='abc'
X $s2='gHi'
X $s3='cat'
X
X %instr($s0,$s1) returns 0
X %instr($s0,$s2) returns 6
X %instr($s0,$s3) returns -1
X %instr($s0,'bcd') returns 2
X %instr($s0,'bad') returns -1
X.DE
X
X.*s 3 "%ischr"
X.DS L
Xusage: %ischr(int0)
X %ischr(str0)
X.DE
X
XThis function returns 1 if the file referenced by the argument is a
Xcharacter special file,
Xelse 0.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
XExamples:
X
X.DS I
X%ischr('/dev/tty') returns 1
X%ischr('/usr/bin') returns 0
X%ischr('/xenix') returns 0
X.DE
X
X.*s 3 "%isdir"
X.DS L
Xusage: %isdir(int0)
X %isdir(str0)
X.DE
X
XThis function returns 1 if the file referenced by the argument is a
Xdirectory file,
Xelse 0.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
XExamples:
X
X.DS I
X%isdir('/dev/tty') returns 0
X%isdir('/usr/bin') returns 1
X%isdir('/xenix') returns 0
X.DE
X
X.*s 3 "%isreg"
X.DS L
Xusage: %isreg(int0)
X %isreg(str0)
X.DE
X
XThis function returns 1 if the file referenced by the argument is a
Xregular file,
Xelse 0.
XIf the argument is an integer, the file referenced is the file
Xopened by that number with the
X.B fopen
Xcommand.
XIf the argument is a string, it is the literal filename.
X
XIf int0 does not refer to an open file, the procedure
Xterminates with an error.
XIf the file specified by str0 does not exist, -1 is returned.
X
XExamples:
X
X.DS I
X%isreg('/dev/tty') returns 0
X%isreg('/usr/bin') returns 0
X%isreg('/xenix') returns 1
X.DE
X
X.*s 3 "%len"
X
Xusage: %len(str0)
X
XThis function returns the length of str0.
X.DS I
XExample:
X
Xset str0='abcdef',i0=%len(str0),i1=%len('1234')
Xstr00 = 'abcdef'
Xint00 = 6
Xint01 = 4
X.DE
X
X.*s 3 "%lgetc"
X
Xusage: %lgetc
X
XReads a character from the line and returns it.
X
X.*s 3 "%lines"
X
XThis function returns the screen height in lines.
XIf running non-interactively, the value will always be 25.
X
X.*s 3 "%nice"
X
Xusage: %nice
X
XThis function returns the nice value of the ECU process.
X
X.*s 3 "%pid"
X
XThis function returns the process id (pid) of ECU.
X
X.*s 3 "%match"
X
Xusage: %match(str0,str1)
X
XThis function searches string str0 for a match with the regular
Xexpression in str1 (for information on regular expressions,
Xrefer to the ed(C) manual pages).
XThe function returns the index into str0 where the
Xmatch is found or -1 if no match can be found.
XThe matching process is case sensitive.
SHAR_EOF
true || echo 'restore of doc/_p_ifunc.txt failed'
fi
echo 'End of ecu310 part 34'
echo 'File doc/_p_ifunc.txt is continued in part 35'
echo 35 > _shar_seq_.tmp
exit 0
--------------------------------------------------------------------
Warren Tucker, TuckerWare emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
Hacker Extraordinaire d' async PADs, pods, proteins and protocols
exit 0 # Just in case...
--
Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
Sterling Software, IMD UUCP: uunet!sparky!kent
Phone: (402) 291-8300 FAX: (402) 291-4362
Please send comp.sources.misc-related mail to kent@uunet.uu.net.