home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / k95source / hostmdm.ksc < prev    next >
Text File  |  2020-01-01  |  1KB  |  58 lines

  1. ; Kermit 95 host mode listener for dialin connections.
  2. ;
  3. ;   Version 1.0, Feb 1996.
  4. ;   Version 2.0, Jan 1997, avoid undoing prior modem customizations.
  5. ;   Version 3.0, Jun 1997, adds support for TAPI.
  6. ;
  7. if < \v(xvers) 1112 stop 1 \v(cmdfil): K-95 1.1.12 or higher is required.
  8.  
  9. local x1 x2 split
  10. undef x2
  11.  
  12. asg _configfile \freplace(\v(startup)scripts/host.cfg,/,\\)
  13.  
  14. def MAKEVAR2 {
  15.     if def \%2 _assign \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8 \%9
  16.     else _assign \%1
  17. }
  18. def MAKEVAR {
  19.     if = \findex(=,\%1,1) 0 end
  20.     asg \%9 _\freplace(\%1,=,\32)
  21.     makevar2 \%9
  22. }
  23. def SPLIT {
  24.     asg x1 \%1
  25.     asg x2 \%2
  26. }
  27. open read \m(_configfile)
  28. if fail forward noconfig
  29. while true { read \%a, if fail break, makevar {\%a} }
  30.  
  31. :NOCONFIG
  32.  
  33. ; Don't give a SET MODEM TYPE command if it will not change the
  34. ; current modem type.  If we do, it wipes out any prior customizations.
  35.  
  36. xif def _modem {
  37.     xif not equal \v(modem) \m(_modem) {
  38.         set modem type \m(_modem)
  39.         if fail stop 1 "\m(_modem)" - Invalid modem type
  40.     }
  41. }
  42. xif def _commport {
  43.     split \m(_commport)     ; This can be one or two words
  44.     set port \m(x1) \m(x2)  ; e.g. SET PORT TAPI Name_of_TAPI_Device
  45.     if fail stop 1 "\m(_commport)" - Invalid port
  46. }
  47. xif def _comspeed {
  48.     set speed \m(_comspeed)
  49.     if fail stop 1 "\m(_comspeed)" - Invalid speed
  50. }
  51. xif not eq "\v(connection)" "serial" {
  52.     stop 1 "\v(line)" - Inappropriate connection type: "\v(connection)"
  53. }
  54. while 1 {
  55.     answer
  56.     if success take host.ksc
  57. }
  58.