37 struct MyProgressData {
45 int s = (int)output.
size();
52 int output = *((
int *)fd);
58 #pragma GCC diagnostic push
59 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
67 pd->sr->update(pd->totalSize, xfered);
69 if (*(pd->term))
return 0;
75 #pragma GCC diagnostic pop
114 SWLOGD(
"connected. logging in...\n");
137 SWLOGD(
"FTPLibFTPTransport::getURL(%s, %s, ...);\n", (destPath)?destPath:
"(null)", sourceURL);
140 if (retVal)
return retVal;
141 SWLOGD(
"FTPLibFTPTransport - logged in.\n");
143 SWBuf sourcePath = sourceURL;
151 SWLOGD(
"getting file %s to %s\n", sourcePath.
c_str(), destBuf ?
"*internal buffer*" : outFile.
c_str());
152 struct MyProgressData pd;
174 SWLOGD(
"getting real directory %s\n", sourcePath.
c_str());
176 SWLOGD(
"got real directory %s to %s\n", sourcePath.
c_str(), destBuf ?
"*internal buffer*" : outFile.
c_str());
186 SWLOGD(
"FTPLibFTPTransport - returning: %d\n", retVal);
#define SWORD_NAMESPACE_START
FTPLibFTPTransport(const char *host, StatusReporter *statusReporter=0)
unsigned long length() const
~FTPLibFTPTransport_init()
#define FTPLIB_CALLBACK_WRITER
static SWLog * getSystemLog()
char getURL(const char *destPath, const char *sourceURL, SWBuf *destBuf=0)
#define FTPLIB_CALLBACK_WRITERARG
GLOBALDEF void FtpInit(void)
GLOBALDEF int FtpConnect(const char *host, netbuf **nControl)
GLOBALDEF int FtpOptions(int opt, long val, netbuf *nControl)
GLOBALDEF int FtpLogin(const char *user, const char *pass, netbuf *nControl)
static void closeFile(int fd)
GLOBALDEF void FtpQuit(netbuf *nControl)
bool endsWith(const SWBuf &postfix) const
static int my_fprogress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
static class SWORD_NAMESPACE_START::FTPLibFTPTransport_init _ftpLibFTPTransport_init
GLOBALDEF int FtpGet(const char *outputfile, const char *path, char mode, netbuf *nControl)
const char * c_str() const
GLOBALDEF int FtpDir(const char *outputfile, const char *path, netbuf *nControl)
static int my_swbufwriter(netbuf *nControl, void *buffer, size_t size, void *swbuf)
FTPLibFTPTransport_init()
unsigned long size() const
static int my_filewriter(netbuf *nControl, void *buffer, size_t size, void *fd)
static long write(int fd, const void *buf, long count)
GLOBALDEF int FtpSize(const char *path, int *size, char mode, netbuf *nControl)
static int createPathAndFile(const char *fName)
void logError(const char *fmt,...) const
#define FTPLIB_CALLBACKARG
#define SWORD_NAMESPACE_END
StatusReporter * statusReporter
#define FTPLIB_CALLBACKBYTES