home *** CD-ROM | disk | FTP | other *** search
- /*
- Library for ftpd clients.(libftp)
- Copyright by Oleg Orel
- All rights reserved.
-
- This library is desined for free, non-commercial software creation.
- It is changeable and can be improved. The author would greatly appreciate
- any advises, new components and patches of the existing programs.
- Commercial usage is also possible with participation of it's author.
-
-
-
- */
-
- #include "FtpLibrary.h"
-
- extern char * FtpMessageList[];
-
- int FtpGetMessage(FTP *con , char * Message )
- {
- int i=0,n;
- FILE *in=fdopen(con->sock,"r");
- String tmp;
-
- while(1)
- {
- if (fgets(tmp,sizeof tmp,in)==NULL) return QUIT;
- tmp[strlen(tmp)-1]='\0';
- if (tmp[3]!='-') break;
- if ( con -> debug != NULL )
- (*con->debug)(con,n,tmp);
- }
-
- strcpy(Message,tmp);
- FtpInitMessageList();
- FtpMessageList[n=FtpNumber(Message)] =
- ( char * ) malloc ( strlen(Message) + 1);
- strcpy(FtpMessageList[n] , Message );
- if ( con -> debug != NULL )
- (*con->debug)(con,n,Message);
-
- return n;
- }
-
-