home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / old / ckermit5a190 / ckermit.ini < prev    next >
Text File  |  2020-01-01  |  22KB  |  673 lines

  1. COMMENT - Standard C-Kermit initialization file
  2. ;
  3. ; For C-Kermit Version: 5A(190)
  4. ;
  5. ; Filename:
  6. ;   .kermrc     (UNIX, OS-9, Aegis)
  7. ;   CKERMIT.INI (OS/2, VMS, OpenVMS, AOS/VS, Atari ST, Commodore Amiga)
  8. ;   ckermit.ini (Stratus VOS)
  9. ;
  10. ; Authors:
  11. ;   Frank da Cruz, Christine M. Gianone
  12. ;   Columbia University, New York, NY, USA
  13. ;
  14. ; OS/2 modifications for version 5A(189-190):
  15. ;   Jeffrey Altman
  16. ;   Altmania Productions
  17. ;
  18. ; Version 5A(188): 23 November 1992
  19. ; Version 5A(189): 29 June 1993
  20. ; Version 5A(190) (in progress): Sat Aug 20 11:20:07 1994
  21. ;
  22. ; This is the standard and recommended C-Kermit 5A initialization file.
  23. ; It should be portable to all implementations of C-Kermit 5A edit 188
  24. ; and later.  To override settings or definitions made in this file, to
  25. ; add new settings or definitions, or to make any other desired
  26. ; customizations, create a separate, personal customization file called: 
  27. ;
  28. ;   .mykermrc     (UNIX, OS-9, Aegis)
  29. ;   CKERMOD.INI   (OS/2, VMS, OpenVMS, AOS/VS, Atari ST, Commodore Amiga)
  30. ;
  31. ; You can also define the customization filename in an environment
  32. ; variable (logical name in VMS), CKERMOD, which takes precedence over
  33. ; the names shown above.
  34. ;
  35. ; WHAT THIS FILE DOES:
  36. ;
  37. ; . The FULLSCREEN file transfer display is selected if it is available
  38. ; . Defines your default dialing directory name:
  39. ;     .kdd for UNIX, OS-9 and Aegis; CKERMIT.KDD for other operating systems.
  40. ;        You can override this with the environment variable CKDDIR.
  41. ; . Defines your default services directory name:
  42. ;     .ksd for UNIX, OS-9 and Aegis; CKERMIT.KSD for other operating systems.
  43. ;        You can override this with environment variable CKSDIR.
  44. ; . Defines your customization file name (name given above)
  45. ; . Performs system-dependent setups for UNIX, VMS, OS/2, etc.
  46. ; . Defines an EDIT macro to let you invoke a text editor from C-Kermit.
  47. ; . Defines TSEND, BSEND, TGET, BGET macros for text and binary file transfer.
  48. ; . Defines VTPRINT, PCGET, and PCSEND macros for use with MS-DOS Kermit.
  49. ; . Opens your dialing directory if you have one.
  50. ; . Reads your services directory and defines ACCESS and LIST macros for it.
  51. ; . Executes your personal customization file, if you have one.
  52. ;
  53. ; C-Kermit 5A is documented in the book "Using C-Kermit" by Frank da Cruz
  54. ; and Christine M. Gianone, 1993, Digital Press / Butterworth-Heinemann,
  55. ; Woburn, MA; ISBN 1-55558-108-0, Price: US $34.95.
  56.  
  57. def \%g FORWARD            ; Use FORWARD for speed if available.
  58. check FORWARD
  59. if success forward OK
  60. ec WARNING:
  61. ec This command file should be used with C-Kermit 5A(190) Beta.18 or later.
  62. def \%g GOTO
  63. :OK
  64.  
  65. ; Everything after this point depends on the script programming language.
  66. ; The CHECK command terminates this command file immediately if the script
  67. ; programming language (IF command) is not configured.
  68. ;
  69. set take error on        ; This makes CHECK quit if no script language.
  70. check if            ; Do we have an IF command?  If not, quit now.
  71. set take error off        ; Back to normal.
  72.  
  73. COMMENT - Greet and make sure C-Kermit edit is 188 or higher.
  74. ;
  75. echo Executing \v(cmdfile) for \v(system)...
  76. if < \v(version) 501188 -
  77.   stop 1 \v(cmdfile): C-Kermit 5A(188) or later required.
  78.  
  79. def _dedit            ; No default editor yet.
  80. \%g \v(system)            ; First do system-dependent items...
  81.  
  82. :unknown            ; Should not happen
  83. Stop 1 Error: System type unknown!
  84.  
  85. :Aegis                ; Apollo Aegis and
  86. :UNIX                ; UNIX, all versions
  87. def _dedit vi            ; Default editor is VI
  88. asg _myinit -
  89.   \v(home).mykermrc        ; Customization filename
  90. if > \v(version) 501189 if remote \%g COMMON ; Skip local-mode items if "-R"
  91. asg _dialdir -
  92.   \v(home).kdd            ; C-Kermit dialing directory
  93. asg _servicedir -
  94.   \v(home).ksd            ; C-Kermit services directory
  95. check fullscreen        ; Do we have a fullscreen display?
  96. if success set file displ full  ; If so, use it.
  97. \%g COMMON                      ; End of UNIX section
  98.  
  99. :OS9/68K            ; OS-9
  100. asg _myinit -
  101.   \v(home).mykermrc        ; Customization filename
  102. if > \v(version) 501189 if remote \%g COMMON
  103. asg _dialdir -
  104.   \v(home).kdd            ; C-Kermit dialing directory
  105. asg _servicedir -
  106.   \v(home).ksd            ; C-Kermit services directory
  107. if eq "\$(TERM)" "vt100" -      ; File transfer display
  108.   set file display full         ; Only works with VT-100 terminal type
  109. else if eq "\$(TERM)" "VT100" -
  110.   set file display full
  111. else set file display crt
  112. \%g COMMON            ; End of OS-9 section
  113.  
  114. :VMS                ; VMS and OpenVMS
  115. def _dedit edit            ; Default editor is EDIT.
  116. set file display fullscreen     ; File transfer fisplay
  117. \%g COMMON
  118.  
  119. :OS/2                ; OS/2
  120. asg _inifile \v(cmdfile)    ; Get directory where this file is kept...
  121. asg _inidirlen \feval(\flength(\m(_inifile))-11)
  122. asg _inidir \fsubstr(\m(_inifile),1,\m(_inidirlen))
  123. asg _dialdir    \m(_inidir)CKERMIT.KDD
  124. asg _servicedir \m(_inidir)CKERMIT.KSD
  125. asg _myinit     \m(_inidir)CKERMOD.INI
  126. asg _inidirlen            ; Release unneeded variables
  127. set file display fullscreen     ; File transfer fisplay
  128. set server display on        ; Show display in server mode too.
  129. def _dedit e            ; Default editor is E
  130. set command bytesize 8          ; Use 8 bits between Kermit and console.
  131. set xfer char latin1            ; Use Latin-1 for text file transfer.
  132. def cls echo \27[H\27[2J        ; Define CLS command to clear the screen.
  133. def os2 push            ; Make OS2 a synonym for PUSH, RUN, etc.
  134. def more run type \%1 | more    ; Easy access to MORE command.
  135. def vdir run dir | more    ; "Verbose" DIRECTORY
  136. def tdir run dir /o-d | more ; Reverse Time-Order DIRECTORY
  137. \%g COMMON                      ; End of OS/2 section
  138.  
  139. :AOS/VS                ; Data General AOS/VS
  140. def _dedit sed            ; Default editor is SED
  141. set file char dg-international    ; File character-set
  142. set xfer char latin1        ; Transfer character-set
  143. set file display crt            ; File transfer fisplay
  144. def cli push            ; Escape to CLI
  145. def reset -            ; Macro to reset DG DASHER terminal
  146.  run write [!ascii 236 306 301]
  147. \%g COMMON                      ; End of AOS/VS section
  148.  
  149. :Amiga                ; Commodore Amiga
  150. def cls echo \27[H\27[2J    ; CLS command to clear the screen
  151. set file display full           ; Supports fullscreen display
  152. set file char latin1        ; Use Latin Alphabet 1 for file transfer
  153. set xfer char latin1        ; ...
  154. \%g COMMON                      ; End of Amiga section
  155.  
  156. :Atari_ST            ; Atari ST
  157. def cls echo \27H\27J        ; Clear screen a`la VT52
  158. set file display crt        ; FULLSCREEN not available
  159. set server display on        ; Show file xfer display in server mode too
  160. set server timeout 15        ; Nonzero required for ^C interruption!
  161. \%g COMMON                      ; End of Atari ST section
  162.  
  163. :Macintosh            ; Apple Macintosh
  164. set server display on        ; Show file xfer display in server mode too.
  165. \%g COMMON
  166.  
  167. :Stratus_VOS                    ; Stratus VOS
  168. def _dedit emacs        ; Default editor is emacs
  169. asg _myinit \v(home)ckermod.ini
  170. if > \v(version) 501189 if remote \%g COMMON
  171. asg _dialdir \v(home)ckermit.kdd
  172. asg _servicedir \v(home)ckermit.ksd
  173. \%g COMMON                      ; End of Stratus VOS section
  174.  
  175. :COMMON                ; System-independent items
  176.  
  177. ; Make the C-Kermit prompt show my current directory.
  178. ; Environment variable or logical name CKPROMPT takes precedence.
  179. ;
  180. if def \$(CKPROMPT) set prompt \$(CKPROMPT)
  181.   else if eq "\v(system)" "VMS" set prompt \v(dir) C-Kermit>
  182.   else  set prompt [\v(dir)] C-Kermit>
  183.  
  184. COMMENT - File transfer macros
  185. ;
  186. def _SEND asg \%9 \ffiles(\%1),-
  187.   if = 0 \%9 end 1 {\?File not found},-
  188.   if = 1 \%9 send \%1 \%2,-  ; Single file with as-name
  189.   else send \%1              ; or wildcard with no as-name
  190. def BINARY set file type binary
  191. def TEXT set file type text
  192. def BSEND binary, _send \%1 \%2    ; Send binary file(s)
  193. def TSEND text, _send \%1 \%2    ; Send text file(s)
  194. def BGET remote set file type binary, -          ; Get binary file(s)
  195.   if success get \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 ;  from server
  196. def TGET remote set file type text, -            ; Get text file(s)
  197.   if success get \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 ;  from server
  198. def FAST -
  199.   ech FAST file transfer settings - use at your own risk...,-
  200.   set win 5, set rec packet 5000, set contr u all,-
  201.   set con p 0 1 3 13 17 19 129 141 145 147
  202. def ROBUST set win 1, set rec packet 90, set con p all
  203.  
  204. COMMENT - EDIT macro.
  205. ;
  206. ; EDITOR environment variable, if defined, takes precedence.
  207. ;
  208. check push            ; Only works if we have a PUSH command
  209. if fail \%g macros        ; (so it doesn't work on the Macintosh).
  210.  
  211. if def \$(EDITOR) assign myeditor \$(EDITOR)
  212.   else assign myeditor \m(_dedit)
  213. if not def myeditor def myeditor edit
  214. def _dedit
  215. def myfile
  216.  
  217. def edit if = \v(argc) 2 assign myfile \%1,-
  218.   if not def myfile echo Edit what?,-
  219.   else run \m(myeditor) \m(myfile)
  220.  
  221. :MACROS
  222.  
  223. ; Define macros that are useful when running C-Kermit in remote mode.
  224. ; These macros serve no purpose on local-mode-only versions such as
  225. ; OS/2, Macintosh, Amiga, and Atari ST Kermit, so we skip defining them
  226. ; for those systems.
  227. ;
  228. if not = 0 \findex(\v(system),OS/2:Macintosh:Amiga:Atari_ST) \%g files
  229.  
  230. COMMENT - VTPRINT macro.  Print a file on your PC's local printer.
  231. ;
  232. def vtprint echo \27[5i, type \%1, echo \27[4i
  233.  
  234. COMMENT - Macros for host-initiated file transfer with MS-DOS Kermit
  235. ;         And OS/2 C-Kermit.
  236. ;
  237. ; The method for doing this changed in June/July 1993, when C-Kermit 5A(189)
  238. ; and MS-DOS Kermit 3.13 were released (at approximately the same time).
  239. ; There is no good way for C-Kermit to find out the MS-DOS Kermit version
  240. ; number, so we determine which method to use based on the C-Kermit version.
  241. ;
  242. if > \v(version) 501188 \%g apc
  243.  
  244. COMMENT - PCGET macro, for use with MS-DOS Kermit 3.12 and earlier.  Argument:
  245. ; 1 = Name of file to get from MS-DOS Kermit.
  246. ; Requires MS-DOS Kermit macro TERMINALS defined as "server, connect".
  247. ;
  248. def PCGET echo \27[\?34h, get \%1, finish
  249.  
  250. COMMENT - PCSEND macro, for use with MS-DOS Kermit 3.12 and earlier.  Args:
  251. ; \%1 = Name of file to send to MS-DOS Kermit.
  252. ; \%2 = Optional name to send it with.
  253. ; Requires MS-DOS Kermit macro TERMINALR defined as "receive, connect".
  254. ;
  255. def PCSEND asg \%9 \ffiles(\%1),-
  256.   if = 0 \%9 end 1 {\?File not found},-
  257.   set delay 1, echo \27[\?34l,-
  258.   if = 1 \%9 send \%1 \%2,-  ; Single file with as-name
  259.   else send \%1              ; or wildcard with no as-name
  260.  
  261. \%g files
  262.  
  263. :APC
  264.  
  265. COMMENT - PCGET macro, for use against MS-DOS Kermit 3.13 and later,
  266. ; or C-Kermit 5A(190) or later on the PC.  Arguments:
  267. ; 1 = Name of file to get from PC.
  268. ; 2 = Optional name that C-Kermit should store it under.
  269. ;
  270. def pcget apc server, -
  271.   msleep 200,-
  272.   if not eq "\v(ftype)" "" remote set file type \v(ftype), -
  273.   xif def \%2 { -          ; If we have an "as-name"
  274.     get, \%1, \%2, -       ; use multiline GET
  275.     asg _tmp \v(status) -  ; Remember status
  276.   } else { -               ; Otherwise
  277.     get \%1, -             ; use regular GET
  278.     asg _tmp \v(status) -  ; Remember status
  279.   }, -
  280.   fin, end \m(_tmp)        ; FINISH server and return status
  281.  
  282. COMMENT - PCSEND macro, for use against MS-DOS Kermit 3.13 and later,
  283. ; or C-Kermit 5A(190) or later.  Arguments:
  284. ; \%1 = Name of file to send to MS-DOS Kermit.
  285. ; \%2 = Optional name to send it with.
  286. ;
  287. def pcsend asg \%9 \ffiles(\%1),-
  288.   if = 0 \%9 end 1 {\?File not found},-
  289.   set delay 1, apc receive,-
  290.   if = 1 \%9 send \%1 \%2,- ; Single file with as-name
  291.   else send \%1             ; or wildcard with no as-name
  292.  
  293. :FILES
  294.  
  295. ; Get customization, dialing directory, and services directory filenames.
  296. ; Let environment variables take precedence, so users do not have to edit
  297. ; this file to change these filenames.
  298. ;
  299. if def \$(CKERMOD) assign _myinit \$(CKERMOD)
  300. if not def _myinit assign _myinit \v(home)CKERMOD.INI
  301.  
  302. if > \v(version) 501189 if remote \%g NOSERVICES
  303.  
  304. if def \$(CKDDIR) assign _dialdir \$(CKDDIR)
  305. if not def _dialdir assign _dialdir \v(home)CKERMIT.KDD
  306.  
  307. if def \$(CKSDIR) assign _servicedir \$(CKSDIR)
  308. if not def _servicedir assign _servicedir \v(home)CKERMIT.KSD
  309.  
  310. CHECK DIAL            ; Is the DIAL command enabled?
  311. xif fail { -            ; No.
  312.     echo DIAL disabled -
  313. } else { -            ; Yes, check for and open the dial directory.
  314.     xif exist \m(_dialdir) { -
  315.         set dial directory \m(_dialdir), -
  316.         echo { Dial directory is \m(_dialdir) } -
  317.     } -
  318. }
  319.  
  320. COMMENT - Check for existence of services directory
  321. ;
  322. if not exist \m(_servicedir) \%g NOSERVICES
  323.  
  324. COMMENT - Have services directory, so read it and define related macros
  325. ;
  326. echo { Services directory is \m(_servicedir)}
  327.  
  328. def max_svcs 50               ; Adjust this if you have more than 50 entries!
  329. open read \m(_servicedir)     ; Open services directory file
  330. xif fail { -
  331.     echo Can't open \m(_servicedir), -
  332.     goto NOSERVICES -
  333. }
  334. declare \&d[\m(max_svcs)]     ; Declare array for service directory entries
  335. for \%i 1 \m(max_svcs) 1 { -  ; Read entries into array
  336.     read \&d[\%i], -
  337.     if fail \%g DONE -
  338. }
  339. close read                    ; Didn't reach the end
  340. echo -                        ; Close the file and print useful message
  341.   \?Too many entries in services directory:
  342. echo { Maximum is \m(max_svcs).}
  343. echo { Change definition of max_svcs in \v(cmdfile) to allow more. }
  344. echo { Services directory disabled.}
  345. \%g NOSERVICES
  346.  
  347. :DONE                         ; We have the services directory in memory
  348. asg \&d[0] \feval(\%i - 1)    ; Keep size of array in zeroth element
  349.  
  350. ; LIST macro.  Arguments:
  351. ; \%1 = service name (optional)
  352. ;
  353. def LIST -
  354.   if > \v(argc) 1 goto SEARCH, -
  355.   echo \&d[0] items in services directory:, -   ; No search item
  356.   for \%i 1 \&d[0] 1 { echo \&d[\%i] }, end, -  ; List whole directory
  357. :SEARCH, -                                      ; Search item given
  358.   lookup \%1, -                                 ; Look it up
  359.   if def \v(return) echo \v(return), -          ; List it if found
  360.   else echo \%1: Not found                      ; or say it wasn't
  361.  
  362. COMMENT - SERIAL macro.  Arguments:
  363. ; \%1 = device name
  364. ; \%2 = speed
  365. ;
  366. def SERIAL -
  367.   if < \v(argc) 3 -                       ; All arguments given?
  368.     end 1 Usage: SERIAL device speed,-    ; No.
  369.   set line \%1,-                          ; OK, try to SET LINE.
  370.   if failure -                            ; If this failed,
  371.     end 1 Can't open device: \%1,-        ; print message and quit.
  372.   set speed \%2,-                         ; Try to set the speed.
  373.   if fail end 1 Unsupported speed: \%2,-  ; Failed.
  374.   echo Connection successful.             ; Succeeded.
  375.  
  376. COMMENT - NET macro.  Arguments:
  377. ; \%1 = network type
  378. ; \%2 = host name or address
  379. ;
  380. def NET if < \v(argc) 3 end 1 Usage: NET network host,-
  381.   set network \%1,-
  382.   if fail end 1 unsupported network: \%1,-
  383.   set host \%2,-
  384.   if fail end 1 can't reach host: \%2,-
  385.   echo Connection successful.
  386.  
  387. COMMENT - CALL macro.  Arguments:
  388. ;
  389. ; \%1 = modem type
  390. ; \%2 = device name
  391. ; \%3 = speed
  392. ; \%4 = phone number
  393. ;
  394. def CALL if < \v(argc) 5 end 1 Usage: CALL modem device speed number,-
  395.   set modem \%1,-
  396.   if fail end 1 unknown modem type: \%1,-
  397.   set line \%2,-
  398.   if fail end 1 can't open device: \%2,-
  399.   set speed \%3,-
  400.   if fail end 1 unsupported speed: \%3,-
  401.   for \%i 1 10 1 { -
  402.     xif > \%i 1 { -
  403.         echo Will redial in 1 minute: please wait...,-
  404.         pause 60,-
  405.         echo Redialing: try number \%i...,-
  406.     },-
  407.     dial \%4,-
  408.     if success goto OK,-
  409.     hangup,-
  410.   } -
  411.   end 1 Can't place call: \%4,-
  412.   :ok,-
  413.   pause 1,-
  414.   echo Connection successful.
  415.  
  416. COMMENT - SPRINT macro.  Arguments:
  417. ; \%1 = Service name or address
  418. ;
  419. def SPRINT -
  420.     if < \v(argc) 2 end 1 Usage: \%0 service,-
  421.     set input timeout proceed,-
  422.     output @D\13,-
  423.     input 10 TERMINAL=,-
  424.     if fail end 1 No terminal prompt,-
  425.     out D1\13,-
  426.     inp 10 @,-
  427.     if fail end 1 No atsign prompt,-
  428.     output c \%1\13,-
  429.     input 10 CONNECTED,-
  430.     if fail end 1 Can't access \%1 from SprintNet
  431.  
  432. COMMENT - VMSLOGIN macro.  Arguments:
  433. ; \%1 = VMS user ID
  434. ; \%2 = Password.  If password not supplied, it is prompted for.
  435. ;
  436. def VMSLOGIN if < \v(argc) 2 end 1 Usage: VMSLOGIN userid password,-
  437.     if eq \fcode(\%2) 32 asg \%2 \fsubst(\%2,2), -
  438.     while not def \%2 { - 
  439.         askq \%2 { \%1's password: } -
  440.     },-
  441.     set parity none,-
  442.     set duplex full,-
  443.     set handshake none,-
  444.     set flow xon/xoff,-
  445.     set input timeout proceed,-
  446.     for \%i 1 3 1 { -
  447.         out \13,-
  448.         in 5 Username:,-
  449.         if success goto DOLOGIN -
  450.     },-
  451.     end 1 No Username prompt,-
  452. :DOLOGIN,-
  453.     out \%1\13,-
  454.     inp 5 Password:,-
  455.     if fail end 1 No password prompt,-
  456.     out \%2\13,-
  457.     def \%2,-
  458.     set inp ech off,-
  459.     minp 20 \27Z \27[c,-
  460.     xif success { -
  461.       out \27[\?1c,-
  462.       in 2 [6n,-
  463.       if succ out \27[24;80R -
  464.     } else { out \13},-
  465.     set inp ech on,-
  466.     if not def \%3 asg \%3 {\10\13$\32},-
  467.     reinp 0 \%3,-
  468.     if fail inp 60 \%3,-
  469.     if fail end 1 No system prompt,-
  470.     echo Login successful.
  471.  
  472. COMMENT - UNIXLOGIN macro.  Arguments:
  473. ; \%1 = user ID
  474. ; \%2 = password
  475. ;
  476. def UNIXLOGIN if < \v(argc) 2 end 1 Usage: \%0 userid password,-
  477.     if eq \fcode(\%2) 32 asg \%2 \fsubst(\%2,2), -
  478.     while not def \%2 { - 
  479.         askq \%2 { \%1's password: } -
  480.     },-
  481.     set parity none,-
  482.     set duplex full,-
  483.     set handshake none,-
  484.     set case on,-
  485.     out \13,-
  486.     set input timeout proceed,-
  487.     for \%i 1 15 1 { -
  488.         in 5 login:,-
  489.         if success goto DOLOGIN,-
  490.         output \\B -
  491.     },-
  492.     end 1 No login prompt,-
  493. :DOLOGIN,-
  494.     out \%1\13,-
  495.     inp 5 Password:,-
  496.     if fail end 1 No password prompt,-
  497.     out \%2\13,-
  498.     def \%2,-
  499.     if not def \%3 asg \%3 {\13\10$ },-
  500.     inp 60 \%3,-
  501.     if fail end 1 No system prompt,-
  502.     echo, echo Login successful.
  503.  
  504. COMMENT - VMLINELOGIN macro.  Arguments:
  505. ; \%1 = User ID
  506. ; \%2 = Password
  507. ;
  508. def VMLINELOGIN -
  509.     if < \v(argc) 2 end 1 Usage: \%0 userid password,-
  510.     if eq \fcode(\%2) 32 asg \%2 \fsubst(\%2,2), -
  511.     while not def \%2 { - 
  512.         askq \%2 { \%1's password: } -
  513.     },-
  514.     set parity mark,-
  515.     set flow none,-
  516.     set handshake xon,-
  517.     set duplex half,-
  518.     set input timeout quit,-
  519.     input 10 BREAK KEY,-
  520.     pause 1,-
  521.     output \\B,-
  522.     input 10 .\17, output login \%1\13,-
  523.     input 10 .\17, output \%2\13, def \%2,-
  524.     input 10 .\17, output \13,-
  525.     input 10 .\17, output \13,-
  526.     set input timeout proceed,-
  527.     echo Login successful.
  528.  
  529. COMMENT - VMFULLOGIN macro.  Arguments:
  530. ; \%1 = User ID
  531. ; \%2 = Password
  532. ;
  533. def VMFULLOGIN -
  534.     if < \v(argc) 2 end 1 Usage: \%0 userid password,-
  535.     if eq \fcode(\%2) 32 asg \%2 \fsubst(\%2,2), -
  536.     while not def \%2 { - 
  537.         askq \%2 { \%1's password: } -
  538.     },-
  539.     set input timeout quit,-
  540.     set parity even,-
  541.     set duplex full,-
  542.     set handshake none,-
  543.     set flow xon/xoff,-
  544.     out \13,-
  545.     inp 5 TERMINAL TYPE:,-
  546.     out vt-100\13,-
  547.     inp 20 RUNNING,-
  548.     pau 1,-
  549.     out \%1\9\%2\13,-
  550.     out \13\13,-
  551.     set input timeout proceed,-
  552.     echo Login successful.
  553.  
  554. COMMENT - CISLOGIN macro for CompuServe.  Arguments:
  555. ; \%1 = CompuServe User ID
  556. ; \%2 = Password
  557. ;
  558. def CISLOGIN -
  559.     if < \v(argc) 2 end 1 Usage: \%0 userid password,-
  560.     if eq \fcode(\%2) 32 asg \%2 \fsubst(\%2,2), -
  561.     while not def \%2 { - 
  562.         askq \%2 { \%1's password: } -
  563.     },-
  564.     set terminal bytesize 7,-
  565.     set input timeout quit,-
  566.     output \13,-
  567.     input 5 Host Name:,-
  568.     output cis\13,-
  569.     input 5 User ID:,-
  570.     output \%1\13,-
  571.     input 5 Password:,-
  572.     output \%2\13,-
  573.     def \%2,-
  574.     if not def \%3 asg \%3 CompuServe Information Service,-
  575.     input 30 \%3,-
  576.     echo, echo Login successful.
  577.  
  578. COMMENT - DOWLOGIN macro for Dow Jones News/Retrieval.  Arguments:
  579. ; \%1 = Dow Jones Password
  580. ;
  581. def DOWLOGIN -
  582.     if eq \fcode(\%2) 32 asg \%2 \fsubst(\%2,2), -
  583.     while not def \%2 { - 
  584.         askq \%2 { \%1's password: } -
  585.     },-
  586.     set input timeout proceed,-
  587.     input 20 SERVICE PLEASE\?\?\?\?,-
  588.     if fail end 1 no service prompt,-
  589.     out djnr\13,-
  590.     input 10 @@@@,-
  591.     if fail end 1 No password prompt,-
  592.     pause 1,-
  593.     output \%1\13,-
  594.     if not def \%3 asg \%3 ENTER QUERY,-
  595.     input 30 \%3,-
  596.     if fail end 1 No main query prompt,-
  597.     pause 1@,-
  598.     echo Login successful.
  599.  
  600. COMMENT - DJNRSPRINT macro: Log in to Dow Jones via SprintNet.
  601. ;
  602. def djnrsprint sprint dow, dowlogin
  603.  
  604. COMMENT - NOLOGIN macro.  Does nothing.  Use when login not required.
  605. ;
  606. def nologin comment
  607.  
  608. COMMENT - LOOKUP macro.  Argument:
  609. ; \%1 = Service name to look for in services directory
  610. ;
  611. def LOOKUP -
  612.     set case off,-          ; Ignore alphabetic case
  613.     for \%i 1 \&d[0] 1 { -  ; Loop thru services directory
  614.         if eq \%1 \fsubstr(\&d[\%i],1,\flen(\%1)) - ; Got a match?
  615.           break -           ; If so, we're done
  616.     },-
  617.     if not > \%i \&d[0] return \&d[\%i] ; Return the entry
  618.  
  619. def _a1 return \%1
  620. def _a2 return \%2
  621.  
  622. def DOACCESS -        ; (Used internally by ACCESS macro)
  623.     do \%5 \%6 \%7 \%8 \%9,- ; Do the connection macro
  624.     if fail end 1,-
  625.     _a2 \%3,-                ; Prompt, if any
  626.     asg \%2 \v(return),-
  627.     _a1 \%3,-                ; Login macro name
  628.     asg \%3 \v(return),-
  629.     do \%3 \%4 {\%1} \%2     ; Login macro, userid, password, prompt
  630.  
  631. ; ACCESS macro.  Arguments:
  632. ; \%1 = service name
  633. ; \%2 = password (optional)
  634. ;
  635. def ACCESS -
  636.     if not defined \%1 end 1 access what?,-      ; Check service
  637.     lookup \%1,-                                 ; Look it up
  638.     if success doaccess { \%2} \v(return),-      ; OK, try it
  639.     else end 1 "\%1" not in services directory,- ; Not found
  640.     if fail stop 1                               ; DOACCESS failed?
  641.  
  642. \%g ENDSERVICES            ; Skip around NOSERVICES definitions.
  643.  
  644. :NOSERVICES
  645. def access echo { Services directory not available.}
  646. asg list \m(access)
  647.  
  648. :ENDSERVICES
  649.  
  650. COMMENT - In VMS and OpenVMS, allow for system-wide site customizations
  651. ;
  652. if not equal "\v(system)" "VMS" \%g CUSTOM
  653. xif exist CKERMIT_INI:CKERMIT.SYS { -
  654.     echo Executing CKERMIT_INI:CKERMIT.SYS, -
  655.     take CKERMIT_INI:CKERMIT.SYS -
  656. }
  657.  
  658. COMMENT - Execute user's personal customization file
  659. ;
  660. :CUSTOM
  661. xif exist \m(_myinit)  { -        ; If it exists,
  662.     echo Executing \m(_myinit)..., -    ; print message,
  663.     take \m(_myinit) -            ; and TAKE the file.
  664. }
  665.  
  666. COMMENT - Greeting.
  667. ;
  668. if < \v(ntime) 43200 echo Good Morning!
  669.   else if < \v(ntime) 61200 echo Good Afternoon!
  670.   else echo Good Evening.
  671.  
  672. ; End of C-Kermit 5A initialization file.
  673.