Initial
This commit is contained in:
442
ftp/FTP.BAK
Normal file
442
ftp/FTP.BAK
Normal file
@@ -0,0 +1,442 @@
|
||||
#include <stdio.h>
|
||||
#include <socket/hostent.hpp>
|
||||
#include <socket/servent.hpp>
|
||||
#include <socket/socket.hpp>
|
||||
#include <ftp/ftp.hpp>
|
||||
|
||||
FTPClient::FTPClient(void)
|
||||
: mIsLoggedIn(FALSE), mCurrentType('A')
|
||||
{
|
||||
createCommands();
|
||||
}
|
||||
|
||||
FTPClient::~FTPClient()
|
||||
{
|
||||
}
|
||||
|
||||
WORD FTPClient::open(String hostName)
|
||||
{
|
||||
HostEnt hostEntry;
|
||||
ServEnt serverEntry;
|
||||
|
||||
message(String("trying ")+hostName+String("..."));
|
||||
if(!mWSASystem.isInitialized()){message("WINSOCK initialization failure.");return FALSE;}
|
||||
InternetAddress internetAddress(hostName);
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){message(String("no DNS entry for ")+hostName);return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){message(String("no DNS entry for ")+hostName);return FALSE;}
|
||||
message(String("connect...")+String("'")+hostEntry.hostName()+String("' (")+(String)(hostEntry.addresses())[0]+String(")"));
|
||||
INETSocketAddress::internetAddress((hostEntry.addresses())[0]);
|
||||
if(!serverEntry.serviceByName("ftp","tcp")){message("cannot determine port number for ftp daemon.");return FALSE;}
|
||||
if(!mFTPControl.openSocket()){message("unable to create socket.");return FALSE;}
|
||||
INETSocketAddress::family(PF_INET);
|
||||
INETSocketAddress::port(serverEntry.port());
|
||||
if(!mFTPControl.connect((INETSocketAddress&)*this)){message("unable to connect to ftp daemon");return FALSE;}
|
||||
receiveStrings();
|
||||
mFTPControl.getSocketName((INETSocketAddress&)*this);
|
||||
return mFTPControl.isConnected();
|
||||
}
|
||||
|
||||
WORD FTPClient::login(String userName,String password)
|
||||
{
|
||||
String blank(" ");
|
||||
String receiveString;
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(isLoggedIn())logout();
|
||||
putControlData(mFTPCommands[User]+blank+userName,FALSE);
|
||||
if(!mFTPControl.receive(receiveString))return FALSE;
|
||||
message(receiveString);
|
||||
putControlData(mFTPCommands[Password]+blank+password,FALSE);
|
||||
if(!mFTPControl.receive(receiveString))return FALSE;
|
||||
message(receiveString);
|
||||
while(mFTPControl.hasData())
|
||||
{
|
||||
mFTPControl.receive(receiveString);
|
||||
message(receiveString);
|
||||
}
|
||||
if(receiveString.betweenString(0,' ')==String("530"))return FALSE;
|
||||
isLoggedIn(TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::logout(void)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
isLoggedIn(FALSE);
|
||||
if(!mFTPControl.isConnected()){message("Not connected.");return FALSE;}
|
||||
if(!putControlData(mFTPCommands[Logout],FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
mFTPControl.closeSocket();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::port(FTPData &ftpData)
|
||||
{
|
||||
InternetAddress inetAddr;
|
||||
String portString;
|
||||
String workString;
|
||||
WORD dataPort;
|
||||
|
||||
inetAddr=((INETSocketAddress&)*this).internetAddress();
|
||||
portString=(String)inetAddr;
|
||||
portString.replaceToken('.',',');
|
||||
dataPort=ntohs(((INETSocketAddress&)ftpData).port());
|
||||
::sprintf(workString,",%d,%d",(short)HIBYTE(dataPort),(short)LOBYTE(dataPort));
|
||||
putControlData(mFTPCommands[DataPort]+String(" ")+portString+workString,FALSE);
|
||||
if(!mFTPControl.receive(workString))return FALSE;
|
||||
message(workString);
|
||||
if(workString.betweenString(0,' ')==String("500"))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::changeWorkingDirectory(String workingDirectory)
|
||||
{
|
||||
String responseLine;
|
||||
|
||||
if(!mFTPControl.isConnected()||workingDirectory.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[ChangeWorkingDirectory]+String(" ")+workingDirectory,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseLine))return FALSE;
|
||||
message(responseLine);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::printWorkingDirectory(void)
|
||||
{
|
||||
String workingDirectory;
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(!putControlData(mFTPCommands[PrintWorkingDirectory],FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(workingDirectory))return FALSE;
|
||||
message(workingDirectory);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::list(String pathName)
|
||||
{
|
||||
String controlData;
|
||||
String responseLine;
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(pathName.isNull())controlData=mFTPCommands[List];
|
||||
else controlData=mFTPCommands[List]+String(" ")+pathName;
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseLine))return FALSE;
|
||||
if(!(responseLine.betweenString(0,' ')==String("150")))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::nameList(String pathName,WORD showResponse)
|
||||
{
|
||||
String controlData;
|
||||
String responseLine;
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(pathName.isNull())controlData=mFTPCommands[NameList];
|
||||
else controlData=mFTPCommands[NameList]+String(" ")+pathName;
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseLine))return FALSE;
|
||||
if(showResponse)message(responseLine);
|
||||
if(!(responseLine.betweenString(0,' ')==String("150")))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::type(BYTE type,BYTE storage)
|
||||
{
|
||||
String representationType;
|
||||
String responseLine;
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if('A'==type||'E'==type)
|
||||
{
|
||||
if(storage)::sprintf(representationType,"%c %c",type,storage);
|
||||
else ::sprintf(representationType,"%c",type);
|
||||
}
|
||||
else if('I'==type)::sprintf(representationType,"%c",type);
|
||||
else if('L'==type)::sprintf(representationType,"%c %d",type,(int)storage);
|
||||
else return FALSE;
|
||||
if(!putControlData(mFTPCommands[RepresentationType]+String(" ")+representationType,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseLine))return FALSE;
|
||||
message(responseLine);
|
||||
mCurrentType=type;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::retrieve(String pathFileName,DWORD &sizeData)
|
||||
{
|
||||
String responseString;
|
||||
char *lpChar;
|
||||
|
||||
sizeData=0;
|
||||
if(!mFTPControl.isConnected()||pathFileName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[Retrieve]+String(" ")+pathFileName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
if(!(responseString.betweenString(0,' ')==String("150")))return FALSE;
|
||||
lpChar=(char*)responseString.strstr("bytes");
|
||||
if(!lpChar)return TRUE;
|
||||
while(*lpChar!='(')lpChar--;
|
||||
String sizeString(++lpChar);
|
||||
sizeString=sizeString.betweenString(0,' ');
|
||||
if(sizeString.isNull())return FALSE;
|
||||
sizeData=(DWORD)((long)sizeString);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::store(String pathFileName)
|
||||
{
|
||||
String responseString;
|
||||
if(!mFTPControl.isConnected()||pathFileName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[Store]+String(" ")+pathFileName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::mode(BYTE transferMode)
|
||||
{
|
||||
String modeString;
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if('S'!=transferMode&&'B'!=transferMode&&'C'!=transferMode)return FALSE;
|
||||
::sprintf(modeString,"%c",transferMode);
|
||||
return putControlData(mFTPCommands[TransferMode]+String(" ")+modeString);
|
||||
}
|
||||
|
||||
WORD FTPClient::renameFrom(String oldPathFileName)
|
||||
{
|
||||
String responseString;
|
||||
if(!mFTPControl.isConnected()||oldPathFileName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[RenameFrom]+String(" ")+oldPathFileName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
if(!(responseString.betweenString(0,' ')==String("350"))){message(responseString);return FALSE;}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::renameTo(String newPathFileName)
|
||||
{
|
||||
String responseString;
|
||||
if(!mFTPControl.isConnected()||newPathFileName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[RenameTo]+String(" ")+newPathFileName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
if(!(responseString.betweenString(0,' ')==String("250")))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::account(String accountInfo)
|
||||
{
|
||||
if(!mFTPControl.isConnected()||accountInfo.isNull())return FALSE;
|
||||
return putControlData(mFTPCommands[Account]+String(" ")+accountInfo);
|
||||
}
|
||||
|
||||
WORD FTPClient::changeToParentDirectory(void)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
return putControlData(mFTPCommands[ChangeToParentDirectory]);
|
||||
}
|
||||
|
||||
WORD FTPClient::structureMount(String systemFileGroupDesignator)
|
||||
{
|
||||
if(!mFTPControl.isConnected()||systemFileGroupDesignator.isNull())return FALSE;
|
||||
return putControlData(mFTPCommands[StructureMount]+String(" ")+systemFileGroupDesignator);
|
||||
}
|
||||
|
||||
WORD FTPClient::reinitialize(void)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
return putControlData(mFTPCommands[Reinitialize]);
|
||||
}
|
||||
|
||||
WORD FTPClient::passive(void)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
return putControlData(mFTPCommands[Passive]);
|
||||
}
|
||||
|
||||
WORD FTPClient::fileStructure(BYTE structure)
|
||||
{
|
||||
String structureString;
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if('F'!=structure&&'R'!=structure&&'P'!=structure)return FALSE;
|
||||
::sprintf(structureString,"%c",structure);
|
||||
return putControlData(mFTPCommands[FileStructure]+String(" ")+structureString);
|
||||
}
|
||||
|
||||
WORD FTPClient::storeUnique(String pathFileName)
|
||||
{
|
||||
if(!mFTPControl.isConnected()||pathFileName.isNull())return FALSE;
|
||||
return putControlData(mFTPCommands[StoreUnique]+String(" ")+pathFileName);
|
||||
}
|
||||
|
||||
WORD FTPClient::append(String pathFileName)
|
||||
{
|
||||
if(!mFTPControl.isConnected()||pathFileName.isNull())return FALSE;
|
||||
return putControlData(mFTPCommands[Append]+String(" ")+pathFileName);
|
||||
}
|
||||
|
||||
WORD FTPClient::allocate(DWORD numBytes,DWORD maxRecord)
|
||||
{
|
||||
String allocationString;
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(maxRecord)::sprintf(allocationString,"%ld R %ld",numBytes,maxRecord);
|
||||
else ::sprintf(allocationString,"%ld",numBytes);
|
||||
return putControlData(mFTPCommands[Allocate]+String(" ")+allocationString);
|
||||
}
|
||||
|
||||
WORD FTPClient::restart(String serverMarker)
|
||||
{
|
||||
if(!mFTPControl.isConnected()||serverMarker.isNull())return FALSE;
|
||||
return putControlData(mFTPCommands[Restart]+String(" ")+serverMarker);
|
||||
}
|
||||
|
||||
WORD FTPClient::abort(void)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
return putControlData(mFTPCommands[Abort]);
|
||||
}
|
||||
|
||||
WORD FTPClient::remove(String pathFileName)
|
||||
{
|
||||
String responseString;
|
||||
if(!mFTPControl.isConnected()||pathFileName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[Delete]+String(" ")+pathFileName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::removeDirectory(String pathDirectoryName)
|
||||
{
|
||||
String responseString;
|
||||
if(!mFTPControl.isConnected()||pathDirectoryName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[RemoveDirectory]+String(" ")+pathDirectoryName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::makeDirectory(String pathDirectoryName)
|
||||
{
|
||||
String responseString;
|
||||
if(!mFTPControl.isConnected()||pathDirectoryName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[MakeDirectory]+String(" ")+pathDirectoryName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::siteParameters(void)
|
||||
{
|
||||
String responseString;
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(!putControlData(mFTPCommands[SiteParameters]))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::system(void)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
return putControlData(mFTPCommands[System]);
|
||||
}
|
||||
|
||||
WORD FTPClient::status(String pathName)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(!pathName.isNull())return putControlData(mFTPCommands[Status]+String(" ")+pathName);
|
||||
return putControlData(mFTPCommands[Status]);
|
||||
}
|
||||
|
||||
WORD FTPClient::help(String commandName)
|
||||
{
|
||||
Block<String> receiveStrings;
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(!commandName.isNull()){if(!putControlData(mFTPCommands[Help]+String(" ")+commandName,FALSE))return FALSE;}
|
||||
else if(!putControlData(mFTPCommands[Help],FALSE))return FALSE;
|
||||
mFTPControl.receive(receiveStrings);
|
||||
for(short itemIndex=0;itemIndex<receiveStrings.size();itemIndex++)message(receiveStrings[itemIndex]);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::noop(void)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
return putControlData(mFTPCommands[Noop]);
|
||||
}
|
||||
|
||||
WORD FTPClient::putControlData(String stringData,WORD waitForResponse)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(!mFTPControl.send(stringData)){message("error sending data to ftp daemon");return FALSE;}
|
||||
if(waitForResponse&&!getControlData()){message("error reading data from ftp daemon");return FALSE;}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::getControlData(void)
|
||||
{
|
||||
mResponseStrings.remove();
|
||||
mFTPControl.receive(mResponseStrings);
|
||||
return mResponseStrings.size();
|
||||
}
|
||||
|
||||
void FTPClient::receiveStrings(WORD displayStrings)
|
||||
{
|
||||
Block<String> receiveStrings;
|
||||
|
||||
if(!mFTPControl.isConnected())return;
|
||||
if(!mFTPControl.receive(receiveStrings))return;
|
||||
if(!displayStrings||!receiveStrings.size())return;
|
||||
message(receiveStrings);
|
||||
}
|
||||
|
||||
void FTPClient::createCommands(void)
|
||||
{
|
||||
mFTPCommands.insert(&String("USER")); // user name
|
||||
mFTPCommands.insert(&String("PASS")); // password
|
||||
mFTPCommands.insert(&String("ACCT")); // account
|
||||
mFTPCommands.insert(&String("CWD")); // change working directory
|
||||
mFTPCommands.insert(&String("CDUP")); // change to parent directory
|
||||
mFTPCommands.insert(&String("SMNT")); // structure mount
|
||||
mFTPCommands.insert(&String("REIN")); // reinitialize
|
||||
mFTPCommands.insert(&String("QUIT")); // quit
|
||||
mFTPCommands.insert(&String("PORT")); // data port
|
||||
mFTPCommands.insert(&String("PASV")); // passive
|
||||
mFTPCommands.insert(&String("TYPE")); // representation type
|
||||
mFTPCommands.insert(&String("STRU")); // file structure
|
||||
mFTPCommands.insert(&String("MODE")); // transfer mode
|
||||
mFTPCommands.insert(&String("RETR")); // retrieve
|
||||
mFTPCommands.insert(&String("STOR")); // store
|
||||
mFTPCommands.insert(&String("STOU")); // store unique
|
||||
mFTPCommands.insert(&String("APPE")); // append (with create)
|
||||
mFTPCommands.insert(&String("ALLO")); // allocate
|
||||
mFTPCommands.insert(&String("REST")); // restart
|
||||
mFTPCommands.insert(&String("RNFR")); // rename from
|
||||
mFTPCommands.insert(&String("RNTO")); // rename to
|
||||
mFTPCommands.insert(&String("ABOR")); // abort
|
||||
mFTPCommands.insert(&String("DELE")); // delete
|
||||
mFTPCommands.insert(&String("RMD")); // remove directory
|
||||
mFTPCommands.insert(&String("MKD")); // make directory
|
||||
mFTPCommands.insert(&String("PWD")); // print working directory
|
||||
mFTPCommands.insert(&String("LIST")); // list
|
||||
mFTPCommands.insert(&String("NLST")); // name list
|
||||
mFTPCommands.insert(&String("SITE")); // site parameters
|
||||
mFTPCommands.insert(&String("SYST")); // system
|
||||
mFTPCommands.insert(&String("STAT")); // status
|
||||
mFTPCommands.insert(&String("HELP")); // help
|
||||
mFTPCommands.insert(&String("NOOP")); // noop
|
||||
}
|
||||
|
||||
// *** virtual overloads
|
||||
|
||||
void FTPClient::message(String /*messageString*/)
|
||||
{
|
||||
}
|
||||
|
||||
void FTPClient::message(Block<String> &/*messageStrings*/)
|
||||
{
|
||||
}
|
||||
|
||||
480
ftp/FTP.CPP
Normal file
480
ftp/FTP.CPP
Normal file
@@ -0,0 +1,480 @@
|
||||
#include <ftp/ftp.hpp>
|
||||
#include <common/stdio.hpp>
|
||||
#include <socket/hostent.hpp>
|
||||
#include <socket/servent.hpp>
|
||||
#include <socket/socket.hpp>
|
||||
|
||||
FTPClient::FTPClient(void)
|
||||
: mIsLoggedIn(FALSE), mCurrentType('A')
|
||||
{
|
||||
createCommands();
|
||||
buildResponseStrings();
|
||||
}
|
||||
|
||||
FTPClient::~FTPClient()
|
||||
{
|
||||
}
|
||||
|
||||
WORD FTPClient::open(String hostName)
|
||||
{
|
||||
HostEnt hostEntry;
|
||||
ServEnt serverEntry;
|
||||
|
||||
message(String("trying ")+hostName+String("..."));
|
||||
if(!mWSASystem.isInitialized()){message("WINSOCK initialization failure.");return FALSE;}
|
||||
InternetAddress internetAddress(hostName);
|
||||
if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){message(String("no DNS entry for ")+hostName);return FALSE;}}
|
||||
else if(!hostEntry.hostByName(hostName)){message(String("no DNS entry for ")+hostName);return FALSE;}
|
||||
message(String("connect...")+String("'")+hostEntry.hostName()+String("' (")+(String)(hostEntry.addresses())[0]+String(")"));
|
||||
INETSocketAddress::internetAddress((hostEntry.addresses())[0]);
|
||||
if(!serverEntry.serviceByName("ftp","tcp")){message("cannot determine port number for ftp daemon.");return FALSE;}
|
||||
if(!mFTPControl.create()){message("unable to create socket.");return FALSE;}
|
||||
INETSocketAddress::family(PF_INET);
|
||||
INETSocketAddress::port(serverEntry.port());
|
||||
if(!mFTPControl.connect((INETSocketAddress&)*this)){message("unable to connect to ftp daemon");return FALSE;}
|
||||
if(!receive(mAckConnectionResponseStrings))return FALSE;
|
||||
mFTPControl.getSocketName((INETSocketAddress&)*this);
|
||||
return mFTPControl.isConnected();
|
||||
}
|
||||
|
||||
WORD FTPClient::login(String userName,String password)
|
||||
{
|
||||
String blank(" ");
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(isLoggedIn())logout();
|
||||
putControlData(mFTPCommands[User]+blank+userName,FALSE);
|
||||
if(!receive(mAckLoginResponseStrings))return FALSE;
|
||||
putControlData(mFTPCommands[Password]+blank+password,FALSE);
|
||||
if(!receive(mAckLoginResponseStrings))return FALSE;
|
||||
isLoggedIn(TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::logout(void)
|
||||
{
|
||||
isLoggedIn(FALSE);
|
||||
if(!mFTPControl.isConnected()){message("Not connected.");return FALSE;}
|
||||
if(!putControlData(mFTPCommands[Logout],FALSE))return FALSE;
|
||||
if(!receive(mAckLogoutResponseStrings))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::port(FTPData &ftpData)
|
||||
{
|
||||
InternetAddress inetAddr;
|
||||
String portString;
|
||||
String workString;
|
||||
WORD dataPort;
|
||||
|
||||
inetAddr=((INETSocketAddress&)*this).internetAddress();
|
||||
portString=(String)inetAddr;
|
||||
portString.replaceToken('.',',');
|
||||
dataPort=ntohs(((INETSocketAddress&)ftpData).port());
|
||||
::sprintf(workString,",%d,%d",(short)HIBYTE(dataPort),(short)LOBYTE(dataPort));
|
||||
putControlData(mFTPCommands[DataPort]+String(" ")+portString+workString,FALSE);
|
||||
if(!receive(mAckPortResponseStrings))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::changeWorkingDirectory(String workingDirectory)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
|
||||
if(!mFTPControl.isConnected()||workingDirectory.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[ChangeWorkingDirectory]+String(" ")+workingDirectory,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseLines))return FALSE;
|
||||
message(responseLines);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::printWorkingDirectory(void)
|
||||
{
|
||||
String workingDirectory;
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(!putControlData(mFTPCommands[PrintWorkingDirectory],FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(workingDirectory))return FALSE;
|
||||
message(workingDirectory);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::list(String pathName)
|
||||
{
|
||||
String controlData;
|
||||
String responseLine;
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(pathName.isNull())controlData=mFTPCommands[List];
|
||||
else controlData=mFTPCommands[List]+String(" ")+pathName;
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseLine))return FALSE;
|
||||
if(!(responseLine.betweenString(0,' ')==String("150")))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::nameList(String pathName,WORD showResponse)
|
||||
{
|
||||
String controlData;
|
||||
String responseLine;
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(pathName.isNull())controlData=mFTPCommands[NameList];
|
||||
else controlData=mFTPCommands[NameList]+String(" ")+pathName;
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseLine))return FALSE;
|
||||
if(showResponse)message(responseLine);
|
||||
if(!(responseLine.betweenString(0,' ')==String("150")))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::type(BYTE type,BYTE storage)
|
||||
{
|
||||
String representationType;
|
||||
String responseLine;
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if('A'==type||'E'==type)
|
||||
{
|
||||
if(storage)::sprintf(representationType,"%c %c",type,storage);
|
||||
else ::sprintf(representationType,"%c",type);
|
||||
}
|
||||
else if('I'==type)::sprintf(representationType,"%c",type);
|
||||
else if('L'==type)::sprintf(representationType,"%c %d",type,(int)storage);
|
||||
else return FALSE;
|
||||
if(!putControlData(mFTPCommands[RepresentationType]+String(" ")+representationType,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseLine))return FALSE;
|
||||
message(responseLine);
|
||||
mCurrentType=type;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::retrieve(String pathFileName,DWORD &sizeData)
|
||||
{
|
||||
String responseString;
|
||||
char *lpChar;
|
||||
|
||||
sizeData=0;
|
||||
if(!mFTPControl.isConnected()||pathFileName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[Retrieve]+String(" ")+pathFileName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
if(!(responseString.betweenString(0,' ')==String("150")))return FALSE;
|
||||
lpChar=(char*)responseString.strstr("bytes");
|
||||
if(!lpChar)return TRUE;
|
||||
while(*lpChar!='(')lpChar--;
|
||||
String sizeString(++lpChar);
|
||||
sizeString=sizeString.betweenString(0,' ');
|
||||
if(sizeString.isNull())return FALSE;
|
||||
sizeData=(DWORD)(sizeString.toInt());
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::store(String pathFileName)
|
||||
{
|
||||
String responseString;
|
||||
if(!mFTPControl.isConnected()||pathFileName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[Store]+String(" ")+pathFileName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::mode(BYTE transferMode)
|
||||
{
|
||||
String modeString;
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if('S'!=transferMode&&'B'!=transferMode&&'C'!=transferMode)return FALSE;
|
||||
::sprintf(modeString,"%c",transferMode);
|
||||
return putControlData(mFTPCommands[TransferMode]+String(" ")+modeString);
|
||||
}
|
||||
|
||||
WORD FTPClient::renameFrom(String oldPathFileName)
|
||||
{
|
||||
String responseString;
|
||||
if(!mFTPControl.isConnected()||oldPathFileName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[RenameFrom]+String(" ")+oldPathFileName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
if(!(responseString.betweenString(0,' ')==String("350"))){message(responseString);return FALSE;}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::renameTo(String newPathFileName)
|
||||
{
|
||||
String responseString;
|
||||
if(!mFTPControl.isConnected()||newPathFileName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[RenameTo]+String(" ")+newPathFileName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
if(!(responseString.betweenString(0,' ')==String("250")))return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::account(String accountInfo)
|
||||
{
|
||||
if(!mFTPControl.isConnected()||accountInfo.isNull())return FALSE;
|
||||
return putControlData(mFTPCommands[Account]+String(" ")+accountInfo);
|
||||
}
|
||||
|
||||
WORD FTPClient::changeToParentDirectory(void)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
return putControlData(mFTPCommands[ChangeToParentDirectory]);
|
||||
}
|
||||
|
||||
WORD FTPClient::structureMount(String systemFileGroupDesignator)
|
||||
{
|
||||
if(!mFTPControl.isConnected()||systemFileGroupDesignator.isNull())return FALSE;
|
||||
return putControlData(mFTPCommands[StructureMount]+String(" ")+systemFileGroupDesignator);
|
||||
}
|
||||
|
||||
WORD FTPClient::reinitialize(void)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
return putControlData(mFTPCommands[Reinitialize]);
|
||||
}
|
||||
|
||||
WORD FTPClient::passive(void)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
return putControlData(mFTPCommands[Passive]);
|
||||
}
|
||||
|
||||
WORD FTPClient::fileStructure(BYTE structure)
|
||||
{
|
||||
String structureString;
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if('F'!=structure&&'R'!=structure&&'P'!=structure)return FALSE;
|
||||
::sprintf(structureString,"%c",structure);
|
||||
return putControlData(mFTPCommands[FileStructure]+String(" ")+structureString);
|
||||
}
|
||||
|
||||
WORD FTPClient::storeUnique(String pathFileName)
|
||||
{
|
||||
if(!mFTPControl.isConnected()||pathFileName.isNull())return FALSE;
|
||||
return putControlData(mFTPCommands[StoreUnique]+String(" ")+pathFileName);
|
||||
}
|
||||
|
||||
WORD FTPClient::append(String pathFileName)
|
||||
{
|
||||
if(!mFTPControl.isConnected()||pathFileName.isNull())return FALSE;
|
||||
return putControlData(mFTPCommands[Append]+String(" ")+pathFileName);
|
||||
}
|
||||
|
||||
WORD FTPClient::allocate(DWORD numBytes,DWORD maxRecord)
|
||||
{
|
||||
String allocationString;
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(maxRecord)::sprintf(allocationString,"%ld R %ld",numBytes,maxRecord);
|
||||
else ::sprintf(allocationString,"%ld",numBytes);
|
||||
return putControlData(mFTPCommands[Allocate]+String(" ")+allocationString);
|
||||
}
|
||||
|
||||
WORD FTPClient::restart(String serverMarker)
|
||||
{
|
||||
if(!mFTPControl.isConnected()||serverMarker.isNull())return FALSE;
|
||||
return putControlData(mFTPCommands[Restart]+String(" ")+serverMarker);
|
||||
}
|
||||
|
||||
WORD FTPClient::abort(void)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
return putControlData(mFTPCommands[Abort]);
|
||||
}
|
||||
|
||||
WORD FTPClient::remove(String pathFileName)
|
||||
{
|
||||
String responseString;
|
||||
if(!mFTPControl.isConnected()||pathFileName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[Delete]+String(" ")+pathFileName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::removeDirectory(String pathDirectoryName)
|
||||
{
|
||||
String responseString;
|
||||
if(!mFTPControl.isConnected()||pathDirectoryName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[RemoveDirectory]+String(" ")+pathDirectoryName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::makeDirectory(String pathDirectoryName)
|
||||
{
|
||||
String responseString;
|
||||
if(!mFTPControl.isConnected()||pathDirectoryName.isNull())return FALSE;
|
||||
if(!putControlData(mFTPCommands[MakeDirectory]+String(" ")+pathDirectoryName,FALSE))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::siteParameters(void)
|
||||
{
|
||||
String responseString;
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(!putControlData(mFTPCommands[SiteParameters]))return FALSE;
|
||||
if(!mFTPControl.receive(responseString))return FALSE;
|
||||
message(responseString);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::system(void)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
return putControlData(mFTPCommands[System]);
|
||||
}
|
||||
|
||||
WORD FTPClient::status(String pathName)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(!pathName.isNull())return putControlData(mFTPCommands[Status]+String(" ")+pathName);
|
||||
return putControlData(mFTPCommands[Status]);
|
||||
}
|
||||
|
||||
WORD FTPClient::help(String commandName)
|
||||
{
|
||||
Block<String> receiveStrings;
|
||||
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(!commandName.isNull()){if(!putControlData(mFTPCommands[Help]+String(" ")+commandName,FALSE))return FALSE;}
|
||||
else if(!putControlData(mFTPCommands[Help],FALSE))return FALSE;
|
||||
mFTPControl.receive(receiveStrings);
|
||||
for(short itemIndex=0;itemIndex<receiveStrings.size();itemIndex++)message(receiveStrings[itemIndex]);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::noop(void)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
return putControlData(mFTPCommands[Noop]);
|
||||
}
|
||||
|
||||
WORD FTPClient::putControlData(String stringData,WORD waitForResponse)
|
||||
{
|
||||
if(!mFTPControl.isConnected())return FALSE;
|
||||
if(!mFTPControl.send(stringData)){message("error sending data to ftp daemon");return FALSE;}
|
||||
if(waitForResponse&&!getControlData()){message("error reading data from ftp daemon");return FALSE;}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD FTPClient::getControlData(void)
|
||||
{
|
||||
mResponseStrings.remove();
|
||||
mFTPControl.receive(mResponseStrings);
|
||||
return mResponseStrings.size();
|
||||
}
|
||||
|
||||
void FTPClient::receiveStrings(WORD displayStrings)
|
||||
{
|
||||
Block<String> receiveStrings;
|
||||
|
||||
if(!mFTPControl.isConnected())return;
|
||||
if(!mFTPControl.receive(receiveStrings))return;
|
||||
if(!displayStrings||!receiveStrings.size())return;
|
||||
message(receiveStrings);
|
||||
}
|
||||
|
||||
void FTPClient::createCommands(void)
|
||||
{
|
||||
mFTPCommands.insert(&String("USER")); // user name
|
||||
mFTPCommands.insert(&String("PASS")); // password
|
||||
mFTPCommands.insert(&String("ACCT")); // account
|
||||
mFTPCommands.insert(&String("CWD")); // change working directory
|
||||
mFTPCommands.insert(&String("CDUP")); // change to parent directory
|
||||
mFTPCommands.insert(&String("SMNT")); // structure mount
|
||||
mFTPCommands.insert(&String("REIN")); // reinitialize
|
||||
mFTPCommands.insert(&String("QUIT")); // quit
|
||||
mFTPCommands.insert(&String("PORT")); // data port
|
||||
mFTPCommands.insert(&String("PASV")); // passive
|
||||
mFTPCommands.insert(&String("TYPE")); // representation type
|
||||
mFTPCommands.insert(&String("STRU")); // file structure
|
||||
mFTPCommands.insert(&String("MODE")); // transfer mode
|
||||
mFTPCommands.insert(&String("RETR")); // retrieve
|
||||
mFTPCommands.insert(&String("STOR")); // store
|
||||
mFTPCommands.insert(&String("STOU")); // store unique
|
||||
mFTPCommands.insert(&String("APPE")); // append (with create)
|
||||
mFTPCommands.insert(&String("ALLO")); // allocate
|
||||
mFTPCommands.insert(&String("REST")); // restart
|
||||
mFTPCommands.insert(&String("RNFR")); // rename from
|
||||
mFTPCommands.insert(&String("RNTO")); // rename to
|
||||
mFTPCommands.insert(&String("ABOR")); // abort
|
||||
mFTPCommands.insert(&String("DELE")); // delete
|
||||
mFTPCommands.insert(&String("RMD")); // remove directory
|
||||
mFTPCommands.insert(&String("MKD")); // make directory
|
||||
mFTPCommands.insert(&String("PWD")); // print working directory
|
||||
mFTPCommands.insert(&String("LIST")); // list
|
||||
mFTPCommands.insert(&String("NLST")); // name list
|
||||
mFTPCommands.insert(&String("SITE")); // site parameters
|
||||
mFTPCommands.insert(&String("SYST")); // system
|
||||
mFTPCommands.insert(&String("STAT")); // status
|
||||
mFTPCommands.insert(&String("HELP")); // help
|
||||
mFTPCommands.insert(&String("NOOP")); // noop
|
||||
}
|
||||
|
||||
void FTPClient::buildResponseStrings(void)
|
||||
{
|
||||
mAckConnectionResponseStrings.insert(&String("220"));
|
||||
mAckLoginResponseStrings.insert(&String("230"));
|
||||
mAckLoginResponseStrings.insert(&String("331"));
|
||||
mAckLogoutResponseStrings.insert(&String("221"));
|
||||
mAckPortResponseStrings.insert(&String("200"));
|
||||
}
|
||||
|
||||
WORD FTPClient::receive(Block<String> &responseStrings)
|
||||
{
|
||||
Block<String> responseLines;
|
||||
return receive(responseLines,responseStrings);
|
||||
}
|
||||
|
||||
WORD FTPClient::receive(Block<String> &receiveStrings,Block<String> &responseStrings)
|
||||
{
|
||||
WORD isInMultiLine(FALSE);
|
||||
BOOL returnCode(TRUE);
|
||||
String seriesItem;
|
||||
String stringData;
|
||||
|
||||
receiveStrings.remove();
|
||||
while(TRUE)
|
||||
{
|
||||
if(!mFTPControl.receive(stringData))break;
|
||||
message(stringData);
|
||||
if(!receiveStrings.size())
|
||||
{
|
||||
seriesItem=stringData.substr(0,2);
|
||||
if(!isInResponse(seriesItem,responseStrings))
|
||||
{
|
||||
message(String(">>")+seriesItem+String(" is not in the valid response set."));
|
||||
returnCode=FALSE;
|
||||
}
|
||||
isInMultiLine=stringData.operator[](3)=='-';
|
||||
}
|
||||
if(receiveStrings.size()&&isInMultiLine&&stringData.operator[](3)!='-'&&stringData.substr(0,2)==seriesItem)break;
|
||||
receiveStrings.insert(&stringData);
|
||||
if(!isInMultiLine)break;
|
||||
}
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
WORD FTPClient::isInResponse(const String &responseString,Block<String> &responseStrings)
|
||||
{
|
||||
if(responseString.isNull())return FALSE;
|
||||
for(int itemIndex=0;itemIndex<responseStrings.size();itemIndex++)
|
||||
if(responseString==responseStrings[itemIndex])return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// *** virtual overloads
|
||||
|
||||
void FTPClient::message(const String &/*messageString*/)
|
||||
{
|
||||
}
|
||||
|
||||
void FTPClient::message(Block<String> &/*messageStrings*/)
|
||||
{
|
||||
}
|
||||
|
||||
12
ftp/FTP.DEF
Normal file
12
ftp/FTP.DEF
Normal file
@@ -0,0 +1,12 @@
|
||||
NAME FTPClient
|
||||
DESCRIPTION 'FTP CLIENT'
|
||||
EXETYPE WINDOWS
|
||||
STUB 'WINSTUB.EXE'
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
DATA PRELOAD MOVEABLE
|
||||
HEAPSIZE 16384
|
||||
STACKSIZE 32767
|
||||
EXPORTS
|
||||
|
||||
|
||||
|
||||
123
ftp/FTP.HPP
Normal file
123
ftp/FTP.HPP
Normal file
@@ -0,0 +1,123 @@
|
||||
#ifndef _FTP_FTPCLIENT_HPP_
|
||||
#define _FTP_FTPCLIENT_HPP_
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_BLOCK_HPP_
|
||||
#include <common/block.hpp>
|
||||
#endif
|
||||
#ifndef _SOCKET_SOCKET_HPP_
|
||||
#include <socket/socket.hpp>
|
||||
#endif
|
||||
#ifndef _SOCKET_INETSOCKETADDRESS_HPP_
|
||||
#include <socket/intsaddr.hpp>
|
||||
#endif
|
||||
#ifndef _FTP_FTPDATA_HPP_
|
||||
#include <ftp/ftpdata.hpp>
|
||||
#endif
|
||||
|
||||
class FTPClient : public INETSocketAddress
|
||||
{
|
||||
public:
|
||||
FTPClient(void);
|
||||
virtual ~FTPClient();
|
||||
WORD open(String hostName);
|
||||
WORD login(String userName,String password);
|
||||
WORD account(String accountInfo);
|
||||
WORD changeWorkingDirectory(String workingDirectory);
|
||||
WORD changeToParentDirectory(void);
|
||||
WORD structureMount(String systemFileGroupDesignator);
|
||||
WORD reinitialize(void);
|
||||
WORD logout(void);
|
||||
WORD port(FTPData &ftpData);
|
||||
WORD passive(void);
|
||||
WORD type(BYTE type,BYTE storage=0);
|
||||
WORD fileStructure(BYTE structure);
|
||||
WORD mode(BYTE transferMode);
|
||||
WORD retrieve(String pathFileName,DWORD &sizeData);
|
||||
WORD store(String pathFileName);
|
||||
WORD storeUnique(String pathFileName);
|
||||
WORD append(String pathFileName);
|
||||
WORD allocate(DWORD numBytes,DWORD maxRecord=0L);
|
||||
WORD restart(String serverMarker);
|
||||
WORD renameFrom(String oldPathFileName);
|
||||
WORD renameTo(String oldPathFileName);
|
||||
WORD abort(void);
|
||||
WORD remove(String pathFileName);
|
||||
WORD removeDirectory(String pathDirectoryName);
|
||||
WORD makeDirectory(String pathDirectoryName);
|
||||
WORD printWorkingDirectory(void);
|
||||
WORD list(String pathName=String());
|
||||
WORD nameList(String pathName=String(),WORD showResponse=TRUE);
|
||||
WORD siteParameters(void);
|
||||
WORD system(void);
|
||||
WORD status(String pathName=String());
|
||||
WORD help(String commandName=String());
|
||||
WORD noop(void);
|
||||
WORD isConnected(void)const;
|
||||
WORD isLoggedIn(void)const;
|
||||
WORD receive(String &lineString);
|
||||
BYTE currentType(void)const;
|
||||
protected:
|
||||
virtual void message(const String &messageString);
|
||||
virtual void message(Block<String> &messageStrings);
|
||||
private:
|
||||
enum FTPCommands{User,Password,Account,ChangeWorkingDirectory,ChangeToParentDirectory,
|
||||
StructureMount,Reinitialize,Logout,DataPort,Passive,RepresentationType,FileStructure,
|
||||
TransferMode,Retrieve,Store,StoreUnique,Append,Allocate,Restart,RenameFrom,RenameTo,
|
||||
Abort,Delete,RemoveDirectory,MakeDirectory,PrintWorkingDirectory,List,NameList,SiteParameters,
|
||||
System,Status,Help,Noop};
|
||||
void createCommands(void);
|
||||
void isLoggedIn(WORD isLoggedIn);
|
||||
WORD getControlData(void);
|
||||
WORD putControlData(String stringData,WORD waitForResponse=TRUE);
|
||||
void receiveStrings(WORD displayStrings=TRUE);
|
||||
WORD receive(Block<String> &receiveStrings,Block<String> &responseStrings);
|
||||
WORD receive(Block<String> &responseStrings);
|
||||
void buildResponseStrings(void);
|
||||
WORD isInResponse(const String &responseString,Block<String> &responseStrings);
|
||||
|
||||
Socket mFTPControl;
|
||||
WSASystem mWSASystem;
|
||||
Block<String> mFTPCommands;
|
||||
Block<String> mAckConnectionResponseStrings;
|
||||
Block<String> mAckLoginResponseStrings;
|
||||
Block<String> mAckLogoutResponseStrings;
|
||||
Block<String> mAckPortResponseStrings;
|
||||
Block<String> mResponseStrings;
|
||||
WORD mIsLoggedIn;
|
||||
BYTE mCurrentType;
|
||||
};
|
||||
|
||||
inline
|
||||
WORD FTPClient::isConnected(void)const
|
||||
{
|
||||
return mFTPControl.isConnected();
|
||||
}
|
||||
|
||||
inline
|
||||
WORD FTPClient::isLoggedIn(void)const
|
||||
{
|
||||
return mIsLoggedIn;
|
||||
}
|
||||
|
||||
inline
|
||||
void FTPClient::isLoggedIn(WORD isLoggedIn)
|
||||
{
|
||||
mIsLoggedIn=isLoggedIn;
|
||||
}
|
||||
|
||||
inline
|
||||
WORD FTPClient::receive(String &lineString)
|
||||
{
|
||||
if(!isConnected()||!isLoggedIn())return FALSE;
|
||||
return mFTPControl.receive(lineString);
|
||||
}
|
||||
|
||||
inline
|
||||
BYTE FTPClient::currentType(void)const
|
||||
{
|
||||
return mCurrentType;
|
||||
}
|
||||
#endif
|
||||
|
||||
BIN
ftp/FTP.IDE
Normal file
BIN
ftp/FTP.IDE
Normal file
Binary file not shown.
67
ftp/FTP.PLG
Normal file
67
ftp/FTP.PLG
Normal file
@@ -0,0 +1,67 @@
|
||||
<html>
|
||||
<body>
|
||||
<pre>
|
||||
<h1>Build Log</h1>
|
||||
<h3>
|
||||
--------------------Configuration: ftp - Win32 Debug--------------------
|
||||
</h3>
|
||||
<h3>Command Lines</h3>
|
||||
Creating temporary file "C:\DOCUME~1\sean\LOCALS~1\Temp\RSP26.tmp" with contents
|
||||
[
|
||||
/nologo /MTd /Z7 /O2 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__FLAT__" /D "STRICT" /Fp"\work\exe\msvc42.pch" /YX"windows.h" /Fo".\msvcobj/" /Fd".\msvcobj/" /FD /c
|
||||
"D:\work\ftp\Ftp.cpp"
|
||||
"D:\work\ftp\Ftpdata.cpp"
|
||||
"D:\work\ftp\ftpthrd.cpp"
|
||||
"D:\work\ftp\hostdlg.cpp"
|
||||
"D:\work\ftp\Interprt.cpp"
|
||||
"D:\work\ftp\Logindlg.cpp"
|
||||
"D:\work\ftp\Main.cpp"
|
||||
"D:\work\ftp\Mainwnd.cpp"
|
||||
"D:\work\ftp\Stdtmpl.cpp"
|
||||
]
|
||||
Creating command line "cl.exe @C:\DOCUME~1\sean\LOCALS~1\Temp\RSP26.tmp"
|
||||
Creating temporary file "C:\DOCUME~1\sean\LOCALS~1\Temp\RSP27.tmp" with contents
|
||||
[
|
||||
wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /pdb:none /debug /debugtype:both /machine:I386 /out:"..\exe\ftp.exe"
|
||||
.\msvcobj\Ftp.obj
|
||||
.\msvcobj\Ftpdata.obj
|
||||
.\msvcobj\ftpthrd.obj
|
||||
.\msvcobj\hostdlg.obj
|
||||
.\msvcobj\Interprt.obj
|
||||
.\msvcobj\Logindlg.obj
|
||||
.\msvcobj\Main.obj
|
||||
.\msvcobj\Mainwnd.obj
|
||||
.\msvcobj\Stdtmpl.obj
|
||||
.\msvcobj\Ftp.res
|
||||
\work\exe\mscommon.lib
|
||||
\work\exe\msdialog.lib
|
||||
\work\exe\mssocket.lib
|
||||
\work\exe\msthread.lib
|
||||
]
|
||||
Creating command line "link.exe @C:\DOCUME~1\sean\LOCALS~1\Temp\RSP27.tmp"
|
||||
<h3>Output Window</h3>
|
||||
Compiling...
|
||||
Ftp.cpp
|
||||
Ftpdata.cpp
|
||||
ftpthrd.cpp
|
||||
D:\WORK\ftp/interprt.hpp(7) : fatal error C1083: Cannot open include file: 'display/editwnd.hpp': No such file or directory
|
||||
hostdlg.cpp
|
||||
D:\work\ftp\hostdlg.cpp(68) : error C2660: 'setFocus' : function does not take 0 parameters
|
||||
Interprt.cpp
|
||||
D:\WORK\ftp/interprt.hpp(7) : fatal error C1083: Cannot open include file: 'display/editwnd.hpp': No such file or directory
|
||||
Logindlg.cpp
|
||||
D:\work\ftp\Logindlg.cpp(71) : error C2660: 'setFocus' : function does not take 0 parameters
|
||||
Main.cpp
|
||||
D:\WORK\ftp/interprt.hpp(7) : fatal error C1083: Cannot open include file: 'display/editwnd.hpp': No such file or directory
|
||||
Mainwnd.cpp
|
||||
D:\WORK\ftp/interprt.hpp(7) : fatal error C1083: Cannot open include file: 'display/editwnd.hpp': No such file or directory
|
||||
Stdtmpl.cpp
|
||||
Error executing cl.exe.
|
||||
|
||||
|
||||
|
||||
<h3>Results</h3>
|
||||
ftp.exe - 6 error(s), 0 warning(s)
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
18
ftp/FTP.RC
Normal file
18
ftp/FTP.RC
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <ftp/resinc.h>
|
||||
|
||||
FTP MENU
|
||||
{
|
||||
POPUP "Connect"
|
||||
{
|
||||
MENUITEM "Remote Host", CM_REMOTEHOST
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Exit Alt+F4", CM_EXIT
|
||||
MENUITEM SEPARATOR
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
{
|
||||
STRING_VERSIONMSG, "FTP Interpreter v2.01 Copyright(c) 1996 Sean M. Kessler"
|
||||
}
|
||||
BIN
ftp/FTP.RWS
Normal file
BIN
ftp/FTP.RWS
Normal file
Binary file not shown.
31
ftp/FTPDATA.CPP
Normal file
31
ftp/FTPDATA.CPP
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <socket/intsaddr.hpp>
|
||||
#include <ftp/ftpdata.hpp>
|
||||
|
||||
FTPData::FTPData(void)
|
||||
{
|
||||
create();
|
||||
}
|
||||
|
||||
FTPData::~FTPData()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
WORD FTPData::accept(void)
|
||||
{
|
||||
if(!mFTPDataSocket.isListening())return FALSE;
|
||||
if(!mFTPDataSocket.accept((Socket&)*this))return FALSE;
|
||||
mFTPDataSocket.destroy();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void FTPData::create(void)
|
||||
{
|
||||
destroy();
|
||||
if(!mWSASystem.isInitialized())return;
|
||||
if(!mFTPDataSocket.create())return;
|
||||
family(AF_INET);
|
||||
if(!mFTPDataSocket.bind((INETSocketAddress&)*this))return;
|
||||
if(!mFTPDataSocket.listen())return;
|
||||
}
|
||||
|
||||
33
ftp/FTPDATA.HPP
Normal file
33
ftp/FTPDATA.HPP
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef _FTP_FTPDATA_HPP_
|
||||
#define _FTP_FTPDATA_HPP_
|
||||
#ifndef _SOCKET_SOCKET_HPP_
|
||||
#include <socket/socket.hpp>
|
||||
#endif
|
||||
#ifndef _SOCKET_SERVENT_HPP_
|
||||
#include <socket/servent.hpp>
|
||||
#endif
|
||||
#ifndef _SOCKET_WSADATA_HPP_
|
||||
#include <socket/wsadata.hpp>
|
||||
#endif
|
||||
|
||||
class FTPData : public Socket, public INETSocketAddress
|
||||
{
|
||||
public:
|
||||
enum {Listen};
|
||||
FTPData(void);
|
||||
virtual ~FTPData();
|
||||
WORD accept(void);
|
||||
WORD isOkay(void)const;
|
||||
private:
|
||||
void create(void);
|
||||
|
||||
Socket mFTPDataSocket;
|
||||
WSASystem mWSASystem;
|
||||
};
|
||||
|
||||
inline
|
||||
WORD FTPData::isOkay(void)const
|
||||
{
|
||||
return (mWSASystem.isInitialized()&&mFTPDataSocket.isOkay()&&mFTPDataSocket.isBound()&&mFTPDataSocket.isListening());
|
||||
}
|
||||
#endif
|
||||
577
ftp/FTPLIB.MAK
Normal file
577
ftp/FTPLIB.MAK
Normal file
@@ -0,0 +1,577 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=ftplib - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to ftplib - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "ftplib - Win32 Release" && "$(CFG)" != "ftplib - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE on this makefile
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Ftplib.mak" CFG="ftplib - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ftplib - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "ftplib - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
################################################################################
|
||||
# Begin Project
|
||||
# PROP Target_Last_Scanned "ftplib - Win32 Debug"
|
||||
CPP=cl.exe
|
||||
|
||||
!IF "$(CFG)" == "ftplib - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
|
||||
ALL : "$(OUTDIR)\Ftplib.lib"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Ftp.obj"
|
||||
-@erase "$(INTDIR)\Ftpdata.obj"
|
||||
-@erase "$(INTDIR)\Ftpthrd.obj"
|
||||
-@erase "$(INTDIR)\hostdlg.obj"
|
||||
-@erase "$(INTDIR)\Interprt.obj"
|
||||
-@erase "$(INTDIR)\Logindlg.obj"
|
||||
-@erase "$(OUTDIR)\Ftplib.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS"\
|
||||
/Fp"$(INTDIR)/Ftplib.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.\.
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/Ftplib.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
LIB32_FLAGS=/nologo /out:"$(OUTDIR)/Ftplib.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\Ftp.obj" \
|
||||
"$(INTDIR)\Ftpdata.obj" \
|
||||
"$(INTDIR)\Ftpthrd.obj" \
|
||||
"$(INTDIR)\hostdlg.obj" \
|
||||
"$(INTDIR)\Interprt.obj" \
|
||||
"$(INTDIR)\Logindlg.obj"
|
||||
|
||||
"$(OUTDIR)\Ftplib.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftplib - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "msvcobj"
|
||||
# PROP Intermediate_Dir "msvcobj"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\msvcobj
|
||||
INTDIR=.\msvcobj
|
||||
|
||||
ALL : "..\exe\ftplib.lib"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Ftp.obj"
|
||||
-@erase "$(INTDIR)\Ftpdata.obj"
|
||||
-@erase "$(INTDIR)\Ftpthrd.obj"
|
||||
-@erase "$(INTDIR)\hostdlg.obj"
|
||||
-@erase "$(INTDIR)\Interprt.obj"
|
||||
-@erase "$(INTDIR)\Logindlg.obj"
|
||||
-@erase "..\exe\ftplib.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /Zp1 /MTd /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STRICT" /D "__FLAT__" /YX /c
|
||||
CPP_PROJ=/nologo /Zp1 /MTd /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D\
|
||||
"STRICT" /D "__FLAT__" /Fp"$(INTDIR)/Ftplib.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\msvcobj/
|
||||
CPP_SBRS=.\.
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/Ftplib.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\exe\ftplib.lib"
|
||||
LIB32_FLAGS=/nologo /out:"..\exe\ftplib.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\Ftp.obj" \
|
||||
"$(INTDIR)\Ftpdata.obj" \
|
||||
"$(INTDIR)\Ftpthrd.obj" \
|
||||
"$(INTDIR)\hostdlg.obj" \
|
||||
"$(INTDIR)\Interprt.obj" \
|
||||
"$(INTDIR)\Logindlg.obj"
|
||||
|
||||
"..\exe\ftplib.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "ftplib - Win32 Release"
|
||||
# Name "ftplib - Win32 Debug"
|
||||
|
||||
!IF "$(CFG)" == "ftplib - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftplib - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftpdata.cpp
|
||||
DEP_CPP_FTPDA=\
|
||||
{$(INCLUDE)}"\.\Ftpdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Servent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Ftpdata.obj" : $(SOURCE) $(DEP_CPP_FTPDA) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftpthrd.cpp
|
||||
|
||||
!IF "$(CFG)" == "ftplib - Win32 Release"
|
||||
|
||||
DEP_CPP_FTPTH=\
|
||||
{$(INCLUDE)}"\.\ftp.hpp"\
|
||||
{$(INCLUDE)}"\.\Ftpdata.hpp"\
|
||||
{$(INCLUDE)}"\.\ftpthrd.hpp"\
|
||||
{$(INCLUDE)}"\.\interprt.hpp"\
|
||||
{$(INCLUDE)}"\.\resinc.h"\
|
||||
{$(INCLUDE)}"\.\resinc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\common\dwindow.hpp"\
|
||||
{$(INCLUDE)}"\common\filemap.hpp"\
|
||||
{$(INCLUDE)}"\common\filetime.hpp"\
|
||||
{$(INCLUDE)}"\common\fixup.hpp"\
|
||||
{$(INCLUDE)}"\common\font.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\gdiobj.hpp"\
|
||||
{$(INCLUDE)}"\common\gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\menuitem.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\common\point.hpp"\
|
||||
{$(INCLUDE)}"\common\puredwrd.hpp"\
|
||||
{$(INCLUDE)}"\common\puremenu.hpp"\
|
||||
{$(INCLUDE)}"\common\pvector.hpp"\
|
||||
{$(INCLUDE)}"\common\pvector.tpp"\
|
||||
{$(INCLUDE)}"\common\pview.hpp"\
|
||||
{$(INCLUDE)}"\common\rect.hpp"\
|
||||
{$(INCLUDE)}"\common\stdio.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\common\systime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\common\window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\common\winnt.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\display\editwnd.hpp"\
|
||||
{$(INCLUDE)}"\display\guibrdr.hpp"\
|
||||
{$(INCLUDE)}"\display\guichar.hpp"\
|
||||
{$(INCLUDE)}"\display\guiline.hpp"\
|
||||
{$(INCLUDE)}"\display\keyctrl.hpp"\
|
||||
{$(INCLUDE)}"\display\vcaret.hpp"\
|
||||
{$(INCLUDE)}"\display\virtdisp.hpp"\
|
||||
{$(INCLUDE)}"\parse\assemble.hpp"\
|
||||
{$(INCLUDE)}"\parse\emit.hpp"\
|
||||
{$(INCLUDE)}"\parse\parse.hpp"\
|
||||
{$(INCLUDE)}"\parse\psymbol.hpp"\
|
||||
{$(INCLUDE)}"\parse\scan.hpp"\
|
||||
{$(INCLUDE)}"\parse\symbol.hpp"\
|
||||
{$(INCLUDE)}"\parse\table.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Servent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\thread\context.hpp"\
|
||||
{$(INCLUDE)}"\thread\event.hpp"\
|
||||
{$(INCLUDE)}"\thread\monitor.hpp"\
|
||||
{$(INCLUDE)}"\thread\msgqueue.hpp"\
|
||||
{$(INCLUDE)}"\thread\mthread.hpp"\
|
||||
{$(INCLUDE)}"\thread\mutex.hpp"\
|
||||
{$(INCLUDE)}"\thread\qthread.hpp"\
|
||||
{$(INCLUDE)}"\thread\savearea.hpp"\
|
||||
{$(INCLUDE)}"\thread\tcallbck.hpp"\
|
||||
{$(INCLUDE)}"\thread\thmsg.hpp"\
|
||||
{$(INCLUDE)}"\thread\thread.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Ftpthrd.obj" : $(SOURCE) $(DEP_CPP_FTPTH) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftplib - Win32 Debug"
|
||||
|
||||
DEP_CPP_FTPTH=\
|
||||
{$(INCLUDE)}"\.\ftp.hpp"\
|
||||
{$(INCLUDE)}"\.\Ftpdata.hpp"\
|
||||
{$(INCLUDE)}"\.\ftpthrd.hpp"\
|
||||
{$(INCLUDE)}"\.\interprt.hpp"\
|
||||
{$(INCLUDE)}"\.\resinc.h"\
|
||||
{$(INCLUDE)}"\.\resinc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\common\dwindow.hpp"\
|
||||
{$(INCLUDE)}"\common\filemap.hpp"\
|
||||
{$(INCLUDE)}"\common\filetime.hpp"\
|
||||
{$(INCLUDE)}"\common\fixup.hpp"\
|
||||
{$(INCLUDE)}"\common\font.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\gdiobj.hpp"\
|
||||
{$(INCLUDE)}"\common\gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\menuitem.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\common\point.hpp"\
|
||||
{$(INCLUDE)}"\common\puredwrd.hpp"\
|
||||
{$(INCLUDE)}"\common\puremenu.hpp"\
|
||||
{$(INCLUDE)}"\common\pvector.hpp"\
|
||||
{$(INCLUDE)}"\common\pvector.tpp"\
|
||||
{$(INCLUDE)}"\common\pview.hpp"\
|
||||
{$(INCLUDE)}"\common\rect.hpp"\
|
||||
{$(INCLUDE)}"\common\stdio.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\common\systime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\common\window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\common\winnt.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\display\editwnd.hpp"\
|
||||
{$(INCLUDE)}"\display\guibrdr.hpp"\
|
||||
{$(INCLUDE)}"\display\guichar.hpp"\
|
||||
{$(INCLUDE)}"\display\guiline.hpp"\
|
||||
{$(INCLUDE)}"\display\keyctrl.hpp"\
|
||||
{$(INCLUDE)}"\display\vcaret.hpp"\
|
||||
{$(INCLUDE)}"\display\virtdisp.hpp"\
|
||||
{$(INCLUDE)}"\parse\assemble.hpp"\
|
||||
{$(INCLUDE)}"\parse\emit.hpp"\
|
||||
{$(INCLUDE)}"\parse\parse.hpp"\
|
||||
{$(INCLUDE)}"\parse\psymbol.hpp"\
|
||||
{$(INCLUDE)}"\parse\scan.hpp"\
|
||||
{$(INCLUDE)}"\parse\symbol.hpp"\
|
||||
{$(INCLUDE)}"\parse\table.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Servent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\thread\context.hpp"\
|
||||
{$(INCLUDE)}"\thread\event.hpp"\
|
||||
{$(INCLUDE)}"\thread\monitor.hpp"\
|
||||
{$(INCLUDE)}"\thread\msgqueue.hpp"\
|
||||
{$(INCLUDE)}"\thread\mthread.hpp"\
|
||||
{$(INCLUDE)}"\thread\mutex.hpp"\
|
||||
{$(INCLUDE)}"\thread\ptcllbck.hpp"\
|
||||
{$(INCLUDE)}"\thread\qthread.hpp"\
|
||||
{$(INCLUDE)}"\thread\savearea.hpp"\
|
||||
{$(INCLUDE)}"\thread\tcallbck.hpp"\
|
||||
{$(INCLUDE)}"\thread\tcallbck.tpp"\
|
||||
{$(INCLUDE)}"\thread\thmsg.hpp"\
|
||||
{$(INCLUDE)}"\thread\thread.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Ftpthrd.obj" : $(SOURCE) $(DEP_CPP_FTPTH) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\hostdlg.cpp
|
||||
DEP_CPP_HOSTD=\
|
||||
{$(INCLUDE)}"\.\hostdlg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\common\dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\common\point.hpp"\
|
||||
{$(INCLUDE)}"\common\rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dlgitem.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dlgtmpl.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dyndlg.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\hostdlg.obj" : $(SOURCE) $(DEP_CPP_HOSTD) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Interprt.cpp
|
||||
DEP_CPP_INTER=\
|
||||
{$(INCLUDE)}"\.\ftp.hpp"\
|
||||
{$(INCLUDE)}"\.\Ftpdata.hpp"\
|
||||
{$(INCLUDE)}"\.\interprt.hpp"\
|
||||
{$(INCLUDE)}"\.\logindlg.hpp"\
|
||||
{$(INCLUDE)}"\.\resinc.h"\
|
||||
{$(INCLUDE)}"\.\resinc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\common\diskinfo.hpp"\
|
||||
{$(INCLUDE)}"\common\dwindow.hpp"\
|
||||
{$(INCLUDE)}"\common\filemap.hpp"\
|
||||
{$(INCLUDE)}"\common\filetime.hpp"\
|
||||
{$(INCLUDE)}"\common\finddata.hpp"\
|
||||
{$(INCLUDE)}"\common\fixup.hpp"\
|
||||
{$(INCLUDE)}"\common\font.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\gdiobj.hpp"\
|
||||
{$(INCLUDE)}"\common\gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\menuitem.hpp"\
|
||||
{$(INCLUDE)}"\common\openfile.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\common\point.hpp"\
|
||||
{$(INCLUDE)}"\common\puredwrd.hpp"\
|
||||
{$(INCLUDE)}"\common\puremenu.hpp"\
|
||||
{$(INCLUDE)}"\common\pvector.hpp"\
|
||||
{$(INCLUDE)}"\common\pvector.tpp"\
|
||||
{$(INCLUDE)}"\common\pview.hpp"\
|
||||
{$(INCLUDE)}"\common\rect.hpp"\
|
||||
{$(INCLUDE)}"\common\stdio.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\common\systime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\common\window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dlgitem.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dlgtmpl.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dyndlg.hpp"\
|
||||
{$(INCLUDE)}"\display\editwnd.hpp"\
|
||||
{$(INCLUDE)}"\display\guibrdr.hpp"\
|
||||
{$(INCLUDE)}"\display\guichar.hpp"\
|
||||
{$(INCLUDE)}"\display\guiline.hpp"\
|
||||
{$(INCLUDE)}"\display\keyctrl.hpp"\
|
||||
{$(INCLUDE)}"\display\vcaret.hpp"\
|
||||
{$(INCLUDE)}"\display\virtdisp.hpp"\
|
||||
{$(INCLUDE)}"\parse\assemble.hpp"\
|
||||
{$(INCLUDE)}"\parse\emit.hpp"\
|
||||
{$(INCLUDE)}"\parse\parse.hpp"\
|
||||
{$(INCLUDE)}"\parse\psymbol.hpp"\
|
||||
{$(INCLUDE)}"\parse\scan.hpp"\
|
||||
{$(INCLUDE)}"\parse\symbol.hpp"\
|
||||
{$(INCLUDE)}"\parse\table.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Servent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\thread\monitor.hpp"\
|
||||
{$(INCLUDE)}"\thread\mutex.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Interprt.obj" : $(SOURCE) $(DEP_CPP_INTER) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Logindlg.cpp
|
||||
DEP_CPP_LOGIN=\
|
||||
{$(INCLUDE)}"\.\logindlg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\common\dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\common\point.hpp"\
|
||||
{$(INCLUDE)}"\common\rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dlgitem.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dlgtmpl.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dyndlg.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Logindlg.obj" : $(SOURCE) $(DEP_CPP_LOGIN) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftp.cpp
|
||||
DEP_CPP_FTP_C=\
|
||||
{$(INCLUDE)}"\.\ftp.hpp"\
|
||||
{$(INCLUDE)}"\.\Ftpdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\stdio.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\socket\hostent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Servent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Ftp.obj" : $(SOURCE) $(DEP_CPP_FTP_C) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
################################################################################
|
||||
70
ftp/FTPTHRD.CPP
Normal file
70
ftp/FTPTHRD.CPP
Normal file
@@ -0,0 +1,70 @@
|
||||
#include <ftp/ftpthrd.hpp>
|
||||
|
||||
FTPThread::FTPThread(void)
|
||||
{
|
||||
mThreadHandler.setCallback(this,&FTPThread::threadHandler);
|
||||
insertHandler(&mThreadHandler);
|
||||
}
|
||||
|
||||
FTPThread::FTPThread(const FTPThread &/*someFTPThread*/)
|
||||
{ // private implementation
|
||||
}
|
||||
|
||||
FTPThread::~FTPThread()
|
||||
{
|
||||
removeHandler(&mThreadHandler);
|
||||
mCompletionHandler=CallbackPointer();
|
||||
}
|
||||
|
||||
WORD FTPThread::interpretLine(const String &lineString)
|
||||
{
|
||||
String *pString=new String(lineString);
|
||||
ThreadMessage interpretMessage(ThreadMessage::TM_USER,MsgInterpretLine,(LONG)pString);
|
||||
return postMessage(interpretMessage);
|
||||
}
|
||||
|
||||
WORD FTPThread::interpretFile(const String &pathFileName)
|
||||
{
|
||||
String *pString=new String(pathFileName);
|
||||
ThreadMessage interpretMessage(ThreadMessage::TM_USER,MsgInterpretFile,(LONG)pString);
|
||||
return postMessage(interpretMessage);
|
||||
}
|
||||
|
||||
void FTPThread::setDisplay(Monitor<EditWindow> &editMonitor)
|
||||
{
|
||||
FTPInterpreter::setDisplay(editMonitor);
|
||||
}
|
||||
|
||||
DWORD FTPThread::threadHandler(ThreadMessage &someThreadMessage)
|
||||
{
|
||||
switch(someThreadMessage.message())
|
||||
{
|
||||
case ThreadMessage::TM_CREATE :
|
||||
break;
|
||||
case ThreadMessage::TM_DESTROY :
|
||||
break;
|
||||
case ThreadMessage::TM_USER :
|
||||
if(MsgInterpretLine==someThreadMessage.userDataOne())handleInterpretLine((String*)someThreadMessage.userDataTwo());
|
||||
else if(MsgInterpretFile==someThreadMessage.userDataOne())handleInterpretFile((String*)someThreadMessage.userDataTwo());
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void FTPThread::handleInterpretLine(String *pInterpretLine)
|
||||
{
|
||||
CallbackData completionData(0,(int)LineComplete);
|
||||
String interpretLine(*pInterpretLine);
|
||||
delete pInterpretLine;
|
||||
FTPInterpreter::interpretLine(interpretLine);
|
||||
mCompletionHandler.callback(completionData);
|
||||
}
|
||||
|
||||
void FTPThread::handleInterpretFile(String *pInterpretFile)
|
||||
{
|
||||
CallbackData completionData(0,(int)FileComplete);
|
||||
String interpretFile(*pInterpretFile);
|
||||
delete pInterpretFile;
|
||||
FTPInterpreter::interpretFile(interpretFile);
|
||||
mCompletionHandler.callback(completionData);
|
||||
}
|
||||
45
ftp/FTPTHRD.HPP
Normal file
45
ftp/FTPTHRD.HPP
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef _FTP_FTPTHREAD_HPP_
|
||||
#define _FTP_FTPTHREAD_HPP_
|
||||
#ifndef _FTP_INTERPRETER_HPP_
|
||||
#include <ftp/interprt.hpp>
|
||||
#endif
|
||||
#ifndef _THREAD_MESSAGETHREAD_HPP_
|
||||
#include <thread/mthread.hpp>
|
||||
#endif
|
||||
|
||||
class EditMonitor;
|
||||
|
||||
class FTPThread : private FTPInterpreter, public MessageThread
|
||||
{
|
||||
public:
|
||||
enum HandlerType{MsgInterpretLine,MsgInterpretFile};
|
||||
enum CompletionCode{LineComplete,FileComplete};
|
||||
FTPThread(void);
|
||||
virtual ~FTPThread();
|
||||
WORD interpretLine(const String &lineString);
|
||||
WORD interpretFile(const String &pathFileName);
|
||||
void setDisplay(Monitor<EditWindow> &displayWindow);
|
||||
void setCompletionHandler(PureCallback *lpCallback);
|
||||
private:
|
||||
FTPThread(const FTPThread &someFTPThread);
|
||||
FTPThread &operator=(const FTPThread &someFTPThread);
|
||||
DWORD threadHandler(ThreadMessage &someThreadMessage);
|
||||
void handleInterpretLine(String *pString);
|
||||
void handleInterpretFile(String *pString);
|
||||
|
||||
ThreadCallback<FTPThread> mThreadHandler;
|
||||
CallbackPointer mCompletionHandler;
|
||||
};
|
||||
|
||||
inline
|
||||
FTPThread &FTPThread::operator=(const FTPThread &/*someFTPThread*/)
|
||||
{ // private implementation
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
void FTPThread::setCompletionHandler(PureCallback *lpCallback)
|
||||
{
|
||||
mCompletionHandler=CallbackPointer(lpCallback);
|
||||
}
|
||||
#endif
|
||||
1314
ftp/Ftp.mak
Normal file
1314
ftp/Ftp.mak
Normal file
File diff suppressed because it is too large
Load Diff
BIN
ftp/Ftp.mdp
Normal file
BIN
ftp/Ftp.mdp
Normal file
Binary file not shown.
BIN
ftp/Ftp.ncb
Normal file
BIN
ftp/Ftp.ncb
Normal file
Binary file not shown.
BIN
ftp/Ftp.opt
Normal file
BIN
ftp/Ftp.opt
Normal file
Binary file not shown.
577
ftp/Ftplib.001
Normal file
577
ftp/Ftplib.001
Normal file
@@ -0,0 +1,577 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=ftplib - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to ftplib - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "ftplib - Win32 Release" && "$(CFG)" != "ftplib - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE on this makefile
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Ftplib.mak" CFG="ftplib - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ftplib - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "ftplib - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
################################################################################
|
||||
# Begin Project
|
||||
# PROP Target_Last_Scanned "ftplib - Win32 Debug"
|
||||
CPP=cl.exe
|
||||
|
||||
!IF "$(CFG)" == "ftplib - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
|
||||
ALL : "$(OUTDIR)\Ftplib.lib"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Ftp.obj"
|
||||
-@erase "$(INTDIR)\Ftpdata.obj"
|
||||
-@erase "$(INTDIR)\Ftpthrd.obj"
|
||||
-@erase "$(INTDIR)\hostdlg.obj"
|
||||
-@erase "$(INTDIR)\Interprt.obj"
|
||||
-@erase "$(INTDIR)\Logindlg.obj"
|
||||
-@erase "$(OUTDIR)\Ftplib.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS"\
|
||||
/Fp"$(INTDIR)/Ftplib.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.\.
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/Ftplib.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
LIB32_FLAGS=/nologo /out:"$(OUTDIR)/Ftplib.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\Ftp.obj" \
|
||||
"$(INTDIR)\Ftpdata.obj" \
|
||||
"$(INTDIR)\Ftpthrd.obj" \
|
||||
"$(INTDIR)\hostdlg.obj" \
|
||||
"$(INTDIR)\Interprt.obj" \
|
||||
"$(INTDIR)\Logindlg.obj"
|
||||
|
||||
"$(OUTDIR)\Ftplib.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftplib - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "msvcobj"
|
||||
# PROP Intermediate_Dir "msvcobj"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\msvcobj
|
||||
INTDIR=.\msvcobj
|
||||
|
||||
ALL : "..\exe\ftplib.lib"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Ftp.obj"
|
||||
-@erase "$(INTDIR)\Ftpdata.obj"
|
||||
-@erase "$(INTDIR)\Ftpthrd.obj"
|
||||
-@erase "$(INTDIR)\hostdlg.obj"
|
||||
-@erase "$(INTDIR)\Interprt.obj"
|
||||
-@erase "$(INTDIR)\Logindlg.obj"
|
||||
-@erase "..\exe\ftplib.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /Zp1 /MTd /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STRICT" /D "__FLAT__" /YX /c
|
||||
CPP_PROJ=/nologo /Zp1 /MTd /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D\
|
||||
"STRICT" /D "__FLAT__" /Fp"$(INTDIR)/Ftplib.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\msvcobj/
|
||||
CPP_SBRS=.\.
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/Ftplib.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\exe\ftplib.lib"
|
||||
LIB32_FLAGS=/nologo /out:"..\exe\ftplib.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\Ftp.obj" \
|
||||
"$(INTDIR)\Ftpdata.obj" \
|
||||
"$(INTDIR)\Ftpthrd.obj" \
|
||||
"$(INTDIR)\hostdlg.obj" \
|
||||
"$(INTDIR)\Interprt.obj" \
|
||||
"$(INTDIR)\Logindlg.obj"
|
||||
|
||||
"..\exe\ftplib.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "ftplib - Win32 Release"
|
||||
# Name "ftplib - Win32 Debug"
|
||||
|
||||
!IF "$(CFG)" == "ftplib - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftplib - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftpdata.cpp
|
||||
DEP_CPP_FTPDA=\
|
||||
{$(INCLUDE)}"\.\Ftpdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Servent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Ftpdata.obj" : $(SOURCE) $(DEP_CPP_FTPDA) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftpthrd.cpp
|
||||
|
||||
!IF "$(CFG)" == "ftplib - Win32 Release"
|
||||
|
||||
DEP_CPP_FTPTH=\
|
||||
{$(INCLUDE)}"\.\ftp.hpp"\
|
||||
{$(INCLUDE)}"\.\Ftpdata.hpp"\
|
||||
{$(INCLUDE)}"\.\ftpthrd.hpp"\
|
||||
{$(INCLUDE)}"\.\interprt.hpp"\
|
||||
{$(INCLUDE)}"\.\resinc.h"\
|
||||
{$(INCLUDE)}"\.\resinc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\common\dwindow.hpp"\
|
||||
{$(INCLUDE)}"\common\filemap.hpp"\
|
||||
{$(INCLUDE)}"\common\filetime.hpp"\
|
||||
{$(INCLUDE)}"\common\fixup.hpp"\
|
||||
{$(INCLUDE)}"\common\font.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\gdiobj.hpp"\
|
||||
{$(INCLUDE)}"\common\gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\menuitem.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\common\point.hpp"\
|
||||
{$(INCLUDE)}"\common\puredwrd.hpp"\
|
||||
{$(INCLUDE)}"\common\puremenu.hpp"\
|
||||
{$(INCLUDE)}"\common\pvector.hpp"\
|
||||
{$(INCLUDE)}"\common\pvector.tpp"\
|
||||
{$(INCLUDE)}"\common\pview.hpp"\
|
||||
{$(INCLUDE)}"\common\rect.hpp"\
|
||||
{$(INCLUDE)}"\common\stdio.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\common\systime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\common\window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\common\winnt.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\display\editwnd.hpp"\
|
||||
{$(INCLUDE)}"\display\guibrdr.hpp"\
|
||||
{$(INCLUDE)}"\display\guichar.hpp"\
|
||||
{$(INCLUDE)}"\display\guiline.hpp"\
|
||||
{$(INCLUDE)}"\display\keyctrl.hpp"\
|
||||
{$(INCLUDE)}"\display\vcaret.hpp"\
|
||||
{$(INCLUDE)}"\display\virtdisp.hpp"\
|
||||
{$(INCLUDE)}"\parse\assemble.hpp"\
|
||||
{$(INCLUDE)}"\parse\emit.hpp"\
|
||||
{$(INCLUDE)}"\parse\parse.hpp"\
|
||||
{$(INCLUDE)}"\parse\psymbol.hpp"\
|
||||
{$(INCLUDE)}"\parse\scan.hpp"\
|
||||
{$(INCLUDE)}"\parse\symbol.hpp"\
|
||||
{$(INCLUDE)}"\parse\table.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Servent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\thread\context.hpp"\
|
||||
{$(INCLUDE)}"\thread\event.hpp"\
|
||||
{$(INCLUDE)}"\thread\monitor.hpp"\
|
||||
{$(INCLUDE)}"\thread\msgqueue.hpp"\
|
||||
{$(INCLUDE)}"\thread\mthread.hpp"\
|
||||
{$(INCLUDE)}"\thread\mutex.hpp"\
|
||||
{$(INCLUDE)}"\thread\qthread.hpp"\
|
||||
{$(INCLUDE)}"\thread\savearea.hpp"\
|
||||
{$(INCLUDE)}"\thread\tcallbck.hpp"\
|
||||
{$(INCLUDE)}"\thread\thmsg.hpp"\
|
||||
{$(INCLUDE)}"\thread\thread.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Ftpthrd.obj" : $(SOURCE) $(DEP_CPP_FTPTH) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftplib - Win32 Debug"
|
||||
|
||||
DEP_CPP_FTPTH=\
|
||||
{$(INCLUDE)}"\.\ftp.hpp"\
|
||||
{$(INCLUDE)}"\.\Ftpdata.hpp"\
|
||||
{$(INCLUDE)}"\.\ftpthrd.hpp"\
|
||||
{$(INCLUDE)}"\.\interprt.hpp"\
|
||||
{$(INCLUDE)}"\.\resinc.h"\
|
||||
{$(INCLUDE)}"\.\resinc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\common\dwindow.hpp"\
|
||||
{$(INCLUDE)}"\common\filemap.hpp"\
|
||||
{$(INCLUDE)}"\common\filetime.hpp"\
|
||||
{$(INCLUDE)}"\common\fixup.hpp"\
|
||||
{$(INCLUDE)}"\common\font.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\gdiobj.hpp"\
|
||||
{$(INCLUDE)}"\common\gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\menuitem.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\common\point.hpp"\
|
||||
{$(INCLUDE)}"\common\puredwrd.hpp"\
|
||||
{$(INCLUDE)}"\common\puremenu.hpp"\
|
||||
{$(INCLUDE)}"\common\pvector.hpp"\
|
||||
{$(INCLUDE)}"\common\pvector.tpp"\
|
||||
{$(INCLUDE)}"\common\pview.hpp"\
|
||||
{$(INCLUDE)}"\common\rect.hpp"\
|
||||
{$(INCLUDE)}"\common\stdio.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\common\systime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\common\window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\common\winnt.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\display\editwnd.hpp"\
|
||||
{$(INCLUDE)}"\display\guibrdr.hpp"\
|
||||
{$(INCLUDE)}"\display\guichar.hpp"\
|
||||
{$(INCLUDE)}"\display\guiline.hpp"\
|
||||
{$(INCLUDE)}"\display\keyctrl.hpp"\
|
||||
{$(INCLUDE)}"\display\vcaret.hpp"\
|
||||
{$(INCLUDE)}"\display\virtdisp.hpp"\
|
||||
{$(INCLUDE)}"\parse\assemble.hpp"\
|
||||
{$(INCLUDE)}"\parse\emit.hpp"\
|
||||
{$(INCLUDE)}"\parse\parse.hpp"\
|
||||
{$(INCLUDE)}"\parse\psymbol.hpp"\
|
||||
{$(INCLUDE)}"\parse\scan.hpp"\
|
||||
{$(INCLUDE)}"\parse\symbol.hpp"\
|
||||
{$(INCLUDE)}"\parse\table.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Servent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\thread\context.hpp"\
|
||||
{$(INCLUDE)}"\thread\event.hpp"\
|
||||
{$(INCLUDE)}"\thread\monitor.hpp"\
|
||||
{$(INCLUDE)}"\thread\msgqueue.hpp"\
|
||||
{$(INCLUDE)}"\thread\mthread.hpp"\
|
||||
{$(INCLUDE)}"\thread\mutex.hpp"\
|
||||
{$(INCLUDE)}"\thread\ptcllbck.hpp"\
|
||||
{$(INCLUDE)}"\thread\qthread.hpp"\
|
||||
{$(INCLUDE)}"\thread\savearea.hpp"\
|
||||
{$(INCLUDE)}"\thread\tcallbck.hpp"\
|
||||
{$(INCLUDE)}"\thread\tcallbck.tpp"\
|
||||
{$(INCLUDE)}"\thread\thmsg.hpp"\
|
||||
{$(INCLUDE)}"\thread\thread.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Ftpthrd.obj" : $(SOURCE) $(DEP_CPP_FTPTH) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\hostdlg.cpp
|
||||
DEP_CPP_HOSTD=\
|
||||
{$(INCLUDE)}"\.\hostdlg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\common\dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\common\point.hpp"\
|
||||
{$(INCLUDE)}"\common\rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dlgitem.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dlgtmpl.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dyndlg.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\hostdlg.obj" : $(SOURCE) $(DEP_CPP_HOSTD) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Interprt.cpp
|
||||
DEP_CPP_INTER=\
|
||||
{$(INCLUDE)}"\.\ftp.hpp"\
|
||||
{$(INCLUDE)}"\.\Ftpdata.hpp"\
|
||||
{$(INCLUDE)}"\.\interprt.hpp"\
|
||||
{$(INCLUDE)}"\.\logindlg.hpp"\
|
||||
{$(INCLUDE)}"\.\resinc.h"\
|
||||
{$(INCLUDE)}"\.\resinc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\common\diskinfo.hpp"\
|
||||
{$(INCLUDE)}"\common\dwindow.hpp"\
|
||||
{$(INCLUDE)}"\common\filemap.hpp"\
|
||||
{$(INCLUDE)}"\common\filetime.hpp"\
|
||||
{$(INCLUDE)}"\common\finddata.hpp"\
|
||||
{$(INCLUDE)}"\common\fixup.hpp"\
|
||||
{$(INCLUDE)}"\common\font.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\gdiobj.hpp"\
|
||||
{$(INCLUDE)}"\common\gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\menuitem.hpp"\
|
||||
{$(INCLUDE)}"\common\openfile.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\common\point.hpp"\
|
||||
{$(INCLUDE)}"\common\puredwrd.hpp"\
|
||||
{$(INCLUDE)}"\common\puremenu.hpp"\
|
||||
{$(INCLUDE)}"\common\pvector.hpp"\
|
||||
{$(INCLUDE)}"\common\pvector.tpp"\
|
||||
{$(INCLUDE)}"\common\pview.hpp"\
|
||||
{$(INCLUDE)}"\common\rect.hpp"\
|
||||
{$(INCLUDE)}"\common\stdio.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\common\systime.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\common\window.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dlgitem.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dlgtmpl.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dyndlg.hpp"\
|
||||
{$(INCLUDE)}"\display\editwnd.hpp"\
|
||||
{$(INCLUDE)}"\display\guibrdr.hpp"\
|
||||
{$(INCLUDE)}"\display\guichar.hpp"\
|
||||
{$(INCLUDE)}"\display\guiline.hpp"\
|
||||
{$(INCLUDE)}"\display\keyctrl.hpp"\
|
||||
{$(INCLUDE)}"\display\vcaret.hpp"\
|
||||
{$(INCLUDE)}"\display\virtdisp.hpp"\
|
||||
{$(INCLUDE)}"\parse\assemble.hpp"\
|
||||
{$(INCLUDE)}"\parse\emit.hpp"\
|
||||
{$(INCLUDE)}"\parse\parse.hpp"\
|
||||
{$(INCLUDE)}"\parse\psymbol.hpp"\
|
||||
{$(INCLUDE)}"\parse\scan.hpp"\
|
||||
{$(INCLUDE)}"\parse\symbol.hpp"\
|
||||
{$(INCLUDE)}"\parse\table.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Servent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
{$(INCLUDE)}"\thread\monitor.hpp"\
|
||||
{$(INCLUDE)}"\thread\mutex.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Interprt.obj" : $(SOURCE) $(DEP_CPP_INTER) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Logindlg.cpp
|
||||
DEP_CPP_LOGIN=\
|
||||
{$(INCLUDE)}"\.\logindlg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\common\callback.hpp"\
|
||||
{$(INCLUDE)}"\common\callback.tpp"\
|
||||
{$(INCLUDE)}"\common\cbdata.hpp"\
|
||||
{$(INCLUDE)}"\common\cbptr.hpp"\
|
||||
{$(INCLUDE)}"\common\dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\common\guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\common\point.hpp"\
|
||||
{$(INCLUDE)}"\common\rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\common\vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\common\windowsx.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dlgitem.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dlgtmpl.hpp"\
|
||||
{$(INCLUDE)}"\dialog\dyndlg.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Logindlg.obj" : $(SOURCE) $(DEP_CPP_LOGIN) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftp.cpp
|
||||
DEP_CPP_FTP_C=\
|
||||
{$(INCLUDE)}"\.\ftp.hpp"\
|
||||
{$(INCLUDE)}"\.\Ftpdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\common\stdio.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Winsock.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Cache.hpp"\
|
||||
{$(INCLUDE)}"\socket\hostent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Inaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Intsaddr.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Servent.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Socket.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Timeinfo.hpp"\
|
||||
{$(INCLUDE)}"\Socket\Wsadata.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Ftp.obj" : $(SOURCE) $(DEP_CPP_FTP_C) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
################################################################################
|
||||
152
ftp/Ftplib.dsp
Normal file
152
ftp/Ftplib.dsp
Normal file
@@ -0,0 +1,152 @@
|
||||
# Microsoft Developer Studio Project File - Name="ftplib" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=ftplib - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Ftplib.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Ftplib.mak" CFG="ftplib - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ftplib - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "ftplib - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "ftplib - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\Release"
|
||||
# PROP BASE Intermediate_Dir ".\Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftplib - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\Debug"
|
||||
# PROP BASE Intermediate_Dir ".\Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ".\msvcobj"
|
||||
# PROP Intermediate_Dir ".\msvcobj"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /Zp8 /MTd /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STRICT" /D "__FLAT__" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\exe\ftplib.lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "ftplib - Win32 Release"
|
||||
# Name "ftplib - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftp.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftpdata.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftpthrd.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\hostdlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Interprt.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Logindlg.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ftp.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftpdata.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ftpthrd.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\hostdlg.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\interprt.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\logindlg.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resinc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resinc.hpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
29
ftp/Ftplib.dsw
Normal file
29
ftp/Ftplib.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ftplib"=.\Ftplib.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
BIN
ftp/Ftplib.mdp
Normal file
BIN
ftp/Ftplib.mdp
Normal file
Binary file not shown.
37
ftp/Ftplib.plg
Normal file
37
ftp/Ftplib.plg
Normal file
@@ -0,0 +1,37 @@
|
||||
<html>
|
||||
<body>
|
||||
<pre>
|
||||
<h1>Build Log</h1>
|
||||
<h3>
|
||||
--------------------Configuration: ftplib - Win32 Debug--------------------
|
||||
</h3>
|
||||
<h3>Command Lines</h3>
|
||||
Creating temporary file "C:\TEMP\RSP131.tmp" with contents
|
||||
[
|
||||
/nologo /MTd /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STRICT" /D "__FLAT__" /Fp".\msvcobj/Ftplib.pch" /YX /Fo".\msvcobj/" /Fd".\msvcobj/" /FD /c
|
||||
"D:\work\FTP\Ftp.cpp"
|
||||
"D:\work\FTP\Ftpdata.cpp"
|
||||
"D:\work\FTP\Ftpthrd.cpp"
|
||||
"D:\work\FTP\hostdlg.cpp"
|
||||
"D:\work\FTP\Interprt.cpp"
|
||||
"D:\work\FTP\Logindlg.cpp"
|
||||
]
|
||||
Creating command line "cl.exe @C:\TEMP\RSP131.tmp"
|
||||
Creating command line "link.exe -lib /nologo /out:"..\exe\ftplib.lib" .\msvcobj\Ftp.obj .\msvcobj\Ftpdata.obj .\msvcobj\Ftpthrd.obj .\msvcobj\hostdlg.obj .\msvcobj\Interprt.obj .\msvcobj\Logindlg.obj "
|
||||
<h3>Output Window</h3>
|
||||
Compiling...
|
||||
Ftp.cpp
|
||||
Ftpdata.cpp
|
||||
Ftpthrd.cpp
|
||||
hostdlg.cpp
|
||||
Interprt.cpp
|
||||
Logindlg.cpp
|
||||
Creating library...
|
||||
|
||||
|
||||
|
||||
<h3>Results</h3>
|
||||
ftplib.lib - 0 error(s), 0 warning(s)
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
74
ftp/HOSTDLG.CPP
Normal file
74
ftp/HOSTDLG.CPP
Normal file
@@ -0,0 +1,74 @@
|
||||
#include <ftp/hostdlg.hpp>
|
||||
|
||||
BOOL HostDialog::performDialog(void)
|
||||
{
|
||||
DialogTemplate dlgTemplate;
|
||||
DialogItemTemplate hostEdit;
|
||||
DialogItemTemplate hostStatic;
|
||||
DialogItemTemplate connectButton;
|
||||
DialogItemTemplate cancelButton;
|
||||
|
||||
dlgTemplate.titleText("Connect to Remote Host...");
|
||||
dlgTemplate.posRect(Rect(6,15,156,63));
|
||||
dlgTemplate.pointSize(8);
|
||||
dlgTemplate.typeFace("Helv");
|
||||
dlgTemplate.style(DS_MODALFRAME|WS_TABSTOP|WS_VISIBLE|WS_CAPTION|WS_SYSMENU|DS_3DLOOK|DS_SETFONT|WS_POPUP);
|
||||
|
||||
hostEdit.className("EDIT");
|
||||
hostEdit.titleText("");
|
||||
hostEdit.style(WS_BORDER|WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL);
|
||||
hostEdit.posRect(Rect(55,11,95,12));
|
||||
hostEdit.itemID(RemoteHostID);
|
||||
|
||||
hostStatic.className("STATIC");
|
||||
hostStatic.titleText("Remote Host :");
|
||||
hostStatic.style(WS_CHILD|WS_VISIBLE);
|
||||
hostStatic.posRect(Rect(6,12,49,8));
|
||||
hostStatic.itemID(-1);
|
||||
|
||||
connectButton.className("BUTTON");
|
||||
connectButton.titleText("Connect");
|
||||
connectButton.style(BS_DEFPUSHBUTTON|WS_CHILD|WS_VISIBLE);
|
||||
connectButton.posRect(Rect(35,30,50,14));
|
||||
connectButton.itemID(IDOK);
|
||||
|
||||
cancelButton.className("BUTTON");
|
||||
cancelButton.titleText("Cancel");
|
||||
cancelButton.style(WS_CHILD|WS_VISIBLE);
|
||||
cancelButton.posRect(Rect(93,30,50,14));
|
||||
cancelButton.itemID(IDCANCEL);
|
||||
|
||||
dlgTemplate+=hostEdit;
|
||||
dlgTemplate+=hostStatic;
|
||||
dlgTemplate+=connectButton;
|
||||
dlgTemplate+=cancelButton;
|
||||
|
||||
createDialog(dlgTemplate);
|
||||
return !mRemoteHost.isNull();
|
||||
}
|
||||
|
||||
WORD HostDialog::dlgCommand(DWORD commandID,CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
switch(commandID)
|
||||
{
|
||||
case IDOK :
|
||||
getText(RemoteHostID,mRemoteHost);
|
||||
if(mRemoteHost.isNull()){::MessageBeep(0);return TRUE;}
|
||||
break;
|
||||
case IDCANCEL :
|
||||
mRemoteHost.reserve(String::MaxString);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL HostDialog::dlgInitDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
if(!remoteHost().isNull())setText(RemoteHostID,mRemoteHost);
|
||||
setFocus();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void HostDialog::dlgDestroyDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
}
|
||||
54
ftp/HOSTDLG.HPP
Normal file
54
ftp/HOSTDLG.HPP
Normal file
@@ -0,0 +1,54 @@
|
||||
#ifndef _FTP_HOSTDIALOG_HPP_
|
||||
#define _FTP_HOSTDIALOG_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _DIALOG_DYNAMICDIALOG_HPP_
|
||||
#include <dialog/dyndlg.hpp>
|
||||
#endif
|
||||
|
||||
class HostDialog : public DynamicDialog
|
||||
{
|
||||
public:
|
||||
HostDialog(void);
|
||||
virtual ~HostDialog();
|
||||
BOOL performDialog(void);
|
||||
const String &remoteHost(void)const;
|
||||
void remoteHost(const String &remoteHost);
|
||||
private:
|
||||
enum {RemoteHostID=101};
|
||||
HostDialog(const HostDialog &someHostDialog);
|
||||
WORD dlgCommand(DWORD commandID,CallbackData &someCallbackData);
|
||||
BOOL dlgInitDialog(CallbackData &someCallbackData);
|
||||
void dlgDestroyDialog(CallbackData &someCallbackData);
|
||||
|
||||
String mRemoteHost;
|
||||
};
|
||||
|
||||
inline
|
||||
HostDialog::HostDialog(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
HostDialog::HostDialog(const HostDialog &/*loginDialog*/)
|
||||
{ // private implementation
|
||||
}
|
||||
|
||||
inline
|
||||
HostDialog::~HostDialog()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
const String &HostDialog::remoteHost(void)const
|
||||
{
|
||||
return mRemoteHost;
|
||||
}
|
||||
|
||||
inline
|
||||
void HostDialog::remoteHost(const String &remoteHost)
|
||||
{
|
||||
mRemoteHost=remoteHost;
|
||||
}
|
||||
#endif
|
||||
463
ftp/INTERPRT.CPP
Normal file
463
ftp/INTERPRT.CPP
Normal file
@@ -0,0 +1,463 @@
|
||||
#include <common/openfile.hpp>
|
||||
#include <common/filemap.hpp>
|
||||
#include <common/pview.hpp>
|
||||
#include <common/diskinfo.hpp>
|
||||
#include <common/systime.hpp>
|
||||
#include <ftp/interprt.hpp>
|
||||
#include <ftp/logindlg.hpp>
|
||||
#include <ftp/ftpdata.hpp>
|
||||
|
||||
FTPInterpreter::FTPInterpreter(void)
|
||||
: mlpEditMonitor(0), mNotConnected("Not connected."), mNotLoggedIn("Not logged in.")
|
||||
{
|
||||
symbolLoad();
|
||||
}
|
||||
|
||||
void FTPInterpreter::setText(Block<String> &messageStrings)
|
||||
{
|
||||
for(short itemIndex=0;itemIndex<messageStrings.size();itemIndex++)setText(messageStrings[itemIndex]);
|
||||
}
|
||||
|
||||
void FTPInterpreter::interpretLine(const String &lineString)
|
||||
{
|
||||
if(lineString.isNull())return;
|
||||
FileMap srcMap("SRCMAP",0L,lineString.length());
|
||||
PureViewOfFile pureView(srcMap);
|
||||
pureView.write(lineString);
|
||||
interpret(srcMap);
|
||||
}
|
||||
|
||||
void FTPInterpreter::interpretFile(const String &pathFileName)
|
||||
{
|
||||
FileHandle srcFile(pathFileName,FileHandle::Read,FileHandle::ShareRead);
|
||||
FileMap srcMap(srcFile);
|
||||
interpret(srcMap);
|
||||
}
|
||||
|
||||
void FTPInterpreter::interpret(FileMap &srcMap)
|
||||
{
|
||||
DWORD asmLength;
|
||||
FileMap dstMap("DSTMAP",0,250000,FileMap::ReadWrite,FileMap::Commit);
|
||||
FileMap asmMap("ASMMAP",0,250000,FileMap::ReadWrite,FileMap::Commit);
|
||||
PureViewOfFile srcView(srcMap);
|
||||
PureViewOfFile dstView(dstMap);
|
||||
Scan scriptScan(srcView,dstView,mSymbolTable);
|
||||
|
||||
scriptScan.analyze();
|
||||
dstView.rewind();
|
||||
PureViewOfFile asmView(asmMap);
|
||||
Parse scriptParse(dstView,asmView);
|
||||
scriptParse.parse();
|
||||
asmLength=asmView.tell();
|
||||
asmView.destroyView();
|
||||
asmView.createView(asmMap,0L,0L,asmLength);
|
||||
if(Parse::Ok!=scriptParse.status())
|
||||
{
|
||||
String errorInfo;
|
||||
::sprintf(errorInfo,"syntax error at line #%d",scriptParse.lastLineNumber());
|
||||
setText(errorInfo);
|
||||
return;
|
||||
}
|
||||
assemble(asmView);
|
||||
}
|
||||
|
||||
void FTPInterpreter::openHandler(const String &hostName)
|
||||
{
|
||||
LoginDialog loginDialog;
|
||||
|
||||
if(!open(hostName))return;
|
||||
loginDialog.performLogin();
|
||||
if(loginDialog.userName().isNull())return;
|
||||
if(loginDialog.password().isNull())return;
|
||||
login(loginDialog.userName(),loginDialog.password());
|
||||
}
|
||||
|
||||
void FTPInterpreter::openHandler(const String &hostName,const String &userName,const String &password)
|
||||
{
|
||||
if(!open(hostName))return;
|
||||
login(userName,password);
|
||||
}
|
||||
|
||||
void FTPInterpreter::closeHandler(void)
|
||||
{
|
||||
logout();
|
||||
}
|
||||
|
||||
void FTPInterpreter::userHandler(const String &userName)
|
||||
{
|
||||
LoginDialog loginDialog;
|
||||
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
loginDialog.userName(userName);
|
||||
loginDialog.performLogin();
|
||||
if(loginDialog.userName().isNull())return;
|
||||
if(loginDialog.password().isNull())return;
|
||||
login(loginDialog.userName(),loginDialog.password());
|
||||
}
|
||||
|
||||
void FTPInterpreter::pwdHandler(void)
|
||||
{
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn())return;
|
||||
printWorkingDirectory();
|
||||
}
|
||||
|
||||
void FTPInterpreter::cdHandler(const String &pathDirectory)
|
||||
{
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn()){setText(mNotLoggedIn);return;}
|
||||
changeWorkingDirectory(pathDirectory);
|
||||
}
|
||||
|
||||
void FTPInterpreter::lcdHandler(const String &pathDirectory)
|
||||
{
|
||||
String currentDirectory;
|
||||
String prefixString("Current directory is: ");
|
||||
DiskInfo diskInfo;
|
||||
if(pathDirectory.isNull())
|
||||
{
|
||||
diskInfo.getCurrentDirectory(currentDirectory);
|
||||
setText(prefixString+currentDirectory);
|
||||
}
|
||||
else
|
||||
{
|
||||
diskInfo.setCurrentDirectory(pathDirectory);
|
||||
diskInfo.getCurrentDirectory(currentDirectory);
|
||||
setText(prefixString+currentDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
void FTPInterpreter::disconnectHandler(void)
|
||||
{
|
||||
logout();
|
||||
}
|
||||
|
||||
void FTPInterpreter::byeHandler(void)
|
||||
{
|
||||
logout();
|
||||
}
|
||||
|
||||
void FTPInterpreter::quitHandler(void)
|
||||
{
|
||||
if(isConnected())logout();
|
||||
SystemTime systemTime;
|
||||
setText(String("client stopped on ")+systemTime.toString());
|
||||
::Sleep(500L);
|
||||
}
|
||||
|
||||
void FTPInterpreter::remotehelpHandler(const String &remoteHelpTopic)
|
||||
{
|
||||
help(remoteHelpTopic);
|
||||
}
|
||||
|
||||
void FTPInterpreter::renameHandler(const String &oldPathFileName,const String &newPathFileName)
|
||||
{
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn()){setText(mNotLoggedIn);return;}
|
||||
if(oldPathFileName.isNull()||newPathFileName.isNull())return;
|
||||
if(!renameFrom(oldPathFileName))return;
|
||||
if(!renameTo(newPathFileName))return;
|
||||
}
|
||||
|
||||
void FTPInterpreter::asciiHandler(void)
|
||||
{
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn()){setText(mNotLoggedIn);return;}
|
||||
type('A');
|
||||
}
|
||||
|
||||
void FTPInterpreter::binaryHandler(void)
|
||||
{
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn()){setText(mNotLoggedIn);return;}
|
||||
type('I');
|
||||
}
|
||||
|
||||
void FTPInterpreter::deleteHandler(const String &pathFileName)
|
||||
{
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn()){setText(mNotLoggedIn);return;}
|
||||
if(pathFileName.isNull())return;
|
||||
remove(pathFileName);
|
||||
}
|
||||
|
||||
void FTPInterpreter::mdeleteHandler(const String ¶mString)
|
||||
{
|
||||
FTPData ftpData;
|
||||
String lineString;
|
||||
Block<String> nameStrings;
|
||||
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn()){setText(mNotLoggedIn);return;}
|
||||
if(!port(ftpData))return;
|
||||
if(!nameList(paramString,FALSE))return;
|
||||
if(!ftpData.accept())return;
|
||||
while(ftpData.receive(lineString))nameStrings.insert(&lineString);
|
||||
ftpData.destroy();
|
||||
if(receive(lineString))setText(lineString);
|
||||
for(DWORD itemIndex=0;itemIndex<nameStrings.size();itemIndex++)deleteHandler(nameStrings[itemIndex]);
|
||||
}
|
||||
|
||||
void FTPInterpreter::dirHandler(const String ¶mString)
|
||||
{
|
||||
FTPData ftpData;
|
||||
String lineString;
|
||||
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn()){setText(mNotLoggedIn);return;}
|
||||
if(!port(ftpData))return;
|
||||
if(!list(paramString))return;
|
||||
if(!ftpData.accept())return;
|
||||
while(ftpData.receive(lineString))setText(lineString);
|
||||
ftpData.destroy();
|
||||
if(receive(lineString))setText(lineString);
|
||||
}
|
||||
|
||||
void FTPInterpreter::lsHandler(const String ¶mString)
|
||||
{
|
||||
FTPData ftpData;
|
||||
String lineString;
|
||||
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn()){setText(mNotLoggedIn);return;}
|
||||
if(!port(ftpData))return;
|
||||
if(!nameList(paramString))return;
|
||||
if(!ftpData.accept())return;
|
||||
while(ftpData.receive(lineString))setText(lineString);
|
||||
ftpData.destroy();
|
||||
if(receive(lineString))setText(lineString);
|
||||
}
|
||||
|
||||
void FTPInterpreter::getHandler(const String &pathFileName)
|
||||
{
|
||||
FTPData ftpData;
|
||||
TimeInfo timeInfo;
|
||||
String lineString;
|
||||
String remoteFileName;
|
||||
DWORD sizeData;
|
||||
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn()){setText(mNotLoggedIn);return;}
|
||||
if(!port(ftpData))return;
|
||||
if(!retrieve(pathFileName,sizeData))return;
|
||||
if(!ftpData.accept())return;
|
||||
if(currentType()=='A')while(ftpData.receive(lineString))setText(lineString);
|
||||
else
|
||||
{
|
||||
if(!sizeData)ftpData.receiveBinary(pathFileName,timeInfo);
|
||||
else ftpData.receiveBinary(pathFileName,sizeData,timeInfo);
|
||||
}
|
||||
ftpData.destroy();
|
||||
if(receive(lineString))setText(lineString);
|
||||
setText((String)timeInfo);
|
||||
}
|
||||
|
||||
void FTPInterpreter::mgetHandler(const String ¶mString)
|
||||
{
|
||||
FTPData ftpData;
|
||||
String lineString;
|
||||
Block<String> nameStrings;
|
||||
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn()){setText(mNotLoggedIn);return;}
|
||||
if(!port(ftpData))return;
|
||||
if(!nameList(paramString,FALSE))return;
|
||||
if(!ftpData.accept())return;
|
||||
while(ftpData.receive(lineString))nameStrings.insert(&lineString);
|
||||
ftpData.destroy();
|
||||
if(receive(lineString))setText(lineString);
|
||||
for(DWORD itemIndex=0;itemIndex<nameStrings.size();itemIndex++)getHandler(nameStrings[itemIndex]);
|
||||
}
|
||||
|
||||
void FTPInterpreter::sendHandler(const String &pathFileName)
|
||||
{
|
||||
putHandler(pathFileName);
|
||||
}
|
||||
|
||||
void FTPInterpreter::putHandler(const String &pathFileName)
|
||||
{
|
||||
String responseString;
|
||||
FTPData ftpData;
|
||||
TimeInfo timeInfo;
|
||||
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn()){setText(mNotLoggedIn);return;}
|
||||
FileHandle sendFile(pathFileName,FileHandle::Read,FileHandle::ShareRead);
|
||||
if(!sendFile.isOkay()){setText("Error accessing local file.");return;}
|
||||
sendFile.close();
|
||||
if(!port(ftpData))return;
|
||||
if(!store(pathFileName))return;
|
||||
if(!ftpData.accept())return;
|
||||
ftpData.sendBinary(pathFileName,timeInfo);
|
||||
ftpData.destroy();
|
||||
if(receive(responseString))setText(responseString);
|
||||
setText((String)timeInfo);
|
||||
}
|
||||
|
||||
void FTPInterpreter::mkdirHandler(const String &pathDirectory)
|
||||
{
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn()){setText(mNotLoggedIn);return;}
|
||||
makeDirectory(pathDirectory);
|
||||
}
|
||||
|
||||
void FTPInterpreter::rmdirHandler(const String &pathDirectory)
|
||||
{
|
||||
if(!isConnected()){setText(mNotConnected);return;}
|
||||
if(!isLoggedIn()){setText(mNotLoggedIn);return;}
|
||||
removeDirectory(pathDirectory);
|
||||
}
|
||||
|
||||
void FTPInterpreter::appendHandler(const String &localPathFileName,const String &remotePathFileName)
|
||||
{
|
||||
setText(String("appendHandler")+String(localPathFileName+String("-")+remotePathFileName));
|
||||
}
|
||||
|
||||
void FTPInterpreter::literalHandler(const String &literalString)
|
||||
{
|
||||
setText(String("literalHandler")+literalString);
|
||||
}
|
||||
|
||||
void FTPInterpreter::mdirHandler(const String &pathDirectory)
|
||||
{
|
||||
setText(String("mdirHandler")+pathDirectory);
|
||||
}
|
||||
|
||||
void FTPInterpreter::typeHandler(const String ¶mString)
|
||||
{
|
||||
setText(String("typeHandler")+paramString);
|
||||
}
|
||||
|
||||
void FTPInterpreter::mlsHandler(const String &pathDirectory)
|
||||
{
|
||||
setText(String("mlsHandler")+pathDirectory);
|
||||
}
|
||||
|
||||
void FTPInterpreter::quoteHandler(const String &commandString)
|
||||
{
|
||||
setText(String("quoteHandler")+commandString);
|
||||
}
|
||||
|
||||
void FTPInterpreter::recvHandler(const String &pathFileName)
|
||||
{
|
||||
setText(String("recvHandler")+pathFileName);
|
||||
}
|
||||
|
||||
void FTPInterpreter::mputHandler(const String &pathFileName)
|
||||
{
|
||||
setText(String("mputHandler")+pathFileName);
|
||||
}
|
||||
|
||||
void FTPInterpreter::debugHandler(void)
|
||||
{
|
||||
setText("debugHandler");
|
||||
}
|
||||
|
||||
void FTPInterpreter::promptHandler(void)
|
||||
{
|
||||
setText("promptHandler");
|
||||
}
|
||||
|
||||
void FTPInterpreter::statusHandler(void)
|
||||
{
|
||||
setText("statusHandler");
|
||||
}
|
||||
|
||||
void FTPInterpreter::traceHandler(void)
|
||||
{
|
||||
setText("traceHandler");
|
||||
}
|
||||
|
||||
void FTPInterpreter::bellHandler(void)
|
||||
{
|
||||
setText("bellHandler");
|
||||
}
|
||||
|
||||
void FTPInterpreter::globHandler(void)
|
||||
{
|
||||
setText("globHandler");
|
||||
}
|
||||
|
||||
void FTPInterpreter::hashHandler(void)
|
||||
{
|
||||
setText("hashHandler");
|
||||
}
|
||||
|
||||
void FTPInterpreter::verboseHandler(void)
|
||||
{
|
||||
setText("verboseHandler");
|
||||
}
|
||||
|
||||
void FTPInterpreter::helpHandler(void)
|
||||
{
|
||||
WORD symbolCount(mSymbolTable.size());
|
||||
|
||||
for(short symbolIndex=0;symbolIndex<symbolCount;)
|
||||
{
|
||||
String helpStrings;
|
||||
for(short itemIndex=0;itemIndex<10&&symbolIndex<symbolCount;itemIndex++,symbolIndex++)
|
||||
{
|
||||
helpStrings+=mSymbolTable[symbolIndex].symbolName();
|
||||
helpStrings+=" ";
|
||||
}
|
||||
setText(helpStrings);
|
||||
}
|
||||
}
|
||||
|
||||
void FTPInterpreter::symbolLoad(void)
|
||||
{
|
||||
mSymbolTable.remove();
|
||||
mSymbolTable.insert(&Symbol(String("append"),Scan::append1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("ascii"),Scan::ascii1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("delete"),Scan::delete1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("debug"),Scan::debug1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("dir"),Scan::dir1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("disconnect"),Scan::disconnect1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("literal"),Scan::literal1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("ls"),Scan::ls1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("mdelete"),Scan::mdelete1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("mdir"),Scan::mdir1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("prompt"),Scan::prompt1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("put"),Scan::put1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("pwd"),Scan::pwd1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("quit"),Scan::quit1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("send"),Scan::send1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("status"),Scan::status1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("trace"),Scan::trace1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("type"),Scan::type1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("bell"),Scan::bell1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("binary"),Scan::binary1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("bye"),Scan::bye1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("get"),Scan::get1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("glob"),Scan::glob1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("hash"),Scan::hash1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("mget"),Scan::mget1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("mkdir"),Scan::mkdir1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("mls"),Scan::mls1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("quote"),Scan::quote1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("recv"),Scan::recv1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("remotehelp"),Scan::remotehelp1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("user"),Scan::user1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("verbose"),Scan::verbose1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("cd"),Scan::cd1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("help"),Scan::help1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("mput"),Scan::mput1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("rename"),Scan::rename1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("close"),Scan::close1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("lcd"),Scan::lcd1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("open"),Scan::open1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("rmdir"),Scan::rmdir1,Symbol::CommandSymbol));
|
||||
mSymbolTable.insert(&Symbol(String("sleep"),Scan::sleep1,Symbol::CommandSymbol));
|
||||
}
|
||||
|
||||
// **** virtual overloads
|
||||
|
||||
void FTPInterpreter::message(const String &lineString)
|
||||
{
|
||||
setText(lineString);
|
||||
}
|
||||
|
||||
void FTPInterpreter::message(Block<String> &lineStrings)
|
||||
{
|
||||
setText(lineStrings);
|
||||
}
|
||||
116
ftp/INTERPRT.HPP
Normal file
116
ftp/INTERPRT.HPP
Normal file
@@ -0,0 +1,116 @@
|
||||
#ifndef _FTP_INTERPRETER_HPP_
|
||||
#define _FTP_INTERPRETER_HPP_
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _DISPLAY_EDITWINDOW_HPP_
|
||||
#include <display/editwnd.hpp>
|
||||
#endif
|
||||
#ifndef _PARSE_TABLE_HPP_
|
||||
#include <parse/table.hpp>
|
||||
#endif
|
||||
#ifndef _PARSE_SCAN_HPP_
|
||||
#include <parse/scan.hpp>
|
||||
#endif
|
||||
#ifndef _PARSE_PARSE_HPP_
|
||||
#include <parse/parse.hpp>
|
||||
#endif
|
||||
#ifndef _PARSE_ASSEMBLER_HPP_
|
||||
#include <parse/assemble.hpp>
|
||||
#endif
|
||||
#ifndef _FTP_FTPCLIENT_HPP_
|
||||
#include <ftp/ftp.hpp>
|
||||
#endif
|
||||
#ifndef _FTP_RESINC_HPP_
|
||||
#include <ftp/resinc.hpp>
|
||||
#endif
|
||||
#ifndef _THREAD_MONITOR_HPP_
|
||||
#include <thread/monitor.hpp>
|
||||
#endif
|
||||
|
||||
class FTPInterpreter : private FTPClient, private Assembler
|
||||
{
|
||||
public:
|
||||
FTPInterpreter(void);
|
||||
virtual ~FTPInterpreter();
|
||||
void interpretFile(const String &pathFileName);
|
||||
void interpretLine(const String &lineString);
|
||||
void setDisplay(Monitor<EditWindow> &editMonitor);
|
||||
protected:
|
||||
virtual void message(const String &lineString);
|
||||
virtual void message(Block<String> &lineStrings);
|
||||
private:
|
||||
void setText(const String &lineString);
|
||||
void setText(Block<String> &lineStrings);
|
||||
void symbolLoad(void);
|
||||
void interpret(FileMap &srcMap);
|
||||
void appendHandler(const String &localPathFileName,const String &remotePathFileName);
|
||||
void remotehelpHandler(const String &remoteHelpTopic);
|
||||
void literalHandler(const String &literalString);
|
||||
void mdeleteHandler(const String ¶mString);
|
||||
void deleteHandler(const String &pathFileName);
|
||||
void openHandler(const String &hostName);
|
||||
void openHandler(const String &hostName,const String &userName,const String &password);
|
||||
void dirHandler(const String ¶mString);
|
||||
void lsHandler(const String ¶mString);
|
||||
void mdirHandler(const String &pathDirectory);
|
||||
void putHandler(const String &pathFileName);
|
||||
void sendHandler(const String &pathFileName);
|
||||
void typeHandler(const String ¶mString);
|
||||
void getHandler(const String &pathFileName);
|
||||
void mgetHandler(const String ¶mString);
|
||||
void mkdirHandler(const String &pathDirectory);
|
||||
void mlsHandler(const String &pathDirectory);
|
||||
void quoteHandler(const String &commandString);
|
||||
void recvHandler(const String &pathFileName);
|
||||
void userHandler(const String &userInfo);
|
||||
void cdHandler(const String &pathDirectory);
|
||||
void mputHandler(const String &pathFileName);
|
||||
void renameHandler(const String &oldPathFileName,const String &newPathFileName);
|
||||
void lcdHandler(const String &pathDirectory);
|
||||
void rmdirHandler(const String &pathDirectory);
|
||||
void disconnectHandler(void);
|
||||
void asciiHandler(void);
|
||||
void debugHandler(void);
|
||||
void promptHandler(void);
|
||||
void pwdHandler(void);
|
||||
void quitHandler(void);
|
||||
void statusHandler(void);
|
||||
void traceHandler(void);
|
||||
void bellHandler(void);
|
||||
void binaryHandler(void);
|
||||
void byeHandler(void);
|
||||
void globHandler(void);
|
||||
void hashHandler(void);
|
||||
void verboseHandler(void);
|
||||
void helpHandler(void);
|
||||
void closeHandler(void);
|
||||
String mNotConnected;
|
||||
String mNotLoggedIn;
|
||||
Monitor<EditWindow> *mlpEditMonitor;
|
||||
Table mSymbolTable;
|
||||
};
|
||||
|
||||
inline
|
||||
FTPInterpreter::~FTPInterpreter()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
void FTPInterpreter::setDisplay(Monitor<EditWindow> &editMonitor)
|
||||
{
|
||||
mlpEditMonitor=&editMonitor;
|
||||
mlpEditMonitor->enter();
|
||||
(*mlpEditMonitor)->setText(STRING_VERSIONMSG);
|
||||
mlpEditMonitor->leave();
|
||||
}
|
||||
|
||||
inline
|
||||
void FTPInterpreter::setText(const String &lineString)
|
||||
{
|
||||
if(!mlpEditMonitor)return;
|
||||
mlpEditMonitor->enter();
|
||||
(*mlpEditMonitor)->setText(lineString);
|
||||
mlpEditMonitor->leave();
|
||||
}
|
||||
#endif
|
||||
78
ftp/LOGINDLG.CPP
Normal file
78
ftp/LOGINDLG.CPP
Normal file
@@ -0,0 +1,78 @@
|
||||
#include <ftp/logindlg.hpp>
|
||||
|
||||
WORD LoginDialog::performLogin(void)
|
||||
{
|
||||
DialogTemplate dlgTemplate;
|
||||
DialogItemTemplate userEdit;
|
||||
DialogItemTemplate passEdit;
|
||||
DialogItemTemplate userStatic;
|
||||
DialogItemTemplate passStatic;
|
||||
|
||||
dlgTemplate.titleText("Login to host...");
|
||||
dlgTemplate.posRect(Rect(8,19,197,76));
|
||||
dlgTemplate.pointSize(8);
|
||||
dlgTemplate.typeFace("Helv");
|
||||
dlgTemplate.style(DS_MODALFRAME|WS_TABSTOP|WS_VISIBLE|WS_CAPTION|WS_SYSMENU|DS_3DLOOK|DS_SETFONT|WS_POPUP);
|
||||
|
||||
userEdit.className("EDIT");
|
||||
userEdit.titleText("");
|
||||
userEdit.style(WS_BORDER|WS_TABSTOP|WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL);
|
||||
userEdit.posRect(Rect(56,19,98,12));
|
||||
userEdit.itemID(UserNameID);
|
||||
|
||||
passEdit.className("EDIT");
|
||||
passEdit.style(WS_BORDER|WS_TABSTOP|ES_PASSWORD|WS_CHILD|WS_VISIBLE);
|
||||
passEdit.posRect(Rect(56,35,98,12));
|
||||
passEdit.itemID(PasswordID);
|
||||
|
||||
userStatic.className("STATIC");
|
||||
userStatic.titleText("User Name :");
|
||||
userStatic.style(WS_CHILD|WS_VISIBLE);
|
||||
userStatic.posRect(Rect(2,20,39,8));
|
||||
userStatic.itemID(-1);
|
||||
|
||||
passStatic.className("STATIC");
|
||||
passStatic.titleText("Password :");
|
||||
passStatic.style(WS_CHILD|WS_VISIBLE);
|
||||
passStatic.posRect(Rect(2,36,39,8));
|
||||
passStatic.itemID(-1);
|
||||
|
||||
dlgTemplate+=userEdit;
|
||||
dlgTemplate+=passEdit;
|
||||
dlgTemplate+=userStatic;
|
||||
dlgTemplate+=passStatic;
|
||||
|
||||
createDialog(::GetTopWindow((HWND)0),dlgTemplate);
|
||||
if(userName().isNull()&&password().isNull())return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD LoginDialog::dlgCommand(DWORD commandID,CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
switch(commandID)
|
||||
{
|
||||
case IDOK :
|
||||
getText(UserNameID,mUserName);
|
||||
getText(PasswordID,mPassword);
|
||||
if(mUserName.isNull()||mPassword.isNull()){::MessageBeep(0);return TRUE;}
|
||||
break;
|
||||
case IDCANCEL :
|
||||
mUserName.reserve(String::MaxString);
|
||||
mPassword.reserve(String::MaxString);
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL LoginDialog::dlgInitDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
if(!userName().isNull())setText(UserNameID,userName());
|
||||
if(!password().isNull())setText(PasswordID,password());
|
||||
setFocus();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LoginDialog::dlgDestroyDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
}
|
||||
|
||||
69
ftp/LOGINDLG.HPP
Normal file
69
ftp/LOGINDLG.HPP
Normal file
@@ -0,0 +1,69 @@
|
||||
#ifndef _FTP_LOGINDIALOG_HPP_
|
||||
#define _FTP_LOGINDIALOG_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _DIALOG_DYNAMICDIALOG_HPP_
|
||||
#include <dialog/dyndlg.hpp>
|
||||
#endif
|
||||
|
||||
class LoginDialog : public DynamicDialog
|
||||
{
|
||||
public:
|
||||
LoginDialog(void);
|
||||
virtual ~LoginDialog();
|
||||
WORD performLogin(void);
|
||||
String userName(void)const;
|
||||
void userName(const String &userName);
|
||||
String password(void)const;
|
||||
void password(const String &password);
|
||||
private:
|
||||
enum {UserNameID=101,PasswordID=102};
|
||||
LoginDialog(const LoginDialog &loginDialog);
|
||||
WORD dlgCommand(DWORD commandID,CallbackData &someCallbackData);
|
||||
BOOL dlgInitDialog(CallbackData &someCallbackData);
|
||||
void dlgDestroyDialog(CallbackData &someCallbackData);
|
||||
String mUserName;
|
||||
String mPassword;
|
||||
};
|
||||
|
||||
inline
|
||||
LoginDialog::LoginDialog(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
LoginDialog::LoginDialog(const LoginDialog &/*loginDialog*/)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
LoginDialog::~LoginDialog()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
String LoginDialog::userName(void)const
|
||||
{
|
||||
return mUserName;
|
||||
}
|
||||
|
||||
inline
|
||||
void LoginDialog::userName(const String &userName)
|
||||
{
|
||||
mUserName=userName;
|
||||
}
|
||||
|
||||
inline
|
||||
String LoginDialog::password(void)const
|
||||
{
|
||||
return mPassword;
|
||||
}
|
||||
|
||||
inline
|
||||
void LoginDialog::password(const String &password)
|
||||
{
|
||||
mPassword=password;
|
||||
}
|
||||
#endif
|
||||
|
||||
27
ftp/MAIN.CPP
Normal file
27
ftp/MAIN.CPP
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <common/string.hpp>
|
||||
#include <ftp/main.hpp>
|
||||
#include <ftp/mainwnd.hpp>
|
||||
|
||||
HINSTANCE Main::smhInstance=0;
|
||||
HINSTANCE Main::smhPrevInstance=0;
|
||||
int Main::smnCmdShow=0;
|
||||
|
||||
int PASCAL WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR /*lpszCmdLine*/,int nCmdShow)
|
||||
{
|
||||
Main::processInstance(hInstance);
|
||||
Main::previousProcessInstance(hPrevInstance);
|
||||
Main::cmdShow(nCmdShow);
|
||||
if(Main::previousProcessInstance())
|
||||
{
|
||||
HWND hWnd=::FindWindow(MainWindow::className(),MainWindow::className());
|
||||
if(!hWnd)
|
||||
{
|
||||
::MessageBox(::GetFocus(),(LPSTR)"Failed to maximize previous instance",(LPSTR)"Error",MB_ICONSTOP|MB_SYSTEMMODAL);
|
||||
return FALSE;
|
||||
}
|
||||
::PostMessage(hWnd,WM_REACTIVATE,0,0L);
|
||||
return FALSE;
|
||||
}
|
||||
MainWindow applicationWindow(Main::processInstance());
|
||||
return applicationWindow.messageLoop();
|
||||
}
|
||||
68
ftp/MAIN.HPP
Normal file
68
ftp/MAIN.HPP
Normal file
@@ -0,0 +1,68 @@
|
||||
#ifndef _FTP_MAIN_HPP_
|
||||
#define _FTP_MAIN_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
|
||||
class Main
|
||||
{
|
||||
public:
|
||||
static HINSTANCE processInstance(HWND hWnd);
|
||||
static HINSTANCE processInstance(void);
|
||||
static HINSTANCE previousProcessInstance(void);
|
||||
static void processInstance(HINSTANCE processInstance);
|
||||
static void previousProcessInstance(HINSTANCE previousProcessInstance);
|
||||
static void cmdShow(int nCmdShow);
|
||||
private:
|
||||
static HINSTANCE smhInstance;
|
||||
static HINSTANCE smhPrevInstance;
|
||||
static int smnCmdShow;
|
||||
};
|
||||
|
||||
inline
|
||||
void Main::processInstance(HINSTANCE hProcessInstance)
|
||||
{
|
||||
smhInstance=hProcessInstance;
|
||||
}
|
||||
|
||||
inline
|
||||
void Main::previousProcessInstance(HINSTANCE previousProcessInstance)
|
||||
{
|
||||
smhPrevInstance=previousProcessInstance;
|
||||
}
|
||||
|
||||
inline
|
||||
void Main::cmdShow(int nCmdShow)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
HINSTANCE Main::processInstance(void)
|
||||
{
|
||||
return smhInstance;
|
||||
}
|
||||
|
||||
inline
|
||||
HINSTANCE Main::previousProcessInstance(void)
|
||||
{
|
||||
return smhPrevInstance;
|
||||
}
|
||||
|
||||
#if defined(__FLAT__)
|
||||
inline
|
||||
HINSTANCE Main::processInstance(HWND hWnd)
|
||||
{
|
||||
return (HINSTANCE)::GetWindowLong(hWnd,GWL_HINSTANCE);
|
||||
}
|
||||
#else
|
||||
inline
|
||||
HINSTANCE Main::processInstance(HWND hWnd)
|
||||
{
|
||||
return (HINSTANCE)::GetWindowWord(hWnd,GWW_HINSTANCE);
|
||||
}
|
||||
#endif
|
||||
#define WM_REACTIVATE WM_USER+1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
240
ftp/MAINWND.CPP
Normal file
240
ftp/MAINWND.CPP
Normal file
@@ -0,0 +1,240 @@
|
||||
#include <ftp/mainwnd.hpp>
|
||||
#include <ftp/ftpdata.hpp>
|
||||
#include <ftp/hostdlg.hpp>
|
||||
#include <ftp/logindlg.hpp>
|
||||
#include <thread/monitor.hpp>
|
||||
#include <display/editwnd.hpp>
|
||||
#include <common/openfile.hpp>
|
||||
#include <common/assert.hpp>
|
||||
|
||||
char MainWindow::szClassName[]="FTP Interpreter v2.01";
|
||||
char MainWindow::szMenuName[]="FTP";
|
||||
|
||||
MainWindow::MainWindow(HINSTANCE hInstance)
|
||||
: mhInstance(hInstance), mlpEditWindow(0)
|
||||
{
|
||||
mPaintHandler.setCallback(this,&MainWindow::paintHandler);
|
||||
mDestroyHandler.setCallback(this,&MainWindow::destroyHandler);
|
||||
mCommandHandler.setCallback(this,&MainWindow::commandHandler);
|
||||
mKeyDownHandler.setCallback(this,&MainWindow::keyDownHandler);
|
||||
mSizeHandler.setCallback(this,&MainWindow::sizeHandler);
|
||||
mCreateHandler.setCallback(this,&MainWindow::createHandler);
|
||||
mTimerHandler.setCallback(this,&MainWindow::timerHandler);
|
||||
mSetFocusHandler.setCallback(this,&MainWindow::setFocusHandler);
|
||||
mLineHandler.setCallback(this,&MainWindow::lineHandler);
|
||||
mCompletionHandler.setCallback(this,&MainWindow::completionHandler);
|
||||
mFTPThread.setCompletionHandler(&mCompletionHandler);
|
||||
insertHandlers();
|
||||
registerClass();
|
||||
::CreateWindow(szClassName,szClassName,
|
||||
WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_SIZEBOX|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_DLGFRAME|WS_CLIPCHILDREN,
|
||||
CW_USEDEFAULT,CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,CW_USEDEFAULT,
|
||||
NULL,NULL,mhInstance,(LPSTR)this);
|
||||
show(SW_SHOW);
|
||||
update();
|
||||
Rect editRect;
|
||||
editRect.right(width());
|
||||
editRect.bottom(height());
|
||||
KeyControl keyControl;
|
||||
keyControl.canScroll(TRUE);
|
||||
mlpEditWindow=new EditWindow(*this,editRect);
|
||||
mEditMonitor=mlpEditWindow;
|
||||
mEditMonitor.enter();
|
||||
mlpEditWindow->setFont(Font("MS LineDraw",12,Font::PitchFixed|Font::WeightBold));
|
||||
mEditMonitor->setKeyControl(keyControl);
|
||||
mEditMonitor->setLineHandler(&mLineHandler);
|
||||
processCommandLine();
|
||||
mEditMonitor.leave();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
mFTPThread.stop();
|
||||
if(mlpEditWindow){delete mlpEditWindow;mlpEditWindow=0;}
|
||||
destroy();
|
||||
}
|
||||
|
||||
void MainWindow::insertHandlers(void)
|
||||
{
|
||||
insertHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
insertHandler(VectorHandler::PaintHandler,&mPaintHandler);
|
||||
insertHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
insertHandler(VectorHandler::SizeHandler,&mSizeHandler);
|
||||
insertHandler(VectorHandler::KeyDownHandler,&mKeyDownHandler);
|
||||
insertHandler(VectorHandler::CreateHandler,&mCreateHandler);
|
||||
insertHandler(VectorHandler::TimerHandler,&mTimerHandler);
|
||||
insertHandler(VectorHandler::SetFocusHandler,&mSetFocusHandler);
|
||||
}
|
||||
|
||||
void MainWindow::removeHandlers(void)
|
||||
{
|
||||
removeHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
|
||||
removeHandler(VectorHandler::PaintHandler,&mPaintHandler);
|
||||
removeHandler(VectorHandler::CommandHandler,&mCommandHandler);
|
||||
removeHandler(VectorHandler::SizeHandler,&mSizeHandler);
|
||||
removeHandler(VectorHandler::KeyDownHandler,&mKeyDownHandler);
|
||||
removeHandler(VectorHandler::CreateHandler,&mCreateHandler);
|
||||
removeHandler(VectorHandler::TimerHandler,&mTimerHandler);
|
||||
removeHandler(VectorHandler::SetFocusHandler,&mSetFocusHandler);
|
||||
}
|
||||
|
||||
void MainWindow::registerClass(void)const
|
||||
{
|
||||
WNDCLASS wndClass;
|
||||
|
||||
if(::GetClassInfo(mhInstance,className(),(WNDCLASS FAR*)&wndClass))return;
|
||||
wndClass.style =CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS|CS_OWNDC;
|
||||
wndClass.lpfnWndProc =(WNDPROC)Window::WndProc;
|
||||
wndClass.cbClsExtra =0;
|
||||
wndClass.cbWndExtra =sizeof(MainWindow*);
|
||||
wndClass.hInstance =mhInstance;
|
||||
wndClass.hIcon =::LoadIcon(NULL,IDI_APPLICATION);
|
||||
wndClass.hCursor =::LoadCursor(NULL,IDC_ARROW);
|
||||
wndClass.hbrBackground =(HBRUSH)::GetStockObject(BLACK_BRUSH);
|
||||
wndClass.lpszMenuName =szMenuName;
|
||||
wndClass.lpszClassName =szClassName;
|
||||
::RegisterClass(&wndClass);
|
||||
assert(0!=::GetClassInfo(mhInstance,className(),(WNDCLASS FAR*)&wndClass));
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::destroyHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
removeHandlers();
|
||||
::PostQuitMessage(0);
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::sizeHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
if(mlpEditWindow)
|
||||
{
|
||||
mEditMonitor.enter();
|
||||
::MoveWindow((HWND)*((EditWindow*)mEditMonitor),0,0,width(),height(),TRUE);
|
||||
mEditMonitor.leave();
|
||||
}
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::commandHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
switch(someCallbackData.wParam())
|
||||
{
|
||||
case CM_EXIT :
|
||||
postMessage(*this,WM_CLOSE,0,0L);
|
||||
break;
|
||||
case CM_REMOTEHOST :
|
||||
handleRemoteHost();
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::keyDownHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::paintHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::createHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
setTimer(TimerID,250);
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::timerHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
killTimer(TimerID);
|
||||
|
||||
mEditMonitor.enter();
|
||||
mEditMonitor->setFocus();
|
||||
mEditMonitor->setText(mWSASystem.description());
|
||||
mEditMonitor->setText(mWSASystem.systemStatus());
|
||||
mFTPThread.setDisplay(mEditMonitor);
|
||||
mEditMonitor->setFocus();
|
||||
mEditMonitor.leave();
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::lineHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
String lineString;
|
||||
|
||||
mEditMonitor.enter();
|
||||
mEditMonitor->getText(lineString,mlpEditWindow->currentLine()-1);
|
||||
mEditMonitor.leave();
|
||||
lineString.trimRight();
|
||||
if(lineString==String("quit"))postMessage(*this,WM_CLOSE,0,0L);
|
||||
mFTPThread.interpretLine(lineString);
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::setFocusHandler(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
if(mlpEditWindow)
|
||||
{
|
||||
mEditMonitor.enter();
|
||||
mEditMonitor->setFocus();
|
||||
mEditMonitor.leave();
|
||||
}
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
CallbackData::ReturnType MainWindow::completionHandler(CallbackData &someCallbackData)
|
||||
{
|
||||
switch((FTPThread::CompletionCode)someCallbackData.lParam())
|
||||
{
|
||||
case FTPThread::LineComplete :
|
||||
mEditMonitor.enter();
|
||||
mEditMonitor->setText(">>Ready.");
|
||||
mEditMonitor.leave();
|
||||
break;
|
||||
case FTPThread::FileComplete :
|
||||
postMessage(*this,WM_CLOSE,0,0L);
|
||||
break;
|
||||
}
|
||||
return (CallbackData::ReturnType)FALSE;
|
||||
}
|
||||
|
||||
void MainWindow::processCommandLine(void)
|
||||
{
|
||||
String commandLine(::GetCommandLine());
|
||||
|
||||
commandLine=commandLine.betweenString(' ',0);
|
||||
if(commandLine.isNull())return;
|
||||
FileHandle cmdFile(commandLine,FileHandle::Read,FileHandle::ShareRead);
|
||||
if(!cmdFile.isOkay()){mFTPThread.interpretLine(commandLine);return;}
|
||||
cmdFile.close();
|
||||
mFTPThread.interpretFile(commandLine);
|
||||
}
|
||||
|
||||
void MainWindow::message(const String &messageString)
|
||||
{
|
||||
mEditMonitor.enter();
|
||||
mEditMonitor->setText(messageString);
|
||||
mEditMonitor.leave();
|
||||
}
|
||||
|
||||
void MainWindow::message(Block<String> &messageStrings)
|
||||
{
|
||||
for(short itemIndex=0;itemIndex<messageStrings.size();itemIndex++)
|
||||
{
|
||||
mEditMonitor.enter();
|
||||
mEditMonitor->setText(messageStrings[itemIndex]);
|
||||
mEditMonitor.leave();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::handleRemoteHost(void)
|
||||
{
|
||||
HostDialog hostDialog;
|
||||
|
||||
if(!hostDialog.performDialog())return;
|
||||
mFTPThread.interpretLine(String("open ")+hostDialog.remoteHost());
|
||||
}
|
||||
67
ftp/MAINWND.HPP
Normal file
67
ftp/MAINWND.HPP
Normal file
@@ -0,0 +1,67 @@
|
||||
#ifndef _FTP_MAINWINDOW_HPP_
|
||||
#define _FTP_MAINWINDOW_HPP_
|
||||
#ifndef _COMMON_WINDOW_HPP_
|
||||
#include <common/window.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
#ifndef _FTP_FTPTHREAD_HPP_
|
||||
#include <ftp/ftpthrd.hpp>
|
||||
#endif
|
||||
|
||||
class EditWindow;
|
||||
template <class T>
|
||||
class Monitor;
|
||||
|
||||
class MainWindow : public Window
|
||||
{
|
||||
public:
|
||||
MainWindow(HINSTANCE hInstance);
|
||||
virtual ~MainWindow();
|
||||
static String className(void);
|
||||
private:
|
||||
enum{TimerID=0};
|
||||
void registerClass(void)const;
|
||||
void insertHandlers(void);
|
||||
void removeHandlers(void);
|
||||
void processCommandLine(void);
|
||||
void handleRemoteHost(void);
|
||||
void message(const String &messageString);
|
||||
void message(Block<String> &messageStrings);
|
||||
CallbackData::ReturnType paintHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType destroyHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType commandHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType keyDownHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType sizeHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType createHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType timerHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType setFocusHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType lineHandler(CallbackData &someCallbackData);
|
||||
CallbackData::ReturnType completionHandler(CallbackData &someCallbackData);
|
||||
|
||||
Callback<MainWindow> mPaintHandler;
|
||||
Callback<MainWindow> mDestroyHandler;
|
||||
Callback<MainWindow> mCommandHandler;
|
||||
Callback<MainWindow> mKeyDownHandler;
|
||||
Callback<MainWindow> mSizeHandler;
|
||||
Callback<MainWindow> mCreateHandler;
|
||||
Callback<MainWindow> mLineHandler;
|
||||
Callback<MainWindow> mTimerHandler;
|
||||
Callback<MainWindow> mSetFocusHandler;
|
||||
Callback<MainWindow> mCompletionHandler;
|
||||
static char szClassName[];
|
||||
static char szMenuName[];
|
||||
HINSTANCE mhInstance;
|
||||
EditWindow *mlpEditWindow;
|
||||
Monitor<EditWindow> mEditMonitor;
|
||||
FTPThread mFTPThread;
|
||||
WSASystem mWSASystem;
|
||||
};
|
||||
|
||||
inline
|
||||
String MainWindow::className(void)
|
||||
{
|
||||
return String(szClassName);
|
||||
}
|
||||
#endif
|
||||
8
ftp/RESINC.H
Normal file
8
ftp/RESINC.H
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
// menu definitions
|
||||
#define IDC_EDIT1 101
|
||||
#define CM_EXIT 101
|
||||
#define CM_REMOTEHOST 0
|
||||
|
||||
// stringtable definitions
|
||||
#define STRING_VERSIONMSG 100
|
||||
4
ftp/RESINC.HPP
Normal file
4
ftp/RESINC.HPP
Normal file
@@ -0,0 +1,4 @@
|
||||
#ifndef _FTP_RESINC_HPP_
|
||||
#define _FTP_RESINC_HPP_
|
||||
#include <ftp/resinc.h>
|
||||
#endif
|
||||
22
ftp/STDTMPL.CPP
Normal file
22
ftp/STDTMPL.CPP
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef _MSC_VER
|
||||
#define _EXPAND_VECTOR_TEMPLATES_
|
||||
#define _EXPAND_BLOCK_TEMPLATES_
|
||||
#include <common/pvector.hpp>
|
||||
#include <common/pvector.tpp>
|
||||
#include <common/block.hpp>
|
||||
#include <common/block.tpp>
|
||||
#include <common/callback.hpp>
|
||||
#include <common/callback.tpp>
|
||||
#include <common/bitmap.hpp>
|
||||
#include <common/progress.hpp>
|
||||
#include <common/gdata.hpp>
|
||||
#include <common/gdata.tpp>
|
||||
#include <common/puredwrd.hpp>
|
||||
#include <ftp/mainwnd.hpp>
|
||||
|
||||
typedef Block<CallbackPointer> a;
|
||||
typedef Callback<MainWindow> b;
|
||||
typedef GlobalData<BYTE> c;
|
||||
typedef Block<PureDWORD> e;
|
||||
#endif
|
||||
|
||||
83
ftp/Scraps.txt
Normal file
83
ftp/Scraps.txt
Normal file
@@ -0,0 +1,83 @@
|
||||
// ***********************
|
||||
WORD FTPClient::retrieveBlock(const String &controlData,Block<String> &stringBlock)
|
||||
{
|
||||
String responseLine;
|
||||
DWORD responseLines(0);
|
||||
|
||||
stringBlock.remove();
|
||||
if(!isConnected())return FALSE;
|
||||
if(!putControlData(controlData,FALSE))return FALSE;
|
||||
while(mNNTPControl.receive(responseLine))
|
||||
{
|
||||
if(mPeriod==responseLine&&1==responseLine.length())break;
|
||||
if(!responseLines++)
|
||||
{
|
||||
String responseString(responseLine.betweenString(0,' '));
|
||||
if(nackResponse.size()&&isInResponse(responseString,nackResponse))break;
|
||||
if(ackResponse.size()&&isInResponse(responseString,ackResponse))continue;
|
||||
}
|
||||
stringBlock.insert(&responseLine);
|
||||
}
|
||||
return (stringBlock.size()?TRUE:FALSE);
|
||||
}
|
||||
// *************
|
||||
|
||||
|
||||
(*mlpEditMonitor)->setText("FTP Interpreter v1.00 Copyright(c) 1996 Sean M. Kessler");
|
||||
|
||||
|
||||
|
||||
|
||||
//CONNECT DIALOG 6, 15, 156, 63
|
||||
//STYLE DS_ABSALIGN | DS_SYSMODAL | DS_MODALFRAME | 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
//CAPTION "Connect to Remote Host"
|
||||
//FONT 8, "MS Sans Serif"
|
||||
//{
|
||||
// LTEXT "Remote Host:", -1, 6, 12, 49, 8
|
||||
// EDITTEXT IDC_EDIT1, 54, 11, 95, 12
|
||||
// DEFPUSHBUTTON "Connect", IDOK, 35, 30, 50, 14
|
||||
// PUSHBUTTON "Cancel", IDCANCEL, 93, 30, 50, 14
|
||||
//}
|
||||
|
||||
|
||||
|
||||
CONNECT DIALOG 6, 15, 156, 63
|
||||
STYLE DS_ABSALIGN | DS_SYSMODAL | DS_MODALFRAME | 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Connect to Remote Host"
|
||||
FONT 8, "MS Sans Serif"
|
||||
{
|
||||
LTEXT "Remote Host:", -1, 6, 12, 49, 8
|
||||
EDITTEXT IDC_EDIT1, 54, 11, 95, 12
|
||||
DEFPUSHBUTTON "Connect", IDOK, 35, 30, 50, 14
|
||||
PUSHBUTTON "Cancel", IDCANCEL, 93, 30, 50, 14
|
||||
}
|
||||
|
||||
|
||||
|
||||
//#ifndef _DISPLAY_EDITWINDOW_HPP_
|
||||
//#include <display/editwnd.hpp>
|
||||
//#endif
|
||||
//#ifndef _THREAD_MONITOR_HPP_
|
||||
//#include <thread/monitor.hpp>
|
||||
//#endif
|
||||
|
||||
|
||||
//#ifndef _FTP_INTERPRETER_HPP_
|
||||
//#include <ftp/interprt.hpp>
|
||||
//#endif
|
||||
//#ifndef _FTP_FTPCLIENT_HPP_
|
||||
//#include <ftp/ftp.hpp>
|
||||
//#endif
|
||||
|
||||
|
||||
#ifndef _COMMON_POINT_HPP_
|
||||
#include <common/point.hpp>
|
||||
#endif
|
||||
|
||||
|
||||
void MainWindow::message(const String &messageString)
|
||||
{
|
||||
// mEditMonitor.enter();
|
||||
mlpEditWindow->setText(messageString);
|
||||
// mEditMonitor.leave();
|
||||
}
|
||||
205
ftp/ftp.001
Normal file
205
ftp/ftp.001
Normal file
@@ -0,0 +1,205 @@
|
||||
# Microsoft Developer Studio Project File - Name="ftp" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=ftp - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ftp.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ftp.mak" CFG="ftp - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ftp - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "ftp - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\Release"
|
||||
# PROP BASE Intermediate_Dir ".\Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\Debug"
|
||||
# PROP BASE Intermediate_Dir ".\Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ".\msvcobj"
|
||||
# PROP Intermediate_Dir ".\msvcobj"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /Zp1 /MTd /Z7 /O2 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__FLAT__" /D "STRICT" /Fp"c:\work\exe\msvc42.pch" /YX"windows.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /pdb:none /debug /debugtype:both /machine:I386 /out:"..\exe\ftp.exe"
|
||||
# SUBTRACT LINK32 /nodefaultlib
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "ftp - Win32 Release"
|
||||
# Name "ftp - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftp.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftp.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftpdata.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ftpthrd.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\hostdlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Interprt.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Logindlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Main.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Mainwnd.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Exe\mscommon.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Exe\msdialog.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Exe\msdisp.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Exe\msparse.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Exe\mssocket.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\exe\msthread.lib
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Stdtmpl.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftp.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftpdata.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftpthrd.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Hostdlg.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Interprt.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Logindlg.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Main.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Mainwnd.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Resinc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Resinc.hpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
182
ftp/ftp.dsp
Normal file
182
ftp/ftp.dsp
Normal file
@@ -0,0 +1,182 @@
|
||||
# Microsoft Developer Studio Project File - Name="ftp" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=ftp - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ftp.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ftp.mak" CFG="ftp - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ftp - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "ftp - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "ftp - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\Release"
|
||||
# PROP BASE Intermediate_Dir ".\Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftp - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\Debug"
|
||||
# PROP BASE Intermediate_Dir ".\Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ".\msvcobj"
|
||||
# PROP Intermediate_Dir ".\msvcobj"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /Zp8 /MTd /Z7 /O2 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__FLAT__" /D "STRICT" /Fp"\work\exe\msvc42.pch" /YX"windows.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386
|
||||
# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib /nologo /subsystem:windows /pdb:none /debug /debugtype:both /machine:I386 /out:"..\exe\ftp.exe"
|
||||
# SUBTRACT LINK32 /nodefaultlib
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "ftp - Win32 Release"
|
||||
# Name "ftp - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftp.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftp.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftpdata.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ftpthrd.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\hostdlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Interprt.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Logindlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Main.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Mainwnd.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Stdtmpl.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftp.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftpdata.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Ftpthrd.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Hostdlg.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Interprt.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Logindlg.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Main.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Mainwnd.hpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Resinc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Resinc.hpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
119
ftp/ftp.dsw
Normal file
119
ftp/ftp.dsw
Normal file
@@ -0,0 +1,119 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "common"=..\COMMON\common.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "dialog"=..\DIALOG\Dialog.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "display"=..\DISPLAY\display.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ftp"=.\ftp.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name common
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name dialog
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name display
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name socket
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name thread
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name parse
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "parse"=..\PARSE\Parse.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "socket"=..\SOCKET\socket.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "thread"=..\THREAD\thread.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Reference in New Issue
Block a user