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);
98 struct timeval idletime;
99 FtpCallbackXfer xfercb;
100 FtpCallbackIdle idlecb;
101 FtpCallbackLog logcb;
113 FtpCallbackCert certcb;
162 char* LastResponse();
163 int Connect(
const char *host);
164 int Login(
const char *user,
const char *pass);
165 int Site(
const char *cmd);
166 int Raw(
const char *cmd);
167 int SysType(
char *buf,
int max);
168 int Mkdir(
const char *path);
169 int Chdir(
const char *path);
171 int Rmdir(
const char *path);
172 int Pwd(
char *path,
int max);
173 int Nlst(
const char *outputfile,
const char *path);
174 int Dir(
const char *outputfile,
const char *path);
175 int Size(
const char *path,
int *size, transfermode mode);
176 int ModDate(
const char *path,
char *dt,
int max);
177 int Get(
const char *outputfile,
const char *path, transfermode mode, off64_t offset = 0);
178 int Put(
const char *inputfile,
const char *path, transfermode mode, off64_t offset = 0);
179 int Rename(
const char *src,
const char *dst);
180 int Delete(
const char *path);
182 void SetCallbackIdleFunction(FtpCallbackIdle pointer);
183 void SetCallbackLogFunction(FtpCallbackLog pointer);
184 void SetCallbackXferFunction(FtpCallbackXfer pointer);
185 void SetCallbackArg(
void *arg);
186 void SetCallbackBytes(off64_t bytes);
187 void SetCorrectPasv(
bool b) { mp_ftphandle->correctpasv = b; };
188 void SetCallbackIdletime(
int time);
189 void SetConnmode(connmode mode);
190 static int Fxp(
ftplib* src,
ftplib* dst,
const char *pathSrc,
const char *pathDst, transfermode mode, fxpmethod method);
191 ftphandle* RawOpen(
const char *path, accesstype type, transfermode mode);
193 int RawWrite(
void* buf,
int len,
ftphandle* handle);
194 int RawRead(
void* buf,
int max,
ftphandle* handle);
195 int TestControlConnection();
197 int SetDataEncryption(dataencryption enc);
198 int NegotiateEncryption();
199 void SetCallbackCertFunction(FtpCallbackCert pointer);
204 int FtpXfer(
const char *localfile,
const char *path,
ftphandle *nControl, accesstype type, transfermode mode);
205 int FtpOpenPasv(
ftphandle *nControl,
ftphandle **nData, transfermode mode,
int dir,
char *cmd);
206 int FtpSendCmd(
const char *cmd,
char expresp,
ftphandle *nControl);
208 int FtpOpenPort(
ftphandle *nControl,
ftphandle **nData, transfermode mode,
int dir,
char *cmd);
209 int FtpRead(
void *buf,
int max,
ftphandle *nData);
210 int FtpWrite(
void *buf,
int len,
ftphandle *nData);
211 int FtpAccess(
const char *path, accesstype type, transfermode mode,
ftphandle *nControl,
ftphandle **nData);
214 int readline(
char *buf,
int max,
ftphandle *ctl);
215 int writeline(
char *buf,
int len,
ftphandle *nData);
216 int readresp(
char c,
ftphandle *nControl);
217 void sprint_rest(
char *buf, off64_t offset);
219 int CorrectPasvResponse(
unsigned char *v);
Definition: to_string.h:49