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

  1.  
  2. DTERM    1.10 Release
  3.  
  4. BETA BETA BETA BETA BETA BETA BETA
  5. REQUEST FOR COMMENTS REQUEST FOR COMMENTS REQUEST FOR COMMENTS
  6.  
  7. Specifically, what other primitives should I add to the console device
  8. to support emulation of other terminals (e.g. graphics commands?).
  9.  
  10. NOTE: Currently, there is not enough low-level support to be able to even
  11. partially emulate a VT100.  The emulation choices you have are for (A) Z29,
  12. (B) ANSI, or (C) your own devising.
  13.  
  14. For those of you who log into 4.2/3 (and many other systems), note that the
  15. termcap for a SUN is actually an extended ANSI specification, compatible
  16. with the Amiga's console driver.
  17.  
  18.     (I)    Overview of Features
  19.     (II)    Command line options
  20.     (III)    Command Language
  21.     (IV)    State Machine Commands    (including carrier state change autovectors)
  22.     (V)    Menu Commands
  23.     (VI)    Mapping Commands
  24.     (VII)    Serial Commands (including console init autovector)
  25.     (VIII)    Misc. other commands    (including XMODEM commands)
  26.  
  27.     (X)    SAMPLE S:DTERM.INIT FILE
  28.     (XI)    SAMPLE Z29 emulation init file.
  29.  
  30.  
  31.  
  32. (I) OVERVIEW OF FEATURES
  33.  
  34.     USER PROGRAMMABLE DATA TRANSLATIONS:
  35.         KeyMap        KEYMAP
  36.         DataMap     DATAMAP
  37.  
  38.     *******************************************************************
  39.  
  40.  
  41.     KEYBOARD---->KEYMAP---->SERIALOUT
  42.             |
  43.             V
  44.            [full duplex]? YES -> done
  45.             NO
  46.             | (HALF, HOST, or HMONITOR duplex)
  47.             |
  48.             |
  49.             |>------>WINDOW
  50.             |>------>CAPTURE (if capture mode)
  51.             \>------>TOCLI     (if remote on & duplex == HMONITOR)
  52.  
  53.  
  54.     SERIALIN--->DATAMAP---->WINDOW
  55.             |
  56.             |>------>WINDOW
  57.             |>------>CAPTUREFILE (if capture mode)
  58.             |>------>TOCLI         (if remote on)
  59.             |>------>STATE_MACHINE
  60.             \>------>SERIALOUT   (if HOST or HMONITOR duplex)
  61.  
  62.  
  63.  
  64.     FROMCLI---------->KEYMAP---------->SERIALOUT
  65.         |
  66.     [HMONITOR duplex]? ---> NO, stop
  67.         YES
  68.         V
  69.         |
  70.         \---->DATAMAP--------->WINDOW
  71.                 |
  72.                 \----->CAPTUREFILE  (if capture mode)
  73.  
  74.  
  75.     SENDFILE-------------------------->SERIALOUT
  76.  
  77.     DIAGNOSTICMESSAGES---------------->LOGFILE (when log is on)
  78.  
  79.     When in XMODEM protocol, everything is suspended and the following
  80.     applies.  XMODEM protocol is entered explicitly with XRECEIVE and
  81.     XTRANSMIT commands.
  82.  
  83.     XTRANSMIT<------------------------>SERIALIN/OUT    (when sending XMODEM)
  84.     XRECEIVE <------------------------>SERIALIN/OUT    (when recv. XMODEM)
  85.  
  86.  
  87.  
  88.     DTERM is a terminal program for use with an Amiga.    DTERM is not meant
  89.     for the weak and helpless.     I consider the following features:
  90.  
  91.     (1) Small executable
  92.     (2) State Machine allowing you to build any automatic control structure
  93.     you wish (from auto-redial, sequence dialing, to auto-logon).
  94.  
  95.     (3) Intelligent Data Mapping
  96.     (4) Intelligent Keyboard Mapping
  97.     (5) Dynamic Menus (user-buildable)
  98.     (6) somewhat intelligent command language (DME-like, but with
  99.     extensions, and a different set of commands of course).
  100.  
  101.     (7) Asyncronous writes in capture mode (it isn't not jerky), and
  102.     block pre-fetch/asyncronous writes in the XMODEM transfer
  103.     protocol.
  104.  
  105.     (8) duplex control, can SLAVE a CLI to the serial port.
  106.  
  107.     A consequence of (3) and (4) means that an intelligent person can setup
  108.     maps to effectively emulate most other terminals.
  109.  
  110.  
  111. (II) COMMAND LINE OPTIONS
  112.  
  113.     DTERM [-flags] [file1...filen]
  114.  
  115.     -x        -Use XON/XOFF protocol
  116.     -f        -Use RAD_BOOGIE (see serial documentation)
  117.     -7        -Use 7Wire protocol
  118.     -e        -Use Exclusive Access
  119.     -b        -Use BORDERLESS window.  Assume person's CONAI vector will
  120.          handle initializing the console device's window parameters.
  121.     default:    SHARED access, no protocol
  122.  
  123.     file1...filen:  A list of script files to execute on startup.  If no
  124.     files specified, S:DTERM.INIT is sourced.
  125.  
  126.  
  127.  
  128. (III) COMMAND LANGUAGE
  129.  
  130.     The command language is based on the DME text editor.  For those of you
  131.     familar with DME, the modifications to the basic structure are as
  132.     follows:  (read the following only if you are familar with DME!!)
  133.     ^c   = control-c, for embedding control characters in a source file
  134.     \nnn = octal escape code
  135.     \f   = a forward single quote (good for first pass-thru only)
  136.     \b   = a back single quote    (good for first pass-thru only)
  137.  
  138.     COMMAND LANGUAGE:
  139.  
  140.     A command has a certain number of arguments.  You can string any number
  141.     of commands together because DTERM knows exactly how many arguments
  142.     each command takes.  Thus:
  143.  
  144.     baud 1200 parity even bits 8 stop 1
  145.  
  146.     will set the program into 1200 baud, even parity, wordlength of 8, and
  147.     1 stop bit.  Note that arguments are space delimited.  A problem occurs
  148.     when you want a given argument to contain several words.  You can get
  149.     around this by surrounding the argument with a SINGLE-BACK-QUOTE,
  150.     SINGLE-FORWARD-QUOTE `' pair.  Example:
  151.  
  152.     conwrite `hello this is a test' conwrite sorry
  153.  
  154.     A set of back-forward single quotes is stripped every time a string is
  155.     passed through the command interpreter.  This represents a problem only
  156.     if some command's argument(s) will be sent through the command
  157.     interpreter at some later date.  The CONAI command is a good example.
  158.     The argument you specify to the CONAI command is executed whenever the
  159.     console gets reset, allowing you to automatically reconfigure the
  160.     console device.  Since a backquote-quote pair will be stripped the
  161.     second time through (once when you gave the CONAI command, and once
  162.     when the CONAI command's argument is executed):
  163.  
  164.     conai `conwrite `my console has been reset!' conwrite bah'
  165.  
  166.     The outer set forces CONAI to recognize the entire rest of the line as
  167.     it's single argument.  The inner set forces the CONWRITE command to
  168.     recognize the 5 words `my console has been reset!' as its single
  169.     argument when it gets executed some time in the future.
  170.  
  171.     Text sent to the modem must be enclosed by yet another backquote-quote
  172.     pair to differentiate it from a command:
  173.  
  174.     conwrite hello    -writes hello to the console device.
  175.     `conwrite hello'    -sends the string "conwrite hello" over the modem
  176.  
  177.     This can be confusing.  Here is a more complex example using CONAI:
  178.  
  179.     conai `baud 2400 `this is sent over the modem at 2400 baud''
  180.  
  181.     (not that you would want to put a serial control command in a
  182.     console reset vector... the console gets reset whenever you resize its
  183.     window.)
  184.  
  185.     USUALLY, YOU WANT TO PUT THE FOLLOWING IN S:DTERM.INIT:
  186.     conai `conwrite `^[[20l''
  187.  
  188.     Almost every terminal in existance uses LF=LF rather than
  189.     LF=CRLF, which is what the above will accomplish.
  190.  
  191.  
  192.     OVERVIEW OF COMMANDS.  See specific sections for more information.
  193.  
  194.     DUPLEX     full/half/host/hmonitor        duplex mode
  195.     BAUD     n                    Set Baud
  196.     PARITY     even/odd/mark/space/off        Set Parity
  197.     STOP     n                    Set Stop bits
  198.     BITS     n                    Set Wordlength
  199.     DELAY     mS                    Delay X mS
  200.     DD                            Delay 1/10 sec
  201.     SOURCE     file                    script
  202.     RESIZE     cols rows                resize window
  203.     SMADD     state newstate matchstring command    add state
  204.     SMREM     state.uniq                remove a specific entry
  205.     SMREMSTATE     state                    remove entire state
  206.     SMCLEAR                        remove ALL states
  207.     SMGOTO     state                    goto a state
  208.     SMONCD     command                On Carrier Detect
  209.     SMONCL     command                On Carrier Lost
  210.     SMONPUCD     command                CD on initial power up
  211.     SMLIST                        display SM info
  212.     DATAMAP     from to                map incomming data
  213.     DATAUNMAP     from                    unmap a map
  214.     DATACLEAR                        clear all datamaps
  215.     KEYMAP     from to   (NOT like DME)        map outgoing keystrokes
  216.     KEYUNMAP     from                    unmap a map
  217.     KEYCLEAR                        clear all datamaps
  218.     MENUADD     menuname itemname command        add a menu entry
  219.     MENUDEL     menuname itemname            delete a menu entry
  220.     MENUCLEARCOL menuname                clear a menu header
  221.     MENUCLEAR                        clear entire menu
  222.     CONAI     command                On Console Init
  223.     CONWRITE     string                 write to console.device
  224.     CAPON     file                    capture to file
  225.     CAPOFF                        close capture
  226.     LOGON     file                    log error/status msgs to file
  227.     LOGOFF                        no log
  228.     SEND     file                    send from file
  229.     SENDABORT                        abort send
  230.     XRECEIVE     file                    XMODEM receive
  231.     XTRANSMIT     file                    XMODEM transmit
  232.  
  233.     SLAVE     on/off                 remote CLI
  234.     SETSLAVE     command                set slave command
  235.                             default is a NEWCLI.
  236.  
  237.     COMENTRY                        manual command entry
  238.     COMPROMPT     promptstring                latter w/prompt
  239.  
  240.  
  241.  
  242. (IV)    STATE MACHINE COMMANDS
  243.  
  244.     The state machine looks at every sub-string comming over the serial
  245.     line for matches against the matchstring of all entries in the current
  246.     state.  Here is an example script to automatically set DTERM's baud
  247.     rate to a modem's new baud rate after it connects to some remote
  248.     machine:
  249.  
  250.     template:    SMADD    state newstate matchstring command
  251.  
  252.     ###########
  253.     smclear
  254.     smadd a b `CONNECT 2400^m^j'  `baud 2400 delay 2000 `^m''
  255.     smadd a b `CONNECT 1200^m^j'  `baud 1200 delay 2000 `^m''
  256.     smadd a b `CONNECT^m^j'       `baud 300 delay 2000 `^m''
  257.     smadd a b `CONNECT ^m^j'      `baud 300 delay 2000 `^m''
  258.     smgoto a
  259.     smoncl `smgoto a'
  260.     ###########
  261.  
  262.     In this case, all entries are in state 'a'.  While the state machine is
  263.     in state 'a', any of these messages will cause it to execute the
  264.     specified command and then go into state 'b'.  Note that we have setup
  265.     the automatic carrier-lost vector to go back into state 'a' on carrier
  266.     lost.
  267.  
  268.     Statenames are in ascii, and need not be a single character.  When you
  269.     remove a state with SMREMSTATE, you are removing all the entries in
  270.     that state.
  271.  
  272.     The state machine is bypassed whenever it is placed in a state which
  273.     doesn't exist... `SMGOTO idontexist'
  274.  
  275.     SMADD     state[.uniq] newstate matchstring command
  276.                             add state
  277.     SMREM     state.uniq                remove an entry
  278.     SMREMSTATE     state                    remove entire state
  279.     SMGOTO     state                    goto a state
  280.     SMONCD     command                On Carrier Detect
  281.     SMONCL     command                On Carrier Lost
  282.     SMONPUCD     command                CD on power up.
  283.     SMCLEAR                        Remove ALL states
  284.     SMLIST                        display SM info
  285.  
  286.     Note: SMONPUCD means 'if the carrier is active when this modem program
  287.     starts up'.  Usually this means that you exited the modem program then
  288.     re-ran it, and that you are already logged into the machine.  You can
  289.     thus have the command be, say, an SMGOTO to your 'online' state.
  290.  
  291.     HINTS:  You could, of course, put all your matches into a single state,
  292.     but this could be disastorous if any of those strings occured
  293.     accidently while you were connected to some host.  Thus, you should
  294.     breakup the state-sets logically.
  295.  
  296.     Definition of state-set:   A state-set is a single state containing
  297.     several match->command entries.  E.G. The example above has a single
  298.     state-set named 'a' with 4 entries.
  299.  
  300.     -Have a state-set that you SMONCL to (SMONCL `smgoto state') for
  301.      your 'off line' activity... e.g. dialing, re-dialing, etc...
  302.  
  303.     -Have a base state-set for your 'connected but not yet logged in'
  304.      state which then dispatches to other state-sets when it determines
  305.      what your logging in to.
  306.  
  307.     -Once you are completely logged in, place the state machine in
  308.      a non-existant or minimal state to prevent accidental matches
  309.      from occuring and to make DTERM run faster (though the slowdown
  310.      is not noticeable at 2400 baud!).
  311.  
  312.     The state commands are usually placed in the S:DTERM.INIT file.
  313.  
  314.     IDENTIFYING STATES FOR REMOVAL WITH SMREM.    You can identify an entry
  315.     in a state by giving it a unique name  state[.name]. example:
  316.  
  317.     smadd a        b match1 command1
  318.     smadd a.special b match2 command2
  319.  
  320.     smrem a.special        -remove a.special only.
  321.  
  322.     NOTE:  Both `a' and `a.special' are considered in state `a'.  The
  323.     .special is only a way of identifying an entry so you can remove it
  324.     later.
  325.  
  326.  
  327.  
  328. (V) MENU COMMANDS
  329.  
  330.     The Menu commands allow you to build user-defined menu's.  These are
  331.     usually placed in S:DTERM.INIT also.  You should make a menu entry for
  332.     the COMENTRY command always to allow you to get into manual
  333.     command-entry mode.  Here is an example:
  334.  
  335.     menuadd phone cory        ``^j' dd `^matdt6420074^m''
  336.     menuadd phone cogsci    ``^j' dd `^matdt6420713^m''
  337.     menuadd phone portsel   ``^j' dd `^matdt6436545^m''
  338.     menuadd phone fidonet   ``^j' dd `^matdt6599169^m''
  339.     menuadd phone bbs2        ``^j' dd `^matdt5952479^m''
  340.     menuadd phone wincrc    ``^j' dd `^matdt8454812^m''
  341.     menuadd phone amwest    ``^j' dd `^matdt3557162^m''
  342.     menuadd phone amconn    ``^j' dd `^matdt5627097^m''
  343.     menuadd phone bbsJC     ``^j' dd `^matdt9617250^m''
  344.     menuadd ctl   comentry  `comentry'
  345.     menuadd ctl   7bit-even `bits 7 parity even'
  346.     menuadd ctl   8bit-none `bits 8 parity off'
  347.     menuadd window 80x24    `resize 80 24'
  348.     menuadd window 80x25    `resize 80 25'
  349.     menuadd emulate none    `dataclear keyclear'
  350.     menuadd emulate z29     `source emulate:z29.termcap'
  351.     menuadd emulate vt100   `source emulate:vt100.termcap'
  352.  
  353.  
  354.  
  355. (VI) MAPPING COMMANDS
  356.  
  357.     Arbitrary keyboard and data mapping is accomplished with the DATAMAP
  358.     and KEYMAP commands.  Both have the same syntax with the exception that
  359.     one applies to the mapping of incomming data, and the other applies to
  360.     the mapping of keys.  The terminal window IS the amiga's console device
  361.     with some additions:
  362.  
  363.     \200    (ascii code 128)    = insert mode off
  364.     \201    (ascii code 129)    = insert mode on
  365.     \202    (ascii code 130)    = save cursor position
  366.     \203    (ascii code 131)    = restore cursor position
  367.     \204    (ascii code 132)    = backtab
  368.  
  369.  
  370.  
  371.  
  372.  
  373.     XXXMAP    from    to
  374.  
  375.     The easiest mapping to understand is an ascii-to-ascii map:
  376.     (map esc-A to esc-left_bracket-A)
  377.  
  378.     DATAMAP  ^[A    ^[[A
  379.  
  380.     The control sequence introducer on the FROM string is '$'.  Thus, to
  381.     get a '$' as part of the from string, you need to say '$$'. $c stands
  382.     for an arbitrary character, and $d stands for an arbitrary
  383.     ascii-numeric string.  When the actual map occurs, both are converted
  384.     to numbers and placed into an array for further manipulation by the TO
  385.     string.
  386.  
  387.     FROM STRING CONTROL SPECIFIERS:
  388.         $c    arbitrary character
  389.         $d    arbitrary ascii-numeric str.
  390.  
  391.     TO STRING CONTROL SPECIFIERS:
  392.         $N[+/-OFFSET]c
  393.         $N[+/-OFFSET]d
  394.  
  395.     The TO control specifier is a bit more complex.  You pick an array
  396.     entry with $N (starting at 0), add an optional offset value to it, then
  397.     plot it down as either a single character, or an ascii-decimal string.
  398.     Example:
  399.  
  400.     (Convert Z29 cursor move sequence to ANSI cursor move sequence)
  401.     datamap ^[Y$c$c ^[[$0-31d;$1-31dH
  402.               ^[Y8!   -> ^[[25;2H
  403.  
  404.     (Map escape X c1 c2 to d2 d1)
  405.     datamap ^[X$c$c $1d.$0d
  406.               ^[XAB   -> 66.65
  407.  
  408.     datamap ^[X$c $0-10d
  409.               ^[XA    -> 55
  410.     datamap ^[X$c $0+10d
  411.               ^[XA    -> 75
  412.     datamap ^[X$c $0+1c
  413.               ^[XA    -> B
  414.  
  415.     See the provided emulation files (not quite complete working, but
  416.     pretty close) for more examples.
  417.  
  418.  
  419.     WITHHOLDING DELAYS:     If you do a keymap, say ^[X -> hello,  and then
  420.     type ESC, you will note that nothing got sent over the modem. DTERM
  421.     withholds anything left unresolved until it is either resolved, or
  422.     found not to be mapped.  Thus:
  423.  
  424.     ESC   (nothing sent)  X   (hello sent)
  425.     ESC   (nothing sent)  Y   (ESC Y sent)
  426.  
  427.     MAPS OVERRIDING OTHER MAPS:     Later maps can override earlier ones.
  428.     Thus, if you have two maps:
  429.  
  430.     KEYMAP    ^[a    haha
  431.     KEYMAP    ^[$c    bobo
  432.  
  433.     The ^[$c map will ALWAYS be executed, even if you type ^[a.  Rightly,
  434.     you should have the order reversed:
  435.  
  436.     KEYMAP    ^[$c    bobo
  437.     KEYMAP    ^[a    haha
  438.  
  439.     Thus you can MAP something general (using $c) to nothing, and then MAP
  440.     some exceptions to the rule.
  441.  
  442.  
  443. (VII)    SERIAL COMMANDS
  444.  
  445.     BAUD, PARITY, STOP, BITS.  Examples:
  446.  
  447.     BAUD 2400 PARITY off BITS 8 STOP 1
  448.  
  449.     NOTE: if using the -f flag (RAD_BOOGIE), the serial device makes some
  450.     assumptions on the parity and wordsize.  Read the serial.device docs
  451.     for more information.
  452.  
  453.  
  454. (VIII)    MISC OTHER COMMANDS
  455.  
  456.     The remaining commands are:
  457.  
  458.     DD
  459.         Delay for a 1/10 of a second.
  460.  
  461.     DELAY N
  462.         Delay for N milliseconds.    `DD 1000' will delay for a second
  463.  
  464.     SOURCE file
  465.         Source a script file.  The script file usually contains state
  466.         machine entries, menu additions, terminal emulation mappings,
  467.         etc...
  468.  
  469.         SOURCE s:dterm.init
  470.  
  471.     RESIZE cols rows
  472.  
  473.         Attempt to resize the window on the current screen.  No window
  474.         repositioning is done.  You might have to move the window to
  475.         the upper-left hand corner before resizing depending.  If the
  476.         screen is big enough, a bordered window is used.  If the screen
  477.         is barely big enough, a borderless window is used.    If the
  478.         screen isn't big enough for even a borderless window, you get
  479.         an error message.
  480.  
  481.         RESIZE 80 24
  482.         RESIZE 76 24
  483.  
  484.         Your CONAI command is automatically executed after the window
  485.         is resized.
  486.  
  487.  
  488.     CONAI command
  489.  
  490.         The command is executed immediate, and also whenever the
  491.         console device gets reset.    This occurs whenever a window is
  492.         resized. Usually, CONAI is set to:
  493.  
  494.         conai `conwrite `^[[20l''
  495.  
  496.  
  497.     CONWRITE string
  498.  
  499.         Write a string directly to the console device.  Does not go
  500.         through the serial.device.    Usually used to initialize the
  501.         console.
  502.  
  503.     CAPON   file
  504.  
  505.         Begin capture mode to a file.  If the file already exists, it
  506.         is APPENDED to.
  507.  
  508.     CAPOFF
  509.  
  510.         End capture mode to a file
  511.  
  512.     DUPLEX HALF/FULL/HOST/HMON
  513.  
  514.         -FULL:  (DEFAULT) keystrokes are not normally displayed on
  515.             terminal screen after going through the keymap.
  516.  
  517.         -HALF:  keystrokes in terminal window are echo'd on terminal
  518.             screen after going through the keymap.
  519.  
  520.         -HOST:  keystrokes are echo'd on terminal screen after going
  521.             through keymap.  Additionally, any data comming over
  522.             the serial port is echo'd back to the sender as well
  523.             as displayed.
  524.  
  525.         -HMON:  same as HOST mode, but if SLAVE is on (for SLAVED CLI),
  526.             keystrokes from the terminal window are also sent to
  527.             the CLI.
  528.  
  529.     LOGON   file
  530.  
  531.         Log messages to a file.. appends to the file.  Anything that
  532.         is displayed on your console by DTERM (not incomming serial
  533.         data) is logged.
  534.  
  535.     LOGOFF
  536.  
  537.         Stop logging messages
  538.  
  539.     SEND file
  540.  
  541.         Send a file over the modem by simply COPYing it to the serial
  542.         device.  Sent semi-concurrently with normal operation so you
  543.         shouldn't type while it's being sent.
  544.  
  545.     SENDABORT
  546.  
  547.         Abort a Send (Sends are done semi-asyncronously).
  548.  
  549.     XRECEIVE file
  550.  
  551.         XMODEM protocol receive to file.  Basic XMODEM protocol using
  552.         a checksum.  The file is written to asyncronously and thus you
  553.         need not specify the RAM: disk for optimal performance.
  554.  
  555.         If the file previously exists, XRECEIVE will attempt to find
  556.         a function of that filename which does not exist. (e.g. file0,
  557.         file1, file2...).  This allows automated downloading.
  558.  
  559.     XTRANSMIT file
  560.  
  561.         XMODEM protocol send from a file.  Basic XMODEM protocol using
  562.         a checkdsum.  The file blocks are pre-fetched while the
  563.         previous block is being sent asyncronously, and thus you need
  564.         not copy the file to the RAM: for optimal performance.
  565.  
  566.     COMENTRY
  567.  
  568.         Begin manual command entry.  Hit return on a blank line to
  569.         end manual entry of commands.
  570.  
  571.     COMPROMPT arg
  572.  
  573.         Enter COMENTRY mode with 'arg' already typed for you... allows
  574.         making menu options which prompt for thing.
  575.  
  576.     SETSLAVE executecommand
  577.  
  578.         Set the command which is Execute()d when SLAVE mode is turned
  579.         on.  The default is 'NEWCLI'.
  580.  
  581.         The command will be executed with a single argument which will
  582.         be the file it is supposed to do ALL communication with the
  583.         modem program through.  The Execute() is expected to return
  584.         immediately, so you should specify something like:
  585.  
  586.         SETSLAVE `run myslave'
  587.  
  588.         The slave program MUST open the specified file with modes
  589.         1005.  The slave program does it's READs and WRITEs to the
  590.         SAME FILE HANDLE.  The latest version of my PIPE: program must
  591.         be mounted in your system for this to work.
  592.  
  593.         NOTE:  The filename passed to your slave program looks something
  594.         like this:
  595.  
  596.         PIPE:somename/t
  597.  
  598.         Usually, you'll want to append a signal to this (make it
  599.         /ts#, for instance, where # is a signal number you have
  600.         allocated) to give you more control.  READ THE DOCS FOR A
  601.         PIPE TO UNDERSTAND THE MEANING!
  602.  
  603.         Look at the flow diagrams at the beginning to see how data
  604.         flows to and from the slave program.
  605.  
  606.         IT IS NOT RECOMMENDED THAT YOU IMPLEMENT TRANSFER PROTOCOLS
  607.         WITH SLAVE PROGRAMS.  This is because the data would have to
  608.         travel through two processes before ever going out the serial
  609.         port, causing unforgivable delays in a transfer protocol.
  610.  
  611.         The slaving is still in a very experimental state.
  612.  
  613.     SLAVE on/off
  614.  
  615.         ACTIVATE SLAVE CLI.  my latest PIPE: device must be mounted
  616.         for this to work.  NOTE: When you turn SLAVE off, the CLI
  617.         will still be connected to the PIPE.  To disconnect the CLI
  618.         from the pipe, you must send an ENDCLI to the CLI.
  619.  
  620.         This command starts up a new CLI on the pipe if none currently
  621.         is attached.
  622.  
  623.         -EFFECTS:    Any data received from the serial port is sent to
  624.         the CLI after going through the datamap.  Any data output from
  625.         the CLI is sent to the serial port after going through the
  626.         keymap.
  627.  
  628.  
  629. (X) SAMPLE S:DTERM.INIT FILE.
  630.  
  631.     This is the DTERM.INIT file that I use.  Needless to say, I've changed
  632.     all references to specific machine names, user names, and passwords to
  633.     gobbly gook.
  634.  
  635. #######################################################################
  636. # Hash is a comments introducer, and must be the first character on   #
  637. # a line                                  #
  638. #                                      #
  639. #                DTERM.INIT                      #
  640. #                                      #
  641. #######################################################################
  642. smclear
  643. smadd a a `comp1'           `baud 2400 parity even bits 7 `^j^matdt5551111^m''
  644. smadd a a `comp2'           `baud 2400 parity even bits 7 `^j^matdt5552222^m''
  645. # NOTE: Sends a return 2 seconds after connect.
  646. smadd a a `CONNECT 2400^m^j'  `baud 2400 delay 2000 `^m''
  647. smadd a a `CONNECT 1200^m^j'  `baud 1200 delay 2000 `^m''
  648. smadd a a `CONNECT^m^j'       `baud 300 delay 2000 `^m''
  649. smadd a a `CONNECT ^m^j'      `baud 300 delay 2000 `^m''
  650.  
  651. # Handle a port-selector
  652. smadd b b    Request:        `dd `cory^m''
  653. # Figure out which computer it is by it's header message
  654. smadd b cl    comp1            `'
  655. smadd b cg    comp2            `'
  656. # A BBS!
  657. smadd b cbbs    `name:'             ``Matthew Dillon^m''
  658.  
  659. smadd cbbs cbbs `Password:'         `delay 1000 `mypassword^m''
  660. smadd cbbs cbbs `[Y,n]:'            `delay 1000 `^m''
  661.  
  662. smadd cl cl1    login:            `dd `dillon^m''
  663. smadd cl1 cl1    Password:        `dd `mypassword^m''
  664. smadd cl1 cl    incorrect        `'
  665. smadd cl1 online (z29)            `dd `vt100^m''
  666.  
  667. smadd cg cg1    login:            `delay 2000 `myfriend^m''
  668. smadd cg1 cg1    Password:        `dd dd dd dd `hispassword' dd `^m''
  669. smadd cg1 cg    incorrect        `'
  670. # For UNIX systems, TERM = sun    (Latest ANSI with enhancements)
  671. # Compatible with the Amiga's CONSOLE.DEVICE
  672. # My login defaults to a Z29...
  673. smadd cg1 online (z29)             `dd `sun^m''
  674.  
  675. #smadd online online Password:         ``mypassword^m''
  676.  
  677. smgoto a
  678. smoncl `smgoto a delay 1000 baud 2400'
  679. smoncd `smgoto b'
  680. smonpucd `smgoto online'
  681.  
  682. menuadd phone fidonet    ``^j' dd `^matdt6599169^m''
  683. menuadd phone bbs2    ``^j' dd `^matdt5952479^m''
  684. menuadd phone wincrc    ``^j' dd `^matdt8454812^m''
  685. menuadd phone amwest    ``^j' dd `^matdt3557162^m''
  686. menuadd phone amconn    ``^j' dd `^matdt5627097^m''
  687. menuadd phone bbsJC    ``^j' dd `^matdt9617250^m''
  688. menuadd ctl   comentry    `comentry'
  689. menuadd ctl   7bit-even `bits 7 parity even'
  690. menuadd ctl   8bit-none `bits 8 parity off'
  691. menuadd ctl   `redial on'   `smadd a a `BUSY^m^j' `delay 30000 `a/'''
  692. menuadd window 80x24    `resize 80 24'
  693. menuadd window 80x25    `resize 80 25'
  694. menuadd emulate none    `dataclear keyclear'
  695. menuadd emulate z29    `source emulate:z29.termcap'
  696.  
  697. conai `conwrite `^[[20l''
  698. #######################################################################
  699. #                                      #
  700. #        END DTERM.INIT                          #
  701. #                                      #
  702. #######################################################################
  703.  
  704.  
  705.  
  706.  
  707. (XI) SAMPLE Z29 EMULATION INIT FILE (not complete, but it gives you the idea).
  708.  
  709. ######################################################################
  710. #            EMULATE:Z29.TERMCAP                 #
  711. #   NOTE: assumes your terminal window is 25-lines             #
  712. ######################################################################
  713. # Z29 termcap
  714. # :am            has automatic margins
  715. # :bc=\ED        backspace if not ^H
  716. datamap ^[D    \233D
  717. # :bt=\E-        backtab
  718. datamap ^[-    \204
  719. # :do=^J        down one line
  720. # :al=\EL        add new blank line
  721. datamap ^[L    \233L
  722. # :le=^H        cursor left
  723. # :bs            terminal can BS with ^H
  724. # :cd=\EJ        clear to end of display
  725. datamap ^[J    \233J
  726. # :ce=\EK        clear to end of line
  727. datamap ^[K    \233K
  728. # :cl=\EE        clear screen and home
  729. datamap ^[E    \2331;1H\233J
  730. # :cm=\EY%+\040%+\040    cursor move
  731. datamap ^[Y$c$c \233$0-31d;$1-31dH
  732. datamap ^[Y8$c    \23325t\23325;$0-31dH
  733. # :co#80        #cols
  734. # :dc=\EN        delete char
  735. datamap ^[N    \233P
  736. # :dl=1*\EM        delete line
  737. datamap ^[M    \233M
  738. # :ei=\EO        end insert mode
  739. datamap ^[O    \200
  740. # :ho=\EH        home cursor
  741. datamap ^[H    \233H
  742. # :im=\E@        enter insert mode
  743. datamap ^[@    \201
  744. # :li#24        #lines
  745. # :mi            safe to move while in insert mode
  746. # :nd=\EC        cursor right
  747. datamap ^[C    \233C
  748. # :as=\EF        start alternate char set
  749. datamap ^[F    `'
  750. # :ae=\EG        end alternate char set
  751. datamap ^[G    `'
  752. # :ms            safe to move in standout mode
  753. # :pt            has hardware tabs
  754. # :sr=\EI        scroll text down
  755. datamap ^[I    \233T
  756. # :se=\Eq        end standout mode
  757. datamap ^[q    `'
  758. # :so=\Ep        begin standout mode
  759. datamap ^[p    `'
  760. # :up=\EA        cursor up
  761. datamap ^[A    \233A
  762. datamap ^[B    \233B
  763. # :vs=\Ex4        cursor very visible
  764. datamap ^[x4    `'
  765. # :ve=\Ey4        cursor normal
  766. datamap ^[y4    `'
  767. # :kb=^H        sent by backspace key
  768. # :ku=\EA        up key
  769. keymap    \233A    ^[A
  770. # :kd=\EB        down key
  771. keymap    \233B    ^[B
  772. # :kl=\ED        left key
  773. keymap    \233D    ^[D
  774. # :kr=\EC        right key
  775. keymap    \233C    ^[C
  776. # :kh=\EH        home key
  777. # :kn#1 # function keys
  778. # :k0=\E~        Function key 0
  779. keymap    \2330~    ^[~
  780. # :l0=HOME        labels on function keys
  781. # :k1=\ES        function keys
  782. keymap    \2331~    ^[S
  783. # :k2=\ET
  784. keymap    \2332~    ^[T
  785. # :k3=\EU
  786. keymap    \2333~    ^[U
  787. # :k4=\EV
  788. keymap    \2334~    ^[V
  789. # :k5=\EW
  790. keymap    \2335~    ^[W
  791. # :k6=\EP
  792. keymap    \2336~    ^[P
  793. # :k7=\EQ
  794. keymap    \2337~    ^[Q
  795. # :k8=\ER
  796. keymap    \2338~    ^[R
  797. # :k9=\E0I
  798. keymap    \2339~    ^[0I
  799. # :es            escape allowed on status line
  800. # :hs            has extra 'status' line
  801. # :ts=\Ej\Ex5\Ex1\EY8%+\040\Eo        GO status line col N
  802. datamap ^[j    \202
  803. datamap ^[x1    `'
  804. datamap ^[x5    \23325t
  805. datamap ^[o    `'
  806. # :fs=\Ek\Ey5        return from status line
  807. # **big hack
  808. datamap ^[k    \203\23324t
  809. datamap ^[y5    \23324t
  810. # :ds=\Ey1        disable status line
  811. datamap ^[y1    \23324t
  812. # :us=\Es8        start underscore mode
  813. datamap ^[s8    `'
  814. # :ue=\Es0        end underscore mode
  815. datamap ^[s0    `'
  816.  
  817. #
  818. #   END EMULATE:Z29.TERMCAP
  819. #
  820.  
  821.  
  822.