31 # define DLLIMPORT __declspec (dllexport) 33 # define DLLIMPORT __declspec (dllimport) 40 #define fseeko64 fseek 54 #if defined(__APPLE__) 55 #define off64_t __darwin_off_t 56 #define fseeko64 fseeko 61 typedef struct ssl_st SSL;
62 typedef struct ssl_ctx_st SSL_CTX;
63 typedef struct bio_st BIO;
64 typedef struct x509_st X509;
66 #include <sys/types.h> 68 #ifndef _FTPLIB_SSL_CLIENT_METHOD_ 69 #define _FTPLIB_SSL_CLIENT_METHOD_ TLSv1_2_client_method 75 typedef struct ssl_st SSL;
76 typedef struct ssl_ctx_st SSL_CTX;
77 typedef struct bio_st BIO;
78 typedef struct x509_st X509;
84 typedef int (*FtpCallbackXfer)(off64_t xfered,
void *arg);
85 typedef int (*FtpCallbackIdle)(
void *arg);
86 typedef void (*FtpCallbackLog)(
char *str,
void* arg,
bool out);
88 typedef bool (*FtpCallbackCert)(
void *arg, X509 *cert);
99 struct timeval idletime;
100 FtpCallbackXfer xfercb;
101 FtpCallbackIdle idlecb;
102 FtpCallbackLog logcb;
114 FtpCallbackCert certcb;
163 char* LastResponse();
164 int Connect(
const char *host);
165 int Login(
const char *user,
const char *pass);
166 int Site(
const char *cmd);
167 int Raw(
const char *cmd);
168 int SysType(
char *buf,
int max);
169 int Mkdir(
const char *path);
170 int Chdir(
const char *path);
172 int Rmdir(
const char *path);
173 int Pwd(
char *path,
int max);
174 int Nlst(
const char *outputfile,
const char *path);
175 int Dir(
const char *outputfile,
const char *path);
176 int Size(
const char *path,
int *size, transfermode mode);
177 int ModDate(
const char *path,
char *dt,
int max);
178 int Get(
const char *outputfile,
const char *path, transfermode mode, off64_t offset = 0);
179 int Put(
const char *inputfile,
const char *path, transfermode mode, off64_t offset = 0);
180 int Rename(
const char *src,
const char *dst);
181 int Delete(
const char *path);
183 void SetCallbackIdleFunction(FtpCallbackIdle pointer);
184 void SetCallbackLogFunction(FtpCallbackLog pointer);
185 void SetCallbackXferFunction(FtpCallbackXfer pointer);
186 void SetCallbackArg(
void *arg);
187 void SetCallbackBytes(off64_t bytes);
188 void SetCorrectPasv(
bool b) { mp_ftphandle->correctpasv = b; };
189 void SetCallbackIdletime(
int time);
190 void SetConnmode(connmode mode);
191 static int Fxp(
ftplib* src,
ftplib* dst,
const char *pathSrc,
const char *pathDst, transfermode mode, fxpmethod method);
192 ftphandle* RawOpen(
const char *path, accesstype type, transfermode mode);
194 int RawWrite(
void* buf,
int len,
ftphandle* handle);
195 int RawRead(
void* buf,
int max,
ftphandle* handle);
196 int TestControlConnection();
198 int SetDataEncryption(dataencryption enc);
199 int NegotiateEncryption();
200 void SetCallbackCertFunction(FtpCallbackCert pointer);
205 int FtpXfer(
const char *localfile,
const char *path,
ftphandle *nControl, accesstype type, transfermode mode);
206 int FtpOpenPasv(
ftphandle *nControl,
ftphandle **nData, transfermode mode,
int dir,
char *cmd);
207 int FtpSendCmd(
const char *cmd,
char expresp,
ftphandle *nControl);
209 int FtpOpenPort(
ftphandle *nControl,
ftphandle **nData, transfermode mode,
int dir,
char *cmd);
210 int FtpRead(
void *buf,
int max,
ftphandle *nData);
211 int FtpWrite(
void *buf,
int len,
ftphandle *nData);
212 int FtpAccess(
const char *path, accesstype type, transfermode mode,
ftphandle *nControl,
ftphandle **nData);
215 int readline(
char *buf,
int max,
ftphandle *ctl);
216 int writeline(
char *buf,
int len,
ftphandle *nData);
217 int readresp(
char c,
ftphandle *nControl);
218 void sprint_rest(
char *buf, off64_t offset);
220 int CorrectPasvResponse(
unsigned char *v);