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