home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / cko191.zip / ckermit.ini < prev    next >
Text File  |  1995-04-15  |  23KB  |  687 lines

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