12#if defined(WIN32) || defined(_WINDOWS)
13# define ASCII_TRANSLATION 0
16#ifndef ASCII_TRANSLATION
17# define ASCII_TRANSLATION 1
20#if !defined(NO_SIGNALS) && (USE_SIO || !defined(SIGALRM) || !defined(SIGPIPE) || !defined(SIGINT))
31static int gCanBrokenDataJmp = 0;
39# define O_BINARY _O_BINARY
55 if (gCanBrokenDataJmp != 0) {
56 gCanBrokenDataJmp = 0;
60 longjmp(gBrokenDataJmp, 1);
111 if (now < cip->nextProgressUpdate)
174FTPList(
const FTPCIPtr cip,
const int outfd,
const int longMode,
const char *
const lsflag)
178 char secondaryBuf[768];
180 char *secBufPtr, *secBufLimit;
193 cmd = (longMode != 0) ?
"LIST" :
"NLST";
194 if ((lsflag ==
NULL) || (lsflag[0] ==
'\0')) {
216 Error(cip,
kDontPerror,
"Could not directory listing data -- timed out.\n");
252 secBufPtr = secondaryBuf +
sizeof(secondaryBuf);
253 secBufLimit = (
char *) 0;
329 STRNCAT(optstr,
"UNIX.owner;");
339 STRNCAT(optstr,
"UNIX.group;");
353 optstrlen =
strlen(optstr);
355 if (optstr[optstrlen - 1] ==
';')
356 optstr[optstrlen - 1] =
'\0';
368 char secondaryBuf[768];
375 char *secBufPtr, *secBufLimit;
402 if (tryMLSD != (
int *) 0)
404 if (lsflags[0] ==
'-') {
408 lim = lsflags1 +
sizeof(lsflags1) - 2;
409 for (; *scp !=
'\0'; scp++) {
413 }
else if (dcp < lim) {
434 (lsflags1[0] ==
'\0') ?
"" :
" ",
436 (
pattern[0] ==
'\0') ?
"" :
" ",
455 Error(cip,
kDontPerror,
"Could not directory listing data -- timed out.\n");
473 if ((blankLines == 0) && (
result <= 1))
499 gCanBrokenDataJmp = 0;
504 sj =
setjmp(gBrokenDataJmp);
513 gCanBrokenDataJmp = 1;
520 secBufPtr = secondaryBuf +
sizeof(secondaryBuf);
521 secBufLimit = (
char *) 0;
522 memset(secondaryBuf, 0,
sizeof(secondaryBuf));
607 while ((xferTimeout <= 0) || (wsecs < xferTimeout)) {
608 if ((cip->
cancelXfer != 0) && (ocancelXfer == 0)) {
635#if !defined(NO_SIGNALS)
652 const char *
const file,
653 const char *
volatile dstfile,
656 const int appendflag,
657 const char *
volatile tmppfx,
658 const char *
volatile tmpsfx,
659 const int resumeflag,
660 const int deleteflag,
665 const char *odstfile;
681#if !defined(NO_SIGNALS)
685 volatile int vfd, vfdtouse;
687 volatile int vzaction;
709 if ((fstatrc == 0) && (
S_ISDIR(st.st_mode))) {
769 zaction = (*resumeProc)(
file, (
longest_int) st.st_size, st.st_mtime, &dstfile, startPoint, mdtm, &startPoint);
791 }
else if ((
longest_int) st.st_size == startPoint) {
879 gCanBrokenDataJmp = 0;
884 sj =
setjmp(gBrokenDataJmp);
896 gCanBrokenDataJmp = 1;
912 if ((tmppfx[0] !=
'\0') || (tmpsfx[0] !=
'\0')) {
943 cip->
errNo = tmpResult;
947#if !defined(NO_SIGNALS)
953 if ((startPoint != 0) && (cip->
startPoint == 0)) {
964#if !defined(NO_SIGNALS)
977 if ((fstatrc == 0) && (
S_ISREG(st.st_mode) != 0)) {
979 cip->
mdtm = st.st_mtime;
982 cip->
rname = odstfile;
996#if !defined(NO_SIGNALS)
997 gCanBrokenDataJmp = 0;
1009 }
else if (nread == 0) {
1014#if !defined(NO_SIGNALS)
1015 gCanBrokenDataJmp = 1;
1018 srclim =
src + nread;
1020 while (
src < srclim) {
1028#if !defined(NO_SIGNALS)
1082 }
while (ntowrite > 0);
1090#if !defined(NO_SIGNALS)
1091 gCanBrokenDataJmp = 0;
1104 }
else if (nread == 0) {
1109#if !defined(NO_SIGNALS)
1110 gCanBrokenDataJmp = 1;
1166 }
while (nread > 0);
1196#if !defined(NO_SIGNALS)
1197 gCanBrokenDataJmp = 0;
1223 if ((tmppfx[0] !=
'\0') || (tmpsfx[0] !=
'\0')) {
1240 if (
FTPUtime(cip, odstfile, st.st_atime, st.st_mtime, st.st_ctime) !=
kNoErr) {
1252#if !defined(NO_SIGNALS)
1264 const char *
const file,
1265 const char *
const dstfile,
1268 const int appendflag,
1269 const char *
const tmppfx,
1270 const char *
const tmpsfx,
1271 const int resumeflag,
1272 const int deleteflag,
1284 if ((dstfile ==
NULL) || (dstfile[0] ==
'\0'))
1290 result =
FTPPutOneF(cip,
file, dstfile, xtype, fdtouse, appendflag, tmppfx, tmpsfx, resumeflag, deleteflag, resumeProc);
1301 const char *
const dstdir1,
1306 const char *
const tmppfx,
1307 const char *
const tmpsfx,
1308 const int resumeflag,
1309 const int deleteflag,
1327 if (dstdir1 ==
NULL) {
1330 dstdir =
STRNCPY(dstdir2, dstdir1);
1351 for (filePtr = files.
first; filePtr !=
NULL; filePtr = filePtr->
next) {
1352 PrintF(cip,
" R=%s, L=%s, 2=%s, size=%d, mdtm=%u, type=%c\n",
1357 (
unsigned int) filePtr->
mdtm,
1364 for (filePtr = files.
first; filePtr !=
NULL; filePtr = filePtr->
next) {
1366 if (batchResult ==
kNoErr)
1370 if (filePtr->
type ==
'd') {
1377 }
else if (filePtr->
type ==
'l') {
1384 result =
FTPPutOneF(cip, filePtr->
lname, filePtr->
rname, xtype, -1, appendflag, tmppfx, tmpsfx, resumeflag, deleteflag, resumeProc);
1397 result =
FTPPutOneF(cip, filePtr->
lname, filePtr->
rname, xtype, -1, appendflag, tmppfx, tmpsfx, resumeflag, deleteflag, resumeProc);
1412 if (batchResult < 0)
1413 cip->
errNo = batchResult;
1414 return (batchResult);
1435 if (xferTimeout < 1)
1446 while ((xferTimeout <= 0) || (wsecs < xferTimeout)) {
1447 if ((cip->
cancelXfer != 0) && (ocancelXfer == 0)) {
1474#if !defined(NO_SIGNALS)
1492OpenTar(
const FTPCIPtr cip,
const char *
const dstdir,
int *
const pid)
1506 if (pipe(pipe1) < 0) {
1511 pid1 = (
int) fork();
1516 }
else if (pid1 == 0) {
1518 if ((dstdir !=
NULL) && (dstdir[0] !=
'\0') && (
chdir(dstdir) < 0)) {
1526 for (
i=3;
i<256;
i++)
1529 argv[0] = (
char *)
"tar";
1530 argv[1] = (
char *)
"xpf";
1531 argv[2] = (
char *)
"-";
1549FTPGetOneTarF(
const FTPCIPtr cip,
const char *
file,
const char *
const dstdir)
1558 const char *
volatile vfile;
1566 char *
volatile basecp;
1571 if ((
file[0] ==
'\0') || ((
file[0] ==
'/') && (
file[1] ==
'\0'))) {
1594 if (basecp !=
NULL) {
1598 if (
FTPGetCWD(cip, savedCwd,
sizeof(savedCwd)) != 0) {
1615 fd = OpenTar(cip, dstdir, &
pid);
1632 gCanBrokenDataJmp = 0;
1634#ifdef HAVE_SIGSETJMP
1637 sj =
setjmp(gBrokenDataJmp);
1660 return(vcip->
errNo);
1662 gCanBrokenDataJmp = 1;
1668 if (tmpResult < 0) {
1719#if !defined(NO_SIGNALS)
1720 gCanBrokenDataJmp = 1;
1730 }
else if (nread < 0) {
1737 }
else if (nread == 0) {
1749 }
else if (nread == 0) {
1752 gCanBrokenDataJmp = 0;
1756 if (nwrote != nread) {
1772#if !defined(NO_SIGNALS)
1775 gCanBrokenDataJmp = 0;
1792 if ((tmpResult < 0) && (
result == 0)) {
1797#if !defined(NO_SIGNALS)
1819 const char *
const file,
1820 const char *dstfile,
1825 const int resumeflag,
1826 const int appendflag,
1827 const int deleteflag,
1836#if ASCII_TRANSLATION
1844#if !defined(NO_SIGNALS)
1847 volatile int vfd, vfdtouse;
1850 volatile int created = 0;
1859 return (cip->
errNo);
1912 statrc =
Stat(dstfile, &st);
1914 if (resumeProc !=
NULL) {
1915 zaction = (*resumeProc)(
1949 if ((st.st_mtime >
now) || (((
now - st.st_mtime) < 46200) && ((
now - mdtm) >= 46200)))
1955 if (startPoint == expectedSize) {
1960 return (cip->
errNo);
1961 }
else if (startPoint > expectedSize) {
1969 }
else if ((mdtm == st.st_mtime) || (mdtm == (st.st_mtime - 1)) || (mdtm == (st.st_mtime + 1))) {
1973 if (startPoint == expectedSize) {
1978 return (cip->
errNo);
1979 }
else if (startPoint > expectedSize) {
1993 }
else if (mdtm < st.st_mtime) {
1999 return (cip->
errNo);
2021 return (cip->
errNo);
2029 if (startPoint == expectedSize) {
2035 }
else if (startPoint > expectedSize) {
2052 Error(cip,
kDoPerror,
"Cannot open local file %s for writing.\n", dstfile);
2060#if defined(WIN32) || defined(_WINDOWS)
2111 gCanBrokenDataJmp = 0;
2113#ifdef HAVE_SIGSETJMP
2116 sj =
setjmp(gBrokenDataJmp);
2126 return(vcip->
errNo);
2128 gCanBrokenDataJmp = 1;
2133 if (tmpResult < 0) {
2143#if !defined(NO_SIGNALS)
2149 if ((startPoint != 0) && (cip->
startPoint == 0)) {
2160#if !defined(NO_SIGNALS)
2163 return (cip->
errNo);
2176 cip->
lname = dstfile;
2182#if ASCII_TRANSLATION
2210 }
else if (nread < 0) {
2223 }
else if (nread == 0) {
2227 gCanBrokenDataJmp = 1;
2245 }
else if (nread == 0) {
2249 gCanBrokenDataJmp = 0;
2253 srclim =
src + nread;
2255 dstlim =
dst +
sizeof(outbuf);
2256 while (
src < srclim) {
2261 if (
dst >= dstlim) {
2262 nwrote =
write(
fd, outbuf, (
size_t) (
dst - outbuf));
2263 if (nwrote == (
int) (
dst - outbuf)) {
2283 nwrote =
write(
fd, outbuf, (
size_t) (
dst - outbuf));
2284 if (nwrote != (
int) (
dst - outbuf)) {
2336 }
else if (nread < 0) {
2349 }
else if (nread == 0) {
2353 gCanBrokenDataJmp = 1;
2370 }
else if (nread == 0) {
2373 gCanBrokenDataJmp = 0;
2377 if (nwrote != nread) {
2403#if ASCII_TRANSLATION
2407#if !defined(NO_SIGNALS)
2410 gCanBrokenDataJmp = 0;
2423 if ((tmpResult < 0) && (
result == 0)) {
2428#if !defined(NO_SIGNALS)
2453 const char *
const file,
2454 const char *
const dstfile,
2457 const int resumeflag,
2458 const int appendflag,
2459 const int deleteflag,
2474 if ((dstfile ==
NULL) || (dstfile[0] ==
'\0'))
2478 result =
FTPGetOneF(cip,
file, dstfile, xtype, fdtouse,
kSizeUnknown,
kModTimeUnknown, resumeflag, appendflag, deleteflag, resumeProc);
2488 const char *pattern1,
2489 const char *
const dstdir1,
2493 const int resumeflag,
2495 const int deleteflag,
2510 char *pattern2, *dstdir2;
2520 if (pattern1 ==
NULL)
2526 if (dstdir1 ==
NULL) {
2529 dstdir2 =
StrDup(dstdir1);
2530 if (dstdir2 ==
NULL) {
2538 pattern2 =
StrDup(pattern1);
2539 if (pattern2 ==
NULL) {
2564 if (batchResult !=
kNoErr) {
2565 errRc = batchResult;
2571 for (itemPtr = globList.
first; itemPtr !=
NULL; itemPtr = itemPtr->
next) {
2594 for (filePtr = files.
first; filePtr !=
NULL; filePtr = filePtr->
next) {
2595 PrintF(cip,
" R=%s, L=%s, 2=%s, size=%d, mdtm=%u, type=%c\n",
2600 (
unsigned int) filePtr->
mdtm,
2607 for (filePtr = files.
first; filePtr !=
NULL; filePtr = filePtr->
next) {
2609 if (batchResult ==
kNoErr)
2613 if (filePtr->
type ==
'd') {
2614#if defined(WIN32) || defined(_WINDOWS)
2619 }
else if (filePtr->
type ==
'l') {
2622 result =
FTPGetOneF(cip, filePtr->
rname, filePtr->
lname, xtype, -1, filePtr->
size, filePtr->
mdtm, resumeflag, appendflag, deleteflag, resumeProc);
2635 ldir = filePtr->
lname;
2648 if (
MkDirs(ldir, 00777) < 0) {
2649 Error(cip,
kDoPerror,
"Could not create local directory \"%s\"\n", ldir);
2657 result =
FTPGetOneF(cip, filePtr->
rname, filePtr->
lname, xtype, -1, filePtr->
size, filePtr->
mdtm, resumeflag, appendflag, deleteflag, resumeProc);
2678 for (filePtr = files.
first; filePtr !=
NULL; filePtr = filePtr->
next) {
2679 if (filePtr->
type ==
'l') {
2694 if (batchResult < 0)
2695 cip->
errNo = batchResult;
2696 errRc = batchResult;
2699 if (dstdir2 !=
NULL)
2701 if (pattern2 !=
NULL)
2721FTPGetOneFile2(
const FTPCIPtr cip,
const char *
const file,
const char *
const dstfile,
const int xtype,
const int fdtouse,
const int resumeflag,
const int appendflag)
2732 return (
FTPGetFiles3(cip,
pattern, dstdir, recurse, doGlob,
kTypeBinary,
kResumeNo,
kAppendNo,
kDeleteNo,
kTarYes, (
ConfirmResumeDownloadProc) 0, 0));
2739FTPGetFiles2(
const FTPCIPtr cip,
const char *
const pattern,
const char *
const dstdir,
const int recurse,
const int doGlob,
const int xtype,
const int resumeflag,
const int appendflag)
2741 return (
FTPGetFiles3(cip,
pattern, dstdir, recurse, doGlob, xtype, resumeflag, appendflag,
kDeleteNo,
kTarYes, (
ConfirmResumeDownloadProc) 0, 0));
2759 return (
FTPGetFiles3(cip,
pattern, dstdir, recurse, doGlob,
kTypeAscii,
kResumeNo,
kAppendNo,
kDeleteNo,
kTarNo, (
ConfirmResumeDownloadProc) 0, 0));
2768 return (
FTPPutOneFile3(cip,
file, dstfile,
kTypeBinary, -1, 0,
NULL,
NULL,
kResumeNo,
kDeleteNo,
NoConfirmResumeUploadProc, 0));
2775FTPPutOneFile2(
const FTPCIPtr cip,
const char *
const file,
const char *
const dstfile,
const int xtype,
const int fdtouse,
const int appendflag,
const char *
const tmppfx,
const char *
const tmpsfx)
2777 return (
FTPPutOneFile3(cip,
file, dstfile, xtype, fdtouse, appendflag, tmppfx, tmpsfx,
kResumeNo,
kDeleteNo,
NoConfirmResumeUploadProc, 0));
2786 return (
FTPPutFiles3(cip,
pattern, dstdir, recurse, doGlob,
kTypeBinary, 0,
NULL,
NULL,
kResumeNo,
kDeleteNo,
NoConfirmResumeUploadProc, 0));
2793FTPPutFiles2(
const FTPCIPtr cip,
const char *
const pattern,
const char *
const dstdir,
const int recurse,
const int doGlob,
const int xtype,
const int appendflag,
const char *
const tmppfx,
const char *
const tmpsfx)
2795 return (
FTPPutFiles3(cip,
pattern, dstdir, recurse, doGlob, xtype, appendflag, tmppfx, tmpsfx,
kResumeNo,
kDeleteNo,
NoConfirmResumeUploadProc, 0));
2804 return (
FTPPutOneFile3(cip,
file, dstfile,
kTypeAscii, -1, 0,
NULL,
NULL,
kResumeNo,
kDeleteNo,
NoConfirmResumeUploadProc, 0));
2813 return (
FTPPutFiles3(cip,
pattern, dstdir, recurse, doGlob,
kTypeAscii, 0,
NULL,
NULL,
kResumeNo,
kDeleteNo,
NoConfirmResumeUploadProc, 0));
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
char * strchr(const char *String, int ch)
#define gettimeofday(tv, tz)
#define STRNCPY(dst, src, n)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLint GLboolean GLint GLenum access
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
int FTPLocalRecursiveFileList(FTPCIPtr cip, LineListPtr fileList, FileInfoListPtr files)
int FTPRemoteRecursiveFileList1(FTPCIPtr cip, char *const rdir, FileInfoListPtr files)
int FTPLocalGlob(FTPCIPtr cip, LineListPtr fileList, const char *pattern, int doGlob)
int FTPRemoteGlob(FTPCIPtr cip, LineListPtr fileList, const char *pattern, int doGlob)
_Check_return_ _CRTIMP int __cdecl iscntrl(_In_ int _C)
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
#define SELECT_TYPE_ARG234
int ComputeLNames(FileInfoListPtr dst, const char *srcdir, const char *dstdir, int nochop)
void InitLineList(LineListPtr list)
int ComputeRNames(FileInfoListPtr dst, const char *dstdir, int pflag, int nochop)
int LineToFileInfoList(LinePtr lp, FileInfoListPtr dst)
void DisposeFileInfoListContents(FileInfoListPtr list)
int LineListToFileInfoList(LineListPtr src, FileInfoListPtr dst)
void DisposeLineListContents(LineListPtr list)
LinePtr AddLine(LineListPtr list, const char *buf1)
int FTPSymlink(const FTPCIPtr cip, const char *const lfrom, const char *const lto)
int FTPFileSizeAndModificationTime(const FTPCIPtr cip, const char *const file, longest_int *const size, const int type, time_t *const mdtm)
int FTPMkdir(const FTPCIPtr cip, const char *const newDir, const int recurse)
int FTPUtime(const FTPCIPtr cip, const char *const file, time_t actime, time_t modtime, time_t crtime)
int FTPFileModificationTime(const FTPCIPtr cip, const char *const file, time_t *const mdtm)
int FTPFileExists2(const FTPCIPtr cip, const char *const file, const int tryMDTM, const int trySIZE, const int tryMLST, const int trySTAT, const int tryNLST)
int FTPDelete(const FTPCIPtr cip, const char *const pattern, const int recurse, const int doGlob)
int FTPGetCWD(const FTPCIPtr cip, char *const newCwd, const size_t newCwdSize)
int FTPRename(const FTPCIPtr cip, const char *const oldname, const char *const newname)
int FTPIsDir(const FTPCIPtr cip, const char *const dir)
int FTPChdir(const FTPCIPtr cip, const char *const cdCwd)
int FTPSetTransferType(const FTPCIPtr cip, int type)
const char * FTPStrError(int e)
int SetStartOffset(const FTPCIPtr cip, longest_int restartPt)
int FTPPutFiles2(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob, const int xtype, const int appendflag, const char *const tmppfx, const char *const tmpsfx)
int FTPGetFiles2(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob, const int xtype, const int resumeflag, const int appendflag)
int FTPPutFilesAscii(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob)
int FTPPutFiles(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob)
int FTPListToMemory(const FTPCIPtr cip, const char *const pattern, const LineListPtr llines, const char *const lsflags)
static int WaitForRemoteInput(const FTPCIPtr cip)
int FTPGetFiles3(const FTPCIPtr cip, const char *pattern1, const char *const dstdir1, const int recurse, int doGlob, const int xtype, const int resumeflag, int appendflag, const int deleteflag, const int tarflag, const ConfirmResumeDownloadProc resumeProc, int UNUSED(reserved))
int FTPListToMemory2(const FTPCIPtr cip, const char *const pattern, const LineListPtr llines, const char *const lsflags, const int blankLines, int *const tryMLSD)
int FTPGetOneFileAscii(const FTPCIPtr cip, const char *const file, const char *const dstfile)
static int WaitForRemoteOutput(const FTPCIPtr cip)
void FTPInitIOTimer(const FTPCIPtr cip)
int FTPGetFiles(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob)
static int FTPPutOneF(const FTPCIPtr cip, const char *const file, const char *volatile dstfile, int xtype, const int fdtouse, const int appendflag, const char *volatile tmppfx, const char *volatile tmpsfx, const int resumeflag, const int deleteflag, const ConfirmResumeUploadProc resumeProc)
int FTPPutOneFile2(const FTPCIPtr cip, const char *const file, const char *const dstfile, const int xtype, const int fdtouse, const int appendflag, const char *const tmppfx, const char *const tmpsfx)
int FTPGetFilesAscii(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob)
int FTPGetOneFile3(const FTPCIPtr cip, const char *const file, const char *const dstfile, const int xtype, const int fdtouse, const int resumeflag, const int appendflag, const int deleteflag, const ConfirmResumeDownloadProc resumeProc, int UNUSED(reserved))
int FTPPutOneFile(const FTPCIPtr cip, const char *const file, const char *const dstfile)
static void FTPRequestMlsOptions(const FTPCIPtr cip)
static int FTPGetOneF(const FTPCIPtr cip, const char *const file, const char *dstfile, int xtype, const int fdtouse, longest_int expectedSize, time_t mdtm, const int resumeflag, const int appendflag, const int deleteflag, const ConfirmResumeDownloadProc resumeProc)
void FTPStartIOTimer(const FTPCIPtr cip)
static int gGotBrokenData
int FTPPutFiles3(const FTPCIPtr cip, const char *const pattern, const char *const dstdir1, const int recurse, const int doGlob, const int xtype, int appendflag, const char *const tmppfx, const char *const tmpsfx, const int resumeflag, const int deleteflag, const ConfirmResumeUploadProc resumeProc, int UNUSED(reserved))
static void AutomaticallyUseASCIIModeDependingOnExtension(const FTPCIPtr cip, const char *const pathName, int *const xtype)
void FTPUpdateIOTimer(const FTPCIPtr cip)
int FTPPutOneFileAscii(const FTPCIPtr cip, const char *const file, const char *const dstfile)
int FTPPutOneFile3(const FTPCIPtr cip, const char *const file, const char *const dstfile, const int xtype, const int fdtouse, const int appendflag, const char *const tmppfx, const char *const tmpsfx, const int resumeflag, const int deleteflag, const ConfirmResumeUploadProc resumeProc, int UNUSED(reserved))
int FTPList(const FTPCIPtr cip, const int outfd, const int longMode, const char *const lsflag)
int FTPGetOneFile2(const FTPCIPtr cip, const char *const file, const char *const dstfile, const int xtype, const int fdtouse, const int resumeflag, const int appendflag)
int FTPGetOneFile(const FTPCIPtr cip, const char *const file, const char *const dstfile)
void FTPStopIOTimer(const FTPCIPtr cip)
void PrintF(const FTPCIPtr cip, const char *const fmt,...)
int SWrite(int, const char *const, size_t, int, int)
void DisposeSReadlineInfo(SReadlineInfo *)
#define kFullBufferNotRequired
int SReadline(SReadlineInfo *, char *const, size_t)
int InitSReadlineInfo(SReadlineInfo *, int, char *, size_t, int, int)
int SRead(int, char *const, size_t, int, int)
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
int sigsetjmp(sigjmp_buf buf, int savesigs)
void siglongjmp(sigjmp_buf buf, int val)
int FTPCmd(const FTPCIPtr cip, const char *const cmdspec,...)
#define NoConfirmResumeUploadProc
int BufferGets(char *, size_t, int, char *, char **, char **, size_t)
void FTPShutdownHost(const FTPCIPtr cip)
#define StrRFindLocalPathDelim(a)
#define kConfirmResumeProcSaidOverwrite
int FTPEndDataCmd(const FTPCIPtr, int)
int MkDirs(const char *const, int mode1)
#define kCommandAvailable
#define kConfirmResumeProcSaidBestGuess
int(* ConfirmResumeDownloadProc)(const char *volatile *localpath, volatile longest_int localsize, volatile time_t localmtime, const char *volatile remotepath, volatile longest_int remotesize, volatile time_t remotetime, volatile longest_int *volatile startPoint)
int FilenameExtensionIndicatesASCII(const char *const pathName, const char *const extnList)
#define kConfirmResumeProcSaidSkip
void FTPAbortDataTransfer(const FTPCIPtr cip)
#define NoConfirmResumeDownloadProc
#define kConfirmResumeProcSaidResume
#define StrRemoveTrailingLocalPathDelim
int FTPStartDataCmd(const FTPCIPtr, int, int, longest_int, const char *,...)
#define kConfirmResumeProcSaidCancel
#define kConfirmResumeProcSaidAppend
#define kCommandAvailabilityUnknown
int(* ConfirmResumeUploadProc)(const char *volatile localpath, volatile longest_int localsize, volatile time_t localmtime, const char *volatile *remotepath, volatile longest_int remotesize, volatile time_t remotetime, volatile longest_int *volatile startPoint)
#define kPreferredMlsOpts
#define IsLocalPathDelim(c)
#define kCommandNotAvailable
void(* FTPProgressMeterProc)(const FTPCIPtr, int)
void StrRemoveTrailingSlashes(char *dst)
#define LIBNCFTP_USE_VAR(a)
#define kErrLocalDeleteFailed
#define kErrSocketReadFailed
#define kErrLocalFileNewer
#define kErrSocketWriteFailed
#define kErrUTIMENotAvailable
#define kErrRemoteFileNewer
#define kErrNoValidFilesSpecified
#define kErrLocalSameAsRemote
#define kErrSetStartPoint
#define kErrRemoteHostClosedConnection
#define kErrDataTransferAborted
_Check_return_ _CRTIMP int __cdecl dup2(_In_ int _FileHandleSrc, _In_ int _FileHandleDst)
_CRTIMP intptr_t __cdecl execv(_In_z_ const char *_Filename, _In_z_ char *const _ArgList[])
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
INT WSAAPI shutdown(IN SOCKET s, IN INT how)
time_t nextProgressUpdate
size_t dataSocketRBufSize
FTPProgressMeterProc progress
const char * asciiFilenameExtensions
size_t dataSocketSBufSize
longest_int bytesTransferred
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid