home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / ncsat.cpt / Telnet2.5 final / main / smtp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-31  |  701 b   |  47 lines

  1. /* SMTP Stub                                             */
  2. /* Created by Gaige B. Paulsen on 2-7-97 for testing    */
  3. /* the smtp protocol                                     */
  4. /* For use in conjunction with VS/TCP/IP routines fm NCSA*/
  5.  
  6. #include <quickdraw.h>
  7. #define VTEKTYPE 1
  8.  
  9.  
  10. extern int scrn;
  11. int smnum=0,smactive;
  12. int smtproc();
  13.  
  14. resetSMTP() 
  15. {
  16.     smactive=0;
  17. }
  18.  
  19. setSMTP()
  20. {
  21.     int temp;
  22.  
  23.     if (smnum) return(0);
  24.     smactive=0;
  25.     temp=netsegsize(512);
  26.     smnum=netlisten(25,0);            /* BYU 2.4.15 */
  27.     netsegsize(temp);
  28. }
  29.  
  30. rSMTPd()
  31. {
  32.     if (smactive) return(0);
  33.     if (!netest(smnum)) 
  34.         smtproc();
  35. }
  36.  
  37. smtproc()
  38. {
  39.     int smscrn;
  40.     if (smactive) return(0);
  41.     if (netest(smnum)) return(0);
  42.     smactive=1;
  43.  
  44.     smscrn=addport(smnum,VTEKTYPE,"\PSMTP",4);
  45.     changeport(scrn,smscrn);
  46. }
  47.