home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume38 / libftp / part01 / FtpGetMessage.c < prev    next >
C/C++ Source or Header  |  1993-07-13  |  559b  |  28 lines

  1. #include "FtpLibrary.h"
  2.  
  3. extern char * FtpMessageList[];
  4.  
  5. int FtpGetMessage(FTP *con , char * Message )
  6. {
  7.   int i=0,n;
  8.   
  9.   while(1)
  10.     {
  11.       if ( read ( con -> sock , &Message[i] , 1 ) != 1 )
  12.     return QUIT;
  13.       if ( Message[i] == Ctrl('J') && Message[i-1] == Ctrl('M'))
  14.     break;
  15.       i++;
  16.     }
  17.   
  18.   Message[i-1] = 0;
  19.   FtpInitMessageList();
  20.   FtpMessageList[n=FtpNumber(Message)] =
  21.     ( char * ) malloc ( strlen(Message) + 1);
  22.   strcpy(FtpMessageList[n] , Message );
  23.   if ( con -> debug != NULL )
  24.     (*con->debug)(con,n,Message);
  25.   return n;
  26. }
  27.       
  28.