home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / lpopper.zip / main.c < prev    next >
C/C++ Source or Header  |  1999-11-09  |  1KB  |  54 lines

  1. #include "popper.h"
  2.  
  3.  
  4. char MyName[514];
  5.  
  6.  
  7.  
  8. int main (int ArgC, char * ArgV[])
  9. { /*int Res;
  10.   struct hostent MyHost;
  11.   struct in_addr MyAddr;
  12.   unsigned long * lMyAddr;*/
  13.  
  14.   printf("vPopper/2. 0.995beta\n(C)'97-99 VR vik@lada.kiev.ua 2:463/262 2:463/278\nPlease mail bug reports to vik@avi.kiev.ua\n");
  15.   printf("Compiled %s at %s\n", __DATE__, __TIME__);
  16.  
  17.   if((ArgC>1) && (ArgV[1][1]=='?'))
  18.     { fprintf(stderr, "POP3 server/2.\nUsage : %s [mailboxes path [passwd file]]\n", ArgV[0]);
  19.       fprintf(stderr, "Default values : mailbox path = ./\n"
  20.              "                 passwd file  = passwd\n");
  21.       return(0);
  22.     }
  23.   if(ArgC>1)
  24.     { strncpy(BoxPath, ArgV[1], 510);
  25.       BoxPath[510]=0;
  26.       if((BoxPath[strlen(BoxPath)-1]!='\\') && (BoxPath[strlen(BoxPath)-1]!='/'))
  27.         { strcat(BoxPath, "\\");
  28.         }
  29.     }
  30.   if(ArgC>2)
  31.     { strncpy(PwdPath, ArgV[2], 511);
  32.       PwdPath[511]=0;
  33.     }
  34.  
  35.   MyName[0]=0;
  36.   gethostname(MyName, 511);
  37.  
  38. /*  memcpy(&MyHost, gethostbyname(MyName), sizeof(MyHost));*/
  39.  
  40. /*  memcpy(&MyAddr.s_addr, MyHost->h_addr_list[0], MyHost->h_length);*/
  41. /*  fprintf(stderr, "POP3@%s [%s]\n", MyName, inet_ntoa(MyAddr));*/
  42.   fprintf(stderr, "POP3@%s\n", MyName);
  43.   fprintf(stderr, "Using [%s] as passwd\nand   [%s] as mail/boxes\n", PwdPath, BoxPath);
  44.  
  45.   fprintf(stderr, "Initializing\n");
  46.   fflush(stdout);
  47.   fflush(stderr);
  48.   WaitConn();
  49.  
  50.   fprintf(stderr, " \nTerminated\n\n");
  51.   return(0);
  52. }
  53.  
  54.