home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / msr313src.zip / mskermit.ini < prev    next >
Text File  |  1994-06-27  |  11KB  |  287 lines

  1. ; FILE MSKERMIT.INI
  2. ;
  3. ; Standard initialization file for MS-DOS Kermit 3.11 or later.  Kermit should
  4. ; execute the commands in this file automatically when it starts.  Kermit
  5. ; looks for MSKERMIT.INI first in the current disk and directory, and if it is
  6. ; not found there, then in the disks and directories listed in your DOS PATH
  7. ; variable (if any).  You can override Kermit's initialization file search by
  8. ; specifying a different filename on the command line, preceded by the -F
  9. ; switch, for example "kermit -f monday.ini" or "kermit -f nul".
  10. ;
  11. ; Author: Christine M. Gianone, February 1990 (for MS-DOS Kermit version 3.0)
  12. ;   Revised for version 3.11 September 1991.
  13. ;   Revised for version 3.12 September 1992.
  14. ;   Revised for version 3.13 June 1993 (corrected August & September 1993)
  15. ;   Corrected June 1994 Michael DeCosta to allow non-IBM versions to
  16. ;   execute MSCUSTOM.INI.
  17.  
  18. ; CUSTOMIZATIONS
  19. ;
  20. ; It is recommended that you not modify this file.  Instead, you should adapt
  21. ; the sample MSCUSTOM.INI file to make your customizations: key settings,
  22. ; macro definitions, SET commands to override the ones in this file, and so
  23. ; on.  The MSCUSTOM.INI file should go in the same directory as this file.
  24. ; This file will execute MSCUSTOM.INI if it can be found.
  25.  
  26. ; COMPATIBILITY
  27. ;
  28. ; This initialization file works for versions 3.11 and later of MS-DOS Kermit.
  29. ; The IF INPATH command is new to version 3.12; it tests whether a given file
  30. ; can be found in your DOS PATH or your current directory.  The IF INPATH
  31. ; command is not used if your MS-DOS Kermit version is earlier than 3.12.
  32.  
  33. ; PATCHES
  34. ;
  35. ; The MSKERMIT.PCH file contains "patches" (corrections) to MS-DOS Kermit.
  36. ; If the MSKERMIT.PCH file can be found, and it agrees with your Kermit
  37. ; version, the patches are applied at this time.  The MSKERMIT.PCH file
  38. ; is included on your MS-DOS Kermit distribution diskette.  Updated patch
  39. ; files can be obtained from Columbia University.
  40. ;
  41. if > \v(version) 312 if inpath MSR\v(version).PCH goto patch
  42. if > \v(version) 311 if not inpath MSKERMIT.PCH goto begin
  43.  
  44. :PATCH
  45. echo Installing patches...
  46. echo
  47. patch
  48.  
  49. :BEGIN
  50. echo MS-DOS Kermit 3.11 / 3.12 / 3.13 initialization file...
  51.  
  52. COMMENT - Variable definitions...
  53.  
  54. ; Reserved variables.  If you define new macros, don't use these names:
  55. ;
  56. ;  _editor   - DOS command that runs my preferred editor, for EDIT macro.
  57. ;  _editfile - Last EDIT command filename, defined by EDIT macro.
  58. ;  _dialfile - Pathname of dialing directory file, for DIAL macro.
  59. ;  _dialnum  - Last DIAL command phone number, defined by DIAL macro.
  60. ;  _modem    - Modem type for DIAL command.  Used to run the appropriate
  61. ;              dialing script, e.g. HAYES.SCR.
  62. ;
  63. ; You can override the default _editor, _dialfile, and _modem definitions
  64. ; by setting environment variables in your AUTOEXEC.BAT file, for example:
  65. ;
  66. ;   SET EDITOR=EDIT
  67. ;   SET MODEM=MICROCOM
  68. ;   SET DIALFILE=C:\PHONES\DIALING.DIR
  69. ;
  70. ; or you can redefine these variables in your MSCUSTOM.INI file.
  71.  
  72. ; Editor...
  73. ;
  74. define _editor edlin            ; EDLIN is the default editor.
  75. if not eq "\$(EDITOR)" "" -
  76.   define _editor \$(EDITOR)
  77.  
  78. ; Dialing directory file...
  79. ;
  80. define _dialfile C:\KERMIT\DIALUPS.TXT    ; Default dialing directory file.
  81. if not eq "\$(DIALFILE)" "" -
  82.   define _dialfile \$(DIALFILE)
  83. if > \v(version) 311 if not inpath \m(_dialfile) -
  84.   echo Dialing directory \m(_dialfile) not found.
  85.  
  86. ; The type of modem you have.  You also need a corresponding <name>.SCR
  87. ; file to dial the modem.  For example, if the value of _modem is HAYES,
  88. ; you must have a HAYES.SCR file stored somewhere in your DOS PATH or in
  89. ; your current directory.
  90. ;
  91. define _modem HAYES            ; Default is modem type is HAYES.
  92. if not eq "\$(MODEM)" "" -
  93.   define _modem \$(MODEM)
  94. if > \v(version) 311 if not inpath \m(_modem).SCR -
  95.   echo WARNING: Dialing script file \m(_modem).SCR not found!
  96.  
  97. COMMENT - Macro definitions section...
  98.  
  99. ; Macros for communicating with UNIX, VAX/VMS, and similar systems:
  100. ;
  101. def 8bit set parity none, set term bytesize 8, set term controls 8
  102. def 7bit set term bytesize 7, set term controls 7
  103.  
  104. def vax set par non, set flo x, set hand no, set dupl ful, set key \270 \127
  105.  
  106. def vms do vax, do 8bit        ; Assumes 8-bit no-parity connection.
  107. def unix do vax, do 7bit    ; Most UNIX systems are still 7-bit.
  108.  
  109. ; Macro for communicating with IBM mainframes in linemode:
  110. ;
  111. def ibm set par mark, set flo no, set hand xon, set dup ha, set key \270 \8
  112.  
  113. ; Macro for communicating with IBM mainframes in fullscreen mode,
  114. ; through 3270 protocol converter like IBM 7171:
  115. ;
  116. def fullscreen set par ev,set flo x,set hand no,set dupl ful,set key \270 \8
  117.  
  118. ; Macro to use Internet host names with Novell's LWP/DOS TELAPI and TSU.
  119. ; Assumes TSU is in the PATH and current directory is writable.
  120. ; Usage: "telapi <host-name>".
  121. ;
  122. def telapi run tsu -o \%1 k1,run tsu -a k1 1,set port bios1,connect
  123.  
  124. ; Additional DOS commands available directly from the MS-Kermit> prompt.
  125.  
  126. ; DOS MORE command... (no "<" needed)
  127. def more if < argc 2 fatal {More what?},-
  128. run more < \%1
  129.  
  130. ; DOS REN(ame) command...
  131. def rename if < argc 2 fatal {Rename what?},-
  132.   if < argc 3 fatal {Rename \%1 to what?},-
  133.   run ren \%1 \%2
  134.  
  135. ; DOS COPY command...
  136. def copy if < argc 2 fatal {Copy what?},-
  137.   if < argc 3 fatal {Copy \%1 to what?},-
  138.   run copy \%1 \%2
  139.  
  140. ; DOS CHCP command to examine or change code page...
  141. def chcp run chcp \%1
  142.  
  143. ; EDIT command...
  144. def edit if = argc 2 assign _editfile \%1,-
  145.   if not def _editfile fatal {Edit what?},-
  146.   run \m(_editor) \m(_editfile)
  147.  
  148. ; CAPTURE command - Easy downloading of a file from the host, with no error
  149. ; checking.  Unlike the LOG SESSION command, CAPTURE always creates a new
  150. ; file.  It overwrites file of same name if it already exists.  Usage: at the
  151. ; MS-Kermit> prompt, type "capture xxx" where xxx is the name of the file you
  152. ; want to create on the PC.  Once you are connected to the host, TYPE the
  153. ; desired file.  Escape back when done.  The captured file will be on your
  154. ; disk (with a TYPE command at the beginning & a prompt at the end).
  155. ;
  156. def capture if = \v(argc) 1 fatal {Capture into what file?},-
  157.   if exist \%1 del \%1,-
  158.   log session \%1,-
  159.   connect,close session,log sess session.log,close sess
  160.  
  161. ; NORMAL, NOISY and CLEAN macros, modify to suit your environment...
  162. def normal set rec pac   94, set ret  5, set block 1, set window 1
  163. def noisy  set rec pac   40, set ret 20, set block 3, set window 8
  164. def clean  set rec pac 1000, set ret  4, set block 2, set window 2
  165.  
  166. ; Define a FATAL error macro.  Print message, go back to prompt.
  167. def fatal echo \%1, stop
  168.  
  169. ; ERRSTP macro, for use in scripts that want to hang up a dialed
  170. ; or network connection if there is any error.
  171. def errstp echo \%1,hangup,stop
  172.  
  173. ; LOOKUP macro for use with DIAL command.
  174. ; Requires MS-DOS Kermit 3.11 or later.
  175. ; Uses \m(_dialfile) for the dialing directory filename, defined above.
  176. ; Edit that file to contain the entries you will actually want to use.
  177. ;
  178. if < version 311 goto nolook
  179. def split assign \%x \%1,-
  180.   assign \%y \%2,-
  181.   assign \%s \%3,-
  182.   assign \%p \%4
  183.  
  184. def lookup if < \v(argc) 2 end 0,-
  185.   if not def _dialfile end 0,-
  186.   if not exist \m(_dialfile) end 0,-
  187.   open read \m(_dialfile),-
  188.   if failure fatal {Can't open dialing directory file \m(_dialfile)},-
  189.   assign \%5 \%x, assi \%6 \%y, assi \%7 \%s, assi \%8 \%p,-
  190.   echo Looking up "\%1",-
  191. :loop,-
  192.   read \%9,-
  193.   if fail goto eof,-
  194.   split \%9,-
  195.   if def \%x if not equal {\%x} {\%1} goto loop,-
  196.   echo From dialing directory: \%x = \%y,-
  197.   assign _dialnum \%y,-
  198.   if def \%s if not eq \%s = set speed \%s,-
  199.   if def \%p if not eq \%p = set parity \%p,-
  200.   goto done,-
  201. :eof,-
  202.   echo "\%1" not found in dialing directory \m(_dialfile),-
  203. :done,-
  204.   assign \%x \%5, assi \%y \%6, assi \%s \%7, assi \%p \%8,-
  205.   close read
  206.  
  207. ; LIST macro to list dialing directory.
  208. ; Assumes pathname of dialing directory is in \m(_dialfile).
  209. define list -
  210.   if not def _dialfile fatal {_DIALFILE not defined},-
  211.   if not exist \m(_dialfile) -
  212.     fatal {Can't find dialing directory file \m(_dialfile)},-
  213.   if < argc 2 run more < \m(_dialfile),-
  214.   if > argc 1 run find "\%1" \m(_dialfile) | more
  215.  
  216. ; DIAL and REDIAL commands...
  217. ;
  218. ; Requires the file \m(_modem).SCR to be on current disk or in DOS PATH,
  219. ; e.g., HAYES.SCR. Uses LOOKUP macro to access your dialing directory, if any.
  220. ; If argument omitted, uses previous phone number, if any.
  221. ; If multiple arguments are given, they are concatenated together
  222. ; with the separating spaces preserved, so you can "dial 800 765 4321".
  223. ;
  224. def dial if < \v(argc) 2 if not def _dialnum fatal {Dial what?},-
  225.   if > \v(argc) 2 assign \%1 \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9,-
  226.   if > \v(argc) 1 assign _dialnum \%1,-
  227.   if not < \v(argc) 2 lookup {\m(_dialnum)},-
  228.   assign \%1 \m(_dialnum),-
  229.   take \m(_modem).scr,-
  230.   if fail end 1, end 0
  231.  
  232. define redial if not def _dialnum fatal {No number to redial}, dial
  233.  
  234. goto common            ; Skip over old-version warning
  235.  
  236. :NOLOOK
  237. version
  238. echo WARNING: This Kermit initialization file is for use with MS-DOS Kermit
  239. echo version 3.11 or later.  The LOOKUP macro will not be defined, and DIAL
  240. echo will not work.  Use an earlier version of MSKERMIT.INI or a later
  241. echo version of MS-DOS Kermit.
  242. define lookup echo The LOOKUP macro is not defined, stop
  243. define dial echo The DIAL macro is not defined, stop
  244.  
  245. :COMMON
  246.  
  247. COMMENT - File transfer settings
  248.  
  249. set file collision rename    ; Don't overwrite existing files
  250. set transfer character-set transparent ; For compatibility with old versions
  251. set receive packet-length 94    ; Regular-size packets
  252. set attributes on        ; Use file-attribute packets
  253. set window 1            ; Don't use sliding windows
  254.  
  255. COMMENT - Script defaults
  256.  
  257. set input timeout proceed    ; Allow IF SUCCESS/FAILURE to work
  258. set input echo on        ; Display port input on screen
  259. set input case ignore        ; Ignore alphabet case for input matching
  260.  
  261. ; The following setups are IBM-PC specific...
  262.  
  263. if not eq "\v(platform)" "IBM-PC" goto CUSTOM
  264.  
  265. COMMENT - Terminal emulation settings.  Modify to suit your environment.
  266.  
  267. set terminal display 7        ; In the 7-bit environment (use 8 for VMS)
  268. set terminal vt320        ; Emulate DEC VT320
  269. set terminal roll off        ; Keep rolled-back screens where they are
  270. set terminal wrap on        ; Tell Kermit to do line wrap
  271. set terminal tabs at 1:8    ; Set tabs at every 8 spaces
  272. set terminal cursor underline    ; Underline cursor (rather than block)
  273. ;
  274. ; The following accounts for the new scan code generated by Space bar
  275. ; on the LK250 keyboard under version 3.13.
  276. ;
  277. if eq \v(keyboard) 250 if > \v(version) 312 set key \313 \32
  278.  
  279. COMMENT - Personalized initialization file
  280. ;
  281. :CUSTOM
  282. if > \v(version) 311 if not inpath MSCUSTOM.INI goto fin
  283. take mscustom.ini
  284.  
  285. :FIN
  286. echo Smile!
  287.