home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / c-kermit / ckurzsz.ini < prev    next >
Text File  |  2020-01-01  |  4KB  |  109 lines

  1. ; CKURZSZ.INI -- UNIX C-Kermit X/Y/ZMODEM extern protocol macros.
  2. ;
  3. ; F. da Cruz and C. Gianone, Columbia University, July 1994.
  4. ; Modeled after earlier non-REDIRECT macros by Rick Calder at AT&T.
  5. ;
  6. ; Most recent update: Mon Sep  5 13:00:32 1994
  7. ;
  8. ; NOTE: This file is obsolete as of C-Kermit 6.0, which supports
  9. ; external protocols directly with its SET PROTOCOL command.
  10. ;
  11. ; UNIX C-Kermit Macros to run UNIX Xmodem, Ymodem, and Zmodem as external
  12. ; protocols when C-Kermit is in local mode, i.e. over SET LINE, SET HOST, or
  13. ; TELNET connections.
  14. ;
  15. ; To use, "take ckurzsz.ini" to define the following macros:
  16. ;
  17. ;   SX - Send with Xmodem    RX - Receive with Xmodem
  18. ;   SB - Send with Ymodem    RB - Receive with Ymodem
  19. ;   SZ - Send with Zmodem    RZ - Receive with Zmodem
  20. ;
  21. ; Each macro each takes the same arguments as the corresponding UNIX program.
  22. ; No validation is performed on the arguments except to ensure that the
  23. ; minimum number of them is supplied in each case.  If so, the program is run
  24. ; with the given arguments with its input and output redirected to Kermit's
  25. ; communication channel.  If not, the macro prints an error message and fails.
  26. ;
  27. ; It is assumed that sx, rx, sb, rb, sz, and rz are in your UNIX PATH, and
  28. ; that they are the pre-1989 versions that allow their standard input and
  29. ; output to be redirected.
  30. ;
  31. ; If this version of C-Kermit has the REDIRECT command, it is used and these
  32. ; macros will work no matter what your shell is.  Otherwise your current shell
  33. ; must be ksh or bash for i/o redirection of \v(ttyfd).  Note: both ksh and
  34. ; bash report themselves as /bin/ksh (or /usr/bin/ksh) via the SHELL
  35. ; environment variable.
  36. ;
  37. ; DISCLAIMER:
  38.  
  39. ;   These macro definitions are included with C-Kermit as a convenience to
  40. ;   users of sz/rz.  Columbia University is not a source for the sz/rz
  41. ;   software, nor does it support sz/rz in any way.  For further information
  42. ;   about sz/rz and related products, contact:
  43. ;
  44. ;     Omen Technology Inc
  45. ;     17505-V Northwest Sauvie Island Road
  46. ;     Portland, OR  97231, USA
  47. ;     Voice: +1 503 614-0430, Fax: 503 629-0665, Email: caf@omen.com
  48. ;
  49. set take error on   ; And of course, we need the script programming language.
  50. check if
  51. set take error off
  52.  
  53. if not eq "\v(system)" "UNIX" -
  54.   stop 1 \v(cmdfile): Sorry - UNIX C-Kermit required.
  55.  
  56. define _zcmd run                 ; Assume we don't have REDIRECT.
  57. xif not < \v(version) 501190 { - ; See if we do.
  58.   check redirect, -
  59.   if ok def _zcmd redirect -     ; We do.
  60. }
  61.  
  62. ; If no REDIRECT command, check shell, and if OK use RUN blah <&n ... >&n ...
  63. ;
  64. xif eq \m(_zcmd) run { -
  65.   if not eq "\$(SHELL)" "/bin/bash" -
  66.     if not eq "\$(SHELL)" "/bin/ksh" -
  67.       if not eq "\$(SHELL)" "/usr/bin/ksh" -
  68.         stop 1 -
  69. \v(cmdfile): Sorry - ksh or bash required - read comments in \v(cmdfile), -
  70. }
  71.  
  72. ; Check that we are in local mode, get redirector if needed.
  73. ; This must be evaluated each time one of these macros is called in case
  74. ; the communication channel changed since last time.
  75. ;
  76. define _zchk if < \v(ttyfd) 0 -
  77.   stop 1 Sorry - prior SET LINE or SET HOST required, -
  78.   if eq \m(_zcmd) run asg _zio <&\v(ttyfd) >&\v(ttyfd)
  79.  
  80. ; Send specified file(s) with Zmodem.
  81. ;
  82. define sz _zchk, if = \v(argc) 1 end 1 {sz what file(s)?}, -
  83.   \m(_zcmd) sz \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9 \m(_zio)
  84.  
  85. ; Receive file(s) with Zmodem.
  86. ;
  87. define rz _zchk, \m(_zcmd) rz \m(_zio)
  88.  
  89. ; Send specified file(s) with Ymodem.
  90. ;
  91. define sb _zchk, if = \v(argc) 1 end 1 {sb what file(s)?}, -
  92.   \m(_zcmd) sb \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9 \m(_zio)
  93.  
  94. ; Receive with Ymodem.
  95. ;
  96. define rb _zchk, \m(_zcmd) rb \m(_zio)
  97.  
  98. ; Send a single file with Xmodem.
  99. ;
  100. define sx _zchk, if = \v(argc) 1 end 1 {sx what file?}, -
  101.   \m(_zcmd) sx \%1 \%2 \%3 \%4 \%5 \%6 \%7 \m(_zio)
  102.  
  103. ; Receive a file with Xmodem (receiver must be told the filename too).
  104. ;
  105. define rx _zchk, if = \v(argc) 1 end 1 {rx what file?}, -
  106.   \m(_zcmd) rx \%1 \m(_zio)
  107.  
  108. ; End of CKURZSZ.INI
  109.