home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 021.lha / Vt100_v2.4 / vt100.doc < prev    next >
Text File  |  1986-11-10  |  18KB  |  598 lines

  1. This is the documentation file for the VT100 terminal emulator by Dave
  2. Wecker (V2.4 DBW 861214). Comments/suggestions/bugs/problems/praise
  3. should be sent to:
  4.  
  5.     Dave Wecker at    ENET:    COOKIE::WECKER
  6.             ARPA:    wecker%cookie.dec.com@decwrl.dec.com
  7.             USENET:    {decvax|decwrl}!cookie.dec.com!wecker
  8.             SNAIL:    Dave Wecker
  9.                 115 Palm Springs Drive
  10.                 Colorado Springs, CO  80908
  11.  
  12. Multi-file transfer, the new version of KERMIT and script support were
  13. contributed by Steve Drew (Aug 20 1986). If you wish to thank Steve
  14. directly he can be contacted through:
  15.  
  16.         Steve Drew at    ENET:    CGFSV1::DREW
  17.                 ARPA:    drew%cfgsv1.dec.com@decwrl.dec.com
  18.                 USENET:  decvax!decwrl!cgfsv1.dec.com!drew    
  19.  
  20. Many other pieces of code/suggestions have been sent in..
  21.  
  22.     thanks to all!
  23.  
  24. Program startup:
  25. ----------------
  26.     1> vt100 [initfile]
  27.  
  28.         - At startup, the program will search for an initialization
  29.           file to execute. It will first look for the specified
  30.           "initfile", then VT100.INIT (in the current directory)
  31.           and finally S:VT100.INIT. The format for the init file
  32.           is described later in this document.
  33.  
  34.         - The init file controls the setting of initial defaults
  35.           and screen and macro definitions.
  36.  
  37.         - If none of the files (listed above) are found, the
  38.           built-in defaults (defined in VT100.H as variables,
  39.           beginning with "p_") are used.
  40.  
  41.         - All commands are either menu or script based. Scripts
  42.           are described below.
  43.  
  44. Menus (Commands in parenthesis are keyboard bindings: Right-Amiga-chr):
  45. -----------------------------------------------------------------------
  46. File                   - file transfers
  47.     Ascii Capture        - Begin/end a script of the current session
  48.     Ascii Send        - Type a file to the host
  49.     Xmodem Receive    (A-V)    - Receive a file using XMODEM protocol
  50.     Xmodem Send    (A-^)    - Send    a file using XMODEM protocol
  51.     Kermit Get    (A-G)    - Receive files from a host KERMIT SERVER
  52.     Kermit Receive    (A-R)    - Receive files from a host KERMIT
  53.     Kermit Send    (A-S)    - Send    files to   a host KERMIT [SERVER]
  54.     Kermit Bye    (A-B)    - Terminate a host KERMIT SERVER
  55. Comm Setup            - Setup communications
  56.     Baud Rate        - Set the terminal baud rate
  57.         300, 
  58.         1200,    (A-L)
  59.         2400,    (A-H)
  60.         4800,
  61.         9600
  62.     Parity            - Type of parity
  63.         NONE,     (A-X)
  64.         MARK,
  65.         SPACE,
  66.         EVEN,    (A-E)
  67.         ODD    (A-O)
  68.     Xfer Mode
  69.         Image    (A-I)    - Send files verbatim (for UNIX hosts or
  70.                   binary files)
  71.         Text    (A-T)    - Send CR LF as line terminator and strip
  72.                   CR on received files (VMS text).
  73. Script                   - Script commands
  74.     Execute file        - Start up an asynchronous script file
  75.     Abort Execution        - Terminate a script file
  76. Utility               - Utility commands
  77.     Send Break    (A-.)    - send a break to the host
  78.     Hang Up            - close line (not implemented yet)
  79.     Change Dir    (A-D)    - change the local directory (for transfers)
  80.  
  81. Keypad mapping (in application mode):
  82. -------------------------------------
  83.  
  84.         AMIGA        VT100        comments
  85.         -------        -------        ---------------------------
  86.         0-9    ==    0-9
  87.         .    ==    .
  88.         ENTER    ==    ENTER        (basically, flip the bottom
  89.         -    ==    ,         2 keys up to get a VT100)
  90.         HELP    ==    -        (only free key around)
  91.         f1-f4    ==    PF1-PF4        (or any rebinding you do)
  92.         arrows    ==    arrows
  93.  
  94. Note:    Right AMIGA key in conjunction with a period (".")
  95.     will send a break to the host.
  96.  
  97.     CTRL in conjunction with an at-sign ("@") a two ("2") or a
  98.     space (" ") will send a NULL to the host.
  99.  
  100.     CTRL in conjunction with a six  ("6") will send a CTRL-^
  101.     CTRL in conjunction with a dash ("-") or question mark ("?")
  102.         will send a CTRL-_ to the host.
  103.  
  104. Initialization file example:
  105. ----------------------------
  106. Here is a (hopefully) self-explanatory VT100.INIT file with all
  107. options used:
  108.  
  109. #####################################################################
  110. #
  111. #    VT100 sample initialization file
  112. #    v2.4 861214 DBW    - Dave Wecker standard defaults
  113. #
  114. # Hash mark at the beginning of a line denotes a comment.
  115. # White space (space(s) or tab(s)) delimit fields.
  116. # Case ignored except for function key bindings.
  117. #
  118. # All items in this file overide variables of the same name in VT100.H
  119. # (all variables in vt100.h have a "p_" prepended to them)
  120. #
  121. #####################################################################
  122. #
  123. BAUD        2400        # Anything after required fields is ignored
  124. SCREEN        CUSTOM        # may be CUSTOM or WORKBENCH
  125. INTERLACE    ON        # ON for CUSTOM or interlaced workbench
  126. DEPTH        1        # number of bit planes to use (1 or 2)
  127. WBCOLORS    YES        # ignore custom colors and use defaults
  128. FOREGROUND    950        # Colors are only used on the custom screen
  129. BACKGROUND    000        # Colors are in hex RGB from 000 to FFF
  130. BOLD        a00        # Color for bold highlighting (in custom)
  131. CURSOR        00a        # Color for cursor (in custom screen)
  132. LINES        48        # normal <= 24 interlaced <= 48
  133. MODE        CRLF        # IMAGE or CRLF (for KERMIT transfers)
  134. BUFFER        512        # 512 <= Input buffer size <= 2048
  135. PARITY        NONE        # NONE (= 8 bit), MARK, SPACE, ODD or EVEN
  136. BREAK        750000        # Length for break key in microseconds
  137. VOLUME        64        # Beep Volume (0 = Visual Beep)
  138. WRAP        OFF        # Auto wrap ON or OFF
  139. KEYSCRIPT    7E        # Hex value for script introducer
  140. #
  141. # Function bindings (strings to type when any of F1 - F10 are pressed)
  142. #    f<num>    = function key
  143. #    F<num>    = shifted function key
  144. #
  145. # The string specified must be delimited and uses one special char:
  146. #    ^    = control next character
  147. #    ^^    = up arrow
  148. #
  149. # Sample control characters:
  150. #    ^[    = escape    ^M    = carriage return
  151. #    ^J    = line feed    ^L    = form feed
  152. #
  153. # If the first character of the string is a script introducer
  154. # (KEYSCRIPT) then the string is interpreted as a script filename
  155. # to be executed when the key is pressed.
  156. #
  157. # Examples of bindings:
  158. #
  159. f1    "^[OP"            # f1-f4 = PF1 - PF4 on a VT100
  160. f2    "^[OQ"
  161. f3    "^[OR"
  162. f4    "^[OS"
  163. #
  164. # f5,6,7 = scripts to execute (assuming that KEYSCRIPT = '~' = 0x7E)
  165. #
  166. f5    "~df1:vt100_source/dialwork.script"
  167. f6    "~df1:vt100_source/sendvt100.script"
  168. f7    "~df1:vt100_source/getpics.script"
  169. #
  170. f8    "MAIL^M"        # Reads my mail (note embedded <CR>)
  171. f9    "NOTE^M"        # Reads conferences
  172. F1    "$2400!"        # dials the phone to work
  173. F2    "$bbs1!"        # dials the phone to billboard 1
  174. F3    "$bbs2!"        # dials the phone to billboard 2
  175. F4    "$bbs3!"        # dials the phone to billboard 3
  176. #
  177. # all done with init, now execute script as startup sequence
  178. #
  179. exit df1:vt100_source/dialwork.script
  180.  
  181. Multi file Xfers:
  182. -----------------
  183. The VT100 emulator now supports multiple file transfers. This is
  184. specified by using a comma (",") between file names when using XMODEM
  185. or KERMIT. (NOTE: host XMODEM's normally CANNOT support multiple file
  186. transfers).
  187.  
  188. When specifying a file name to recieve by default the directory path
  189. is stripped of the filename when sent to the host but is kept for the
  190. local file spec. eg:
  191.  
  192.         receive file: ram:file.txt,df1:newfile.bin,$
  193.  
  194. will ask the server for file.txt and put it in ram:, and get
  195. newfile.bin and put it on df1: (see explanation of "$" below). If you
  196. do a single file transfer you will get another prompt for the remote
  197. name e.g.:
  198.  
  199.         receive file: ram:file.txt
  200.         remote file name[file.txt] userdisk1:wantfile.txt
  201.  
  202. The same rules apply to sending multiple files therefore if you are
  203. doing multi file transfers make sure the host server is connected to
  204. the desired directory.
  205.  
  206. In addition KERMIT now supports wildcards (* = any number of
  207. characters, ? = any single character). Examples:
  208.  
  209.     send:    *.c,*.h,*.doc
  210.     get:    *.c,*.h,$
  211.  
  212. KERMIT receive is now smart enough to use the host filename so no
  213. filename needs to be specified on the AMIGA's side.
  214.  
  215. Script file operation:
  216. ----------------------
  217. The script file can be invoked by selecting 'execute file' from the
  218. script menu. At any time you can abort the script file by selecting
  219. 'Abort Execution'.
  220.  
  221. During the time script file is running the terminal emulation is still
  222. active and you may type simulataneous to the script file. This may be
  223. desired if your script file is WAITing for a string or is DELAYing for
  224. a period of time etc.
  225.  
  226. Script file Commands (case insensitive):
  227. ------------------------------------------------------------
  228. #    Commented line
  229.    Format:
  230.     # comment         may not be on same line as a command.
  231.    Example:
  232.     # this is a comment
  233. ------------------------------------------------------------
  234. ASCII_SEND Send an ascii file to the host.
  235.    Format:
  236.     (same format as CAPTURE)
  237. ------------------------------------------------------------
  238. BAUD     Set baud rate
  239.    Format:
  240.     BAUD rate        Sets the baud rate for send/receive
  241.    Example:
  242.     BAUD 2400        Sets the baud rate at 2400 baud
  243. ------------------------------------------------------------
  244. BT    Set the break time (for an SB command)
  245.    Format:
  246.     BT value        Value is in micro-seconds
  247.    Example:
  248.     BT 750000
  249. ------------------------------------------------------------
  250. CAPTURE    To start/stop ascii file capture.
  251.    Format:
  252.     CAPTURE    file        Start ascii capturing
  253.     CAPTURE            End ascii capturing
  254.    Example:
  255.     CAPTURE foo.bar        Starts capture of file foo.bar
  256.     CAPTURE            Ends ascii capture of file foo.bar
  257. ------------------------------------------------------------
  258. CD     To change the local directory
  259.    Format:
  260.     CD    newdir        set a new directory for file transfers
  261.    Example:
  262.     CD    DF1:foo/bar    set the directory as specified
  263. ------------------------------------------------------------
  264. DELAY     Suspends script file for a specified time
  265.    Format:        
  266.         DELAY     n        Suspends execution for n seconds
  267.    Example:
  268.     DELAY    2        Suspends for 2 seconds
  269. ------------------------------------------------------------
  270. EXIT    Ends execution of the current script file.
  271.    Format:
  272.     EXIT            Exit the current script
  273.     EXIT VT100        Exit vt100 program
  274.     EXIT newscript        Exit this script and start up newscript
  275.    Example:
  276.     EXIT DF1:FOO.BAR    Exit the current script and start FOO.BAR
  277. ------------------------------------------------------------
  278. GOTO    Jumps to a different part of the script file.
  279.    Format:
  280.     GOTO label        Jumps to a line beginning with label:
  281.                 Jumps may be forward or backward.
  282.    Example:
  283.     FOO:            Sets up a label
  284.     GOTO FOO        Jumps to FOO
  285. ------------------------------------------------------------
  286. KB      Send a BYE packet to a host KERMIT server (shut down server).
  287.    Format:
  288.     KB
  289. ------------------------------------------------------------
  290. KG      Gets files from host. (which is running as a server).
  291.    Format:
  292.     (same format as KS)
  293. ------------------------------------------------------------
  294. KR      Receives a file from kermit host (not running as server)
  295.    Format:
  296.     (same format as KS)
  297. ------------------------------------------------------------
  298. KS      Sends files via kermit to the host.
  299.    Format:
  300.     KS file            Send one file
  301.     KS file1,file2,...    Send multiple files
  302.     KS file1,file2,...,$    Send multiple files and shut down server
  303.    Example:
  304.     KS foo.bar        sends foo.bar (note no quoting is used)
  305.     KS foo1,foo2,foo3    sends three files
  306.     KS foo1,foo2,foo3,$    sends three files and shuts down server
  307. ------------------------------------------------------------
  308. ON    Peforms a command every time a string is received
  309.    Format:
  310.         ON      "string"  cmd    Execute cmd when string is received.
  311.                 Only one ON string may be installed at a
  312.                 time.
  313.  
  314.                   If cmd is a GOTO and we were previously
  315.                 WAITing for a string the WAIT is aborted and
  316.                 execution resumes at the new label.
  317.  
  318.                           If cmd is not SEND and we were previously
  319.                 DELAYing, then the DELAY is aborted and the
  320.                 cmd is executed, followed by the next command
  321.                 after the DELAY.
  322.  
  323.                 If cmd is a SEND and we were previously
  324.                 DELAYing, then the DELAY is continued.
  325.    Example:
  326.         ON  "LOSS CARRIER" GOTO RESTART
  327.                 If modem drops carrier, try to redial
  328.         ON  "--more--" SEND " "
  329.                 Send a space every time --more-- is received
  330. ------------------------------------------------------------
  331. PARITY    Sets the parity
  332.    Format:
  333.     PARITY    type        Set the parity type
  334.    Example:
  335.     PARITY    NONE        no parity
  336.     PARITY    MARK        mark parity
  337.     PARITY    SPACE        space parity
  338.     PARITY    ODD        odd parity
  339.     PARITY    EVEN        even parity
  340. ------------------------------------------------------------
  341. SEND     Sends a string or character to the host.
  342.    Format:
  343.     SEND    "string"    Sends a string to the host. Beginning and
  344.                 ending double quotes (") are required. A
  345.                 carat (^) may be used to send control chars.
  346.                 Two carats transmits a carat character.
  347.         SEND    chr               Sends a single character.
  348.         SEND    ^chr               Sends a single control character. The chr
  349.                 is NOT case sensitve
  350.    Example:
  351.     SEND    "mail"        Send the string mail
  352.     SEND    "dir^M"        Send the string dir followed by a <CR>
  353.     SEND    a        Send the letter a
  354.     SEND    ^C        Send a control C
  355.     SEND    "abc^^def"    Send the string abc^def
  356.     SEND    ^^        Send a control-uparrow
  357.     SEND    "        Send the '"' character
  358. ------------------------------------------------------------
  359. SB    Sends a break character to the host
  360.    Format:
  361.     SB            Note that any pending character to send
  362.    Example:                is aborted by this call
  363.     SB
  364. ------------------------------------------------------------
  365. TM    Set a transfer mode for KERMIT to use
  366.    Format:
  367.     TM type            type of transfers to perform
  368.    Example:
  369.     TM IMAGE        image mode transfers
  370.     TM CRLF            <CR><LF> text transfers (VMS Kermit).
  371. ------------------------------------------------------------
  372. WAIT     Suspends the script file until a certain string is received.
  373.    Format:
  374.     WAIT    "string"    Same rules for string as SEND
  375.     WAIT            Enter an endless wait. Usually used after
  376.                 some "ON" commands have been set up. Can
  377.                 still aborted via the script menu.
  378.    Example:
  379.         WAIT    "User:"        Waits for the string User:
  380.         WAIT                   Waits forever
  381. ------------------------------------------------------------
  382. XR      Receives a file via XMODEM.
  383.    Format:
  384.     (same format as KS)
  385. ------------------------------------------------------------
  386. XS      Sends a file via XMODEM.
  387.    Format:
  388.     (same format as KS)
  389. ------------------------------------------------------------
  390.  
  391.  
  392. Script file examples:
  393. --------------------
  394. ###################################################################
  395. # Script to dial work (dialwork.script)
  396. #    v2.4    861214    DBW
  397. ###################################################################
  398. #
  399. # Make sure that we have all the parameters we want
  400. #
  401.     DELAY    2
  402.     BAUD    2400
  403.     PARITY    NONE
  404.     TM    CRLF
  405.     BT    750000
  406.     SB
  407. #
  408. # First get the modem's attention:
  409. #
  410. Start:
  411.     DELAY 1
  412.     ON "Ready" GOTO Dial
  413.     SEND ^B
  414.     DELAY 2
  415.     GOTO Start
  416. #
  417. # Now dial the 2400 baud line to work:
  418. #
  419. Dial:
  420.     ON "Attached" GOTO Login
  421.     SEND "$2400!"
  422.     DELAY 30
  423.     GOTO Start
  424. #
  425. # We got attached, so keep hitting return until the Gandalf terminal
  426. # handler wakes up:
  427. #
  428. Login:
  429.     ON "enter" GOTO Gandalf
  430.     DELAY 1
  431.     SEND ^M
  432.     GOTO Login
  433. #
  434. # Now connect from the Gandalf to the terminal server (ts1):
  435. # (when it asks for a password I need to type the password 
  436. # manually here)
  437. #
  438. Gandalf:
  439.     DELAY 2
  440.     SEND "ts1^M"
  441.     WAIT "class start"
  442. #
  443. # Keep sending <CR>'s until the LAT prompts for a username:
  444. #
  445. WaitLat:
  446.     DELAY 2
  447.     ON "username>" GOTO Lat
  448.     SEND ^M
  449.     GOTO WaitLat
  450. #
  451. # Tell the LAT that it's me, and connect to the "cookie cluster"
  452. # (my host systems). Tell the cluster my user name.
  453. # (when it asks for a password I need to type the password
  454. # manually here)
  455. #
  456. Lat:
  457.     SEND "wecker^M"
  458.     DELAY 1
  459.     SEND "connect cookie^M"
  460.     WAIT "Username:"
  461.     SEND "WECKER^M"
  462.     WAIT "at home"
  463.     SEND "^M^M^M"
  464. #
  465. # Got through all the LOGIN garbage, so let's do some work.
  466. #
  467.     WAIT "$ "
  468. #
  469. # Now go back to the LAT and connect to my workstation
  470. #
  471.     SEND "^]connect child^M"
  472.     WAIT "login:"
  473.     SEND "wecker^M"
  474.     WAIT "at home"
  475.     SEND "^M^M^M"
  476. #
  477. # Leave us on VMS
  478. #
  479.     SEND ^^
  480.     DELAY 2
  481. #
  482. # Go run the next script
  483. #
  484.     EXIT df1:vt100_source/sendvt100.script
  485.  
  486. #####################################################################
  487. # Script to upload the terminal emulator sources (sendvt100.script)
  488. #    v2.4    861214    DBW
  489. #####################################################################
  490. #
  491. # Make sure that we have all the parameters we want
  492. #
  493.     DELAY    2
  494.     PARITY    NONE
  495.     TM    IMAGE
  496. #
  497. # Get into the right directory and upload to my U**X workstation
  498. #
  499.     CD df1:vt100_source
  500.     SEND ^^
  501.     SEND "cd ~/amiga/vt100^M"
  502.     SEND "rm -f *^M"
  503.     WAIT "% "
  504.     DELAY 2
  505. #
  506. # Send the readme file for the terminal emulator via XMODEM:
  507. #
  508.     SEND "xmodem -r readme^M"
  509.     DELAY 3
  510.     XS readme
  511.     WAIT "% "
  512. #
  513. # Send the other terminal emulator files via KERMIT:
  514. #
  515.     DELAY 1
  516.     SEND "kermit -x^M"
  517.     DELAY 3
  518.     KS vt100.doc,makefile,vt100.h,*.c
  519.     DELAY 2
  520.     KB
  521.     WAIT "% "
  522. #
  523. # We popped out of server mode, so send the compiled code
  524. #
  525.     DELAY 1
  526.     SEND "kermit -i -x^M"
  527.     DELAY 3
  528.     KS vt100
  529.     DELAY 2
  530.     KB
  531.     WAIT "% "
  532. #
  533. # Now build the target shar files
  534. #
  535.     SEND "shar -a readme vt100.doc makefile vt100.h vt100.c init.c "
  536.     SEND "> vt100_24a.shar^M"
  537.     SEND "shar -a script.c remote.c window.c expand.c kermit.c xmodem.c "
  538.     SEND "> vt100_24b.shar^M"
  539. #
  540. # Time to pull copies over to VMS
  541. #
  542.     SEND ^^
  543.     SEND "swi [wecker.amiga]^M"
  544.     SEND "cop child::"
  545.     SEND "
  546.     SEND "/staff/wecker/amiga/vt100/vt100_24a.shar"
  547.     SEND "
  548.     SEND " []vt100_24a.shar^M"
  549.     WAIT "$ "
  550.     SEND "cop child::"
  551.     SEND "
  552.     SEND "/staff/wecker/amiga/vt100/vt100_24b.shar"
  553.     SEND "
  554.     SEND " []vt100_24b.shar^M"
  555.     WAIT "$ "
  556.     SEND "cop child::"
  557.     SEND "
  558.     SEND "/staff/wecker/amiga/vt100/vt100"
  559.     SEND "
  560.     SEND " []vt100_24.bin^M"
  561.     WAIT "$ "
  562. #
  563. # Make them available to the world
  564. #
  565.     SEND "pub vt100_24*.*^M"
  566.     WAIT "$ "
  567. #
  568. # All done so go to the next script
  569. #
  570.     EXIT df1:vt100_source/getpics.script
  571.  
  572. ###################################################################
  573. # Script to download images (getpics.script)
  574. #    v2.4    861214    DBW
  575. ###################################################################
  576. #
  577. # Make sure that we have all the parameters we want
  578. #
  579.     DELAY    2
  580.     PARITY    NONE
  581.     TM    CRLF
  582. #
  583. # Get into the right directory and download
  584. #
  585.     CD RAY:
  586.     SEND "swi [wecker.render]^M"
  587.     SEND "kermit server^M"
  588.     DELAY 3
  589.     KG *.img
  590.     DELAY 2
  591.     KB
  592.     WAIT "$ "
  593. #
  594. # Now get out of the emulator
  595. #
  596.     EXIT VT100
  597.  
  598.