home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume42 / ecu / part17 < prev    next >
Encoding:
Internet Message Format  |  1994-05-24  |  64.8 KB

  1. From: wht@n4hgf.atl.ga.us (Warren Tucker)
  2. Newsgroups: comp.sources.misc
  3. Subject: v42i115:  ecu - ECU Asynchronous Communications v3.30, Part17/37
  4. Date: 24 May 1994 09:06:24 -0500
  5. Organization: Sterling Software
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <2rt1l0$d12@sparky.sterling.com>
  9. X-Md4-Signature: 0cba85edfc03b8db0bbd40e47860b592
  10.  
  11. Submitted-by: wht@n4hgf.atl.ga.us (Warren Tucker)
  12. Posting-number: Volume 42, Issue 115
  13. Archive-name: ecu/part17
  14. Environment: SCO,SCOXENIX,MOTOROLA,HP-UX,LINUX,NetBSD,SUNOS,SYSVR4,SOLARIS2
  15. Supersedes: ecu: Volume 32, Issue 36-75
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  ecu330/models/funckeymap ecu330/pcmd.c
  22. # Wrapped by kent@sparky on Mon May 23 13:40:54 1994
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 17 (of 37)."'
  26. if test -f 'ecu330/models/funckeymap' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'ecu330/models/funckeymap'\"
  28. else
  29.   echo shar: Extracting \"'ecu330/models/funckeymap'\" \(28332 characters\)
  30.   sed "s/^X//" >'ecu330/models/funckeymap' <<'END_OF_FILE'
  31. X#+------------------------------------------------------------------------
  32. X# ECU 3.30 funckeymap
  33. X#
  34. X# This file contains mapping information to convert non-ANSI
  35. X# keyboard function keys to an internal ECU function key
  36. X# representation.
  37. X# 
  38. X# The format of an entry is shown below in the 'ansilike' example (used
  39. X# to ansilike ECU from the console by defining an ansi terminal type
  40. X# nevertheless equivalent to ansi).
  41. X# 
  42. X# The first line(s) in a terminal keyboard description begin in
  43. X# column 1 and contain the terminal types (a la $TERM) for which
  44. X# the keyboard description are valid.  The example entry contains
  45. X# several references to terminal types containing the substring
  46. X# 'ansi'.  These are included only as an example of one keyboard
  47. X# description servicing multiple terminal types.
  48. X# 
  49. X# ECU determines whether a terminal meets the ansi vs.  ANSI
  50. X# distinction by searching for 'ansi' in the $TERM environment
  51. X# variable (without regard to case: 'AnSi' will match as well as
  52. X# 'ansi').  If your keyboard matches the ANSI specification even
  53. X# though your $TERM environment variable does not contain 'ansi'
  54. X# (such as 'sun'), then you may add the terminal type to the 'ansilike'
  55. X# entry rather than create a separate entry.
  56. X# 
  57. X# Following the "first lines" are key definition entries, each
  58. X# preceded by at least one tab or space.  Each entry is composed of
  59. X# three fields delimited by commas.  The first field of an entry is
  60. X# the internal ECU function key name and must be chosen from the
  61. X# following strings (with no regard to case): "F1", "F2", "F3",
  62. X# "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "Home",
  63. X# "End", "PgUp", "PgDn", "CUP", "CUL", "CU5", "CUR" and "CUD" The
  64. X# second field contains the name of the key as it appears on the
  65. X# non-ANSI keyboard (such as "Send" for End on the Wyse 60).  The
  66. X# third field is a description of the character sequence generated
  67. X# by the non-ANSI keyboard when the chosen key is pressed; it is a
  68. X# string of one or more tokens separated by spaces or tabs.
  69. X# The tokens are described in full in the ECU manual sections titled
  70. X# "Function Key Recognition" and "Function Key Mapping."
  71. X#
  72. X# << LOOK >> NOTE:
  73. X# Compile and run 'kbdtest3.c' (see the source file for information)
  74. X# to build a file containing the emitted sequences for each supported
  75. X# function key.  Looking at the file, you will see it is a funckeymap
  76. X# formatted keyboard description complete with the TERM terminal type.
  77. X# I would appreciate your mailing me any files you
  78. X# create describing non-SCO/non-ISC main console keyboards.
  79. X#
  80. X# If you like, compile the older 'kbdtest.c' module released with 3.0
  81. X# and run it. Press any key you like and hex for the emitted
  82. X# sequence will appear on the screen.  Press ^D to exit the program.
  83. X#
  84. X#-------------------------------------------------------------------------
  85. X#+:EDITS:
  86. X#:05-04-1994-04:39-wht@n4hgf-ECU release 3.30
  87. X#:04-24-1994-05:17-wht@n4hgf-clean up+add entries for release 3.30
  88. X#:03-13-1994-18:38-root@fep-add rterm entry
  89. X#:11-22-1993-23:46-wht@n4hgf-hpux
  90. X#:11-12-1993-10:51-wht@n4hgf-add Linux diffs
  91. X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
  92. X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
  93. X#:05-14-1992-02:07-wht@n4hgf-make note of Metro Link R5 compatibility
  94. X#:04-19-1992-01:37-wht@n4hgf-add ESIX SVR4 console
  95. X#:10-03-1991-04:56-wht@n4hgf-add X386 1.1b Roell X11R4 xterm entry
  96. X#:08-26-1991-05:06-wht@n4hgf2-add sun console and xterm entry
  97. X#:08-10-1991-16:07-wht@n4hgf-add new Metro Link server entry
  98. X#:05-06-1991-02:31-wht@n4hgf-add tandem terminal "ansi-terminal"
  99. X#:05-05-1991-17:37-root@n4hgf-add ISC at386 tnx to dug@kd4nc
  100. X#:05-02-1991-04:53-wht@n4hgf-document kbdtest3
  101. X#:03-26-1991-00:00-wht@n4hgf-more Metro Link work
  102. X#:03-19-1991-21:04-root@n4hgf-add Metro Link MetroX X11R4 xterm
  103. X#:12-20-1990-23:50-wht@n4hgf-"correct" wyse entry
  104. X#:12-18-1990-19:43-wht@n4hgf-add xterm and wy60
  105. X#:12-02-1990-13:34-wht@n4hgf-creation
  106. X
  107. X#+-------------------------------------------------------------------
  108. X#   SCO multiscreen (and other ANSI for F1-F10, cursor keys)
  109. X#--------------------------------------------------------------------
  110. Xsco
  111. Xansi
  112. Xansi43
  113. Xmsdos
  114. Xdos
  115. Xdosansi
  116. Xtest
  117. X    F1:F1:          esc [ M 
  118. X    F2:F2:          esc [ N 
  119. X    F3:F3:          esc [ O 
  120. X    F4:F4:          esc [ P 
  121. X    F5:F5:          esc [ Q 
  122. X    F6:F6:          esc [ R 
  123. X    F7:F7:          esc [ S 
  124. X    F8:F8:          esc [ T 
  125. X    F9:F9:          esc [ U 
  126. X    F10:F10:        esc [ V 
  127. X    F11:F11:        esc [ W 
  128. X    F12:F12:        esc [ X 
  129. X    Home:Home:      esc [ H 
  130. X    End:End:        esc [ F 
  131. X    PgUp:PgUp:      esc [ I 
  132. X    PgDn:PgDn:      esc [ G 
  133. X    CUU:CUU:        esc [ A 
  134. X    CUL:CUL:        esc [ D 
  135. X    CU5:CU5:        esc [ E 
  136. X    CUR:CUR:        esc [ C 
  137. X    CUD:CUD:        esc [ B 
  138. X    Ins:Ins:        esc [ L
  139. X    BkTab:BackTab:  esc [ Z
  140. X
  141. X#+-------------------------------------------------------------------
  142. X# ~wht/.Xdefaults on a networked SCO and Sun boxes
  143. X# has these xterm translations: allows
  144. X# me to be able to run ECU on n4hgf from 
  145. X#
  146. X#  a local xterm with the Roell X386 1.1b, Metro Link X11R4 and X11R5
  147. X#    or SCO ODT servers or
  148. X#  a remote Sparc IPX MIT X11R4 xterm running under
  149. X#    news/open windows 2.0 or the MIT X11R4 server
  150. X#
  151. X# and vice versa on the Sun box
  152. X#
  153. X# This translation set demonstrates two different servers'
  154. X# keyboard-to-keysym mappings being accommodated by one 'xterm'
  155. X# funckey entry
  156. X#
  157. X#XTerm*VT100*Translations: #override\
  158. X#     Shift <Key>Tab:  string(0x1b) string("[Z") \n \
  159. X#     <Key>Insert:     string(0x1b) string("[L") \n \
  160. X#     <Key>Home:       string(0x1b) string("[H") \n \
  161. X#     <Key>End:        string(0x1b) string("[F") \n \
  162. X#     <Key>Begin:      string(0x1b) string("[E") \n \
  163. X#     <Key>F27:        string(0x1b) string("[H") \n \
  164. X#     <Key>R13:        string(0x1b) string("[F") \n \
  165. X#     <Key>F29:        string(0x1b) string("[I") \n \
  166. X#     <Key>F31:        string(0x1b) string("[E") \n \
  167. X#     <Key>F35:        string(0x1b) string("[G") \n
  168. X#
  169. X#--------------------------------------------------------------------
  170. Xxterm
  171. X    BkTab:BkTab:    esc [ Z
  172. X    CU5:CU5:        esc [ E
  173. X    F1:F1:          esc [ 1 1 ~
  174. X    F2:F2:          esc [ 1 2 ~
  175. X    F3:F3:          esc [ 1 3 ~
  176. X    F4:F4:          esc [ 1 4 ~
  177. X    F5:F5:          esc [ 1 5 ~
  178. X    F6:F6:          esc [ 1 7 ~
  179. X    F7:F7:          esc [ 1 8 ~
  180. X    F8:F8:          esc [ 1 9 ~
  181. X    F9:F9:          esc [ 2 0 ~
  182. X    F10:F10:        esc [ 2 1 ~
  183. X    F11:F11:        esc [ 2 3 ~
  184. X    F12:F12:        esc [ 2 4 ~
  185. X    Ins:Ins:        esc [ 2 ~
  186. X    Home:Home:      esc [ H
  187. X    End:End:        esc [ F
  188. X    PgUp:PgUp:      esc [ 5 ~
  189. X    PgDn:PgDn:      esc [ 6 ~
  190. X    CUU:CUU:        esc [ A
  191. X    CUD:CUD:        esc [ B
  192. X    CUL:CUL:        esc [ D
  193. X    CUR:CUR:        esc [ C
  194. X
  195. X#+-------------------------------------------------------------------
  196. X#   Sun Sparc xterm using MIT X11R4 server (pl18)
  197. X#
  198. X# Place in .Xdefaults or whatever:
  199. X#
  200. X# XTerm*VT100*Translations: #override\
  201. X#     Shift <Key>Tab:   string(0x1b) string("[Z") \n \
  202. X#     <Key>F27:         string(0x1b) string("[H") \n \
  203. X#     <Key>R13:         string(0x1b) string("[F") \n \
  204. X#     <Key>F29:         string(0x1b) string("[I") \n \
  205. X#     <Key>F31:         string(0x1b) string("[E") \n \
  206. X#     <Key>F35:         string(0x1b) string("[G") \n \
  207. X#     <Key>Insert:      string(0x1b) string("[L") \n \
  208. X#
  209. X# funckeymap for 'xterm' under SunOS
  210. X# built by kbdtest3 1.02 Mon Aug 26 04:55:24 1991
  211. X# keyboard parity required = even
  212. X#--------------------------------------------------------------------
  213. Xxterm
  214. X    BkTab:BkTab:    esc [ Z
  215. X    CU5:CU5:        esc [ E
  216. X    F1:F1:          esc [ 1 1 ~
  217. X    F2:F2:          esc [ 1 2 ~
  218. X    F3:F3:          esc [ 1 3 ~
  219. X    F4:F4:          esc [ 1 4 ~
  220. X    F5:F5:          esc [ 1 5 ~
  221. X    F6:F6:          esc [ 1 7 ~
  222. X    F7:F7:          esc [ 1 8 ~
  223. X    F8:F8:          esc [ 1 9 ~
  224. X    F9:F9:          esc [ 2 0 ~
  225. X    F10:F10:        esc [ 2 1 ~
  226. X    F11:F11:        esc [ 2 3 ~
  227. X    F12:F12:        esc [ 2 4 ~
  228. X    Ins:Ins:        esc [ L     # Ins generates Insert
  229. X    Home:Home:      esc [ H     # Home generates F27
  230. X    End:End:        esc [ F     # End generates R13
  231. X    PgUp:PgUp:      esc [ I     # PgUp generates F29
  232. X    PgDn:PgDn:      esc [ G     # PgDn generates F35
  233. X    CUU:CUU:        esc [ A
  234. X    CUD:CUD:        esc [ B
  235. X    CUL:CUL:        esc [ D
  236. X    CUR:CUR:        esc [ C
  237. X
  238. X#+-------------------------------------------------------------------
  239. X#   SCO ODT 2.0 console xterm (with translations shown below)
  240. X#
  241. X#XTerm*VT100*Translations: #override\
  242. X#     Shift <Key>Tab:  string(0x1b) string("[Z") \n \
  243. X#     <Key>KP_Insert:  string(0x1b) string("[L") \n \
  244. X#     <Key>KP_Home:    string(0x1b) string("[H") \n \
  245. X#     <Key>KP_End:     string(0x1b) string("[F") \n \
  246. X#     <Key>KP_Prior:   string(0x1b) string("[I") \n \
  247. X#     <Key>KP_Next:    string(0x1b) string("[G") \n \
  248. X#     <Key>KP_Begin:   string(0x1b) string("[E") \n \
  249. X#
  250. X#--------------------------------------------------------------------
  251. Xxterm
  252. X    BkTab:BkTab:    esc [ Z
  253. X    CU5:CU5:        esc [ E
  254. X    F1:F1:          esc [ 1 1 ~
  255. X    F2:F2:          esc [ 1 2 ~
  256. X    F3:F3:          esc [ 1 3 ~
  257. X    F4:F4:          esc [ 1 4 ~
  258. X    F5:F5:          esc [ 1 5 ~
  259. X    F6:F6:          esc [ 1 7 ~
  260. X    F7:F7:          esc [ 1 8 ~
  261. X    F8:F8:          esc [ 1 9 ~
  262. X    F9:F9:          esc [ 2 0 ~
  263. X    F10:F10:        esc [ 2 1 ~
  264. X    F11:F11:        esc [ 2 3 ~
  265. X    F12:F12:        esc [ 2 4 ~
  266. X    Ins:Ins:        esc [ L
  267. X    Home:Home:      esc [ H
  268. X    End:End:        esc [ F
  269. X    PgUp:PgUp:      esc [ I
  270. X    PgDn:PgDn:      esc [ G
  271. X    CUU:CUU:        esc [ A
  272. X    CUD:CUD:        esc [ B
  273. X    CUL:CUL:        esc [ D
  274. X    CUR:CUR:        esc [ C
  275. X
  276. X#+-------------------------------------------------------------------
  277. X#    Sun Console
  278. X#
  279. X# funckeymap for 'sun' (native console) under SunOS 4.1
  280. X# built by kbdtest3 1.02 Mon Aug 26 16:21:57 1991
  281. X# keyboard parity required = even
  282. X#--------------------------------------------------------------------
  283. Xsun
  284. X#   BkTab:BkTab:    ht                   # does not work
  285. X    CU5:CU5:        esc [ 2 1 8 z
  286. X    F1:F1:          esc [ 2 2 4 z
  287. X    F2:F2:          esc [ 2 2 5 z
  288. X    F3:F3:          esc [ 2 2 6 z
  289. X    F4:F4:          esc [ 2 2 7 z
  290. X    F5:F5:          esc [ 2 2 8 z
  291. X    F6:F6:          esc [ 2 2 9 z
  292. X    F7:F7:          esc [ 2 3 0 z
  293. X    F8:F8:          esc [ 2 3 1 z
  294. X    F9:F9:          esc [ 2 3 2 z
  295. X    F10:F10:        esc [ 2 3 3 z
  296. X    F11:F11:        esc [ 2 3 4 z
  297. X    F12:F12:        esc [ 2 3 5 z
  298. X    Ins:Ins:        esc [ 2 4 7 z
  299. X    Home:Home:      esc [ 2 1 4 z
  300. X    End:End:        esc [ 2 2 0 z
  301. X    PgUp:PgUp:      esc [ 2 1 6 z
  302. X    PgDn:PgDn:      esc [ 2 2 2 z
  303. X    CUU:CUU:        esc [ A
  304. X    CUD:CUD:        esc [ B
  305. X    CUL:CUL:        esc [ D
  306. X    CUR:CUR:        esc [ C
  307. X
  308. X#+-------------------------------------------------------------------
  309. X#   ISC 'AT386' keyboard
  310. X#--------------------------------------------------------------------
  311. XAT386
  312. Xat386
  313. X    F1:F1:          esc O P 
  314. X    F2:F2:          esc O Q 
  315. X    F3:F3:          esc O R 
  316. X    F4:F4:          esc O S 
  317. X    F5:F5:          esc O T 
  318. X    F6:F6:          esc O U 
  319. X    F7:F7:          esc O V 
  320. X    F8:F8:          esc O W 
  321. X    F9:F9:          esc O X 
  322. X    F10:F10:        esc O Y 
  323. X    F11:F11:        esc O Z 
  324. X    F12:F12:        esc O A 
  325. X    Home:Home:      esc [ H 
  326. X    End:End:        esc [ Y 
  327. X    PgUp:PgUp:      esc [ V 
  328. X    PgDn:PgDn:      esc [ U 
  329. X    CUU:CUU:        esc [ A 
  330. X    CUL:CUL:        esc [ D 
  331. X    CU5:CU5:        esc [ G 
  332. X    CUR:CUR:        esc [ C 
  333. X    CUD:CUD:        esc [ B 
  334. X    Ins:Ins:        esc [ @
  335. X    BkTab:BackTab:  gs
  336. X
  337. X#+-------------------------------------------------------------------
  338. X#       ESIX SVR4 console
  339. X#
  340. X# funckeymap for 'AT386-M' under ESIX SVR4
  341. X# built by kbdtest3 3.20 Thu Apr 16 23:16:22 1992
  342. X# keyboard parity required = none
  343. X# stty -a at kbdtest3 execution time:
  344. X# speed 9600 baud; 
  345. X# intr = DEL; quit = ^|; erase = ^h; kill = @;
  346. X# eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
  347. X# start = <undef>; stop = <undef>; susp = ^z; dsusp = <undef>;
  348. X# rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
  349. X# -parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -parext 
  350. X# -ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc 
  351. X# ixon ixany -ixoff -imaxbel 
  352. X# isig icanon -xcase echo echoe echok -echonl -noflsh 
  353. X# -tostop -echoctl -echoprt -echoke -defecho -flusho -pendin -iexten 
  354. X# opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3 
  355. X#
  356. X# supplied by Joseph H Buehler <jhpb@sarto.budd-lake.nj.us>
  357. X#+-------------------------------------------------------------------
  358. XAT386-M
  359. X    BkTab:BkTab:    gs 
  360. X    CU5:CU5:        esc [ G
  361. X    F1:F1:          esc O P
  362. X    F2:F2:          esc O Q
  363. X    F3:F3:          esc O R
  364. X    F4:F4:          esc O S
  365. X    F5:F5:          esc O T
  366. X    F6:F6:          esc O U
  367. X    F7:F7:          esc O V
  368. X    F8:F8:          esc O W
  369. X    F9:F9:          esc O X
  370. X    F10:F10:        esc O Y
  371. X    F11:F11:        esc O Z
  372. X    F12:F12:        esc O A
  373. X    Ins:Ins:        esc [ @
  374. X    Home:Home:      esc [ H
  375. X    End:End:        esc [ Y
  376. X    PgUp:PgUp:      esc [ V
  377. X    PgDn:PgDn:      esc [ U
  378. X    CUU:CUU:        esc [ A
  379. X    CUD:CUD:        esc [ B
  380. X    CUL:CUL:        esc [ D
  381. X    CUR:CUR:        esc [ C
  382. X
  383. X#+-------------------------------------------------------------------
  384. X#    Wyse 60 Native Mode (no reprogrammed function keys)
  385. X#    (matching the keyboard tops I have, anyway)
  386. X#
  387. X# The following is for native mode Wyse 60 with no function keys
  388. X# programmed for emitting alternate sequences.  This is such a
  389. X# nice terminal in so many ways.  Too bad they cocked up the left
  390. X# and down function keys by making them indistinguishable from
  391. X# backspace and newline. You may wish to study the SCO /etc/termcap
  392. X# 'wy60ak' entry for a way around this.
  393. X#
  394. X# Note there is a kludge in the terminal initialization code
  395. X# to force a Wyse 60's *arrow keys* to use ANSI sequences.
  396. X# This entry as shipped counts on this.  If you don't have SCO, try
  397. X# the termcap entry in README.WY60
  398. X#
  399. X# If you really want to avoid this, comment out the IS strings below.
  400. X#--------------------------------------------------------------------
  401. Xwy60
  402. Xwyse60
  403. Xwy60ak
  404. Xwyse60ak
  405. Xwy60-43
  406. Xwyse60-43
  407. Xwyse60ak-43
  408. Xwy60ak-43
  409. X    IS:1:           esc Z 1 + esc [ A del
  410. X    IS:2:           esc Z 1 , esc [ B del
  411. X    IS:3:           esc Z 1 - esc [ D del
  412. X    IS:4:           esc Z 1 . esc [ C del
  413. X    IS:5:           esc Z 1 \ esc [ F del
  414. X    IS:6:           esc Z 1 q esc [ L del 
  415. X    F1:F1:          soh @ cr
  416. X    F2:F1:          soh A cr
  417. X    F3:F1:          soh B cr
  418. X    F4:F1:          soh C cr
  419. X    F5:F1:          soh D cr
  420. X    F6:F1:          soh E cr
  421. X    F7:F1:          soh F cr
  422. X    F8:F1:          soh G cr
  423. X    F9:F1:          soh H cr
  424. X    F10:F10:        soh I cr
  425. X    F11:F11:        soh J cr
  426. X    F12:F12:        soh K cr
  427. X    Home:Home:      rs
  428. X    PgUp:PrevPg:    esc J
  429. X    PgDn:NextPg:    esc K
  430. X    BkTab:F14:      soh M cr
  431. X    Ins:InsChar:    esc Q
  432. X    End:Send:       esc 7
  433. X#comment these out if you DO comment the IS strings
  434. X   CUU:CUU:        esc [ A 
  435. X   CUL:CUL:        esc [ D 
  436. X   CU5:CU5:        esc [ E 
  437. X   CUR:CUR:        esc [ C 
  438. X   CUD:CUD:        esc [ B 
  439. X#   Home:Home:      esc [ H 
  440. X#   End:End:        esc [ F 
  441. X#uncomment the if you DO NOT comment the IS strings
  442. X#    CUU:CUU:        vt
  443. X#    CUR:CUR:        ff
  444. X
  445. X#+-------------------------------------------------------------------
  446. X#    Tandem Integrity S2
  447. X#
  448. X# From: rootk@tdmsou (Admin) [John Dashner]
  449. X# Date: Mon, 6 May 91 2:23:56 EDT
  450. X# funckeymap definition for TERM='ansi-tandem'
  451. X# built by kbdtest3.c Mon May  6 02:17:13 1991
  452. X#--------------------------------------------------------------------
  453. Xansi-tandem
  454. X    BkTab:BkTab:    esc [ Z
  455. X    CU5:CU5:        esc [ T
  456. X    F1:F1:          soh @ cr 
  457. X    F2:F2:          soh A cr 
  458. X    F3:F3:          soh B cr 
  459. X    F4:F4:          soh C cr 
  460. X    F5:F5:          soh D cr 
  461. X    F6:F6:          soh E cr 
  462. X    F7:F7:          soh F cr 
  463. X    F8:F8:          soh G cr 
  464. X    F9:F9:          soh H cr 
  465. X    F10:F10:        soh I cr 
  466. X    F11:F11:        soh J cr 
  467. X    F12:F12:        soh K cr 
  468. X    Ins:Ins:        esc [ @
  469. X    Home:Home:      esc [ H
  470. X    End:End:        esc [ 2 4 H
  471. X    PgUp:PgUp:      esc [ V
  472. X    PgDn:PgDn:      esc [ U
  473. X    CUU:CUU:        esc [ A
  474. X    CUD:CUD:        esc [ B
  475. X    CUL:CUL:        esc [ D
  476. X    CUR:CUR:        esc [ C
  477. X
  478. X#+-----------------------------------------------------------------------------
  479. X#  "versatile"  xterm - an example (works for me) -- wht
  480. X#------------------------------------------------------------------------------
  481. X# funckeymap definition for TERM='xterm' 
  482. X# ODT 2.0 + Roell x386 1.1b + Sun OW2 + Sun MIT combined
  483. X# built by kbdtest3 3.21 Wed Sep 16 12:58:06 1992
  484. X# keyboard parity required = even
  485. X# stty -a at kbdtest3 execution time:
  486. X# speed 9600 baud;   ispeed 9600 baud;   ospeed 9600 baud; 
  487. X# line = 0; intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = ^@; 
  488. X# swtch = ^@;susp = ^Z;start = ^Q;stop = ^S;
  489. X# parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crtsfl -ctsflow -rtsflow 
  490. X# -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc 
  491. X# ixon -ixany -ixoff 
  492. X# isig icanon -xcase echo echoe echok -echonl -noflsh -iexten -tostop -xclude 
  493. X# opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel 
  494. X# -isscancode 
  495. X#------------------------------------------------------------------------------
  496. X# stock OW2/nEwS doesn't include F11 or F12; xev for both:
  497. X# state 0x0, keycode 16 (keysym 0x1005ff10, (no name)), same_screen YES,
  498. X# XLookupString gives 0 characters:  ""
  499. X# (keycode 16 for F11, 18 for F12)
  500. X#------------------------------------------------------------------------------
  501. X# XTerm*VT100*Translations: #override\
  502. X#      <Key>Home:       string(0x1b) string("[H") \n \
  503. X#      <Key>KP_Home:    string(0x1b) string("[H") \n \
  504. X#      <Key>F27:        string(0x1b) string("[H") \n \
  505. X#      <Key>End:        string(0x1b) string("[F") \n \
  506. X#      <Key>KP_End:     string(0x1b) string("[F") \n \
  507. X#      <Key>R13:        string(0x1b) string("[F") \n \
  508. X#      <Key>Prior:      string(0x1b) string("[I") \n \
  509. X#      <Key>F29:        string(0x1b) string("[I") \n \
  510. X#      <Key>Next:       string(0x1b) string("[G") \n \
  511. X#      <Key>KP_Next:    string(0x1b) string("[G") \n \
  512. X#      <Key>F35:        string(0x1b) string("[G") \n \
  513. X#      <Key>KP_Begin:   string(0x1b) string("[E") \n \
  514. X#      <Key>Begin:      string(0x1b) string("[E") \n \
  515. X#      <Key>F31:        string(0x1b) string("[E") \n \
  516. X#      <Key>KP_Insert:  string(0x1b) string("[L") \n \
  517. X#      <Key>Insert:     string(0x1b) string("[L") \n \
  518. X#      Shift <Key>Tab:  string(0x1b) string("[Z") \n 
  519. X#
  520. X#--------------------------------------------------------------------
  521. Xxterm
  522. X    BkTab:BkTab:    esc [ Z
  523. X    CU5:CU5:        esc [ E
  524. X    F1:F1:          esc [ 1 1 ~
  525. X    F2:F2:          esc [ 1 2 ~
  526. X    F3:F3:          esc [ 1 3 ~
  527. X    F4:F4:          esc [ 1 4 ~
  528. X    F5:F5:          esc [ 1 5 ~
  529. X    F6:F6:          esc [ 1 7 ~
  530. X    F7:F7:          esc [ 1 8 ~
  531. X    F8:F8:          esc [ 1 9 ~
  532. X    F9:F9:          esc [ 2 0 ~
  533. X    F10:F10:        esc [ 2 1 ~
  534. X    F11:F11:        esc [ 2 3 ~
  535. X    F12:F12:        esc [ 2 4 ~
  536. X    Ins:Ins:        esc [ L
  537. X    Home:Home:      esc [ H
  538. X    End:End:        esc [ F
  539. X    PgUp:PgUp:      esc [ I
  540. X    PgDn:PgDn:      esc [ G
  541. X    CUU:CUU:        esc [ A
  542. X    CUD:CUD:        esc [ B
  543. X    CUL:CUL:        esc [ D
  544. X    CUR:CUR:        esc [ C
  545. X
  546. X#+---------------------------------------------------------------------
  547. X#    Linux console
  548. X#----------------------------------------------------------------------
  549. Xconsole
  550. X    F1:F1:          esc [ [ A
  551. X    F2:F2:          esc [ [ B
  552. X    F3:F3:          esc [ [ C
  553. X    F4:F4:          esc [ [ D
  554. X    F5:F5:          esc [ [ E
  555. X    F6:F6:          esc [ 1 7 ~
  556. X    F7:F7:          esc [ 1 8 ~
  557. X    F8:F8:          esc [ 1 9 ~
  558. X    F9:F9:          esc [ 2 0 ~
  559. X    F10:F10:        esc [ 2 1 ~
  560. X    F11:F11:        esc [ 2 8 ~
  561. X    F12:F12:        esc [ 2 9 ~
  562. X    Home:Home:      esc [ 1 ~
  563. X    End:End:        esc [ 4 ~
  564. X    PgUp:PgUp:      esc [ 5 ~
  565. X    PgDn:PgDn:      esc [ 6 ~
  566. X    CUU:CUU:        esc [ A
  567. X    CUL:CUL:        esc [ D
  568. X    CU5:CU5:        esc [ G
  569. X    CUR:CUR:        esc [ C
  570. X    CUD:CUD:        esc [ B
  571. X    Ins:Ins:        esc [ 2 ~
  572. X
  573. X#+-----------------------------------------------------------------------------
  574. X#  H P - U X  hpterm
  575. X#------------------------------------------------------------------------------
  576. X# Date: Mon, 29 Nov 1993 14:09:53 -0800 (PST)
  577. X# From: "Robert E. Laughlin" <bel@nosc.mil>
  578. X# funckeymap for 'hpterm' under HP-UX
  579. X# built by kbdtest3 3.21 Wed Nov 24 10:26:29 1993
  580. X# keyboard parity required = even
  581. X# stty -a at kbdtest3 execution time:
  582. X# speed 9600 baud; line = 0; susp = ^Z; dsusp = ^@
  583. X# rows = 25; columns = 80
  584. X# intr = ^C; quit = ^\; erase = ^H; kill = ^U; swtch = ^@
  585. X# eof = ^D; eol = ^@; min = 4; time = 0; stop = ^S; start = ^Q
  586. X# parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crts 
  587. X# -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc 
  588. X# ixon -ixany ixoff -rtsxoff -ctsxon -ienqak 
  589. X# isig icanon iexten -xcase echo echoe echok -echonl -noflsh 
  590. X# opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop 
  591. Xhpterm
  592. X# BkTab: dead key and no reasonable alternate
  593. X#    CU5:CU5:        5
  594. X# the above entry is suspect
  595. X    F1:F1:          esc p cr 
  596. X    F2:F2:          esc q cr 
  597. X    F3:F3:          esc r cr 
  598. X    F4:F4:          esc s cr 
  599. X    F5:F5:          esc t cr 
  600. X    F6:F6:          esc u cr 
  601. X    F7:F7:          esc v cr 
  602. X    F8:F8:          esc w cr 
  603. X# F9: dead key and no reasonable alternate
  604. X# F10: dead key and no reasonable alternate
  605. X# F11: dead key and no reasonable alternate
  606. X# F12: dead key and no reasonable alternate
  607. X# Ins: dead key and no reasonable alternate
  608. X    Home:Home:      soh
  609. X    End:End:        enq
  610. X# PgUp: dead key and no reasonable alternate
  611. X# PgDn: dead key and no reasonable alternate
  612. X# CUU: dead key and no reasonable alternate
  613. X# CUD: dead key and no reasonable alternate
  614. X# CUL: dead key and no reasonable alternate
  615. X# CUR: dead key and no reasonable alternate
  616. X
  617. X#+-----------------------------------------------------------------------------
  618. X# funckeymap for 'rterm' for WHT
  619. X#------------------------------------------------------------------------------
  620. Xrterm
  621. X    F1:F1:          esc O q
  622. X    F2:F2:          esc O r 
  623. X    F3:F3:          esc O s 
  624. X    F4:F4:          esc O t 
  625. X    F5:F5:          esc O u 
  626. X    F6:F6:          esc O v 
  627. X    F7:F7:          esc O w 
  628. X    F8:F8:          esc O x 
  629. X    F9:F9:          esc O y 
  630. X    F10:F10:        esc O z 
  631. X#   F11:F11:
  632. X#   F12:F12:
  633. X    Home:Home:      esc [ H 
  634. X    End:End:        esc [ F 
  635. X    PgUp:PgUp:      esc [ I 
  636. X    PgDn:PgDn:      esc [ G 
  637. X    CUU:CUU:        esc [ A 
  638. X    CUL:CUL:        esc [ D 
  639. X    CU5:CU5:        esc [ E 
  640. X    CUR:CUR:        esc [ C 
  641. X    CUD:CUD:        esc [ B 
  642. X    Ins:Ins:        esc [ L
  643. X    BkTab:BackTab:  esc [ Z
  644. X
  645. X#+-----------------------------------------------------------------------------
  646. X#   N e t B S D  console (pc3)
  647. X#------------------------------------------------------------------------------
  648. X# From: Daniel Harris <daniel@reubio.apana.org.au>
  649. X# Date: Fri, 8 Apr 1994 23:18:27 +1000 (EST)
  650. X# 
  651. X# Here's the funckeymap entries for the NetBSD console,
  652. X# and an arbitrary xterm.
  653. X#------------------------------------------------------------------------------
  654. X# funckeymap for 'pc3' under NetBSD OS
  655. X# From: Daniel Harris <daniel@reubio.apana.org.au>
  656. X# built by kbdtest3 3.30 Sun Mar 20 14:56:43 1994
  657. X# keyboard parity required = even
  658. X# stty -a at kbdtest3 execution time:
  659. X# speed 1200 baud; 0 rows; 0 columns;
  660. X# lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
  661. X#     -echoprt -altwerase -noflsh -tostop -mdmbuf -flusho pendin
  662. X#     -nokerninfo -extproc
  663. X# iflags: istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
  664. X#     brkint -inpck -ignpar -parmrk
  665. X# oflags: opost onlcr oxtabs
  666. X# cflags: cread cs7 parenb -parodd hupcl -clocal -cstopb -crtscts
  667. X# cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
  668. X#     eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
  669. X#     quit = ^\; reprint = ^R; start = ^Q; status = <undef>; stop = ^S;
  670. X#     susp = ^Z; werase = ^W;
  671. Xpc3
  672. X#    BkTab:BkTab:    del
  673. X    CU5:CU5:        esc [ E
  674. X    F1:F1:          esc [ M
  675. X    F2:F2:          esc [ N
  676. X    F3:F3:          esc [ O
  677. X    F4:F4:          esc [ P
  678. X    F5:F5:          esc [ Q
  679. X    F6:F6:          esc [ R
  680. X    F7:F7:          esc [ S
  681. X    F8:F8:          esc [ T
  682. X    F9:F9:          esc [ U
  683. X    F10:F10:        esc [ V
  684. X    F11:F11:        esc [ W
  685. X    F12:F12:        esc [ X
  686. X    Ins:Ins:        esc [ L
  687. X    Home:Home:      esc [ H
  688. X    End:End:        esc [ F
  689. X    PgUp:PgUp:      esc [ I
  690. X    PgDn:PgDn:      esc [ G
  691. X    CUU:CUU:        esc [ A
  692. X    CUD:CUD:        esc [ B
  693. X    CUL:CUL:        esc [ D
  694. X    CUR:CUR:        esc [ C
  695. X
  696. X#------------------------------------------------------------------------------
  697. X#   N e t B S D xterm -- experimental
  698. X#------------------------------------------------------------------------------
  699. X# funckeymap for 'xterm' under NetBSD OS
  700. X# From: Daniel Harris <daniel@reubio.apana.org.au>
  701. X# built by kbdtest3 3.30 Sun Mar 20 15:06:20 1994
  702. X# keyboard parity required = even
  703. X# stty -a at kbdtest3 execution time:
  704. X# speed 9600 baud; 55 rows; 80 columns;
  705. X# lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
  706. X#     -echoprt -altwerase -noflsh -tostop -mdmbuf -flusho pendin
  707. X#     -nokerninfo -extproc
  708. X# iflags: istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
  709. X#     brkint -inpck -ignpar -parmrk
  710. X# oflags: opost onlcr -oxtabs
  711. X# cflags: cread cs7 parenb -parodd hupcl -clocal -cstopb -crtscts
  712. X# cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
  713. X#     eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
  714. X#     quit = ^\; reprint = ^R; start = ^Q; status = <undef>; stop = ^S;
  715. X#     susp = ^Z; werase = ^W;
  716. X#------------------------------------------------------------------------------
  717. X# "The translations required for ECU in xterms to work are provided 
  718. X# at the end of the file.  (Of course, X support won't work with
  719. X# stock 0.9!)" -- Daniel Harris <daniel@reubio.apana.org.au>
  720. X#- required X resources -------------------------------------------------------
  721. X#XTerm*VT100*Translations: #override\
  722. X#        Shift <Key>Tab:  string(0x1b) string("[Z") \n \
  723. X#        <Key>Home:    string(0x1b) string("[H") \n \
  724. X#        <Key>End:     string(0x1b) string("[F") \n \
  725. X#------------------------------------------------------------------------------
  726. Xnetbsd-xterm
  727. X    BkTab:BkTab:    esc [ Z
  728. X    CU5:CU5:        esc [ nul
  729. X    F1:F1:          esc [ 1 1 ~
  730. X    F2:F2:          esc [ 1 2 ~
  731. X    F3:F3:          esc [ 1 3 ~
  732. X    F4:F4:          esc [ 1 4 ~
  733. X    F5:F5:          esc [ 1 5 ~
  734. X    F6:F6:          esc [ 1 7 ~
  735. X    F7:F7:          esc [ 1 8 ~
  736. X    F8:F8:          esc [ 1 9 ~
  737. X    F9:F9:          esc [ 2 0 ~
  738. X    F10:F10:        esc [ 2 1 ~
  739. X    F11:F11:        esc [ 2 3 ~
  740. X    F12:F12:        esc [ 2 4 ~
  741. X    Ins:Ins:        esc [ 2 ~
  742. X    Home:Home:      esc [ H
  743. X    End:End:        esc [ F
  744. X    PgUp:PgUp:      esc [ 5 ~
  745. X    PgDn:PgDn:      esc [ 6 ~
  746. X    CUU:CUU:        esc [ A
  747. X    CUD:CUD:        esc [ B
  748. X    CUL:CUL:        esc [ D
  749. X    CUR:CUR:        esc [ C
  750. X
  751. X#+-------------------------------------------------------------------
  752. X#   SCO ODT 1.0/1.1 console xterm (as released, unmodified)
  753. X#--------------------------------------------------------------------
  754. Xxterm
  755. X    F1:F1:          esc [ 1 1 ~
  756. X    F2:F2:          esc [ 1 2 ~
  757. X    F3:F3:          esc [ 1 3 ~
  758. X    F4:F4:          esc [ 1 4 ~
  759. X    F5:F5:          esc [ 1 5 ~
  760. X    F6:F6:          esc [ 1 7 ~
  761. X    F7:F7:          esc [ 1 8 ~
  762. X    F8:F8:          esc [ 1 9 ~
  763. X    F9:F9:          esc [ 2 0 ~
  764. X    F10:F10:        esc [ 2 1 ~
  765. X#   F11:F11:        esc [ 2 3 ~   # decommitted to provide a CU5
  766. X#   F12:F12:        esc [ 2 4 ~   # decommitted to provide a BkTab
  767. X    Home:Home:      esc [ 8 ~
  768. X    End:End:        esc [ 7 ~
  769. X    PgUp:PgUp:      esc [ 5 ~
  770. X    PgDn:PgDn:      esc [ 6 ~
  771. X    CUU:CUU:        esc [ A 
  772. X    CUL:CUL:        esc [ D 
  773. X#   CU5:CU5:        esc [ 8 ~     # same as HOME unfortunately
  774. X    CU5:F11:        esc [ 2 3 ~
  775. X    CUR:CUR:        esc [ C 
  776. X    CUD:CUD:        esc [ B 
  777. X    Ins:Ins:        esc [ 2 ~
  778. X#   BkTab:BackTab:  tab           # same as TAB unfortunately
  779. X    BkTab:F12:      esc [ 2 4 ~
  780. X
  781. X
  782. X
  783. END_OF_FILE
  784.   if test 28332 -ne `wc -c <'ecu330/models/funckeymap'`; then
  785.     echo shar: \"'ecu330/models/funckeymap'\" unpacked with wrong size!
  786.   fi
  787.   # end of 'ecu330/models/funckeymap'
  788. fi
  789. if test -f 'ecu330/pcmd.c' -a "${1}" != "-c" ; then 
  790.   echo shar: Will not clobber existing file \"'ecu330/pcmd.c'\"
  791. else
  792.   echo shar: Extracting \"'ecu330/pcmd.c'\" \(33339 characters\)
  793.   sed "s/^X//" >'ecu330/pcmd.c' <<'END_OF_FILE'
  794. X/*+-------------------------------------------------------------------------
  795. X    pcmd.c - ecu miscellaneous procedure commands
  796. X    wht@n4hgf.atl.ga.us
  797. X
  798. X  Defined functions:
  799. X    get_big_endian_16(ptr)
  800. X    get_big_endian_32(ptr)
  801. X    pcmd_autorz(param)
  802. X    pcmd_baud(param)
  803. X    pcmd_cd(param)
  804. X    pcmd_clrx(param)
  805. X    pcmd_dcdwatch(param)
  806. X    pcmd_dial(param)
  807. X    pcmd_duplex(param)
  808. X    pcmd_echo(param)
  809. X    pcmd_exec(param)
  810. X    pcmd_exit(param)
  811. X    pcmd_flush(param)
  812. X    pcmd_getf(param)
  813. X    pcmd_hangup(param)
  814. X    pcmd_hexdump(param)
  815. X    pcmd_lbreak(param)
  816. X    pcmd_lgets(param)
  817. X    pcmd_logevent(param)
  818. X    pcmd_lookfor(param)
  819. X    pcmd_nap(param)
  820. X    pcmd_nice(param)
  821. X    pcmd_parity(param)
  822. X    pcmd_popd(param)
  823. X    pcmd_prompt(param)
  824. X    pcmd_ptrace(param)
  825. X    pcmd_pushd(param)
  826. X    pcmd_putf(param)
  827. X    pcmd_rname(param)
  828. X    pcmd_rtscts(param)
  829. X    pcmd_send(param)
  830. X    pcmd_set(param)
  831. X    pcmd_setline(param)
  832. X    pcmd_system(param)
  833. X    pcmd_xon(param)
  834. X
  835. X--------------------------------------------------------------------------*/
  836. X/*+:EDITS:*/
  837. X/*:05-04-1994-04:39-wht@n4hgf-ECU release 3.30 */
  838. X/*:08-01-1993-02:39-wht@n4hgf-pass LRWT got_delim back to lgets caller in $i1 */
  839. X/*:09-10-1992-14:00-wht@n4hgf-ECU release 3.20 */
  840. X/*:09-06-1992-13:44-wht@n4hgf-rtscts would not accept a numeric argument */
  841. X/*:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA */
  842. X/*:01-12-1992-20:54-wht@n4hgf-add autorz command */
  843. X/*:12-12-1991-05:27-wht@n4hgf-proc_trace of intvar shows char value if 0-255 */
  844. X/*:11-11-1991-14:38-wht@n4hgf-add pcmd_dcdwatch code */
  845. X/*:10-09-1991-21:54-wht@n4hgf-add -p and -v switch to send */
  846. X/*:10-09-1991-20:32-wht@n4hgf-proc_trace code for send */
  847. X/*:09-01-1991-19:10-wht@n4hgf2-baud cmd can set rate even if no line open */
  848. X/*:09-01-1991-18:10-wht@n4hgf2-add setline */
  849. X/*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  850. X/*:08-06-1991-21:18-wht@n4hgf-nap -m test wrong sense ... old bug! */
  851. X/*:08-05-1991-16:22-wht@n4hgf-add nap -1 return and proc_trace */
  852. X/*:07-25-1991-12:58-wht@n4hgf-ECU release 3.10 */
  853. X/*:07-17-1991-07:04-wht@n4hgf-avoid SCO UNIX nap bug */
  854. X/*:06-05-1991-22:50-wht@n4hgf-fix parity cmd not taking alpha str */
  855. X/*:05-21-1991-18:52-wht@n4hgf-add pcmd_pushd and pcmd_popd */
  856. X/*:03-16-1991-15:12-wht@n4hgf-add pcmd_nice */
  857. X/*:01-09-1991-22:31-wht@n4hgf-ISC port */
  858. X/*:12-26-1990-02:34-wht@n4hgf-add cmd_rtscts */
  859. X/*:12-03-1990-04:59-wht@n4hgf-beef up pcmd_exit */
  860. X/*:09-19-1990-19:36-wht@n4hgf-ecu_log_event now gets pid for log from caller */
  861. X/*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  862. X
  863. X#include "ecu.h"
  864. X#include "ecuerror.h"
  865. X#include "termecu.h"
  866. X#include "ecukey.h"
  867. X#include "esd.h"
  868. X#include "var.h"
  869. X#include "proc.h"
  870. X
  871. X#define NAMED_VARIABLE_FLAG 0x1000L
  872. X
  873. X#if defined(SVR4)
  874. X#include <sys/termiox.h>
  875. Xextern int hx_flag;
  876. X
  877. X#endif
  878. X
  879. Xchar *get_time_plus_msec();
  880. X
  881. Xextern int rc_ep_has_run;
  882. Xextern ulong colors_current;
  883. Xextern char errmsg[];
  884. Xextern char curr_dir[CURR_DIRSIZ];    /* current working directory */
  885. X
  886. X/*+-------------------------------------------------------------------------
  887. X    pcmd_autorz(param)
  888. X--------------------------------------------------------------------------*/
  889. Xint
  890. Xpcmd_autorz(param)
  891. XESD *param;
  892. X{
  893. X    char s8[8];
  894. X
  895. X    if (get_alpha_zstr(param, s8, sizeof(s8)))
  896. X        return (eSyntaxError);
  897. X    if (!strcmp(s8, "on"))
  898. X        shm->autorz = 1;
  899. X    else if (!strcmp(s8, "off"))
  900. X        shm->autorz = 0;
  901. X    else
  902. X        return (eSyntaxError);
  903. X    shm->autorz_pos = 0;
  904. X    return (0);
  905. X}                             /* end of pcmd_autorz */
  906. X
  907. X/*+-------------------------------------------------------------------------
  908. X    pcmd_baud(param) - set line or default baud rate
  909. X
  910. XThe command sets shm->Lbaud whether or not a line is open.
  911. XIf a line is open, the baud rate is actually set.
  912. X--------------------------------------------------------------------------*/
  913. Xint
  914. Xpcmd_baud(param)
  915. XESD *param;
  916. X{
  917. X    long new_baud;
  918. X    int erc;
  919. X
  920. X    if (erc = gint(param, &new_baud))
  921. X        return (erc);
  922. X    if (!valid_baud_rate((uint) new_baud))
  923. X    {
  924. X        pprintf("invalid baud rate: %lu\n", new_baud);
  925. X        return (eFATAL_ALREADY);
  926. X    }
  927. X    shm->Lbaud = (uint) new_baud;
  928. X    if (shm->Liofd >= 0)
  929. X        lset_baud_rate(1);
  930. X    if (proc_trace)
  931. X    {
  932. X        pprintf("baud rate set to %u\n", shm->Lbaud);
  933. X    }
  934. X    return (0);
  935. X
  936. X}                             /* end of pcmd_baud */
  937. X
  938. X/*+-------------------------------------------------------------------------
  939. X    pcmd_cd(param)
  940. X--------------------------------------------------------------------------*/
  941. Xint
  942. Xpcmd_cd(param)
  943. XESD *param;
  944. X{
  945. X    int erc;
  946. X    ESD *tesd = esdalloc(ESD_NOMSZ);
  947. X
  948. X    if (!tesd)
  949. X        return (eNoMemory);
  950. X    if (erc = gstr(param, tesd, 0))
  951. X        goto FUNC_RETURN;
  952. X    if (expand_dirname(tesd->pb, tesd->maxcb))
  953. X    {
  954. X        pprintf("%s\n", errmsg);
  955. X        param->index = param->old_index;
  956. X        erc = eFATAL_ALREADY;
  957. X        goto FUNC_RETURN;
  958. X    }
  959. X    if (chdir(tesd->pb) < 0) /* now change to the new directory */
  960. X    {
  961. X        pperror(tesd->pb);     /* print error if we get one */
  962. X        pputs("\n");
  963. X        erc = eFATAL_ALREADY;
  964. X        goto FUNC_RETURN;
  965. X    }
  966. X    get_curr_dir(curr_dir, 256);
  967. X
  968. X  FUNC_RETURN:
  969. X    esdfree(tesd);
  970. X    return (erc);
  971. X}                             /* end of pcmd_cd */
  972. X
  973. X/*+-------------------------------------------------------------------------
  974. X    pcmd_pushd(param)
  975. X--------------------------------------------------------------------------*/
  976. Xint
  977. Xpcmd_pushd(param)
  978. XESD *param;
  979. X{
  980. X    int erc = 0;
  981. X    int arg_present;
  982. X    ESD *tesd = (ESD *) 0;
  983. X
  984. X    if (arg_present = !!end_of_cmd(param))
  985. X    {
  986. X        if (!(tesd = esdalloc(ESD_NOMSZ)))
  987. X            return (eNoMemory);
  988. X        if (erc = gstr(param, tesd, 0))
  989. X            goto FUNC_RETURN;
  990. X    }
  991. X
  992. X    if (!push_directory((arg_present) ? tesd->pb : "", arg_present, 1))
  993. X    {
  994. X        param->index = param->old_index;
  995. X        erc = eFATAL_ALREADY;
  996. X    }
  997. X
  998. X  FUNC_RETURN:
  999. X    if (tesd)
  1000. X        esdfree(tesd);
  1001. X    return (erc);
  1002. X
  1003. X}                             /* end of pcmd_pushd */
  1004. X
  1005. X/*+-------------------------------------------------------------------------
  1006. X    pcmd_popd(param)
  1007. X--------------------------------------------------------------------------*/
  1008. Xint
  1009. Xpcmd_popd(param)
  1010. XESD *param;
  1011. X{
  1012. X    int erc = 0;
  1013. X    int arg_present;
  1014. X    char allstr[8];
  1015. X
  1016. X    allstr[0] = 0;
  1017. X    if (arg_present = !!end_of_cmd(param))
  1018. X    {
  1019. X        if (get_alpha_zstr(param, allstr, sizeof(allstr)))
  1020. X        {
  1021. X            param->index = param->old_index;
  1022. X            return (eSyntaxError);
  1023. X        }
  1024. X    }
  1025. X
  1026. X    if (!pop_directory(allstr, arg_present, 1))
  1027. X    {
  1028. X        param->index = param->old_index;
  1029. X        erc = eFATAL_ALREADY;
  1030. X    }
  1031. X
  1032. X    return (erc);
  1033. X
  1034. X}                             /* end of pcmd_popd */
  1035. X
  1036. X/*+-------------------------------------------------------------------------
  1037. X    pcmd_clrx(param)
  1038. X--------------------------------------------------------------------------*/
  1039. X/*ARGSUSED*/
  1040. Xint
  1041. Xpcmd_clrx(param)
  1042. XESD *param;
  1043. X{
  1044. X    if (shm->Liofd < 0)
  1045. X        return (eNoLineAttached);
  1046. X
  1047. X    lclear_xmtr_xoff();
  1048. X    if (proc_trace)
  1049. X        pputs("transmitter XOFF cleared\n");
  1050. X    return (0);
  1051. X}                             /* end of pcmd_clrx */
  1052. X
  1053. X/*+-------------------------------------------------------------------------
  1054. X    pcmd_dcdwatch(param)
  1055. X--------------------------------------------------------------------------*/
  1056. Xint
  1057. Xpcmd_dcdwatch(param)
  1058. XESD *param;
  1059. X{
  1060. X    int erc;
  1061. X    char s16[16];
  1062. X    char *cptr;
  1063. X
  1064. X    if (shm->Liofd < 0)
  1065. X        return (eNoLineAttached);
  1066. X
  1067. X    if (erc = get_alpha_zstr(param, s16, sizeof(s16)))
  1068. X        return (erc);
  1069. X
  1070. X    erc = (ldcdwatch_str(s16)) ? eSyntaxError : 0;
  1071. X    if (!erc && proc_trace)
  1072. X    {
  1073. X        pputs("DCD watch set to ");
  1074. X        cptr = "???";
  1075. X        switch (shm->Ldcdwatch)
  1076. X        {
  1077. X            case DCDW_OFF:
  1078. X                cptr = "off";
  1079. X                break;
  1080. X            case DCDW_ON:
  1081. X                cptr = "on";
  1082. X                break;
  1083. X            case DCDW_TERMINATE:
  1084. X                cptr = "TERMINATE";
  1085. X                break;
  1086. X        }
  1087. X        pprintf("%s\n", cptr);
  1088. X    }
  1089. X    return (0);
  1090. X
  1091. X}                             /* end of pcmd_dcdwatch */
  1092. X
  1093. X/*+-------------------------------------------------------------------------
  1094. X    pcmd_dial(param) - connect to a remote DTE or to local DCE
  1095. X
  1096. X  sets I0 to 0==connect,
  1097. X             1==failed to connect,
  1098. X             2==interrupted,
  1099. X             3==modem error
  1100. X  sets S0 to modem result code
  1101. X--------------------------------------------------------------------------*/
  1102. Xint
  1103. Xpcmd_dial(param)
  1104. XESD *param;
  1105. X{
  1106. X    int erc;
  1107. X    ESD *tesd = (ESD *) 0;
  1108. X
  1109. X    if (shm->Lconnected)
  1110. X    {
  1111. X        pprintf("Already connected (to %s)\n", shm->Llogical);
  1112. X        return (eFATAL_ALREADY);
  1113. X    }
  1114. X
  1115. X    if (!(tesd = esdalloc(64)))
  1116. X        return (eNoMemory);
  1117. X
  1118. X    if (erc = gstr(param, tesd, 0))
  1119. X    {
  1120. X        esdfree(tesd);
  1121. X        return (erc);
  1122. X    }
  1123. X
  1124. X    if ((erc = call_logical_telno(tesd->pb)) && (erc == eConnectFailed))
  1125. X        erc = 0;
  1126. X
  1127. X    if (!erc && (shm->Liofd < 0))
  1128. X        erc = eNoLineAttached;
  1129. X
  1130. X    esdfree(tesd);
  1131. X
  1132. X    return (erc);
  1133. X}                             /* end of pcmd_dial */
  1134. X
  1135. X/*+-------------------------------------------------------------------------
  1136. X    pcmd_duplex(param)
  1137. X
  1138. Xduplex [f | h]
  1139. Xduplex ['f' | 'h']
  1140. Xduplex <int>  0 == half, non-0 == full
  1141. X--------------------------------------------------------------------------*/
  1142. Xint
  1143. Xpcmd_duplex(param)
  1144. XESD *param;
  1145. X{
  1146. X    int erc;
  1147. X    int new_duplex;
  1148. X    ESD *tesd;
  1149. X
  1150. X    if (erc = skip_cmd_break(param))
  1151. X        return (erc);
  1152. X    if (!(tesd = esdalloc(64)))
  1153. X        return (eNoMemory);
  1154. X    erc = gstr(param, tesd, 0);
  1155. X    new_duplex = to_lower((erc) ? param->pb[param->index] : *tesd->pb);
  1156. X    esdfree(tesd);
  1157. X    erc = 0;
  1158. X
  1159. X    switch (new_duplex)
  1160. X    {
  1161. X        case 'f':
  1162. X            shm->Lfull_duplex = 1;
  1163. X            break;
  1164. X        case 'h':
  1165. X            shm->Lfull_duplex = 0;
  1166. X            break;
  1167. X        default:
  1168. X            erc = eBadParameter;
  1169. X    }
  1170. X    if (proc_trace && !erc)
  1171. X        pprintf("duplex set to %s\n", (shm->Lfull_duplex) ? "full" : "half");
  1172. X    return (erc);
  1173. X
  1174. X}                             /* end of pcmd_duplex */
  1175. X
  1176. X/*+-------------------------------------------------------------------------
  1177. X    pcmd_echo(param)
  1178. Xecho [-n] <str>
  1179. X--------------------------------------------------------------------------*/
  1180. Xint
  1181. Xpcmd_echo(param)
  1182. XESD *param;
  1183. X{
  1184. X    int erc;
  1185. X    ESD *tesd;
  1186. X    char switches[8];
  1187. X
  1188. X    if (!(tesd = esdalloc(ESD_NOMSZ)))
  1189. X        return (eNoMemory);
  1190. X
  1191. X    get_switches(param, switches, sizeof(switches));
  1192. X
  1193. X    if (erc = gstr(param, tesd, 1))
  1194. X    {
  1195. X        esdfree(tesd);
  1196. X        return (erc);
  1197. X    }
  1198. X    pputs(tesd->pb);
  1199. X    if (!strchr(switches, 'n'))    /* if no -n */
  1200. X        pputs("\n");
  1201. X    esdfree(tesd);
  1202. X    return (0);
  1203. X
  1204. X}                             /* end of pcmd_echo */
  1205. X
  1206. X/*+-------------------------------------------------------------------------
  1207. X    pcmd_exec(param)
  1208. X--------------------------------------------------------------------------*/
  1209. Xint
  1210. Xpcmd_exec(param)
  1211. XESD *param;
  1212. X{
  1213. X    int erc = 0;
  1214. X    ESD *tesd = (ESD *) 0;
  1215. X
  1216. X    if (!(tesd = esdalloc(64)))
  1217. X        return (eNoMemory);
  1218. X    if (erc = gstr(param, tesd, 1))
  1219. X        goto FUNC_RETURN;
  1220. X
  1221. X    /* reset indices */
  1222. X    tesd->index = 0;
  1223. X    tesd->old_index = 0;
  1224. X
  1225. X    if (proc_trace)
  1226. X        pprintf("executing: <%s>\n", tesd->pb);
  1227. X    if (erc = execute_esd(tesd))
  1228. X    {
  1229. X        esdshow(tesd, "error executing dynamic statement:");
  1230. X        proc_error(erc);
  1231. X        erc = eFATAL_ALREADY;
  1232. X    }
  1233. X
  1234. X  FUNC_RETURN:
  1235. X    if (tesd)
  1236. X        esdfree(tesd);
  1237. X    return (erc);
  1238. X
  1239. X}                             /* end of pcmd_exec */
  1240. X
  1241. X/*+-------------------------------------------------------------------------
  1242. X    pcmd_exit(param)
  1243. X--------------------------------------------------------------------------*/
  1244. Xint
  1245. Xpcmd_exit(param)
  1246. XESD *param;
  1247. X{
  1248. X    long int1;
  1249. X    ulong colors_at_entry = colors_current;
  1250. X
  1251. X    if (!gint(param, &int1) && int1)
  1252. X    {
  1253. X        setcolor(colors_error);
  1254. X        pprintf("[procedure terminating ecu: user code %ld]\n", int1);
  1255. X        setcolor(colors_at_entry);
  1256. X        if ((int1 += TERMECU_USER1 - 1) > TERMECU_USERN)
  1257. X        {
  1258. X            int1 = TERMECU_USERN;
  1259. X            pprintf("user exit code too large, using %d\r\n",
  1260. X                TERMECU_USERN - TERMECU_USER1);
  1261. X        }
  1262. X        termecu((int)int1);
  1263. X    }
  1264. X    setcolor(colors_success);
  1265. X    pputs("[procedure terminating ecu: normal exit]\n");
  1266. X    setcolor(colors_at_entry);
  1267. X    termecu(0);
  1268. X}                             /* end of pcmd_exit */
  1269. X
  1270. X/*+-------------------------------------------------------------------------
  1271. X    pcmd_lgets(param)
  1272. X
  1273. Xlgets [-er] <strvar> <int1> <int2> [<str>]
  1274. X
  1275. Xread string into string variable number <stvar>
  1276. Xwaiting <int1> 1/10th secs for first char,
  1277. Xwaiting <int2> 1/10th secs for subsequent chars,
  1278. Xoptionally terminating read upon detection of <str>
  1279. X-e echos to screen
  1280. X-r completely raw, else strip CRs & NLs from either end of string
  1281. X$i0 receives the length of the read
  1282. X$i1 receives 1 if your specified delimiter was read, else zero
  1283. X<strvar> receives the string
  1284. X--------------------------------------------------------------------------*/
  1285. Xint
  1286. Xpcmd_lgets(param)
  1287. XESD *param;
  1288. X{
  1289. X    int erc;
  1290. X    long int2;
  1291. X    long int3;
  1292. X    ESD *tesd1 = (ESD *) 0;
  1293. X    ESD *svptr;
  1294. X    LRWT lr;
  1295. X    char switches[8];
  1296. X    ESD *esdalloc();
  1297. X    char ctmp;
  1298. X
  1299. X    if (shm->Liofd < 0)
  1300. X        return (eNoLineAttached);
  1301. X
  1302. X    get_switches(param, switches, sizeof(switches));
  1303. X
  1304. X    skip_cmd_char(param, '$');
  1305. X    if (erc = get_cmd_char(param, &ctmp))
  1306. X        return (erc);
  1307. X    if (to_lower(ctmp) != 's')
  1308. X        return (eIllegalVarType);
  1309. X    if (erc = get_svptr(param, &svptr, 1))
  1310. X        return (erc);
  1311. X
  1312. X    if (erc = gint(param, &int2))
  1313. X        return (erc);
  1314. X
  1315. X    if (erc = gint(param, &int3))
  1316. X        return (erc);
  1317. X
  1318. X    if (!(tesd1 = esdalloc(64)))
  1319. X        return (eNoMemory);
  1320. X    if (gstr(param, tesd1, 1))    /* optional delimiter */
  1321. X    {
  1322. X        esdfree(tesd1);
  1323. X        tesd1 = (ESD *) 0;
  1324. X    }
  1325. X
  1326. X    esdzero(svptr);             /* no characters read yet */
  1327. X    iv[0] = 0;                 /* no characters read yet */
  1328. X    iv[1] = 0;                 /* no delim detected yet */
  1329. X
  1330. X    lr.to1 = int2 * 100L;
  1331. X    lr.to2 = int3 * 100L;
  1332. X    /* allow interrupts + raw read per -r */
  1333. X    lr.raw_flag = (strchr(switches, 'r')) ? 0x81 : 0x80;
  1334. X    lr.buffer = svptr->pb;
  1335. X    lr.bufsize = svptr->maxcb;
  1336. X    lr.delim = (tesd1) ? tesd1->pb : (char *)0;
  1337. X    lr.echo_flag = (strchr(switches, 'e') != (char *)0);
  1338. X
  1339. X    if (proc_trace)
  1340. X    {
  1341. X        pprintf("lgets (to1=%ld,to2=%ld) started at %s\n",
  1342. X            lr.to1, lr.to2,
  1343. X            get_time_plus_msec());
  1344. X    }
  1345. X
  1346. X    (void)lgets_timeout(&lr);
  1347. X    if (tesd1)
  1348. X        esdfree(tesd1);
  1349. X
  1350. X    svptr->cb = lr.count;
  1351. X    esd_null_terminate(svptr);
  1352. X    iv[0] = (long)lr.count;
  1353. X    iv[1] = (long)lr.got_delim;
  1354. X    if (zero_length_read_detected)
  1355. X    {
  1356. X        zero_length_read_detected = 0;
  1357. X        erc = eProcAttn_DCDloss;
  1358. X    }
  1359. X    if (proc_trace)
  1360. X    {
  1361. X        pprintf("lgets ended at %s (read %d chars)\n",
  1362. X            get_time_plus_msec(), lr.count);
  1363. X    }
  1364. X    return (erc);
  1365. X
  1366. X}                             /* end of pcmd_lgets */
  1367. X
  1368. X/*+-------------------------------------------------------------------------
  1369. X    pcmd_flush(param)
  1370. X--------------------------------------------------------------------------*/
  1371. X/*ARGSUSED*/
  1372. Xint
  1373. Xpcmd_flush(param)
  1374. XESD *param;
  1375. X{
  1376. X    if (shm->Liofd < 0)
  1377. X        return (eNoLineAttached);
  1378. X
  1379. X    lflush(2);
  1380. X    if (proc_trace)
  1381. X        pputs("line flushed\n");
  1382. X    return (0);
  1383. X}                             /* end of pcmd_flush */
  1384. X
  1385. X/*+-------------------------------------------------------------------------
  1386. X    pcmd_hangup(param)
  1387. X--------------------------------------------------------------------------*/
  1388. X/*ARGSUSED*/
  1389. Xint
  1390. Xpcmd_hangup(param)
  1391. XESD *param;
  1392. X{
  1393. X    if (shm->Liofd < 0)
  1394. X    {
  1395. X        if (proc_trace)
  1396. X            pputs("no line attached ... hangup ignored\n");
  1397. X        DCE_now_on_hook();
  1398. X        return (0);
  1399. X    }
  1400. X
  1401. X    if (proc_trace)
  1402. X        pputs("hanging up ... ");
  1403. X    DCE_hangup();
  1404. X    if (proc_trace)
  1405. X        pputs("line on hook\n");
  1406. X    return (0);
  1407. X}                             /* end of pcmd_hangup */
  1408. X
  1409. X/*+-------------------------------------------------------------------------
  1410. X    pcmd_hexdump(param)
  1411. X
  1412. Xhexdump [-s] <str>
  1413. Xhexdump -t[s] <str1> <str>
  1414. X<str> buf to dump
  1415. X<str1> title (if -t)
  1416. X-s short (terse) dump
  1417. X--------------------------------------------------------------------------*/
  1418. Xint
  1419. Xpcmd_hexdump(param)
  1420. XESD *param;
  1421. X{
  1422. X    int erc;
  1423. X    ESD *title = 0;
  1424. X    ESD *tesd = 0;
  1425. X    char switches[8];
  1426. X    extern FILE *plog_fp;
  1427. X
  1428. X    if (!(tesd = esdalloc(ESD_NOMSZ)))
  1429. X        return (eNoMemory);
  1430. X
  1431. X    get_switches(param, switches, sizeof(switches));
  1432. X
  1433. X    if (strchr(switches, 't'))    /* if -t */
  1434. X    {
  1435. X        if (!(title = esdalloc(ESD_NOMSZ)))
  1436. X        {
  1437. X            erc = eNoMemory;
  1438. X            goto FUNC_RETURN;
  1439. X        }
  1440. X        if (erc = gstr(param, title, 0))
  1441. X            goto FUNC_RETURN;
  1442. X    }
  1443. X
  1444. X    if (erc = gstr(param, tesd, 1))
  1445. X        goto FUNC_RETURN;
  1446. X
  1447. X    hex_dump(tesd->pb, tesd->cb, (title) ? title->pb : "",
  1448. X        (strchr(switches, 's')) ? 1 : 0);
  1449. X
  1450. X    if (plog_fp)
  1451. X        hex_dump_fp(plog_fp, tesd->pb, tesd->cb, (title) ? title->pb : "",
  1452. X            (strchr(switches, 's')) ? 1 : 0);
  1453. X
  1454. X  FUNC_RETURN:
  1455. X    if (tesd)
  1456. X        esdfree(tesd);
  1457. X    if (title)
  1458. X        esdfree(title);
  1459. X    return (erc);
  1460. X
  1461. X}                             /* end of pcmd_hexdump */
  1462. X
  1463. X/*+-------------------------------------------------------------------------
  1464. X    pcmd_lbreak(param)
  1465. X--------------------------------------------------------------------------*/
  1466. X/*ARGSUSED*/
  1467. Xint
  1468. Xpcmd_lbreak(param)
  1469. XESD *param;
  1470. X{
  1471. X    if (shm->Liofd < 0)
  1472. X        return (eNoLineAttached);
  1473. X
  1474. X    lbreak();
  1475. X    return (0);
  1476. X}                             /* end of pcmd_lbreak */
  1477. X
  1478. X/*+-------------------------------------------------------------------------
  1479. X    pcmd_logevent(param)
  1480. X
  1481. Xlogevent 'cmd'
  1482. X--------------------------------------------------------------------------*/
  1483. Xint
  1484. Xpcmd_logevent(param)
  1485. XESD *param;
  1486. X{
  1487. X    int erc;
  1488. X    ESD *eventstr;
  1489. X    char switches[8];
  1490. X
  1491. X    if (!(eventstr = esdalloc(ESD_NOMSZ)))
  1492. X        return (eNoMemory);
  1493. X
  1494. X    get_switches(param, switches, sizeof(switches));
  1495. X
  1496. X/* a hack */
  1497. X    strcpy(eventstr->pb, "PROC ");
  1498. X    eventstr->pb += 5;
  1499. X    eventstr->maxcb -= 5;
  1500. X
  1501. X    if (erc = gstr(param, eventstr, 0))
  1502. X    {
  1503. X        eventstr->pb -= 5;     /* be nice */
  1504. X        eventstr->maxcb += 5;/* or surely this will haunt us one day */
  1505. X        esdfree(eventstr);
  1506. X        return (erc);
  1507. X    }
  1508. X
  1509. X/* rehack */
  1510. X    eventstr->pb -= 5;
  1511. X    eventstr->maxcb += 5;
  1512. X    eventstr->cb += 5;
  1513. X
  1514. X    ecu_log_event(getpid(), eventstr->pb);
  1515. X    esdfree(eventstr);
  1516. X    return (0);
  1517. X
  1518. X}                             /* end of eventstr_logevent */
  1519. X
  1520. X/*+-------------------------------------------------------------------------
  1521. X    pcmd_lookfor(param)
  1522. X
  1523. Xlookfor [-e] [quiet | <str>] [<int>]
  1524. X
  1525. X-e echo to screen while looking
  1526. Xquiet means look for quiet
  1527. X<str> means look for string
  1528. X<int> number 1/10ths secs (default 5.0 second) for timeout
  1529. X
  1530. Xin case of lookfor <str>, $i0 plugged 1 if found, else 0
  1531. X--------------------------------------------------------------------------*/
  1532. Xint
  1533. Xpcmd_lookfor(param)
  1534. XESD *param;
  1535. X{
  1536. X    int erc;
  1537. X    char switches[8];
  1538. X    char *cptr = (char *)0;
  1539. X    ESD *tesd = (ESD *) 0;
  1540. X    ulong decisecs = 50;     /* default wait is 5 seconds */
  1541. X    int echo_flag;
  1542. X    char s8[8];
  1543. X    long start_secs;
  1544. X
  1545. X    if (shm->Liofd < 0)
  1546. X        return (eNoLineAttached);
  1547. X
  1548. X    get_switches(param, switches, sizeof(switches));
  1549. X    echo_flag = (strchr(switches, 'e') != (char *)0);
  1550. X
  1551. X    if (!get_alpha_zstr(param, s8, sizeof(s8)))
  1552. X    {
  1553. X        if (strcmp(s8, "quiet"))
  1554. X            return (eSyntaxError);
  1555. X    }
  1556. X    else
  1557. X    {
  1558. X        if (!(tesd = esdalloc(ESD_NOMSZ)))
  1559. X            return (eNoMemory);
  1560. X        if (erc = gstr(param, tesd, 0))
  1561. X            goto FUNC_RETURN;
  1562. X        if (!tesd->cb)
  1563. X        {
  1564. X            pputs("lookfor null string\n");
  1565. X            erc = eFATAL_ALREADY;
  1566. X            goto FUNC_RETURN;
  1567. X        }
  1568. X        cptr = tesd->pb;
  1569. X    }
  1570. X
  1571. X    if (erc = gint(param, &decisecs))
  1572. X    {
  1573. X        /* if something there non-integer */
  1574. X        if (!end_of_cmd(param))
  1575. X        {
  1576. X            erc = eSyntaxError;
  1577. X            goto FUNC_RETURN;
  1578. X        }
  1579. X    }
  1580. X    erc = 0;
  1581. X
  1582. X    if (proc_trace)
  1583. X        time(&start_secs);
  1584. X
  1585. X    if (cptr)
  1586. X    {
  1587. X        iv[0] = (long)llookfor(cptr, decisecs * 100L, echo_flag);
  1588. X        if (proc_trace)
  1589. X            pprintf("lookfor set $i00 = %ld\n", iv[0]);
  1590. X    }
  1591. X    else
  1592. X        lquiet(decisecs * 100L, echo_flag);
  1593. X
  1594. X    if (proc_trace)
  1595. X        pprintf("waited %ld secs\n", time((long *)0) - start_secs);
  1596. X
  1597. X  FUNC_RETURN:
  1598. X    if (tesd)
  1599. X        esdfree(tesd);
  1600. X    if (zero_length_read_detected)
  1601. X    {
  1602. X        zero_length_read_detected = 0;
  1603. X        erc = eProcAttn_DCDloss;
  1604. X    }
  1605. X    return (erc);
  1606. X
  1607. X}                             /* end of pcmd_lookfor */
  1608. X
  1609. X/*+-------------------------------------------------------------------------
  1610. X    pcmd_nap(param)
  1611. Xnap [-m] <int>
  1612. X<int> number 1/10ths secs, except if -m, nap <int> milliseconds
  1613. X--------------------------------------------------------------------------*/
  1614. Xint
  1615. Xpcmd_nap(param)
  1616. XESD *param;
  1617. X{
  1618. X    int erc;
  1619. X    char switches[8];
  1620. X    ulong interval;
  1621. X
  1622. X    get_switches(param, switches, sizeof(switches));
  1623. X
  1624. X    if (erc = gint(param, &interval))
  1625. X        return (erc);
  1626. X    if (interval)
  1627. X    {
  1628. X        if (!strchr(switches, 'm'))
  1629. X            interval *= 100L;
  1630. X        if (interval < hzmsec)    /* SCO nap bug */
  1631. X            interval = hzmsec;    /* SCO nap bug */
  1632. X        if (proc_trace && (interval > 100))    /* short naps hurt by pprintf */
  1633. X            pprintf("nap %ld msec\n", interval);
  1634. X        if (Nap(interval) == -1)    /* EINTR is the only error returned
  1635. X                                     * ... */
  1636. X        {                     /* but check anyway */
  1637. X            if (errno == EINTR)
  1638. X                erc = eCONINT;
  1639. X        }
  1640. X    }
  1641. X    return (erc);
  1642. X}                             /* end of pcmd_nap */
  1643. X
  1644. X/*+-------------------------------------------------------------------------
  1645. X    pcmd_nice(param)
  1646. X--------------------------------------------------------------------------*/
  1647. Xint
  1648. Xpcmd_nice(param)
  1649. XESD *param;
  1650. X{
  1651. X    long new_nice;
  1652. X    int erc;
  1653. X    int old_nice;
  1654. X    int nice();
  1655. X
  1656. X    if (shm->Liofd < 0)
  1657. X        return (eNoLineAttached);
  1658. X
  1659. X    if (erc = gint(param, &new_nice))
  1660. X        return (erc);
  1661. X    if ((new_nice < 0) || (new_nice > 39))
  1662. X    {
  1663. X        pprintf("warning: invalid nice %ld ignored (valid range 0-39)\n",
  1664. X            new_nice);
  1665. X        return (0);
  1666. X    }
  1667. X
  1668. X    old_nice = nice(0) + 20;
  1669. X    nice(-old_nice + (int)new_nice);
  1670. X
  1671. X    if (proc_trace)
  1672. X        pprintf("nice desired %u, set to %u\n", (uint) new_nice, nice(0) + 20);
  1673. X    return (0);
  1674. X
  1675. X}                             /* end of pcmd_nice */
  1676. X
  1677. X/*+-------------------------------------------------------------------------
  1678. X    pcmd_parity(param)
  1679. Xparity [e | o | n]
  1680. Xparity ['e' | 'o' | 'n']
  1681. X--------------------------------------------------------------------------*/
  1682. Xint
  1683. Xpcmd_parity(param)
  1684. XESD *param;
  1685. X{
  1686. X    int erc;
  1687. X    int new_parity = 0;
  1688. X    ESD *tesd;
  1689. X    char s64[64];
  1690. X
  1691. X    if (erc = skip_cmd_break(param))
  1692. X        return (erc);
  1693. X    if (!(tesd = esdalloc(64)))
  1694. X        return (eNoMemory);
  1695. X    if (!gstr(param, tesd, 0))
  1696. X        new_parity = to_lower(*tesd->pb);
  1697. X    else if (!get_alpha_zstr(param, s64, sizeof(s64)))
  1698. X        new_parity = to_lower(s64[0]);
  1699. X    else
  1700. X    {
  1701. X        erc = eSyntaxError;
  1702. X        goto FUNC_RETURN;
  1703. X    }
  1704. X    esdfree(tesd);
  1705. X
  1706. X    switch (new_parity)
  1707. X    {
  1708. X        case 'n':
  1709. X            new_parity = 0;
  1710. X        case 'e':
  1711. X        case 'o':
  1712. X            shm->Lparity = new_parity;
  1713. X            if (shm->Liofd < 0)
  1714. X                lset_parity(1);
  1715. X            break;
  1716. X        default:
  1717. X            erc = eBadParameter;
  1718. X    }
  1719. X    if (proc_trace && !erc)
  1720. X    {
  1721. X        pprintf("parity set to %s\n",
  1722. X            (shm->Lparity) ? ((shm->Lparity == 'e') ? "even" : "odd")
  1723. X            : "none");
  1724. X    }
  1725. X
  1726. X  FUNC_RETURN:
  1727. X    esdfree(tesd);
  1728. X    return (erc);
  1729. X
  1730. X}                             /* end of pcmd_parity */
  1731. X
  1732. X/*+-------------------------------------------------------------------------
  1733. X    pcmd_prompt(param)
  1734. X--------------------------------------------------------------------------*/
  1735. Xint
  1736. Xpcmd_prompt(param)
  1737. XESD *param;
  1738. X{
  1739. X    extern ESD *icmd_prompt;
  1740. X
  1741. X    return (gstr(param, icmd_prompt, 0));
  1742. X}                             /* end of pcmd_prompt */
  1743. X
  1744. X/*+-------------------------------------------------------------------------
  1745. X    pcmd_ptrace(param)
  1746. X--------------------------------------------------------------------------*/
  1747. Xint
  1748. Xpcmd_ptrace(param)
  1749. XESD *param;
  1750. X{
  1751. X    char s8[8];
  1752. X
  1753. X    if (get_alpha_zstr(param, s8, sizeof(s8)))
  1754. X        return (eSyntaxError);
  1755. X    if (isdigit(s8[0]))
  1756. X        proc_trace = atoi(s8);
  1757. X    if (!strcmp(s8, "on"))
  1758. X        proc_trace = 1;
  1759. X    else if (!strcmp(s8, "off"))
  1760. X        proc_trace = 0;
  1761. X    else
  1762. X        return (eSyntaxError);
  1763. X    return (0);
  1764. X}                             /* end of pcmd_ptrace */
  1765. X
  1766. X/*+-------------------------------------------------------------------------
  1767. X    pcmd_rname(param) - set remote name
  1768. X--------------------------------------------------------------------------*/
  1769. Xint
  1770. Xpcmd_rname(param)
  1771. XESD *param;
  1772. X{
  1773. X    int itmp;
  1774. X    int erc = 0;
  1775. X    ESD *rname = 0;
  1776. X
  1777. X    if (shm->Liofd < 0)
  1778. X        return (eNoLineAttached);
  1779. X
  1780. X    if (!shm->Lconnected)
  1781. X    {
  1782. X        pputs("Not connected\n");
  1783. X        return (eFATAL_ALREADY);
  1784. X    }
  1785. X
  1786. X    /*
  1787. X     * get temp for rname param (all exits after here must go through
  1788. X     * FUNC_RETURN)
  1789. X     */
  1790. X    if (!(rname = esdalloc(ESD_NOMSZ)))
  1791. X        return (eNoMemory);
  1792. X
  1793. X    if (erc = gstr(param, rname, 0))
  1794. X        goto FUNC_RETURN;
  1795. X
  1796. X    if (rname->cb > (itmp = sizeof(shm->Lrname) - 1))
  1797. X    {
  1798. X        pprintf("rname may only be %d characters long\n", itmp);
  1799. X        erc = eFATAL_ALREADY;
  1800. X        goto FUNC_RETURN;
  1801. X    }
  1802. X
  1803. X    strcpy(shm->Lrname, rname->pb);
  1804. X    if (proc_trace)
  1805. X        pprintf("rname set to '%s'\n", rname->pb);
  1806. X
  1807. X  FUNC_RETURN:
  1808. X    if (rname)
  1809. X        esdfree(rname);
  1810. X    return (erc);
  1811. X
  1812. X}                             /* end of pcmd_rname */
  1813. X
  1814. X/*+-------------------------------------------------------------------------
  1815. X    pcmd_send(param)
  1816. Xsend [-n] <str>
  1817. X-n do not send trailing CR
  1818. X-v turn on proc_trace for just this statement
  1819. X-p## pace characters ## msec apart
  1820. X--------------------------------------------------------------------------*/
  1821. Xint
  1822. Xpcmd_send(param)
  1823. XESD *param;
  1824. X{
  1825. X    int erc;
  1826. X    char *cptr;
  1827. X    ESD *buf;
  1828. X    char switches[32];
  1829. X    int send_cr;
  1830. X    int tell_it;
  1831. X    long pace_msec = 0L;
  1832. X
  1833. X    if (shm->Liofd < 0)
  1834. X        return (eNoLineAttached);
  1835. X
  1836. X    if ((buf = esdalloc(ESD_NOMSZ)) == (ESD *) 0)
  1837. X        return (eNoMemory);
  1838. X
  1839. X    get_switches(param, switches, sizeof(switches));
  1840. X    send_cr = !strchr(switches, 'n');
  1841. X    tell_it = !!strchr(switches, 'v');
  1842. X    if (cptr = strchr(switches, 'p'))
  1843. X        sscanf(cptr + 1, "%ld", &pace_msec);
  1844. X
  1845. X    if (erc = gstr(param, buf, 1))
  1846. X    {
  1847. X        esdfree(buf);
  1848. X        return (erc);
  1849. X    }
  1850. X
  1851. X    if (proc_trace || tell_it)
  1852. X    {
  1853. X        hex_dump(buf->pb, buf->cb,
  1854. X            (send_cr) ? "send with CR" : "send w/o CR", 1);
  1855. X    }
  1856. X
  1857. X    if (pace_msec)
  1858. X        lputs_paced(pace_msec, buf->pb);
  1859. X    else
  1860. X        lputs(buf->pb);
  1861. X
  1862. X    if (send_cr)
  1863. X        lputc(CRET);
  1864. X    if (pace_msec)
  1865. X        Nap(pace_msec);
  1866. X
  1867. X    esdfree(buf);
  1868. X    return (erc);
  1869. X}                             /* end of pcmd_send */
  1870. X
  1871. X/*+-------------------------------------------------------------------------
  1872. X    pcmd_set(param)
  1873. X--------------------------------------------------------------------------*/
  1874. Xint
  1875. Xpcmd_set(param)
  1876. XESD *param;
  1877. X{
  1878. X    int erc;
  1879. X    int itmp;
  1880. X    ulong varnum;
  1881. X    uint varmax;
  1882. X    char vartype;
  1883. X    char varstr[16];
  1884. X    int show_status;
  1885. X    long *ivptr;
  1886. X    ESD *svptr;
  1887. X    char *cptr;
  1888. X    char *make_char_graphic();
  1889. X
  1890. X    if (erc = skip_cmd_break(param))
  1891. X        return (erc);
  1892. X
  1893. X    do
  1894. X    {
  1895. X
  1896. X        /* $ is optional */
  1897. X        if ((erc = skip_cmd_char(param, '$')) && (erc != eSyntaxError))
  1898. X            return (erc);
  1899. X
  1900. X        /* get variable type */
  1901. X        if (get_cmd_char(param, &vartype))
  1902. X            return (eSyntaxError);
  1903. X
  1904. X        /* validate variable type */
  1905. X        vartype = to_lower(vartype);
  1906. X        switch (vartype)
  1907. X        {
  1908. X            case 'i':
  1909. X                varmax = IVQUAN;
  1910. X                break;
  1911. X            case 's':
  1912. X                varmax = SVQUAN;
  1913. X                break;
  1914. X            default:
  1915. X                return (eIllegalVarType);
  1916. X        }
  1917. X
  1918. X        if (!get_numeric_value(param, &varnum))
  1919. X            goto TEST_VARNUM;
  1920. X        else if (*(param->pb + param->index) == '[')
  1921. X        {
  1922. X            if (erc = get_subscript(param, &varnum))
  1923. X                return (erc);
  1924. X          TEST_VARNUM:
  1925. X            if ((int)varnum >= varmax)
  1926. X                return (eIllegalVarNumber);
  1927. X            switch (vartype)
  1928. X            {
  1929. X                case 'i':
  1930. X                    ivptr = &iv[(int)varnum];
  1931. X                    break;
  1932. X                default:
  1933. X                    svptr = sv[(int)varnum];
  1934. X            }
  1935. X        }
  1936. X        else if (get_alphanum_zstr(param, varstr, sizeof(varstr)))
  1937. X            return (eInvalidVarName);
  1938. X        else
  1939. X        {
  1940. X            varnum = NAMED_VARIABLE_FLAG;
  1941. X            switch (vartype)
  1942. X            {
  1943. X                case 'i':
  1944. X                    erc = find_mkvi(varstr, &ivptr, 1);
  1945. X                    break;
  1946. X                default:
  1947. X                    erc = find_mkvs(varstr, &svptr, 1);
  1948. X            }
  1949. X            if (erc)
  1950. X                return (erc);
  1951. X        }
  1952. X
  1953. X        show_status = 1;
  1954. X        if (!skip_cmd_char(param, '='))    /* assignment */
  1955. X        {
  1956. X            switch (vartype)
  1957. X            {
  1958. X                case 'i':
  1959. X                    if (erc = gint(param, ivptr))
  1960. X                        return (erc);
  1961. X                    break;
  1962. X                default:
  1963. X                    if (erc = gstr(param, svptr, 1))
  1964. X                        return (erc);
  1965. X                    break;
  1966. X            }
  1967. X            if (!proc_trace)
  1968. X                show_status = 0;
  1969. X        }
  1970. X        if (show_status)
  1971. X        {
  1972. X            switch (vartype)
  1973. X            {
  1974. X                case 'i':
  1975. X                    if (varnum != NAMED_VARIABLE_FLAG)
  1976. X                        pprintf("$i%02ld = %7ld (0x%08lx,0%03lo", varnum,
  1977. X                            *ivptr, *ivptr, *ivptr);
  1978. X                    else
  1979. X                        pprintf("$i%s = %ld (0x%08lx,0%03lo", varstr,
  1980. X                            *ivptr, *ivptr, *ivptr);
  1981. X                    if ((*ivptr >= 0) && (*ivptr <= 255))
  1982. X                        pprintf(",'%s'", make_char_graphic((char)*ivptr, 1));
  1983. X                    pputs(")\n");
  1984. X                    break;
  1985. X                default:
  1986. X                    if (varnum != NAMED_VARIABLE_FLAG)
  1987. X                        pprintf("$s%02ld = '", varnum);
  1988. X                    else
  1989. X                        pprintf("$s%s = '", varstr);
  1990. X                    itmp = svptr->cb;
  1991. X                    cptr = svptr->pb;
  1992. X                    while (itmp--)
  1993. X                        pputs(make_char_graphic(*cptr++, 0));
  1994. X                    pputs("'\n");
  1995. X                    break;
  1996. X            }
  1997. X        }
  1998. X    }
  1999. X    while (!skip_comma(param));
  2000. X
  2001. X    if (!end_of_cmd(param))
  2002. X        return (eSyntaxError);
  2003. X
  2004. X    return (0);
  2005. X}                             /* end of pcmd_set */
  2006. X
  2007. X/*+-------------------------------------------------------------------------
  2008. X    pcmd_system(param)
  2009. X
  2010. Xsystem [-l] 'cmd'
  2011. X-l makes comm line stdin/stdout
  2012. X-s keeps all fds the same
  2013. X
  2014. Xreturns $i0 set to exit status of program or 0x100 if interrupted
  2015. X--------------------------------------------------------------------------*/
  2016. Xint
  2017. Xpcmd_system(param)
  2018. XESD *param;
  2019. X{
  2020. X    int erc;
  2021. X    ESD *cmd;
  2022. X    extern int last_child_wait_status;
  2023. X    char switches[8];
  2024. X
  2025. X    if ((cmd = esdalloc(ESD_NOMSZ)) == (ESD *) 0)
  2026. X        return (eNoMemory);
  2027. X
  2028. X    get_switches(param, switches, sizeof(switches));
  2029. X
  2030. X/* a hack */
  2031. X    *cmd->pb++ = (strchr(switches, 's')) ? '>' :
  2032. X        ((strchr(switches, 'l')) ? '$' : '!');
  2033. X
  2034. X    cmd->maxcb--;
  2035. X
  2036. X    if (erc = gstr(param, cmd, 1))
  2037. X    {
  2038. X        cmd->pb--;             /* be nice */
  2039. X        cmd->maxcb++;         /* or surely this will haunt us one day */
  2040. X        esdfree(cmd);
  2041. X        return (erc);
  2042. X    }
  2043. X
  2044. X/* rehack */
  2045. X    cmd->pb--;
  2046. X    cmd->cb++;
  2047. X    cmd->maxcb++;
  2048. X
  2049. X    if (proc_trace)
  2050. X    {
  2051. X        pputs(cmd->pb + 1);
  2052. X        pputs("\n");
  2053. X    }
  2054. X
  2055. X    last_child_wait_status = 0xFF00;
  2056. X    shell(cmd->pb);
  2057. X    iv[0] = (last_child_wait_status & 0xFF)
  2058. X        ? 0x100L : (long)last_child_wait_status >> 8;
  2059. X    if (proc_trace)
  2060. X        pprintf("$i0 = %ld, (%s)\n", iv[0],
  2061. X            (iv[0] == 0x100L) ? "interrupted" : "program exit status");
  2062. X
  2063. X    esdfree(cmd);
  2064. X    return (0);
  2065. X}                             /* end of pcmd_system */
  2066. X
  2067. X/*+-------------------------------------------------------------------------
  2068. X    get_big_endian_16(ptr)
  2069. X--------------------------------------------------------------------------*/
  2070. Xushort
  2071. Xget_big_endian_16(ptr)
  2072. Xregister uchar *ptr;
  2073. X{
  2074. X    register ushort uint16 = ((ushort) ptr[0] << 8) | ptr[1];
  2075. X
  2076. X    return (uint16);
  2077. X
  2078. X}                             /* end of get_big_endian_16 */
  2079. X
  2080. X/*+-------------------------------------------------------------------------
  2081. X    get_big_endian_32(ptr)
  2082. X--------------------------------------------------------------------------*/
  2083. Xulong
  2084. Xget_big_endian_32(ptr)
  2085. Xregister uchar *ptr;
  2086. X{
  2087. X    register ulong uint32 = ((ulong) * ptr++) << 24;
  2088. X
  2089. X    uint32 |= ((ulong) * ptr++) << 16;
  2090. X    uint32 |= ((ulong) * ptr++) << 8;
  2091. X    uint32 |= (ulong) * ptr++;
  2092. X    return (uint32);
  2093. X
  2094. X}                             /* end of get_big_endian_32 */
  2095. X
  2096. X/*+-------------------------------------------------------------------------
  2097. X    pcmd_getf(param) - get friend memory
  2098. X
  2099. Xgetf -x <int-var-spec> <offset>
  2100. Xwhere: -x ==
  2101. X   -b byte
  2102. X   -w word (little-endian)
  2103. X   -W word (big-endian)
  2104. X   -l 32-bits (little-endian)
  2105. X   -L 32-bits (big-endian)
  2106. X--------------------------------------------------------------------------*/
  2107. Xint
  2108. Xpcmd_getf(param)
  2109. XESD *param;
  2110. X{
  2111. X    int erc;
  2112. X    char switches[8];
  2113. X    long *piv;
  2114. X    long offset;
  2115. X    int size;
  2116. X    int big_endian;
  2117. X
  2118. X    if (erc = get_switches(param, switches, sizeof(switches)))
  2119. X        return (erc);
  2120. X    if ((strlen(switches) != 2) || !strchr("bwWlL", switches[1]))
  2121. X    {
  2122. X        pputs("invalid switch\n");
  2123. X        return (eFATAL_ALREADY);
  2124. X    }
  2125. X    size = to_lower(switches[1]);
  2126. X    big_endian = isupper(switches[1]);
  2127. X
  2128. X/*
  2129. X    if(!get_svptr(param,&psv))
  2130. X        return(eNotImplemented);
  2131. X    else
  2132. X*/
  2133. X    if (!strncmp(param->pb + param->index, "$i", 2))
  2134. X        param->index += 2;
  2135. X    if (erc = get_ivptr(param, &piv, 1))
  2136. X        return (erc);
  2137. X
  2138. X    if (erc = gint(param, &offset))
  2139. X        return (erc);
  2140. X
  2141. X    if (proc_trace)
  2142. X        pprintf("getf %s offset=0x%lx", switches, offset);
  2143. X
  2144. X    switch (size)
  2145. X    {
  2146. X        case 'b':
  2147. X            if (offset > ((long)sizeof(shm->friend_space) - 1))
  2148. X                goto OFFSET_TOO_LARGE;
  2149. X            *piv = *(((uchar *) shm->friend_space) + (int)offset) & 0xFF;
  2150. X            break;
  2151. X        case 'w':
  2152. X            if (offset > ((long)sizeof(shm->friend_space) - 2))
  2153. X                goto OFFSET_TOO_LARGE;
  2154. X            if (big_endian)
  2155. X                *piv = get_big_endian_16((uchar *) shm->friend_space +
  2156. X                    (int)offset);
  2157. X            else
  2158. X                *piv = *(((ushort *) shm->friend_space) + (int)offset) & 0xFFFF;
  2159. X            break;
  2160. X        case 'l':
  2161. X            if (offset > ((long)sizeof(shm->friend_space) - 4))
  2162. X                goto OFFSET_TOO_LARGE;
  2163. X            if (big_endian)
  2164. X            {
  2165. X                *piv = get_big_endian_32((uchar *) shm->friend_space +
  2166. X                    (int)offset);
  2167. X            }
  2168. X            else
  2169. X                *piv = *((long *)((char *)shm->friend_space + (int)offset));
  2170. X            break;
  2171. X    }
  2172. X
  2173. X    if (proc_trace)
  2174. X        pprintf(" value=%ld (%08lx)\n", *piv, *piv);
  2175. X    return (0);
  2176. X
  2177. X  OFFSET_TOO_LARGE:
  2178. X    if (proc_trace)
  2179. X        pputs("\n");
  2180. X    pprintf("offset 0x%02lx too large for -%c (0x%02x bytes available)\n",
  2181. X        offset, switches[1], sizeof(shm->friend_space));
  2182. X    return (eFATAL_ALREADY);
  2183. X
  2184. X}                             /* end of pcmd_getf */
  2185. X
  2186. X/*+-------------------------------------------------------------------------
  2187. X    pcmd_putf(param)
  2188. X--------------------------------------------------------------------------*/
  2189. X/*ARGSUSED*/
  2190. Xint
  2191. Xpcmd_putf(param)
  2192. XESD *param;
  2193. X{
  2194. X    return (eNotImplemented);
  2195. X}                             /* end of pcmd_putf */
  2196. X
  2197. X/*+-------------------------------------------------------------------------
  2198. X    pcmd_xon(param)
  2199. X--------------------------------------------------------------------------*/
  2200. Xint
  2201. Xpcmd_xon(param)
  2202. XESD *param;
  2203. X{
  2204. X    int erc;
  2205. X    char new_xonxoff[8];
  2206. X    char *xon_status();
  2207. X
  2208. X    if (shm->Liofd < 0)
  2209. X        return (eNoLineAttached);
  2210. X
  2211. X    if (erc = get_alpha_zstr(param, new_xonxoff, sizeof(new_xonxoff)))
  2212. X        return (erc);
  2213. X
  2214. X    if (set_xon_xoff_by_arg(new_xonxoff))
  2215. X        return (eBadParameter);
  2216. X
  2217. X    if (proc_trace)
  2218. X        pprintf("xon/xoff flow control set to %s\n", xon_status());
  2219. X
  2220. X    return (erc);
  2221. X
  2222. X}                             /* end of pcmd_xon */
  2223. X
  2224. X/*+-------------------------------------------------------------------------
  2225. X    pcmd_rtscts(param)
  2226. X--------------------------------------------------------------------------*/
  2227. Xint
  2228. Xpcmd_rtscts(param)
  2229. XESD *param;
  2230. X{
  2231. X    int erc;
  2232. X    char new_rtscts[8];
  2233. X
  2234. X    if (shm->Liofd < 0)
  2235. X        return (eNoLineAttached);
  2236. X
  2237. X    if (erc = get_alphanum_zstr(param, new_rtscts, sizeof(new_rtscts)))
  2238. X        return (erc);
  2239. X
  2240. X#if defined(HW_FLOW_CONTROL) /* see ecu.h */
  2241. X    lRTSCTS_control(yes_or_no(new_rtscts));
  2242. X
  2243. X    if (proc_trace)
  2244. X        display_hw_flow_config();
  2245. X#else
  2246. X    if (proc_trace)
  2247. X        pprintf("hardware flow control not available .... rtscts ignored\n");
  2248. X#endif /* RTSFLOW */
  2249. X
  2250. X    return (erc);
  2251. X}                             /* end of pcmd_rtscts */
  2252. X
  2253. X/*+-------------------------------------------------------------------------
  2254. X    pcmd_setline(param) - _rc.ep setline command
  2255. X
  2256. XThis command can be used to set the initial line in _rc.ep
  2257. X--------------------------------------------------------------------------*/
  2258. Xint
  2259. Xpcmd_setline(param)
  2260. XESD *param;
  2261. X{
  2262. X    int erc;
  2263. X    ESD *tesd;
  2264. X
  2265. X    if (rc_ep_has_run)
  2266. X    {
  2267. X        pprintf("command legal only in _rc.ep\n");
  2268. X        return (eFATAL_ALREADY);
  2269. X    }
  2270. X
  2271. X    if (!(tesd = esdalloc(sizeof(shm->Lline))))
  2272. X        return (eNoMemory);
  2273. X    if (erc = gstr(param, tesd, 0))
  2274. X        goto FUNC_RETURN;
  2275. X    shm->Lline[0] = 0;
  2276. X    if (strncmp(tesd->pb, "/dev/", 5))
  2277. X        strcat(shm->Lline, "/dev/");
  2278. X    strncat(shm->Lline, tesd->pb, sizeof(shm->Lline) - strlen(shm->Lline));
  2279. X    shm->Lline[sizeof(shm->Lline) - 1] = 0;
  2280. X    if (proc_trace)
  2281. X        pprintf("line set to %s\n", shm->Lline);
  2282. X
  2283. X  FUNC_RETURN:
  2284. X    esdfree(tesd);
  2285. X    return (erc);
  2286. X}                             /* end of pcmd_setline */
  2287. X
  2288. X/* vi: set tabstop=4 shiftwidth=4: */
  2289. X/* end of pcmd.c */
  2290. END_OF_FILE
  2291.   if test 33339 -ne `wc -c <'ecu330/pcmd.c'`; then
  2292.     echo shar: \"'ecu330/pcmd.c'\" unpacked with wrong size!
  2293.   fi
  2294.   # end of 'ecu330/pcmd.c'
  2295. fi
  2296. echo shar: End of archive 17 \(of 37\).
  2297. cp /dev/null ark17isdone
  2298. MISSING=""
  2299. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ; do
  2300.     if test ! -f ark${I}isdone ; then
  2301.     MISSING="${MISSING} ${I}"
  2302.     fi
  2303. done
  2304. if test "${MISSING}" = "" ; then
  2305.     echo You have unpacked all 37 archives.
  2306.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2307. else
  2308.     echo You still must unpack the following archives:
  2309.     echo "        " ${MISSING}
  2310. fi
  2311. exit 0
  2312. exit 0 # Just in case...
  2313.