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

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