home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-05 | 53.4 KB | 1,910 lines |
- Newsgroups: comp.sources.misc
- From: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
- Subject: v21i087: ecu - ECU async comm package rev 3.10, Part35/37
- Message-ID: <1991Aug5.212037.8543@sparky.IMD.Sterling.COM>
- X-Md4-Signature: f4ce869e095470761c2c2e1713b08e4c
- Date: Mon, 5 Aug 1991 21:20:37 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
- Posting-number: Volume 21, Issue 87
- Archive-name: ecu/part35
- Environment: SCO, XENIX, ISC
- Supersedes: ecu3: Volume 16, Issue 25-59
-
- ---- Cut Here and feed the following to sh ----
- #!/bin/sh
- # this is ecu310.35 (part 35 of ecu310)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file doc/_p_ifunc.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" != 35; 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_ifunc.txt'
- else
- echo 'x - continuing file doc/_p_ifunc.txt'
- sed 's/^X//' << 'SHAR_EOF' >> 'doc/_p_ifunc.txt' &&
- X
- XThe variable $i0 receives the length of the matching
- Xstring in str0 if a match is found. For this reason,
- Xit is not advisable that $i0 otherwise be involved
- Xin the operation. Specifically to be avoided is:
- X.DS I
- Xset $i0=%instr(...)
- X.DE
- X.DS L
- XExamples:
- X
- X 00000000001111111
- X 01234567890123456
- XAssume $s0='abcdefghijklmnabc'
- X $s1='abc'
- X $s2='n.*'
- X
- X %match($s0,$s1) returns 0 $i0=3
- X %match($s0,$s2) returns 16 $i0=4
- X %match($s0,$s3) returns -1 $i0 unchanged
- X %match($s0,'de..h') returns 3 $i0=5
- X %match($s0,'de..H') returns -1 $i0 unchanged
- X.DE
- X
- X.*s 3 "%mhack"
- X
- Xusage: %mhack
- X
- XThis function ("Millisecond time HACK") returns the number of
- Xmilliseconds since ecu was started. It isn't a very useful
- Xvalue by itself, but differences between the values
- Xreturned by two calls to the function may be used to determine
- Xthe time between two events with the maximum accuracy the
- Xoperating system can deliver (1/HZ resolution with a bit of
- Xlatency).
- X
- X.DS L
- XExamples:
- X $i10 = %mhack
- X send 'test'
- X lookfor -e %chr(0x0A) 100
- X ifi $i0 == 0 echo 'no response in 10 seconds'
- X else echo 'response time '+%itos(%mhack - $i10)+' msec'
- X.DE
- X
- X.*s 3 "%rchr"
- X
- XThis function returns the number of characters
- Xreceived by ECU since the program starrted.
- X
- X.*s 3 "%rchrc"
- X
- XThis function returns the number of characters
- Xreceived by ECU during the current connection.
- X
- X.*s 3 "%rinstr"
- X
- Xusage: %rinstr(str0,str1)
- X
- XThis function returns the rightmost 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 14
- X %instr($s0,$s2) returns 6
- X %instr($s0,$s3) returns -1
- X.DE
- X
- X.*s 3 "%shmid"
- X
- XThis function returns the integer shared memory segment id
- Xfor the current ECU process. It may be used to pass the id
- Xto a "friend" process so that it may access the shared memory
- Xsegment (described in header file ecushm.h).
- XFor more details,
- Xrefer to an earlier section entitled "Shared Memory 'Friend' Interface."
- X
- X.DS L
- XExample:
- X
- X system 'ecufriend '+%itos(%shmid)
- X.DE
- X
- X.*s 3 "%stoi"
- X
- Xusage: %stoi(str0)
- X
- XThis function converts the contents of str0 to an
- Xinteger and returns the value.
- X
- X.*s 3 "%uid"
- X
- Xusage: %uid
- X
- XThis function returns the uid of the user.
- X
- X.*s 3 "%xchr"
- X
- XThis function returns the number of characters
- Xtransmitted by ECU since the program starrted.
- X
- X.*s 3 "%xchrc"
- X
- XThis function returns the number of characters
- Xtransmitted by ECU during the current connection.
- X
- X
- SHAR_EOF
- echo 'File doc/_p_ifunc.txt is complete' &&
- $TOUCH -am 0429171591 'doc/_p_ifunc.txt' &&
- chmod 0644 doc/_p_ifunc.txt ||
- echo 'restore of doc/_p_ifunc.txt failed'
- Wc_c="`wc -c < 'doc/_p_ifunc.txt'`"
- test 11499 -eq "$Wc_c" ||
- echo 'doc/_p_ifunc.txt: original size 11499, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= doc/_p_param.txt ==============
- if test -f 'doc/_p_param.txt' -a X"$1" != X"-c"; then
- echo 'x - skipping doc/_p_param.txt (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting doc/_p_param.txt (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'doc/_p_param.txt' &&
- X.*s 2 "Arguments"
- X
- XThere are five types of arguments to procedure commands:
- X.DS I
- XSwitch
- XAlphabetic Token
- XInteger
- XString
- XRelational Operators
- X.DE
- XThis section describes the syntax and construction of each type in turn.
- XThere are separate groups of valid of relational operators for integers
- Xand strings; thus, they are described under the appropriate sections.
- X
- X.*s 3 "Switches"
- X
- XSwitch arguments begin with a hyphen (minus, '-'). The switch
- Xargument must be the first argument after the command. Only
- Xone switch argument is allowed on the command line. If
- Xswitches '-a', '-b' and '-c', are available and '-a' and '-b'
- Xare desired, '-ab' or '-ba' is entered.
- X
- X.*s 3 "Alphabetic Tokens"
- X
- XAlphabetic tokens, for lack of a better term, are non-integer,
- Xnon-quoted terms used as arguments for certain commands, such as:
- X.DS I
- Xplog off
- X.DE
- XSuch argument types are fairly simple to understand and use; they are
- Xdescribed here for completeness.
- X
- X.*s 3 "Integers"
- X
- XInteger values are 32-bit quantities ranging between -2147483647
- Xand 2147483647.
- X
- XIn one case, an integer is used to store a 32-bit color mask as
- Xdescribed by the
- X.B color
- Xcommand and the
- X.B %colors
- Xinteger function.
- X
- X.*s 4 "Constants"
- X
- XInteger constants are numeric strings, optionally with an initial
- Xminus sign, the absolute value of which must be less than 2147483648.
- XIf the constant begins with the string "0x", it is interpreted
- Xas hexadecimal. Octal, like FORTRAN and COBOL will be dead soon; until
- Xthen, however, octal constants may be denoted by a leading "0o".
- X
- X.DS L
- XExamples:
- X 123 --> 123(10)
- X 0123 --> 123(10)
- X 0x123 --> 291(10)
- X 0o123 --> 83(10)
- X.DE
- X
- X.*s 4 "Variables"
- X
- XThere are 50 numbered, permanent integer variables referenced by
- Xthe terms '$i0' through '$i49'. When ECU is started, the value of each
- Xvariable is zero. Variables retain their
- Xvalue until changed, even between procedure executions.
- XThe integer variable number may be expressed
- Xas an expression by enclosing an integer expression in brackets.
- XFor instance:
- X.DS L
- X $i[4+5] refers to $i9
- X
- X $i2=5
- X $i[20+$i2] refers to $i25
- X.DE
- X
- XInteger variables may be created for use as "local" variables or
- Xto promote code readability. Refer to the
- X.B mkvar
- Xcommand.
- X
- X.*s 4 "Functions"
- X
- XECU has many built-in functions which return the value of ecu- or
- Xsystem-related information. A list of the functions appears in a
- Xlater section.
- X
- X.*s 4 "Expressions"
- X
- XIn almost any place an integer argument is allowed, an expression
- Xmay be supplied. Expressions are composed of two or more integer
- Xconstants or variables separated by operators from the group:
- X.DS L
- X + addition
- X - subtraction
- X * multiplication
- X / division
- X | OR
- X @ MOD
- X ^ XOR
- X & AND
- X.DE
- XEvaluation of expressions is left-to-right. Parentheses are
- Xnot allowed.
- X
- X.*s 4 "Relational Operators"
- X
- XInteger relational operators are chosen from the following group:
- X.DS L
- X = "is equal to"
- X == "is equal to"
- X != "is not equal to"
- X <> "is not equal to"
- X > "is greater than"
- X < "is greater than"
- X >= "is greater than or equal to"
- X <= "is less than or equal to"
- X.DE
- X
- X.*s 3 "Strings"
- X
- XStrings are classic concatenations of zero or more eight-bit
- Xcharacters. In general, the maximum size of a string used by
- XECU is 256 characters. The absolute maximum size is 5120 characters.
- X
- XNull in strings are poorly handled.
- XYou may be able to get away with using them, but it is not recommended.
- X
- X.*s 4 "Constants"
- X
- XString constants are formed by placing alphanumeric characters
- Xbetween single quote characters (apostrophes). The backslash ('\\')
- Xcharacter is used to "escape" certains characters (I am no nroff guru
- Xand backslashes give it gas, so):
- X.DS L
- X backslash-backslash one backslash
- X backslash-n newline
- X backslash-t tab
- X backslash-apostrophe apostrophe
- X.DE
- X
- XNOTE: ecu converts every tab in a procedure line to one space when the
- Xprocedure file is read in. Therefore, if you wish to place a tab in a string
- Xconstant, you must place it there with the \\t escape sequence.
- X
- X.*s 4 "Variables"
- X
- XThere are 50 numbered, permanent string variables referenced by
- Xthe terms '$s0' through '$s49',
- Xeach possessing a maximum length of 256 characters
- XWhen ECU is started, the value of each
- Xvariable is null (zero length). Variables retain their
- Xvalue until changed, even between procedure executions.
- XThe string variable number may be expressed
- Xas an expression by enclosing an string expression in brackets.
- XFor instance:
- X.DS L
- X $s[4+5] refers to $s9
- X
- X $s2=5
- X $s[20+$s2] refers to $s25
- X.DE
- X
- XString variables may be created for use as "local" variables or
- Xto promote code readability. Refer to the
- X.B mkvar
- Xcommand.
- XCreated variables have a life equal to the duration
- Xof the procedure which created them.
- XRegardless of the declared size of a created string variable,
- XECU will automatically grow it to a maximum of 5120 characters
- Xas necessary. Numbered (permanent) string variables have a maximum
- Xsize of 256 bytes.
- X
- X.*s 4 "Functions"
- X
- XECU has many built-in functions which return the value of ecu- or
- Xsystem-related information. A list of the functions appears in a
- Xlater section.
- X
- X.*s 4 "Expressions"
- X
- XString expressions are formed by the concatenation of string
- Xconstants, variables and function return values using the '+'
- Xoperator:
- X.DS L
- XExample:
- X 'The quick brown fox jumped over the '+$s0'+' dog at '+%time
- X.DE
- X
- X.*s 4 "Relational Operators"
- X
- XString relational operators are chosen from the following group:
- X.DS L
- X = "is equal to"
- X == "is equal to"
- X != "is not equal to"
- X <> "is not equal to"
- X.DE
- X
- SHAR_EOF
- $TOUCH -am 0525055991 'doc/_p_param.txt' &&
- chmod 0644 doc/_p_param.txt ||
- echo 'restore of doc/_p_param.txt failed'
- Wc_c="`wc -c < 'doc/_p_param.txt'`"
- test 5730 -eq "$Wc_c" ||
- echo 'doc/_p_param.txt: original size 5730, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= doc/_p_sfunc.txt ==============
- if test -f 'doc/_p_sfunc.txt' -a X"$1" != X"-c"; then
- echo 'x - skipping doc/_p_sfunc.txt (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting doc/_p_sfunc.txt (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'doc/_p_sfunc.txt' &&
- X.*s 2 "String Functions"
- X
- X.*s 3 "%argv"
- X
- Xusage: %argv(int0)
- X
- XThis function returns the string value of an argument passed
- Xto the procedure by the 'do' command. Argument 0 is the
- Xname of the procedure itself.
- XThe integer function %argc may be used to determine the
- Xnumber of arguments passed to the procedure. Specifying
- Xan argument number greater than the number of arguments
- Xpassed returns a null string (if procedure tracing is enabled
- Xwith the 'ptrace' comand, a warning will be displayed
- Xin this case).
- X.DS I
- XExample:
- X invocation from shell:
- X ecu -p test Quick Brown Fox
- X
- X invocation from interactive command line:
- X do test Quick Brown Fox
- X
- X invocation from procedure:
- X do 'test' 'Quick' 'Brown' 'Fox'
- X
- X results in:
- X %argv(0) = 'test'
- X %argv(1) = 'Quick'
- X %argv(2) = 'Brown'
- X %argv(3) = 'Fox'
- X %argv(4) = ''
- X.DE
- X
- X.B NOTE:
- Xthe interactive
- X.B dial
- Xcommand, the dialing directory menu and the initial setup menu
- Xall can automatically execute a procedure which matches
- Xa dialed
- X.B
- Xlogical telephone number.
- X.R
- XThere two arguments passed to these procedures, %argv(0) being
- Xthe procedure name as always. %argv(1) is set according to the following
- Xtable:
- X.DS I
- X invoker %argv(1)
- X------------------- -------------
- Xinitial setup menu !INITIAL
- Xinteractive dial !INTERACTIVE
- Xdialing menu !MENU
- X.DE
- XThus it is possible for the invoked procedure
- Xto determine that it has been automatically executed
- Xby testing %argv(1) for an exclamation point, or possibly
- Xthe entire argument.
- X
- X.*s 3 "%basename"
- X
- XUsage: %basename(str0,str1)
- X
- XThis function is similar to the UNIX basename(1) utility in
- Xthat it returns a filename minus a supplied suffix, if it is present.
- XUnlike the UNIX basename(C) program, %basename does not remove
- Xthe directory part of the filename.
- XSee also
- X.B %dirpart
- Xand
- X.B %filepart .
- X
- X.DS L
- XExamples:
- X
- X %basename('/u1/src/ecu/ecu.c','.c') = /u1/src/ecu/ecu
- X %basename('ecu.c','.c') = ecu
- X %basename('ecu.c','.x') = ecu.c
- X.DE
- X
- X.*s 3 "%cgetc"
- X
- Xusage: %cgetc
- X
- XThis function reads one character from the console keyboard
- Xand returns it. The character is not echoed.
- X
- X.*s 3 "%cgets"
- X
- Xusage: %cgets
- X
- XThis function reads a string from the console keyboard
- Xand returns it. Each character is echoed as it is typed
- Xand the user's normal erase and kill character is available
- Xto edit the input before terminating the read with ENTER.
- X
- X.*s 3 "%chr"
- X
- Xusage: %chr(int0)
- X
- XThis function returns the character value whose ASCII value
- Xis supplied in int0.
- X
- X.DS L
- XExample:
- X
- X set $s0 = %chr(4) places a ^D (EOT) character into $s0
- X.DE
- X
- X.*s 3 "%date"
- X
- Xusage: %date
- X
- XThis function returns the current date in the form 'mm-dd-yyyy'
- Xin the local time zone (daylight time if it applies).
- X
- X.*s 3 "%datez"
- X
- Xusage: %datez
- X
- XThis function returns the current date in the form 'mm-dd-yyyy'
- Xin the UTC (Z) time zone.
- X
- X.*s 3 "%day"
- X
- Xusage: %day
- X
- XThis function returns the current day of the week as a three character
- Xabbreviation: 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
- Xin the local time zone (daylight time if it applies).
- X
- X.*s 3 "%dayz"
- X
- Xusage: %dayz
- X
- XThis function returns the current day of the week as a three character
- Xabbreviation: 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'
- Xin the UTC (Z) time zone.
- X
- X.*s 3 "%dir"
- X
- Xusage: %dir
- X
- XThis function returns the
- Xfull pathname of the current working directory.
- X
- X.*s 3 "%dirpart"
- X
- Xusage: %dirpart(str0)
- X
- XThis function returns the
- Xdirectory portion of the pathname supplied in str0.
- XSee also
- X.B %basename
- Xand
- X.B %filepart .
- X
- X
- X.DS L
- XExamples:
- X
- X%dirpart('/u1/src/src/foo.c') = "/u1/src/src"
- X%dirpart('foo.c') = "foo.c"
- X%dirpart('/usr') = ""
- X.DE
- X
- X.*s 3 "%edate"
- X
- Xusage: %edate(int0)
- X
- XThe value in int0 is expected to be a number of seconds since January 1,
- X1970 00:00 UTC (Universal Coordinated Time) as returned by
- Xthe integer functions %fatime and %fmtime.
- XThis function converts the value into a string representing the
- Xequivalent local time in the form 'mm-dd-yyyy hh:mm:ss'.
- X.DS L
- XExample:
- X
- Xset $i0=%fmtime('/xenix')
- X$i00 = 601178971 (0x23d5435b,04365241533)
- X
- Xset $s0=%edate($i0)
- X$s00 = '01-18-1989 21:09:31'
- X.DE
- X
- X.*s 3 "%envvar"
- X
- Xusage: %envvar()
- X
- XThis function returns the string value of an environment
- Xvariable.
- X
- X.DS L
- XExample:
- X
- X set $s0=%envvar('HOME') might set $s0 '/usr/user'
- X.DE
- X.DF L
- XTypical Environment Variables:
- X
- X HOME pathname of home directory
- X EDITOR user's preferred editor
- X PATH program execution searchlist
- X TERM terminal type
- X SHELL user's preferred shell
- X MAIL user's mail box file
- X ECUPROMPT ECU interactive command prompt
- X at beginning of execution
- X.DE
- X
- X.*s 3 "%errstr"
- X
- Xusage: %errstr(int0)
- X
- XThis function returns the system error message, given int0 as an
- X.B errno
- Xas returned by a file-related command.
- X.B fopen.
- X
- X.DS L
- XExample:
- X
- X echo %errstr(1)
- X Not owner
- X.DE
- X
- X.*s 3 "%etime"
- X
- Xusage: %etime(int0)
- X
- XThis function returns a string representation of elapsed time
- Xin the format 'hh:mm:ss'
- Xfor the integer parameter int0, a number of seconds.
- X
- X.DS L
- XExample:
- X
- X echo %etime(62)
- X 00:01:02
- X.DE
- X
- X.*s 3 "%filepart"
- X
- Xusage: %filepart(str0)
- X
- XThis function returns the
- Xfilename portion of the pathname supplied in str0.
- XSee also
- X.B %basename
- Xand
- X.B %dirpart .
- X
- X.DS L
- XExamples:
- X
- X%filepart('/u1/src/src/foo.c') = "foo.c"
- X%filepart('foo.c') = "foo.c"
- X.DE
- X
- X.*s 3 "%fmodestr"
- X
- Xusage: %fmodestr(int0)
- X
- XThis function returns a string representation of the
- Xfamiliar file mode string given the file mode integer int0.
- X
- X.DS L
- XExample:
- X
- X echo %fmodestr(0100755)
- X -rwxr-xr-x
- X
- X echo %fmodestr(%fmode('/usr/lib'))
- X drwxr-xr-x
- X.DE
- X
- X.*s 3 "%itos"
- X
- Xusage: %itos(int0[,format])
- X
- XThis function converts integer int0 to a string, optionally
- Xcontrolling the format of the conversion.
- X
- XIf the format parameter is missing, the conversion is to
- Xa minimum number of decimal characters necessary to
- Xhold the result.
- X
- XIf the format parameter is present, it must of consist of
- Xa non-null string made of one or both optional parts:
- X.DS L
- X decimal number of digits to be part of result string
- X (a leading zero indicates leading zeroes are to
- X appear in the string; no leading zero pads with
- X leading spaces
- X
- X a lower case letter from the following list:
- X d - decimal conversion
- X x - hexadecimal conversion
- X o - octal conversion
- X.DE
- X.DS L
- XExample:
- X
- X %itos(33) '33'
- X %itos(33,d) '33'
- X %itos(33,x) '21'
- X %itos(33,5d) ' 33'
- X %itos(33,010d) '0000000033'
- X %itos(33,10d) ' 33'
- X %itos(33,x) '21'
- X %itos(33,04x) '0021'
- X %itos(33,4x) ' 21'
- X %itos(33,o) '41'
- X %itos(33,4o) ' 41'
- X.DE
- X
- X.*s 3 "%left"
- X
- Xusage: %left(str0,int0)
- X
- XThis function returns the leftmost int0 characters of str0.
- XIf the length of the string is less than int0,
- Xthe entire str0 is returned.
- X.DS L
- XExample:
- X
- X if $s0 == 'abcdefg'
- X %left($s0,3) returns 'abc'
- X.DE
- X
- X.*s 3 "%line"
- X
- Xusage: %line
- X
- XThis function returns the name of the attached communications
- Xline in the form "/dev/ttyxx". If no line is currently
- Xattached, the function returns null.
- X
- X.*s 3 "%logname"
- X
- Xusage: %logname
- X
- XThis function returns the login name of the user executing
- XECU. Note: the name returned is the name supplied to a login
- Xprompt, not any current su(C) username that may be in effect.
- X
- X.*s 3 "%mid"
- X
- Xusage: %mid(str0,int0[,int1])
- X
- XThis function returns the middle portion of a string str0
- Xbeginning with the character at position int0 and for a length
- Xof int1 characters.
- XIf int0 is greater than or equal to the length of
- Xstro, a null string is returned.
- XIf the optional argument int1 is not supplied, or
- Xif the length of the string is less than int1,
- Xthe entire str0 is returned.
- X.DS L
- XExample:
- X
- X if $s0 == '0123456789abc'
- X %mid($s0,3,4) returns '3456'
- X %mid($s0,3) returns '3456789abc'
- X %mid($s0,10,2) returns 'ab'
- X %mid($s0,10,5) returns 'abc'
- X.DE
- X
- X.*s 3 "%month"
- X
- Xusage: %month
- X
- XThis function returns the current month as a three character
- Xabbreviation: 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'.
- X
- X.*s 3 "%rdesc"
- X
- Xusage: %rdesc
- X
- XThis function returns the
- Xdescription
- Xportion of the
- Xdialing directory entry for the currently connected remote.
- XIf no connection exists, the function returns null.
- X
- X.*s 3 "%right"
- X
- Xusage: %right(str0,int0)
- X
- XThis function returns the rightmost int0 characters of str0.
- XIf the length of the string is less than int0,
- Xthe entire str0 is returned.
- X.DS L
- XExample:
- X
- X if $s0 == 'abcdefg'
- X %right($s0,3) returns 'efg'
- X.DE
- X
- X.*s 3 "%rname"
- X
- Xusage: %rname
- X
- XThis function returns the
- Xlogical name
- Xportion of the
- Xdialing directory entry for the currently connected remote.
- XIf the remote was dialed directly, as in dial 5551212, the
- Xreturned value is the phone number.
- XIf no connection exists, the function returns null.
- X
- XThe value returned by this command may be overridden by use of the
- X.B rname
- Xprocedure command.
- X
- X.*s 3 "%rtelno"
- Xusage: %rtelno
- X
- XThis function returns the
- Xtelephone number
- Xportion of the
- Xdialing directory entry for the currently connected remote.
- XIf no connection exists, the function returns null.
- X
- X.*s 3 "%time"
- X
- Xusage: %time
- X
- XThis function returns the current time in the form 'hh:mm'
- Xin the local time zone (daylight time if it applies).
- X
- X.*s 3 "%times"
- X
- Xusage: %times
- X
- XThis function returns the current time in the form 'hh:mm:ss'
- Xin the local time zone (daylight time if it applies).
- X
- X.*s 3 "%timez"
- X
- Xusage: %timez
- X
- XThis function returns the current time in the form 'hh:mm'
- Xin the UTC (Z) time zone.
- X
- X.*s 3 "%timezs"
- X
- Xusage: %timezs
- X
- XThis function returns the current time in the form 'hh:mm:ss'
- Xin the UTC (Z) time zone.
- X
- X.*s 3 "%tty"
- X
- Xusage: %tty
- X
- XThis function returns the console tty name in the form "/dev/ttynn".
- X
- SHAR_EOF
- $TOUCH -am 0429171591 'doc/_p_sfunc.txt' &&
- chmod 0644 doc/_p_sfunc.txt ||
- echo 'restore of doc/_p_sfunc.txt failed'
- Wc_c="`wc -c < 'doc/_p_sfunc.txt'`"
- test 9865 -eq "$Wc_c" ||
- echo 'doc/_p_sfunc.txt: original size 9865, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= doc/_proc.txt ==============
- if test -f 'doc/_proc.txt' -a X"$1" != X"-c"; then
- echo 'x - skipping doc/_proc.txt (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting doc/_proc.txt (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'doc/_proc.txt' &&
- X.*s 1 "Procedures"
- X
- XProcedures are "programs" or "scripts" written in an addled but
- Xadequate language which ECU executes upon demand.
- XAn "initial procedure" may be executed when ECU starts up (see
- Xthe description of the -p command line switch). Certain special
- Xprocedures are executed automatically as described below in the
- Xsection "Special Procedures."
- X
- X.*s 2 "Procedures"
- X
- XThe procedures themselves are source files consisting of
- Xthe procedure "name" with an extension of ".ep".
- XWhen executing a procedure by name,
- X.DS I
- Xdo name interactive
- X-or-
- Xdo 'name' from insikde a procedure
- X.DE
- Xis sufficient if the procedure is in the current directory,
- Xthe user's ~/.ecu directory or in the ECU library
- Xdirectory (normally /usr/local/lib/ecu). Procedure files
- Xare search for in the above order, so you may have
- Xa system default in the lib directory, a user default
- Xin the ~/.ecu directory and a specific version in the current
- Xdirectory all by the same name.
- X
- XMany example procedures, some useful, some not so,
- Xare found in the models subdirectory of the release.
- XThere are also several complrete procedures and many fragments
- Xused as examples throughout the following sections.
- X
- X.*s 2 "Line Syntax (Labels, Commands and Comments)"
- XLines in a procedure
- Xconsist of an optional label, followed by optional commands and
- Xarguments. Anything on a line after an octothorpe (#) outside
- Xof quote marks is ignored (read "# is the comment character.")
- X
- XLabels must begin in column one. Commands must have white space
- Xbefore them. A label may appear on a line by itself or with a comment
- Xappended. A common mistake I make (from writing too much C) is
- Xto append a colon to a label derclaration; this does not work unless
- Xyou also "goto LABEL:". Labels are not allowed inside braces
- X(inside if compound statements). You may get away with it sometimes
- Xbecause the procedure language processor is written for speed, not
- Xpolitical correctness.
- X
- X.so _p_param.txt
- X
- X.so _p_cmd.txt
- X
- X.so _p_ifunc.txt
- X
- X.so _p_sfunc.txt
- X
- X.*s 2 "Special Procedures"
- X
- XECU provides for special "hook" procedures to be executed
- Xat certain times. Their use is encouraged, but you must
- Xtake precautions not to excecute any unreasoable commands
- Xin them, for the are rather "raw" hooks and it is easily possible
- Xto confuse ECU by performing illogical operations in them.
- XJudicious use can, however, be quite productive.
- X
- XThey are searched for in the same manner
- Xas any other procedure, so you can have a
- Xcustomised version of them in a working directory and a default
- Xin your ~/.ecu subdirectory. No error is reported if they are not found.
- X
- X.*s 3 "_rc.ep"
- X
- XAfer ECU is initialized, but before it presents the setup
- Xscreen or executes a -p initial procedure,
- Xprocedure '_rc' is executed with no arguments.
- X(It is named in the tradition of /etc/rc, .mailrc, etc..)
- XThis procedure can be used to customize the ecu environment
- Xprior to beginning the usual operation. This is not a place
- Xto do any dialing or long-lived operations, nor is it possible to
- Xbypass the setup screen: for this, use the -p initial procedure.
- X
- XThe %getenv() function may be useful in here (Am I running on an
- Xxterm? Do I want to change the default ECUPROMPT?).
- X
- XIf _rc.ep returns a non-zero status or fails (due to syntax or
- Xother error), ecu terminates immediately.
- X
- X.*s 3 "_connect.ep"
- X
- XThis procedure is executed after every connection success
- Xafter the CONNECT message ("result code") is printed.
- XIt is passed one argument, the "result code" string
- Xgenerated by the dialer function (e.g., "CONNECT 19200").
- X
- XYou may use %rname and other functions and features to customize
- Xthis function based on the particular system just reached. Note
- Xthat integer variable $i0 and string variable $s0 set zero prior
- Xto executing the function. This function may modify the behavior
- Xof coorperating dialer functions by setting the value of numbered
- Xstring or integer variables. In particular, the dialer function
- Xwill inherit the values of $i0 and $s0 when this special function
- Xterminates.
- X.B
- XBe careful of what you do in here since MANY ecu procedure commands
- Xaffect $i0 and $s0 as a side effect of their operation.
- X.R
- XEven if you know what you do in _connect.ep does not modify $i0
- Xor $s0, use of the preservation technique shown in the example
- Xbelow may save you headaches if you add to the function in the
- Xfuture (long after you have forgotten this pedantic admonition).
- X
- XIf this procedure fails (abnormal procedure termination
- Xor non-zero return code), ECU hangs up on the line and proceeds
- Xas if the connection failed.
- X
- X.DS L
- XExample:
- X#+------------------------------------------------------------------
- X# _connect.ep - post-CONNECT special "hook" procedure
- X#-------------------------------------------------------------------
- X#+:EDITS:
- X#:07-13-1991-14:47-wht@n4hgf-creation
- X
- X $iv0_save = $i0 # it is a VERY good idea to save the dialer
- X $sv0_save = $s0 # function return status
- X # since gobs of functions and commands modify $i0
- X # and/or $s0 as a side effect of their operation
- X
- X $s30 = '_connect '+%rname+' ('+%argv(1)+')'
- X echo $s30 # this still will also live to be visible by
- X # the dialer function
- X
- X ifi %baud > 2400
- X {
- X xon off # turn XON/XOFF off first, then ...
- X rtscts on # turn on RTS/CTS
- X }
- X else
- X {
- X rtscts off # turn off RTS/CTS, then ...
- X xon on # turn XON/XOFF on
- X }
- X
- X $i0 = $iv0_save # restore dialer return status
- X $s0 = $sv0_save
- X.DE
- X
- X.*s 3 "_connfail.ep"
- X
- XThis procedure is executed after every connection failure after
- Xthe failure message ("result code") is printed. It is passed two
- Xarguments, the logical system name (the dial directory
- Xentry name or the phone number)
- Xand the "result code" string generated by the dialer
- Xfunction (e.g., "BUSY"). The function is called after $i0 has
- Xbeen set to 1 and $s0 has been set to the result code. This
- Xfunction may modify the behavior of coorperating dialer functions
- Xby setting the value of numbered string or integer variables. In
- Xparticular, the dialer function will inherit the values of $i0
- Xand $s0 when this special function terminates.
- X.B
- XBe careful of what you do in here since MANY ecu procedure commands
- Xaffect $i0 and/or $s0 as a side effect of their operation.
- X.R
- XSee _connect.ep above for further screams and moans.
- X
- X]If you get very involved with using this procedure, you'll sooner
- Xor later run into some undocumented $so values. You'll have to
- Xtake a look at ecuDCE.c and hdbintf.c
- Xfor an authoritative reference, but perhaps
- Xyou can get along by knowing that result codes with an exclamation point
- Xas their first character are generated by ECU.
- X
- XECU ignores any failure (abnormal procedure termination
- Xor non-zero return code) resulting from the execution of this procedure.
- X
- X.*s 3 "_hangup.ep"
- X
- XThis procedure is executed after every connection termination.
- XIt is passed one argument, a string representation
- Xof the number of seconds you were connected.
- XYou may use %rname and other functions and features
- Xto customize this function based on the particular system
- Xjust reached. ECU ignores any error
- Xreturned by the procedure.
- XECU ignores any failure (abnormal procedure termination
- Xor non-zero return code) resulting from the execution of this procedure.
- SHAR_EOF
- $TOUCH -am 0715141291 'doc/_proc.txt' &&
- chmod 0644 doc/_proc.txt ||
- echo 'restore of doc/_proc.txt failed'
- Wc_c="`wc -c < 'doc/_proc.txt'`"
- test 7302 -eq "$Wc_c" ||
- echo 'doc/_proc.txt: original size 7302, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= doc/_startup.txt ==============
- if test -f 'doc/_startup.txt' -a X"$1" != X"-c"; then
- echo 'x - skipping doc/_startup.txt (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting doc/_startup.txt (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'doc/_startup.txt' &&
- X.*s 1 "Starting the Program"
- X
- X.*s 2 "Simple Startup - Initial Setup Menu"
- X
- XECU may be started in a number of ways through use of
- Xcommand line switches, but the easiest is to enter
- X.DS I
- Xecu
- X.DE
- Xby itself.
- XIn this case, the screen is cleared
- Xand the folowing screen will be presented.
- X
- X
- X.DS L
- X
- X .--[ ecu 1.96 Copyright 1986,1989, W. Tucker ]-----------------.
- X | |
- X | Name/phone number to call: ___________________ |
- X | |
- X | |
- X | tty: /dev/tty1a |
- X | |
- X | duplex: F baud: 2400 parity:N (data bits 8) |
- X | Add NL to transmitted CR: N |
- X | Add NL to received CR: N |
- X | |
- X | |
- X | TAB:next ^B:prev END:proceed ^D:phone dir ESC:quit ecu |
- X `- logical phone directory entry, phone number or empty -------'
- X
- X
- X.DE
- X
- X.*s 3 "Name/Phone Number Field"
- X
- XIf a dialing directory has been configured,
- Xa literal phone number need not be entered.
- XHowever, on your first invocation, you'll very likely have
- Xno directory. Therefore, you have three options:
- X
- X.DS I
- X1. Enter a literal telephone number, (e.g. 18005551212).
- X Hyphens and open and close parentheses may also
- X be entered.
- X
- X2. Press ENTER to skip the 'Name/phone' field and enter
- X ^D to enter the telephone directory to enter your
- X first directory entry.
- X
- X3. Press END to enter interactive mode and use the Dial
- X interactive command to dial a literal telephone num-
- X ber or to enter the dialing directory.
- X.DE
- X
- X.*s 3 "Other Fields"
- X
- XThe 'tty' field may be used to select an
- Xoutgoing line
- Xother than the default
- X/dev/tty1a.
- XNote: only the last two characters of the tty name
- Xneed be entered. The remainder of the tty name
- Xis assumed to be '/dev/tty'.
- X
- XThe 'duplex' field may be used to select a
- Xduplex value other than the default 'F' (full).
- X
- XThe 'baud' field may be used to select a
- Xbaud rate value other than the default 2400.
- X
- XThe 'parity' field may be used to select a
- Xparity value other than the default 'N' (none).
- X
- X
- XThe 'Add NL to transmitted CR' and 'Add NL to received CR'
- Xfields are usually left defaulted to 'N' (no). If you
- Xwill be communicating with a terminal (with a human), you
- Xwill usually need to set both of these fields to 'Y' as
- Xwell as to select 'H'alf duplex.
- X
- X.*s 3 "Special Characters"
- X
- XSpecial keyboard characters while filling in the
- Xstartup screen are:
- X
- X
- X.DS I
- X TAB move to next field ... if nothing typed in
- X the field, do not disturb contents
- X
- X ^B back up to previous field
- X
- X END proceed with session, dialing remote if
- X logical directory entry name or literal
- X telephone number enetered
- X
- X ^D enter phone directory
- X
- X ESC quit ecu without any communications
- X.DE
- X
- X.*s 2 "Command Line Arguments and Switches"
- X
- XECU can be started in a number of ways:
- X
- X.DS I
- Xecu [-lxx] [-b<baud>] [-h] [-e|-o] [-t] <tel-number>
- Xecu [-lxx] [-b<baud>] [-h] [-e|-o] [-t]
- Xecu [-t] [-h] <logical>
- Xecu [-lxx] [-b<baud>] [-h] [-e|-o] [-d] [-D] -p <proc> [<arg> ...]
- X.DE
- X
- X.*s 3 "Non-Switch Arguments"
- X
- XOnly one type of non-switch argument may be used on the command line.
- X<tel-number> or <logical> may appear when the -p switch is absent.
- XOne or more <arg> arguments may appear when the -p switch is used.
- X
- X.*s 3 "<tel-number>"
- X
- XThis type of argument has a digit as its initial character and
- Xrepresents an actual telephone number to be passed to a modem
- Xdialer program or Dialers chat script. The string may contain
- Xnon-numeric characters if appropriate for a dialer program,
- Xsuch as dialTBIT. For example:
- X.DS L
- X ecu -l/dev/tty2a -b 19200 -e 5551212UC
- X.DE
- Xuses tty2a (assumed to be connected to a Trailblazer modem) and
- Xestablishes a 19200 baud, even parity PEP Compressed connection
- Xafter dialing 5551212.
- X
- X.*s 3 "<logical>"
- X
- XThis type of argument has an alphabetic initial character and
- Xcauses the dialing directory entry by that name to be dialed.
- XThe line may be specified by '-l', but if the dialing directory
- Xspecifies a line (tty field contaions other than 'Any'), the
- Xdialing directory entry will override it. The '-b', '-e' and '-o'
- Xswitches are ignored; the values specified by the dialing directory
- Xentry are used. The '-t' and '-h' switches are valid and honored
- Xif present.
- X
- X.*s 3 "<arg>"
- X
- XThis type of argument is passed to an initial procedure when
- Xthe -p switch is present.
- X
- X.DS L
- Xecu -p unixlogin user pwd ansi43
- X.DE
- Xexecutes unixlogin.ep with arguments 'user' 'pwd' 'ansi43'
- X
- XFor more detail, refer to the description of -p, -d and -D below.
- X
- X.*s 3 "-l"
- X
- XWhen ECU starts up, it normally chooses a line as described later
- Xin the section titled "Choosing a Dialout Line".
- XSpecifying the -l switch can suggest that the program
- Xchoose a specific line. The argument to the switch is the
- Xlast two charcters of the ttyname; e.g., "-l1a".
- X
- XOn a system with HoneyDanBerr UUCP,
- Xto access a device which does not appear in the Devices file,
- Xit may be necessary to explicitly specify the device with -l.
- X
- X.*s 3 "-f"
- XNormally, ECU starts up in the full duplex mode.
- XIf half duplex is desired, the
- X.B
- X-f switch
- X.R
- Xis used.
- X
- X.*s 3 "-e, -o"
- X
- XNormally, ECU starts up with 8 data bits and no parity.
- XIf even parity is desired, the
- X.B
- X-e switch
- X.R
- Xis specified.
- XIf odd parity is desired, the
- X.B
- X-o switch
- X.R
- Xis specified.
- X
- XThese switches
- X
- X.*s 3 "-p <procname>"
- X
- XThe
- X.B
- X-p switch
- X.R
- Xcauses ECU to execute the procedure <procname> ("<procname>.ep")
- Ximmediately. Such a procedure is termed the
- X.B
- Xinitial procedure.
- X.R
- XAll non-switch arguments after <procname> are passed as arguments
- Xto the initial procedure (see the descriptions of the
- Xinteger function
- X.B %argc
- Xand the string function
- X.B %argv ).
- X
- X.*s 3 "-d"
- X
- XThe
- X.B
- X-d switch
- X.R
- Xinstructs ECU to "die" (terminate with error status) if
- Xan initial procedure (-p) fails. This switch ensures a batch
- XECU execution will hang up any connection and terminate if
- Xa procedure error occurs. See also -D below.
- X
- XAbsence of the
- X.B -d
- Xand
- X.B -D
- Xswitches
- Xcauses ecu (upon any completion of the
- Xinitial procedure) to enter the 1) interactive mode if a line
- Xwas successfully attached by the procedure or 2) the setup menu
- Xif no line was attached.
- X
- X.*s 3 "-D"
- X
- XThe
- X.B
- X-D switch
- X.R
- Xinstructs ECU to unconditionally terminate when an
- Xinitial procedure finishes.
- X
- X.*s 3 "-t"
- X
- XThe
- X.B
- X-t switch
- X.R
- Xinstructs ECU to map incoming and outgoing carriage
- Xreturns to carriage return/line feed pairs.
- XThis is helpful if the remote connection will be to a
- Xterminal with a human operator. Use of the
- X.B
- X-h switch
- X.R
- Xis probably also necessary.
- X
- X.*s 3 "-A"
- X
- XNormally, ECU reads the terminal type (TERM environment
- Xvariable) to determine whether or not
- Xa terminal is "ANSI"-like or not. -A forces ECU to treat the
- Xterminal as an ANSI terminal, regardless of the contents
- Xof the $TERM string.
- X
- X.*s 3 "-N"
- X
- XThis switch forces ECU to treat the terminal as a non-ANSI
- Xterminal. It has the opposite effect of -A. You must have
- Xa valid function key recognition entry for the $TERM type
- Xif this switch is used.
- X
- X.*s 2 "Environment Variables"
- X
- XPrior to starting ECU, it is useful, but not necessary,
- Xto establish two environment variables, ECUPROMPT and ECUHELP.
- X
- X.*s 3 "ECUPROMPT"
- X
- XThe ECUPROMPT environment variable determines the prompt printed
- Xby ECU when the interactive command key ("HOME") is pressed.
- XWhen you first run ECU, try setting it to your name, e. g.,
- X.DS I
- Xsetenv ECUPROMPT Ralph if you use csh
- X
- XECUPROMPT=Ralph if you use sh, ksh, etc.
- Xexport ECUPROMPT
- X.DE
- XThen, when you see how it used, you may wish to
- Xestablish a more permanent choice in your .login or .profile.
- X
- X.*s 3 "ECUHELP"
- X
- XOrdinarily, ECU looks for interactive command help information
- Xin "/usr/lib/ecu/ecuhelp.data".
- XThe ECUHELP environment may be set to the complete
- Xpathname of the ecu help file if an alternate file
- Xis to be used.
- X
- XThe help file is explained later in the section
- Xtitled "Online Command Dictionary".
- X
- SHAR_EOF
- $TOUCH -am 0528125391 'doc/_startup.txt' &&
- chmod 0644 doc/_startup.txt ||
- echo 'restore of doc/_startup.txt failed'
- Wc_c="`wc -c < 'doc/_startup.txt'`"
- test 8276 -eq "$Wc_c" ||
- echo 'doc/_startup.txt: original size 8276, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= doc/_top.txt ==============
- if test -f 'doc/_top.txt' -a X"$1" != X"-c"; then
- echo 'x - skipping doc/_top.txt (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting doc/_top.txt (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'doc/_top.txt' &&
- X
- X.de *s
- X.H "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
- X.br
- X..
- X.po 4
- X.ll 7.2i
- X.ls 1
- X.nh
- X.tp
- X.sp 2i
- X.ft B
- X.ce 10
- XECU 3.10
- X
- X(Extended Call Utility)
- X.ce 0
- X.sp 1i
- X.ce 100
- XProfessional and Engineering
- XAsynchronous Communications Package
- Xfor UNIX and XENIX System V
- X.ce 0
- X.ft P
- X.sp 2i
- X.lp
- X.ce 1
- XWarren H. Tucker, III <wht@n4hgf.Mt-Park.GA.US>
- X.sp 1i
- X.ce 100
- XTechnical Description
- XRevision 3.10
- X\n(mo/\n(dy/\n(yr
- X.ce 0
- X.ls 1
- X.PH "'ECU Technical Description''%'"
- X.PF "'Public Domain by wht@n4hgf''\n(mo/\n(dy/\n(yr'"
- X.nr si 2n
- X.nr Cl 9
- X.nr Ej 1
- X.nr U 1
- X.SA 0
- X.ul
- X.bp 1
- X
- SHAR_EOF
- $TOUCH -am 0712142291 'doc/_top.txt' &&
- chmod 0644 doc/_top.txt ||
- echo 'restore of doc/_top.txt failed'
- Wc_c="`wc -c < 'doc/_top.txt'`"
- test 561 -eq "$Wc_c" ||
- echo 'doc/_top.txt: original size 561, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= doc/ecu.txt ==============
- if test -f 'doc/ecu.txt' -a X"$1" != X"-c"; then
- echo 'x - skipping doc/ecu.txt (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting doc/ecu.txt (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'doc/ecu.txt' &&
- X.so _top.txt
- X
- X.so _intro.txt
- X
- X.so _basic.txt
- X
- X.so _features.txt
- X
- X.so _startup.txt
- X
- X.so _icmd.txt
- X
- X.so _proc.txt
- X
- X.so _hdb.txt
- X
- X.so _end.txt
- SHAR_EOF
- $TOUCH -am 0718160491 'doc/ecu.txt' &&
- chmod 0644 doc/ecu.txt ||
- echo 'restore of doc/ecu.txt failed'
- Wc_c="`wc -c < 'doc/ecu.txt'`"
- test 140 -eq "$Wc_c" ||
- echo 'doc/ecu.txt: original size 140, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= doc/exits.txt ==============
- if test -f 'doc/exits.txt' -a X"$1" != X"-c"; then
- echo 'x - skipping doc/exits.txt (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting doc/exits.txt (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'doc/exits.txt' &&
- X
- X
- X.de *s
- X.H "\\$1" "\\$2" \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
- X.br
- X..
- X.po 4
- X.ll 7.2i
- X.ls 1
- X.nh
- X.tp
- X.sp 2i
- X.ft B
- X.ce 10
- XECU 3.10
- X
- X(Extended Call Utility)
- X.ce 0
- X.sp 1i
- X.ce 100
- XProfessional and Engineering
- XAsynchronous Communications Package
- Xfor UNIX and XENIX System V
- X.ce 0
- X.ft P
- X.sp 2i
- X.lp
- X.ce 1
- XWarren H. Tucker, III <wht@n4hgf.Mt-Park.GA.US>
- X.sp 1i
- X.ce 100
- XExit Codes
- XRevision 3.10
- X\n(mo/\n(dy/\n(yr
- X.ce 0
- X.ls 1
- X.PH "'ECU Exit Codes''%'"
- X.PF "'Public Domain by wht@n4hgf''\n(mo/\n(dy/\n(yr'"
- X.nr si 2n
- X.nr Cl 9
- X.nr Ej 1
- X.nr U 1
- X.SA 0
- X.ul
- X.bp 1
- X
- X.*s 1 "Exit Codes"
- X
- XWhen ECU exits (terminates execution),
- Xit uses a code from the following table:
- X.DS L
- XOK 0 no error
- XSIG1 1 SIGHUP (signal 1)
- XSIGN 64 signal 64 - see below
- XLINE_READ_ERROR 129 could not read from attached line
- XXMTR_WRITE_ERROR 130 could not write to attached line
- XXMTR_LOGIC_ERROR 131 software logic error
- XBSD4_IOCTL 132 not currently used
- XSHM_ABL 133 not currently used
- XSHM_RTL 134 not currently used
- XNO_FORK_FOR_RCVR 135 could not fork receiver process
- XTTYIN_READ_ERROR 136 could not read from console
- XLINE_OPEN_ERROR 137 could not attach (open) requested line
- XPWENT_ERROR 138 error in /etc/passwd processing
- XUSAGE 139 command line syntax error
- XCONFIG_ERROR 140 missing or erroroenous configuration file
- XINIT_PROC_ERROR 192 initial procedure terminated in error
- XUSER1 193 exit procedure command called with 1
- XUSERN 223 exit procedure command called with 31
- X.DE
- X
- XThe logical names 'SIG1' and 'SIGN' refer to a range of error codes
- Xsignifying ecu termination due to a signal. A larger range (64) is
- Xreserved than is necessary to handle reasonable expansion of
- XSIG values in the OS. Not all signals will be reported
- Xin this manner. ECU will never report status 9 (signal 9, SIGKILL),
- Xfor instance.
- X
- XThe logical names 'USER1' and 'USERN' refer to a range of error
- Xexits codes reserved for use by the 'exit' procedure command.
- XSee the description of this command for more information.
- X
- XFor ecu friend code,
- Xformal C #define identifiers for exit codes may be found in
- Xecuhangup.h and consist of the above logical names prefixed with 'HANGUP_'.
- X
- SHAR_EOF
- $TOUCH -am 0712142291 'doc/exits.txt' &&
- chmod 0644 doc/exits.txt ||
- echo 'restore of doc/exits.txt failed'
- Wc_c="`wc -c < 'doc/exits.txt'`"
- test 2303 -eq "$Wc_c" ||
- echo 'doc/exits.txt: original size 2303, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= doc/runoff ==============
- if test -f 'doc/runoff' -a X"$1" != X"-c"; then
- echo 'x - skipping doc/runoff (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting doc/runoff (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'doc/runoff' &&
- X#!/bin/csh
- Xunset noclobber
- Xecho 'nroff -mm ecu.txt | col > ecu.man'
- Xnroff -mm ecu.txt |& col > ecu.man
- X
- Xecho 'nroff -mm exits.txt | col > exits.man'
- Xnroff -mm exits.txt |& col > exits.man
- SHAR_EOF
- $TOUCH -am 0521210291 'doc/runoff' &&
- chmod 0755 doc/runoff ||
- echo 'restore of doc/runoff failed'
- Wc_c="`wc -c < 'doc/runoff'`"
- test 188 -eq "$Wc_c" ||
- echo 'doc/runoff: original size 188, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= models/_connect.ep ==============
- if test ! -d 'models'; then
- echo 'x - creating directory models'
- mkdir 'models'
- fi
- if test -f 'models/_connect.ep' -a X"$1" != X"-c"; then
- echo 'x - skipping models/_connect.ep (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting models/_connect.ep (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'models/_connect.ep' &&
- X#+------------------------------------------------------------------
- X# _connect.ep - CONNECT special "hook" procedure
- X#
- X# %argv(1) - result code
- X#-------------------------------------------------------------------
- X#+:EDITS:
- X#:07-13-1991-14:47-wht@n4hgf-creation
- X
- X return # skip this unless you want it
- X
- X $iv0_save = $i0 # it is a VERY good idea to save the dialer
- X $sv0_save = $s0 # function return status
- X # since gobs of functions and commands modify $i0
- X # as a side effect of their operation
- X
- X echo 'connected to '+%rname+' result: "'+%argv(1)+'"'
- X
- X $i0 = $iv0_save # restore dialer return status
- X $s0 = $sv0_save
- SHAR_EOF
- $TOUCH -am 0715135291 'models/_connect.ep' &&
- chmod 0644 models/_connect.ep ||
- echo 'restore of models/_connect.ep failed'
- Wc_c="`wc -c < 'models/_connect.ep'`"
- test 682 -eq "$Wc_c" ||
- echo 'models/_connect.ep: original size 682, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= models/_connfail.ep ==============
- if test -f 'models/_connfail.ep' -a X"$1" != X"-c"; then
- echo 'x - skipping models/_connfail.ep (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting models/_connfail.ep (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'models/_connfail.ep' &&
- X#+------------------------------------------------------------------
- X# _connfail.ep - connection failure special "hook" procedure
- X#
- X# %argv(1) - system name
- X# %argv(2) - result code
- X#
- X# Its is also very likely $s0 will == %argv(1)
- X#-------------------------------------------------------------------
- X#+:EDITS:
- X#:07-13-1991-14:47-wht@n4hgf-creation
- X
- X return # skip this unless you want it
- X
- X $iv0_save = $i0 # it is a VERY good idea to save the dialer
- X $sv0_save = $s0 # function return status
- X # since gobs of functions and commands modify $i0
- X # as a side effect of their operation
- X
- X echo 'failed to connect to '+%argv(1)+' result: "'+%argv(2)+'"'
- X
- X $i0 = $iv0_save # restore dialer return status
- X $s0 = $sv0_save
- SHAR_EOF
- $TOUCH -am 0715135391 'models/_connfail.ep' &&
- chmod 0644 models/_connfail.ep ||
- echo 'restore of models/_connfail.ep failed'
- Wc_c="`wc -c < 'models/_connfail.ep'`"
- test 781 -eq "$Wc_c" ||
- echo 'models/_connfail.ep: original size 781, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= models/_hangup.ep ==============
- if test -f 'models/_hangup.ep' -a X"$1" != X"-c"; then
- echo 'x - skipping models/_hangup.ep (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting models/_hangup.ep (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'models/_hangup.ep' &&
- X#+------------------------------------------------------------------
- X# _hangup.ep - hangup special "hook" procedure
- X#-------------------------------------------------------------------
- X#+:EDITS:
- X#:07-13-1991-14:47-wht@n4hgf-creation
- X
- X return # skip this unless you want it
- X
- X $i0 = %stoi(%argv(1))
- X $s0 = %etime($i0)
- X echo '_hangup on '+%rname+' after '+$s0+' connect'
- SHAR_EOF
- $TOUCH -am 0715135391 'models/_hangup.ep' &&
- chmod 0644 models/_hangup.ep ||
- echo 'restore of models/_hangup.ep failed'
- Wc_c="`wc -c < 'models/_hangup.ep'`"
- test 382 -eq "$Wc_c" ||
- echo 'models/_hangup.ep: original size 382, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= models/bsd_uname.ep ==============
- if test -f 'models/bsd_uname.ep' -a X"$1" != X"-c"; then
- echo 'x - skipping models/bsd_uname.ep (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting models/bsd_uname.ep (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'models/bsd_uname.ep' &&
- X# CHK=0xFD46
- X#--------------------------------------------------------------
- X# bsd_uname.ep - get remote username from bsd system
- X# return: $s0 = username
- X# $i0 = 1 if success, else 0
- X#--------------------------------------------------------------
- X#+:EDITS:*/
- X#:07-11-1989-16:55-wht-get cmd became lgets
- X#:06-28-1989-19:36-wht-use named variables
- X#:06-25-1989-13:56-wht-new do command syntax
- X#:06-25-1989-12:33-wht-new if/while syntax
- X#:06-22-1989-13:30-wht-creation
- X
- X set $s0='whoami' # send command
- X do 'oneline' # get $s0=username
- X ifi $i0 == 0 # we bombed?
- X {
- X set $i0=%colors; color red
- X echo 'bsd_uname: get user name failed'
- X icolor $i0
- X $i0 = 0
- X }
- X
- SHAR_EOF
- $TOUCH -am 0429171591 'models/bsd_uname.ep' &&
- chmod 0644 models/bsd_uname.ep ||
- echo 'restore of models/bsd_uname.ep failed'
- Wc_c="`wc -c < 'models/bsd_uname.ep'`"
- test 673 -eq "$Wc_c" ||
- echo 'models/bsd_uname.ep: original size 673, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= models/colors ==============
- if test -f 'models/colors' -a X"$1" != X"-c"; then
- echo 'x - skipping models/colors (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting models/colors (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'models/colors' &&
- X#colors - ecu color file
- Xnormal lt_cyan black
- Xreverse red white
- Xnotify black gray
- Xsuccess lt_green black
- Xalert yellow black
- Xerror red black
- SHAR_EOF
- $TOUCH -am 0429171591 'models/colors' &&
- chmod 0644 models/colors ||
- echo 'restore of models/colors failed'
- Wc_c="`wc -c < 'models/colors'`"
- test 140 -eq "$Wc_c" ||
- echo 'models/colors: original size 140, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= models/dir ==============
- if test -f 'models/dir' -a X"$1" != X"-c"; then
- echo 'x - skipping models/dir (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting models/dir (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'models/dir' &&
- X/tmp
- X/usr/tmp
- SHAR_EOF
- $TOUCH -am 0429171591 'models/dir' &&
- chmod 0644 models/dir ||
- echo 'restore of models/dir failed'
- Wc_c="`wc -c < 'models/dir'`"
- test 14 -eq "$Wc_c" ||
- echo 'models/dir: original size 14, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= models/f.ep ==============
- if test -f 'models/f.ep' -a X"$1" != X"-c"; then
- echo 'x - skipping models/f.ep (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting models/f.ep (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'models/f.ep' &&
- X# CHK=0x1C17
- X#+------------------------------------------------------
- X# f.eq - colorful finger on remote BSD system
- X#-------------------------------------------------------
- X#+:EDITS:*/
- X#:07-11-1989-16:55-wht-get cmd became lgets
- X#:06-30-1989-18:53-wht-creation
- X
- X mkvar $icolor; $icolor = %colors
- X mkvar $itimeout; $itimeout = 50
- X send %argv(0)
- X lookfor '\n' 40
- X $s0 = ''
- X whilei 1==1
- X {
- X lgets $s00 $itimeout 5 '\n'
- X ifi $i0 == 0 continue
- X ifi %instr($s0,'% ') >= 0 break # prompt ends it
- X $itimeout = 20
- X color cyan
- X ifi %instr($s0,'Login') == 0 color gray
- X ifi %instr($s0,' i29 ') > 0 color green
- X ifi %instr($s0,' i13 ') > 0 color red
- X ifi %instr($s0,'cma') == 0 color yellow
- X ifi %instr($s0,'gfp') == 0 color lt_blue
- X ifi %instr($s0,'jts') == 0 color lt_blue
- X echo $s0
- X }
- X icolor $icolor
- X send ''
- X
- SHAR_EOF
- $TOUCH -am 0429171591 'models/f.ep' &&
- chmod 0644 models/f.ep ||
- echo 'restore of models/f.ep failed'
- Wc_c="`wc -c < 'models/f.ep'`"
- test 815 -eq "$Wc_c" ||
- echo 'models/f.ep: original size 815, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= models/file_test.ep ==============
- if test -f 'models/file_test.ep' -a X"$1" != X"-c"; then
- echo 'x - skipping models/file_test.ep (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting models/file_test.ep (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'models/file_test.ep' &&
- X# CHK=0xA2AF
- X#------------------------------------------------------------
- X# ftst.ep - test ecu procedure file functions
- X#------------------------------------------------------------
- X
- X ptrace off # turn off trace mode
- X fdel 'ftst.log' # kill any previous file
- X plog 'ftst.log' # turn on logging
- X
- X echo ''
- X echo 'ftst '+%date+' '+%time
- X echo ''
- X
- X ptrace on # turn on trace mode
- X
- X set $s10 = '/tmp/ftst.tmp' # temp file name
- X fdel $s10 # test proc trace warning
- X fopen -w 0 $s10 # open file 0 for write
- X set i0=%ftell(0) # should produce 0
- X fputs 0 'abcdefghijk' # put a line in the file
- X set i0=%ftell(0) # should produce 12
- X fclose 0 n # close the file
- X
- X fopen -r 0 $s10 # open again for reading
- X fgets 0 $s0 # should produce 'abcdefghijk'
- X fseek 0 0 # rewind to read again
- X fgets 0 $s0 # should produce 'abcdefghijk'
- X fgets 0 $s0 # should produce null string
- X set $i0=%fmode(0) # test file mode function
- X fclose 0 # close the file
- X
- X fchmod 'rw-rw-r-x' $s10 # set mode using string
- X set $i0=%fmode($s10)
- X
- X fchmod 0777 $s10 # set mode using constant
- X set $i0=%fmode($s10)
- X
- X ptrace off # show file attributes
- X echo ''
- X echo -n $s10+' has '+%itos(%fsize($s10),06d)
- SHAR_EOF
- true || echo 'restore of models/file_test.ep failed'
- fi
- echo 'End of ecu310 part 35'
- echo 'File models/file_test.ep is continued in part 36'
- echo 36 > _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.
-