ReactOS  0.4.13-dev-551-gf37fb1f
ncftp.h
Go to the documentation of this file.
1 /* ncftp.h
2  *
3  * Copyright (c) 1996-2001 Mike Gleason, NCEMRSoft.
4  * All rights reserved.
5  *
6  */
7 
8 #ifndef _ncftp_h_
9 #define _ncftp_h_ 1
10 
11 #define kLibraryVersion "@(#) LibNcFTP 3.0.6 (April 14, 2001)"
12 
13 #if defined(WIN32) || defined(_WINDOWS)
14 # define longest_int LONGLONG
15 # define longest_uint ULONGLONG
16 # ifndef HAVE_LONG_LONG
17 # define HAVE_LONG_LONG 1
18 # endif
19 # ifndef SCANF_LONG_LONG
20 # define SCANF_LONG_LONG "%I64d"
21 # endif
22 # ifndef PRINTF_LONG_LONG
23 # define PRINTF_LONG_LONG "%I64d"
24 # endif
25 # ifndef PRINTF_LONG_LONG_I64D
26 # define PRINTF_LONG_LONG_I64D 1
27 # endif
28 # ifndef SCANF_LONG_LONG_I64D
29 # define SCANF_LONG_LONG_I64D 1
30 # endif
31 # ifndef USE_SIO
32 # define USE_SIO 1
33 # endif
34 # ifndef NO_SIGNALS
35 # define NO_SIGNALS 1
36 # endif
37 #else
38 # include <stdio.h>
39 # include <sys/time.h>
40 # if !defined(__ultrix) || !defined(XTI)
41 # include <sys/socket.h>
42 # endif
43 # include <netinet/in.h>
44 # if 1 /* %config1% -- set by configure script -- do not modify */
45 # ifndef USE_SIO
46 # define USE_SIO 1
47 # endif
48 # ifndef NO_SIGNALS
49 # define NO_SIGNALS 1
50 # endif
51 # else
52 # ifndef USE_SIO
53 # define USE_SIO 0
54 # endif
55  /* #undef NO_SIGNALS */
56 # endif
57 #endif
58 
59 #include "ncftp_errno.h"
60 
61 /* This is used to verify validty of the data passed in.
62  * It also specifies the minimum version that is binary-compatibile with
63  * this version. (So this may not necessarily be kLibraryVersion.)
64  */
65 #define kLibraryMagic "LibNcFTP 3.0.6"
66 
67 #ifndef longest_int
68 #define longest_int long long
69 #define longest_uint unsigned long long
70 #endif
71 
72 #ifndef forever
73 # define forever for ( ; ; )
74 #endif
75 
76 typedef void (*FTPSigProc)(int);
77 
78 typedef struct Line *LinePtr;
79 typedef struct Line {
81  char *line;
82 } Line;
83 
84 typedef struct LineList {
86  int nLines;
88 
89 typedef struct Response {
91  int codeType;
92  int code;
93  int printMode;
94  int eofOkay;
95  int hadEof;
97 
98 #if USE_SIO && !defined(_SReadlineInfo_)
99 #define _SReadlineInfo_ 1
100 typedef struct SReadlineInfo {
101  char *buf; /* Pointer to beginning of buffer. */
102  char *bufPtr; /* Pointer to current position in buffer. */
103  char *bufLim; /* Pointer to end of buffer. */
104  size_t bufSize; /* Current size of buffer block. */
105  size_t bufSizeMax; /* Maximum size available for buffer. */
106  int malloc; /* If non-zero, malloc() was used for buf. */
107  int fd; /* File descriptor to use for I/O. */
108  int timeoutLen; /* Timeout to use, in seconds. */
109  int requireEOLN; /* When buffer is full, continue reading and discarding until \n? */
110 } SReadlineInfo;
111 #endif
112 
113 typedef struct FTPLibraryInfo {
114  char magic[16]; /* Don't modify this field. */
115  int init; /* Don't modify this field. */
116  int socksInit; /* Don't modify this field. */
117  unsigned int defaultPort; /* Don't modify this field. */
118  char ourHostName[64]; /* Don't modify this field. */
119  int hresult; /* Don't modify this field. */
120  int htried; /* Don't modify this field. */
121  char defaultAnonPassword[80]; /* You may set this after init. */
123 
124 typedef struct FTPConnectionInfo *FTPCIPtr;
126 typedef void (*FTPLogProc)(const FTPCIPtr, char *);
131 typedef int (*FTPFtwProc)(const FTPCIPtr cip, const char *fn, int flag);
132 typedef void (*FTPGetPassphraseProc)(const FTPCIPtr, LineListPtr pwPrompt, char *pass, size_t dsize);
133 
134 typedef struct FTPConnectionInfo {
135  char magic[16]; /* Don't modify this field. */
136  char host[64]; /* REQUIRED input parameter. */
137  char user[64]; /* OPTIONAL input parameter. */
138  char pass[64]; /* OPTIONAL input parameter. */
139  char acct[64]; /* OPTIONAL input parameter. */
140  unsigned int port; /* OPTIONAL input parameter. */
141  unsigned int xferTimeout; /* OPTIONAL input parameter. */
142  unsigned int connTimeout; /* OPTIONAL input parameter. */
143  unsigned int ctrlTimeout; /* OPTIONAL input parameter. */
144  unsigned int abortTimeout; /* OPTIONAL input parameter. */
145  FILE *debugLog; /* OPTIONAL input parameter. */
146  FILE *errLog; /* OPTIONAL input parameter. */
147  FTPLogProc debugLogProc; /* OPTIONAL input parameter. */
148  FTPLogProc errLogProc; /* OPTIONAL input parameter. */
149  FTPLIPtr lip; /* Do not modify this field. */
150  int maxDials; /* OPTIONAL input parameter. */
151  int redialDelay; /* OPTIONAL input parameter. */
152  int dataPortMode; /* OPTIONAL input parameter. */
153  char actualHost[64]; /* Do not modify this field. */
154  char ip[32]; /* Do not modify this field. */
155  int connected; /* Do not modify this field. */
156  int loggedIn; /* Do not modify this field. */
157  int curTransferType; /* Do not modify this field. */
158  char *startingWorkingDirectory; /* Use, but do not modify. */
159  longest_int startPoint; /* Do not modify this field. */
160  int hasPASV; /* Do not modify this field. */
161  int hasSIZE; /* Do not modify this field. */
162  int hasMDTM; /* Do not modify this field. */
163  int hasREST; /* Do not modify this field. */
164  int hasNLST_d; /* Do not modify this field. */
165  int hasUTIME; /* Do not modify this field. */
166  int hasFEAT; /* Do not modify this field. */
167  int hasMLSD; /* Do not modify this field. */
168  int hasMLST; /* Do not modify this field. */
169  int usedMLS; /* Do not modify this field. */
170  int hasCLNT; /* Do not modify this field. */
171  int hasRETRBUFSIZE; /* Do not modify this field. */
172  int hasRBUFSIZ; /* Do not modify this field. */
173  int hasRBUFSZ; /* Do not modify this field. */
174  int hasSTORBUFSIZE; /* Do not modify this field. */
175  int hasSBUFSIZ; /* Do not modify this field. */
176  int hasSBUFSZ; /* Do not modify this field. */
177  int hasBUFSIZE; /* Do not modify this field. */
178  int mlsFeatures; /* Do not modify this field. */
179  int STATfileParamWorks; /* Do not modify this field. */
180  int NLSTfileParamWorks; /* Do not modify this field. */
181  struct sockaddr_in servCtlAddr; /* Do not modify this field. */
182  struct sockaddr_in servDataAddr; /* Do not modify this field. */
183  struct sockaddr_in ourCtlAddr; /* Do not modify this field. */
184  struct sockaddr_in ourDataAddr; /* Do not modify this field. */
185  int netMode; /* Do not use or modify. */
186  char *buf; /* Do not modify this field. */
187  size_t bufSize; /* Do not modify this field. */
188  FILE *cin; /* Do not use or modify. */
189  FILE *cout; /* Do not use or modify. */
190  int ctrlSocketR; /* You may use but not modify/close. */
191  int ctrlSocketW; /* You may use but not modify/close. */
192  int dataSocket; /* You may use but not modify/close. */
193  int errNo; /* You may modify this if you want. */
194  unsigned short ephemLo; /* You may modify this if you want. */
195  unsigned short ephemHi; /* You may modify this if you want. */
196  int cancelXfer; /* You may modify this. */
197  longest_int bytesTransferred; /* Do not modify this field. */
198  FTPProgressMeterProc progress; /* You may modify this if you want. */
199  int useProgressMeter; /* Used internally. */
200  int leavePass; /* You may modify this. */
201  double sec; /* Do not modify this field. */
202  double secLeft; /* Do not modify this field. */
203  double kBytesPerSec; /* Do not modify this field. */
204  double percentCompleted; /* Do not modify this field. */
205  longest_int expectedSize; /* Do not modify this field. */
206  time_t mdtm; /* Do not modify this field. */
207  time_t nextProgressUpdate; /* Do not modify this field. */
208  const char *rname; /* Do not modify this field. */
209  const char *lname; /* Do not modify this field. */
210  struct timeval t0; /* Do not modify this field. */
211  int stalled; /* Do not modify this field. */
212  int dataTimedOut; /* Do not modify this field. */
213  int eofOkay; /* Do not use or modify. */
214  char lastFTPCmdResultStr[128]; /* You may modify this if you want. */
215  LineList lastFTPCmdResultLL; /* Use, but do not modify. */
216  int lastFTPCmdResultNum; /* You may modify this if you want. */
217  char firewallHost[64]; /* You may modify this. */
218  char firewallUser[64]; /* You may modify this. */
219  char firewallPass[64]; /* You may modify this. */
220  unsigned int firewallPort; /* You may modify this. */
221  int firewallType; /* You may modify this. */
222  int require20; /* You may modify this. */
223  int usingTAR; /* Use, but do not modify. */
224  FTPConnectMessageProc onConnectMsgProc; /* You may modify this. */
225  FTPRedialStatusProc redialStatusProc; /* You may modify this. */
226  FTPPrintResponseProc printResponseProc; /* You may modify this. */
227  FTPLoginMessageProc onLoginMsgProc; /* You may modify this. */
228  size_t ctrlSocketRBufSize; /* You may modify this. */
229  size_t ctrlSocketSBufSize; /* You may modify this. */
230  size_t dataSocketRBufSize; /* You may modify this. */
231  size_t dataSocketSBufSize; /* You may modify this. */
232  int serverType; /* Do not use or modify. */
233  int ietfCompatLevel; /* Do not use or modify. */
234  int numDownloads; /* Do not use or modify. */
235  int numUploads; /* Do not use or modify. */
236  int numListings; /* Do not use or modify. */
237  int doNotGetStartingWorkingDirectory; /* You may modify this. */
238 #if USE_SIO
239  char srlBuf[768];
240  SReadlineInfo ctrlSrl; /* Do not use or modify. */
241 #endif
242  FTPGetPassphraseProc passphraseProc; /* You may modify this. */
243  int iUser; /* Scratch integer field you can use. */
244  void *pUser; /* Scratch pointer field you can use. */
245  longest_int llUser; /* Scratch long long field you can use. */
246  const char *asciiFilenameExtensions; /* You may assign this. */
247  int reserved[32]; /* Do not use or modify. */
249 
250 typedef struct FileInfo *FileInfoPtr, **FileInfoVec;
251 typedef struct FileInfo {
253  char *relname;
254  char *rname;
255  char *rlinkto;
256  char *lname;
257  char *plug; /* permissions, links, user, group */
258  int type;
261  size_t relnameLen;
262 } FileInfo;
263 
264 typedef struct FileInfoList {
267  size_t maxFileLen;
268  size_t maxPlugLen;
270  int sortKey;
273 
274 /* Used with UnMlsT() */
275 typedef struct MLstItem{
276  char fname[512];
277  char linkto[512];
278  int ftype;
281  int mode; /* "UNIX.mode" fact */
282  int uid; /* "UNIX.uid" fact */
283  int gid; /* "UNIX.gid" fact */
284  char perm[16]; /* "perm" fact */
285  char owner[16]; /* "UNIX.owner" fact */
286  char group[16]; /* "UNIX.group" fact */
288 
289 /* Messages we pass to the current progress meter function. */
290 #define kPrInitMsg 1
291 #define kPrUpdateMsg 2
292 #define kPrEndMsg 3
293 
294 /* Parameter for OpenDataConnection() */
295 #define kSendPortMode 0
296 #define kPassiveMode 1
297 #define kFallBackToSendPortMode 2
298 
299 /* Parameter for AcceptDataConnection() */
300 #define kAcceptForWriting 00100
301 #define kAcceptForReading 00101
302 #define kNetWriting kAcceptForWriting
303 #define kNetReading kAcceptForReading
304 
305 /* Value for printMode field of Response structure.
306  * Generally, don't worry about this.
307  */
308 #define kResponseNoPrint 00001
309 #define kResponseNoSave 00002
310 #define kResponseNoProc 00002
311 
312 #define kDefaultFTPPort 21
313 
314 #define kDefaultFTPBufSize 32768
315 
316 #ifdef USE_SIO
317 /* This version of the library can handle timeouts without
318  * a user-installed signal handler.
319  */
320 #define kDefaultXferTimeout 600
321 #define kDefaultConnTimeout 30
322 #define kDefaultCtrlTimeout 135
323 #define kDefaultAbortTimeout 10
324 #else
325 /* The library doesn't use timeouts by default because it would
326  * break apps that don't have a SIGALRM handler.
327  */
328 #define kDefaultXferTimeout (0) /* No timeout. */
329 #define kDefaultConnTimeout (0) /* No timeout. */
330 #define kDefaultCtrlTimeout (0) /* No timeout. */
331 #define kDefaultAbortTimeout 10
332 #endif
333 
334 
335 /* Suggested timeout values, in seconds, if you use timeouts. */
336 #define kSuggestedDefaultXferTimeout (0) /* No timeout on data blocks. */
337 #define kSuggestedDefaultConnTimeout 30
338 #define kSuggestedDefaultCtrlTimeout 135 /* 2*MSL, + slop */
339 #define kSuggestedAbortTimeout 10
340 
341 #define kDefaultMaxDials 3
342 #define kDefaultRedialDelay 20 /* seconds */
343 
344 #define kDefaultDataPortMode kSendPortMode
345 
346 #define kRedialStatusDialing 0
347 #define kRedialStatusSleeping 1
348 
349 #ifndef INADDR_NONE
350 # define INADDR_NONE (0xffffffff) /* <netinet/in.h> should have it. */
351 #endif
352 
353 #define kTypeAscii 'A'
354 #define kTypeBinary 'I'
355 #define kTypeEbcdic 'E'
356 
357 #define kGlobChars "[*?"
358 #define GLOBCHARSINSTR(a) (strpbrk(a, kGlobChars) != NULL)
359 
360 #define kGlobYes 1
361 #define kGlobNo 0
362 #define kRecursiveYes 1
363 #define kRecursiveNo 0
364 #define kAppendYes 1
365 #define kAppendNo 0
366 #define kResumeYes 1
367 #define kResumeNo 0
368 #define kDeleteYes 1
369 #define kDeleteNo 0
370 #define kTarYes 1
371 #define kTarNo 0
372 
373 #define UNIMPLEMENTED_CMD(a) ((a == 500) || (a == 502) || (a == 504))
374 
375 /* Possible values returned by GetDateAndTime. */
376 #define kSizeUnknown ((longest_int) (-1))
377 #define kModTimeUnknown ((time_t) (-1))
378 
379 #define kCommandAvailabilityUnknown (-1)
380 #define kCommandAvailable 1
381 #define kCommandNotAvailable 0
382 
383 /* Values returned by FTPDecodeURL. */
384 #define kNotURL (-1)
385 #define kMalformedURL (-2)
386 
387 /* Values for the firewall/proxy open. */
388 #define kFirewallNotInUse 0
389 #define kFirewallUserAtSite 1
390 #define kFirewallLoginThenUserAtSite 2
391 #define kFirewallSiteSite 3
392 #define kFirewallOpenSite 4
393 #define kFirewallUserAtUserPassAtPass 5
394 #define kFirewallFwuAtSiteFwpUserPass 6
395 #define kFirewallUserAtSiteFwuPassFwp 7
396 #define kFirewallLastType kFirewallUserAtSiteFwuPassFwp
397 
398 /* For MLSD, MLST, and STAT. */
399 #define kPreferredMlsOpts (kMlsOptType | kMlsOptSize | kMlsOptModify | kMlsOptUNIXmode | kMlsOptUNIXowner | kMlsOptUNIXgroup | kMlsOptUNIXuid | kMlsOptUNIXgid | kMlsOptPerm)
400 
401 #define kMlsOptType 00001
402 #define kMlsOptSize 00002
403 #define kMlsOptModify 00004
404 #define kMlsOptUNIXmode 00010
405 #define kMlsOptUNIXowner 00020
406 #define kMlsOptUNIXgroup 00040
407 #define kMlsOptPerm 00100
408 #define kMlsOptUNIXuid 00200
409 #define kMlsOptUNIXgid 00400
410 #define kMlsOptUnique 01000
411 
412 /* For FTPFtw(). */
413 #define kFtwFile 0
414 #define kFtwDir 1
415 
416 /* For FTPChdir3(). */
417 #define kChdirOnly 00000
418 #define kChdirAndMkdir 00001
419 #define kChdirAndGetCWD 00002
420 #define kChdirOneSubdirAtATime 00004
421 
422 /* Return codes for custom ConfirmResumeDownloadProcs. */
423 #define kConfirmResumeProcNotUsed 0
424 #define kConfirmResumeProcSaidSkip 1
425 #define kConfirmResumeProcSaidResume 2
426 #define kConfirmResumeProcSaidOverwrite 3
427 #define kConfirmResumeProcSaidAppend 4
428 #define kConfirmResumeProcSaidBestGuess 5
429 #define kConfirmResumeProcSaidCancel 6
430 
432  const char *volatile *localpath,
433  volatile longest_int localsize,
434  volatile time_t localmtime,
435  const char *volatile remotepath,
436  volatile longest_int remotesize,
437  volatile time_t remotetime,
438  volatile longest_int *volatile startPoint
439 );
440 
442  const char *volatile localpath,
443  volatile longest_int localsize,
444  volatile time_t localmtime,
445  const char *volatile *remotepath,
446  volatile longest_int remotesize,
447  volatile time_t remotetime,
448  volatile longest_int *volatile startPoint
449 );
450 
451 #define NoConfirmResumeDownloadProc ((ConfirmResumeDownloadProc) 0)
452 #define NoConfirmResumeUploadProc ((ConfirmResumeUploadProc) 0)
453 #define NoGetPassphraseProc ((FTPGetPassphraseProc) 0)
454 
455 /* Types of FTP server software.
456  *
457  * We try to recognize a few of these, for information
458  * only, and occasional uses to determine some additional
459  * or broken functionality.
460  */
461 #define kServerTypeUnknown 0
462 #define kServerTypeWuFTPd 1
463 #define kServerTypeNcFTPd 2
464 #define kServerTypeProFTPD 3
465 #define kServerTypeMicrosoftFTP 4
466 #define kServerTypeWarFTPd 5
467 #define kServerTypeServ_U 6
468 #define kServerTypeWFTPD 7
469 #define kServerTypeVFTPD 8
470 #define kServerTypeFTP_Max 9
471 #define kServerTypeRoxen 10
472 #define kServerTypeNetWareFTP 11
473 #define kServerTypeWS_FTP 12
474 
475 
476 #if !defined(WIN32) && !defined(_WINDOWS) && !defined(closesocket)
477 # define closesocket close
478 #endif
479 
480 #if !defined(WIN32) && !defined(_WINDOWS) && !defined(ioctlsocket)
481 # define ioctlsocket ioctl
482 #endif
483 
484 #if defined(WIN32) || defined(_WINDOWS)
485 # define LOCAL_PATH_DELIM '\\'
486 # define LOCAL_PATH_DELIM_STR "\\"
487 # define LOCAL_PATH_ALTDELIM '/'
488 # define IsLocalPathDelim(c) ((c == LOCAL_PATH_DELIM) || (c == LOCAL_PATH_ALTDELIM))
489 # define UNC_PATH_PREFIX "\\\\"
490 # define IsUNCPrefixed(s) (IsLocalPathDelim(s[0]) && IsLocalPathDelim(s[1]))
491 #else
492 # define LOCAL_PATH_DELIM '/'
493 # define LOCAL_PATH_DELIM_STR "/"
494 # define StrFindLocalPathDelim(a) strchr(a, LOCAL_PATH_DELIM)
495 # define StrRFindLocalPathDelim(a) strrchr(a, LOCAL_PATH_DELIM)
496 # define StrRemoveTrailingLocalPathDelim StrRemoveTrailingSlashes
497 # define IsLocalPathDelim(c) (c == LOCAL_PATH_DELIM)
498 # define TVFSPathToLocalPath(s)
499 # define LocalPathToTVFSPath(s)
500 #endif
501 
502 #ifdef __cplusplus
503 extern "C"
504 {
505 #endif /* __cplusplus */
506 
507 #ifndef _libncftp_ftp_c_
508 extern char gLibNcFTPVersion[64];
509 #endif
510 
511 #ifndef _libncftp_errno_c_
513 #endif
514 
515 #if (defined(__GNUC__)) && (__GNUC__ >= 2)
516 # ifndef UNUSED
517 # define UNUSED(a) a __attribute__ ((unused))
518 # endif
519 # define LIBNCFTP_USE_VAR(a)
520 #else
521 # define LIBNCFTP_USE_VAR(a) gLibNcFTP_Uses_Me_To_Quiet_Variable_Unused_Warnings = (a == 0)
522 # ifndef UNUSED
523 # define UNUSED(a) a
524 # endif
525 #endif
526 
527 /* Public routines */
528 void FTPAbortDataTransfer(const FTPCIPtr cip);
529 int FTPChdir(const FTPCIPtr cip, const char *const cdCwd);
530 int FTPChdirAndGetCWD(const FTPCIPtr cip, const char *const cdCwd, char *const newCwd, const size_t newCwdSize);
531 int FTPChdir3(FTPCIPtr cip, const char *const cdCwd, char *const newCwd, const size_t newCwdSize, int flags);
532 int FTPChmod(const FTPCIPtr cip, const char *const pattern, const char *const mode, const int doGlob);
533 int FTPCloseHost(const FTPCIPtr cip);
534 int FTPCmd(const FTPCIPtr cip, const char *const cmdspec, ...)
535 #if (defined(__GNUC__)) && (__GNUC__ >= 2)
536 __attribute__ ((format (printf, 2, 3)))
537 #endif
538 ;
539 int FTPDecodeURL(const FTPCIPtr cip, char *const url, LineListPtr cdlist, char *const fn, const size_t fnsize, int *const xtype, int *const wantnlst);
540 int FTPDelete(const FTPCIPtr cip, const char *const pattern, const int recurse, const int doGlob);
541 int FTPFileExists(const FTPCIPtr cip, const char *const file);
542 int FTPFileModificationTime(const FTPCIPtr cip, const char *const file, time_t *const mdtm);
543 int FTPFileSize(const FTPCIPtr cip, const char *const file, longest_int *const size, const int type);
544 int FTPFileSizeAndModificationTime(const FTPCIPtr cip, const char *const file, longest_int *const size, const int type, time_t *const mdtm);
545 int FTPFileType(const FTPCIPtr cip, const char *const file, int *const ftype);
546 int FTPGetCWD(const FTPCIPtr cip, char *const newCwd, const size_t newCwdSize);
547 int FTPGetFiles3(const FTPCIPtr cip, const char *pattern, const char *const dstdir, const int recurse, int doGlob, const int xtype, const int resumeflag, int appendflag, const int deleteflag, const int tarflag, const ConfirmResumeDownloadProc resumeProc, int reserved);
548 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 reserved);
549 int FTPInitConnectionInfo(const FTPLIPtr lip, const FTPCIPtr cip, size_t bufsize);
550 int FTPInitLibrary(const FTPLIPtr lip);
551 int FTPIsDir(const FTPCIPtr cip, const char *const dir);
552 int FTPIsRegularFile(const FTPCIPtr cip, const char *const file);
553 int FTPList(const FTPCIPtr cip, const int outfd, const int longMode, const char *const lsflag);
554 int FTPListToMemory(const FTPCIPtr cip, const char *const pattern, const LineListPtr llines, const char *const lsflags);
555 int FTPLocalGlob(FTPCIPtr cip, LineListPtr fileList, const char *pattern, int doGlob);
556 int FTPLoginHost(const FTPCIPtr cip);
557 int FTPMkdir(const FTPCIPtr cip, const char *const newDir, const int recurse);
558 int FTPMkdir2(const FTPCIPtr cip, const char *const newDir, const int recurse, const char *const curDir);
559 int FTPOpenHost(const FTPCIPtr cip);
560 int FTPOpenHostNoLogin(const FTPCIPtr cip);
561 void FTPPerror(const FTPCIPtr cip, const int err, const int eerr, const char *const s1, const char *const s2);
562 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 reserved);
563 int FTPPutFiles3(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, 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 reserved);
564 int FTPRemoteGlob(FTPCIPtr cip, LineListPtr fileList, const char *pattern, int doGlob);
565 int FTPRename(const FTPCIPtr cip, const char *const oldname, const char *const newname);
566 int FTPRmdir(const FTPCIPtr cip, const char *const pattern, const int recurse, const int doGlob);
567 void FTPShutdownHost(const FTPCIPtr cip);
568 const char *FTPStrError(int e);
569 int FTPSymlink(const FTPCIPtr cip, const char *const lfrom, const char *const lto);
570 int FTPUmask(const FTPCIPtr cip, const char *const umsk);
571 int FTPUtime(const FTPCIPtr cip, const char *const file, time_t actime, time_t modtime, time_t crtime);
572 
573 /* LineList routines */
578 LinePtr AddLine(LineListPtr, const char *);
579 
580 /* Other routines that might be useful. */
581 char *StrDup(const char *);
582 char *FGets(char *, size_t, FILE *);
583 void GetHomeDir(char *, size_t);
584 void GetUsrName(char *, size_t);
585 void Scramble(unsigned char *dst, size_t dsize, unsigned char *src, char *key);
586 time_t UnMDTMDate(char *);
587 int MkDirs(const char *const, int mode1);
588 char *GetPass(const char *const prompt);
589 int FilenameExtensionIndicatesASCII(const char *const pathName, const char *const extnList);
590 void StrRemoveTrailingSlashes(char *dst);
591 #if defined(WIN32) || defined(_WINDOWS)
592 char *StrFindLocalPathDelim(const char *src);
593 char *StrRFindLocalPathDelim(const char *src);
595 void TVFSPathToLocalPath(char *dst);
596 void LocalPathToTVFSPath(char *dst);
597 int gettimeofday(struct timeval *const tp, void *junk);
598 void WinSleep(unsigned int seconds);
599 #endif
600 
601 #ifdef HAVE_SIGACTION
602 void (*NcSignal(int signum, void (*handler)(int)))(int);
603 #elif !defined(NcSignal)
604 # define NcSignal signal
605 #endif
606 
607 /* Obselete routines. */
608 int FTPGetOneFile(const FTPCIPtr cip, const char *const file, const char *const dstfile);
609 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);
610 int FTPGetFiles(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob);
611 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);
612 int FTPGetOneFileAscii(const FTPCIPtr cip, const char *const file, const char *const dstfile);
613 int FTPGetFilesAscii(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob);
614 int FTPPutOneFile(const FTPCIPtr cip, const char *const file, const char *const dstfile);
615 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);
616 int FTPPutFiles(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob);
617 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);
618 int FTPPutOneFileAscii(const FTPCIPtr cip, const char *const file, const char *const dstfile);
619 int FTPPutFilesAscii(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob);
620 
621 /* Private routines, or stuff for testing */
622 char *FTPGetLocalCWD(char *buf, size_t size);
623 int FTPQueryFeatures(const FTPCIPtr);
624 int FTPMListOneFile(const FTPCIPtr cip, const char *const file, const MLstItemPtr mlip);
627 int FTPListToMemory2(const FTPCIPtr cip, const char *const pattern, const LineListPtr llines, const char *const lsflags, const int blanklines, int *const tryMLSD);
628 void FTPInitIOTimer(const FTPCIPtr);
629 int FTPStartDataCmd(const FTPCIPtr, int, int, longest_int, const char *,...)
630 #if (defined(__GNUC__)) && (__GNUC__ >= 2)
631 __attribute__ ((format (printf, 5, 6)))
632 #endif
633 ;
634 void FTPStartIOTimer(const FTPCIPtr);
635 void FTPStopIOTimer(const FTPCIPtr);
636 void FTPUpdateIOTimer(const FTPCIPtr);
637 int FTPSetTransferType(const FTPCIPtr, int);
638 int FTPEndDataCmd(const FTPCIPtr, int);
639 int FTPRemoteHelp(const FTPCIPtr, const char *const, const LineListPtr);
640 int FTPCmdNoResponse(const FTPCIPtr, const char *const cmdspec,...)
641 #if (defined(__GNUC__)) && (__GNUC__ >= 2)
642 __attribute__ ((format (printf, 2, 3)))
643 #endif
644 ;
645 int WaitResponse(const FTPCIPtr, unsigned int);
647 int FTPLocalRecursiveFileList2(FTPCIPtr cip, LineListPtr fileList, FileInfoListPtr files, int erelative);
650 int FTPRebuildConnectionInfo(const FTPLIPtr lip, const FTPCIPtr cip);
651 int FTPFileExistsStat(const FTPCIPtr cip, const char *const file);
652 int FTPFileExistsNlst(const FTPCIPtr cip, const char *const file);
653 int FTPFileExists2(const FTPCIPtr cip, const char *const file, const int tryMDTM, const int trySIZE, const int tryMLST, const int trySTAT, const int tryNLST);
654 int FTPFtw(const FTPCIPtr cip, const char *const dir, FTPFtwProc proc, int maxdepth);
655 int BufferGets(char *, size_t, int, char *, char **, char **, size_t);
661 void SortFileInfoList(FileInfoListPtr, int, int);
664 int ComputeRNames(FileInfoListPtr, const char *, int, int);
665 int ComputeLNames(FileInfoListPtr, const char *, const char *, int);
670 void URLCopyToken(char *, size_t, const char *, size_t);
671 int UnMlsT(const char *const, const MLstItemPtr);
674 void TraceResponse(const FTPCIPtr, ResponsePtr);
675 void PrintResponse(const FTPCIPtr, LineListPtr);
678 void ReInitResponse(const FTPCIPtr, ResponsePtr);
679 int GetTelnetString(const FTPCIPtr, char *, size_t, FILE *, FILE *);
680 int GetResponse(const FTPCIPtr, ResponsePtr);
681 int RCmd(const FTPCIPtr, ResponsePtr, const char *, ...)
682 #if (defined(__GNUC__)) && (__GNUC__ >= 2)
683 __attribute__ ((format (printf, 3, 4)))
684 #endif
685 ;
686 
687 #ifdef __cplusplus
688 }
689 #endif /* __cplusplus */
690 
691 #endif /* _ncftp_h_ */
longest_int expectedSize
Definition: ncftp.h:205
int dataTimedOut
Definition: ncftp.h:212
size_t bufSizeMax
Definition: ncftp.h:105
LinePtr last
Definition: ncftp.h:85
FileInfoVec vec
Definition: ncftp.h:266
void * pUser
Definition: ncftp.h:244
FileInfoPtr RemoveFileInfo(FileInfoListPtr, FileInfoPtr)
Definition: linelist.c:483
LineList lastFTPCmdResultLL
Definition: ncftp.h:215
void SortFileInfoList(FileInfoListPtr, int, int)
Definition: linelist.c:353
FileInfoPtr prev
Definition: ncftp.h:252
int printMode
Definition: ncftp.h:93
int ietfCompatLevel
Definition: ncftp.h:233
FILE * cin
Definition: ncftp.h:188
void ReInitResponse(const FTPCIPtr, ResponsePtr)
Definition: rcmd.c:142
unsigned int ctrlTimeout
Definition: ncftp.h:143
int FTPGetFilesAscii(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob)
Definition: io.c:2757
void FTPAbortDataTransfer(const FTPCIPtr cip)
Definition: rcmd.c:870
void FTPPerror(const FTPCIPtr cip, const int err, const int eerr, const char *const s1, const char *const s2)
Definition: errno.c:134
struct S2 s2
void FTPInitIOTimer(const FTPCIPtr)
Definition: io.c:71
int FTPLocalGlob(FTPCIPtr cip, LineListPtr fileList, const char *pattern, int doGlob)
Definition: glob.c:1580
unsigned int port
Definition: ncftp.h:140
int FTPFtw(const FTPCIPtr cip, const char *const dir, FTPFtwProc proc, int maxdepth)
Definition: glob.c:1706
int socksInit
Definition: ncftp.h:116
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
const char * asciiFilenameExtensions
Definition: ncftp.h:246
int hasSTORBUFSIZE
Definition: ncftp.h:174
size_t relnameLen
Definition: ncftp.h:261
struct timeval t0
Definition: ncftp.h:210
int STATfileParamWorks
Definition: ncftp.h:179
int RCmd(const FTPCIPtr, ResponsePtr, const char *,...)
Definition: rcmd.c:718
int FTPRemoteRecursiveFileList(FTPCIPtr, LineListPtr, FileInfoListPtr)
Definition: glob.c:1032
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define LocalPathToTVFSPath(s)
Definition: ncftp.h:499
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
int FTPChdir3(FTPCIPtr cip, const char *const cdCwd, char *const newCwd, const size_t newCwdSize, int flags)
Definition: cmds.c:376
int FTPLocalRecursiveFileList(FTPCIPtr, LineListPtr, FileInfoListPtr)
Definition: glob.c:1333
int WaitResponse(const FTPCIPtr, unsigned int)
Definition: rcmd.c:684
char fname[512]
Definition: ncftp.h:276
int FTPInitLibrary(const FTPLIPtr lip)
Definition: open.c:1110
char * buf
Definition: ncftp.h:186
void FTPStartIOTimer(const FTPCIPtr)
Definition: io.c:93
void(* FTPPrintResponseProc)(const FTPCIPtr, ResponsePtr)
Definition: ncftp.h:130
FTPLoginMessageProc onLoginMsgProc
Definition: ncftp.h:227
int FTPEndDataCmd(const FTPCIPtr, int)
Definition: rcmd.c:933
uint8_t junk[422]
Definition: fsck.fat.h:69
int FTPRebuildConnectionInfo(const FTPLIPtr lip, const FTPCIPtr cip)
Definition: open.c:1041
int FTPRemoteGlob(FTPCIPtr cip, LineListPtr fileList, const char *pattern, int doGlob)
Definition: glob.c:1341
char magic[16]
Definition: ncftp.h:114
unsigned short ephemHi
Definition: ncftp.h:195
void DoneWithResponse(const FTPCIPtr, ResponsePtr)
Definition: rcmd.c:114
time_t UnMDTMDate(char *)
Definition: util.c:486
char ourHostName[64]
Definition: ncftp.h:118
char user[64]
Definition: ncftp.h:137
double sec
Definition: ncftp.h:201
LinePtr next
Definition: ncftp.h:80
int BufferGets(char *, size_t, int, char *, char **, char **, size_t)
Definition: rcmd.c:978
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)
Definition: io.c:2775
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
longest_int fsize
Definition: ncftp.h:279
int FTPPutFilesAscii(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob)
Definition: io.c:2811
LinePtr AddLine(LineListPtr, const char *)
Definition: linelist.c:94
struct FileInfo ** FileInfoVec
Definition: ncftp.h:250
int doNotGetStartingWorkingDirectory
Definition: ncftp.h:237
char owner[16]
Definition: ncftp.h:285
int FTPLoginHost(const FTPCIPtr cip)
Definition: open.c:110
char linkto[512]
Definition: ncftp.h:277
int FTPMkdir2(const FTPCIPtr cip, const char *const newDir, const int recurse, const char *const curDir)
Definition: cmds.c:472
struct Line * LinePtr
Definition: ncftp.h:78
_In_ UINT64 _In_ UINT64 _In_ UINT64 _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2694
int FTPGetFiles3(const FTPCIPtr cip, const char *pattern, const char *const dstdir, const int recurse, int doGlob, const int xtype, const int resumeflag, int appendflag, const int deleteflag, const int tarflag, const ConfirmResumeDownloadProc resumeProc, int reserved)
static HANDLE proc()
Definition: pdb.c:32
int UnMlsD(FileInfoListPtr, LineListPtr)
Definition: glob.c:827
FTPProgressMeterProc progress
Definition: ncftp.h:198
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)
Definition: io.c:2793
char * lname
Definition: ncftp.h:256
const char * FTPStrError(int e)
Definition: errno.c:114
GLenum GLuint GLsizei bufsize
Definition: glext.h:7473
#define __attribute__(Spec)
Definition: hlsl.tab.c:1213
int NLSTfileParamWorks
Definition: ncftp.h:180
char * rname
Definition: ncftp.h:254
int FTPIsRegularFile(const FTPCIPtr cip, const char *const file)
Definition: cmds.c:1558
int gid
Definition: ncftp.h:283
void InitFileInfo(FileInfoPtr)
Definition: linelist.c:471
int FTPGetOneFileAscii(const FTPCIPtr cip, const char *const file, const char *const dstfile)
Definition: io.c:2748
char magic[16]
Definition: ncftp.h:135
unsigned short ephemLo
Definition: ncftp.h:194
struct sockaddr_in ourCtlAddr
Definition: ncftp.h:183
int useProgressMeter
Definition: ncftp.h:199
int FTPCmdNoResponse(const FTPCIPtr, const char *const cmdspec,...)
Definition: rcmd.c:656
longest_int llUser
Definition: ncftp.h:245
int mode
Definition: ncftp.h:281
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
struct MLstItem * MLstItemPtr
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)
Definition: ncftp.h:431
FTPLogProc errLogProc
Definition: ncftp.h:148
void InitFileInfoList(FileInfoListPtr)
Definition: linelist.c:193
char perm[16]
Definition: ncftp.h:284
void FTPInitializeAnonPassword(const FTPLIPtr)
Definition: open.c:81
int FTPGetCWD(const FTPCIPtr cip, char *const newCwd, const size_t newCwdSize)
Definition: cmds.c:254
int FTPFileSize(const FTPCIPtr cip, const char *const file, longest_int *const size, const int type)
Definition: cmds.c:887
int FTPCmd(const FTPCIPtr cip, const char *const cmdspec,...)
Definition: rcmd.c:603
char * plug
Definition: ncftp.h:257
size_t dataSocketSBufSize
Definition: ncftp.h:231
int requireEOLN
Definition: ncftp.h:109
pass
Definition: typegen.h:24
#define gettimeofday(tv, tz)
Definition: adns_win32.h:159
void FTPInitializeOurHostName(const FTPLIPtr)
Definition: open.c:63
char host[64]
Definition: ncftp.h:136
void modtime(int argc, const char *argv[])
Definition: cmds.c:2232
struct FileInfo * FileInfoPtr
Definition: ncftp.h:250
FTPLIPtr lip
Definition: ncftp.h:149
double percentCompleted
Definition: ncftp.h:204
FTPRedialStatusProc redialStatusProc
Definition: ncftp.h:225
FileInfoPtr first
Definition: ncftp.h:265
int FTPPutOneFileAscii(const FTPCIPtr cip, const char *const file, const char *const dstfile)
Definition: io.c:2802
#define StrRemoveTrailingLocalPathDelim
Definition: ncftp.h:496
#define e
Definition: ke_i.h:82
int LineListToFileInfoList(LineListPtr, FileInfoListPtr)
Definition: linelist.c:758
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 reserved)
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 reserved)
struct MLstItem MLstItem
int hasRETRBUFSIZE
Definition: ncftp.h:171
int FTPPutOneFile(const FTPCIPtr cip, const char *const file, const char *const dstfile)
Definition: io.c:2766
FILE * errLog
Definition: ncftp.h:146
r reserved
Definition: btrfs.c:2704
char firewallHost[64]
Definition: ncftp.h:217
int FTPChmod(const FTPCIPtr cip, const char *const pattern, const char *const mode, const int doGlob)
Definition: cmds.c:46
FTPConnectMessageProc onConnectMsgProc
Definition: ncftp.h:224
LinePtr RemoveLine(LineListPtr, LinePtr)
Definition: linelist.c:63
FileInfoPtr AddFileInfo(FileInfoListPtr, FileInfoPtr)
Definition: linelist.c:530
int FTPStartDataCmd(const FTPCIPtr, int, int, longest_int, const char *,...)
Definition: rcmd.c:763
int firewallType
Definition: ncftp.h:221
int FTPRename(const FTPCIPtr cip, const char *const oldname, const char *const newname)
Definition: cmds.c:703
char * rlinkto
Definition: ncftp.h:255
size_t ctrlSocketSBufSize
Definition: ncftp.h:229
int ConcatFileInfoList(FileInfoListPtr, FileInfoListPtr)
Definition: linelist.c:556
unsigned int dir
Definition: maze.c:112
struct FileInfoList FileInfoList
char * relname
Definition: ncftp.h:253
void(* FTPRedialStatusProc)(const FTPCIPtr, int, int)
Definition: ncftp.h:129
struct FTPConnectionInfo FTPConnectionInfo
int FTPListToMemory2(const FTPCIPtr cip, const char *const pattern, const LineListPtr llines, const char *const lsflags, const int blanklines, int *const tryMLSD)
Definition: io.c:366
int FTPPutFiles(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob)
Definition: io.c:2784
int reserved[32]
Definition: ncftp.h:247
int FTPList(const FTPCIPtr cip, const int outfd, const int longMode, const char *const lsflag)
Definition: io.c:174
const char * rname
Definition: ncftp.h:208
int FTPListToMemory(const FTPCIPtr cip, const char *const pattern, const LineListPtr llines, const char *const lsflags)
Definition: io.c:2819
int GetTelnetString(const FTPCIPtr, char *, size_t, FILE *, FILE *)
char firewallPass[64]
Definition: ncftp.h:219
FileInfoPtr last
Definition: ncftp.h:265
int UnMlsT(const char *const, const MLstItemPtr)
Definition: glob.c:693
int FTPRmdir(const FTPCIPtr cip, const char *const pattern, const int recurse, const int doGlob)
Definition: cmds.c:784
int lastFTPCmdResultNum
Definition: ncftp.h:216
char * startingWorkingDirectory
Definition: ncftp.h:158
int code
Definition: ncftp.h:92
GLboolean GLuint group
Definition: glext.h:11120
char * FGets(char *, size_t, FILE *)
Definition: util.c:111
int nLines
Definition: ncftp.h:86
int gLibNcFTP_Uses_Me_To_Quiet_Variable_Unused_Warnings
Definition: errno.c:111
int FTPFileModificationTime(const FTPCIPtr cip, const char *const file, time_t *const mdtm)
Definition: cmds.c:649
int FTPRemoteRecursiveFileList1(FTPCIPtr, char *const, FileInfoListPtr)
Definition: glob.c:983
int nFileInfos
Definition: ncftp.h:269
void(* FTPProgressMeterProc)(const FTPCIPtr, int)
Definition: ncftp.h:125
GLsizeiptr size
Definition: glext.h:5919
char acct[64]
Definition: ncftp.h:139
Definition: dhcpd.h:61
void TraceResponse(const FTPCIPtr, ResponsePtr)
Definition: rcmd.c:55
int htried
Definition: ncftp.h:120
int timeoutLen
Definition: ncftp.h:108
int FTPFileExistsStat(const FTPCIPtr cip, const char *const file)
Definition: cmds.c:1008
struct FTPLibraryInfo * FTPLIPtr
int ComputeLNames(FileInfoListPtr, const char *, const char *, int)
Definition: linelist.c:663
static const WCHAR url[]
Definition: encode.c:1432
struct S1 s1
LinePtr prev
Definition: ncftp.h:80
int MkDirs(const char *const, int mode1)
Definition: util.c:785
int FTPIsDir(const FTPCIPtr cip, const char *const dir)
Definition: cmds.c:1531
#define longest_int
Definition: ncftp.h:68
void URLCopyToken(char *, size_t, const char *, size_t)
Definition: open.c:598
int ConcatFileToFileInfoList(FileInfoListPtr, char *)
Definition: linelist.c:740
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)
Definition: ncftp.h:441
int FTPLocalRecursiveFileList2(FTPCIPtr cip, LineListPtr fileList, FileInfoListPtr files, int erelative)
Definition: glob.c:1276
int sortOrder
Definition: ncftp.h:271
char defaultAnonPassword[80]
Definition: ncftp.h:121
int FTPUmask(const FTPCIPtr cip, const char *const umsk)
Definition: cmds.c:1602
int UnLslR(FileInfoListPtr, LineListPtr, int)
Definition: glob.c:561
unsigned int defaultPort
Definition: ncftp.h:117
struct SReadlineInfo SReadlineInfo
longest_int bytesTransferred
Definition: ncftp.h:197
int FTPOpenHostNoLogin(const FTPCIPtr cip)
Definition: open.c:910
int FTPDelete(const FTPCIPtr cip, const char *const pattern, const int recurse, const int doGlob)
Definition: cmds.c:195
size_t maxFileLen
Definition: ncftp.h:267
int FTPUtime(const FTPCIPtr cip, const char *const file, time_t actime, time_t modtime, time_t crtime)
Definition: cmds.c:1649
struct Response * ResponsePtr
int FTPRemoteHelp(const FTPCIPtr, const char *const, const LineListPtr)
Definition: cmds.c:739
void(* FTPSigProc)(int)
Definition: ncftp.h:76
size_t maxPlugLen
Definition: ncftp.h:268
int codeType
Definition: ncftp.h:91
Definition: ncftp.h:89
GLbitfield flags
Definition: glext.h:7161
void(* FTPLogProc)(const FTPCIPtr, char *)
Definition: ncftp.h:126
time_t ftime
Definition: ncftp.h:280
Definition: ncftp.h:79
double secLeft
Definition: ncftp.h:202
void VectorizeFileInfoList(FileInfoListPtr)
Definition: linelist.c:423
char firewallUser[64]
Definition: ncftp.h:218
char * bufLim
Definition: ncftp.h:103
int FTPCloseHost(const FTPCIPtr cip)
Definition: open.c:523
void FTPUpdateIOTimer(const FTPCIPtr)
Definition: io.c:104
Definition: ncftp.h:84
void(* FTPLoginMessageProc)(const FTPCIPtr, ResponsePtr)
Definition: ncftp.h:128
unsigned int xferTimeout
Definition: ncftp.h:141
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 flag
Definition: glfuncs.h:52
FTPLogProc debugLogProc
Definition: ncftp.h:147
char lastFTPCmdResultStr[128]
Definition: ncftp.h:214
int FTPChdir(const FTPCIPtr cip, const char *const cdCwd)
Definition: cmds.c:11
time_t nextProgressUpdate
Definition: ncftp.h:207
FILE * cout
Definition: ncftp.h:189
int sortKey
Definition: ncftp.h:270
LinePtr first
Definition: ncftp.h:85
FILE * debugLog
Definition: ncftp.h:145
GLenum src
Definition: glext.h:6340
#define err(...)
int FTPChdirAndGetCWD(const FTPCIPtr cip, const char *const cdCwd, char *const newCwd, const size_t newCwdSize)
Definition: cmds.c:313
void(* FTPConnectMessageProc)(const FTPCIPtr, ResponsePtr)
Definition: ncftp.h:127
GLenum mode
Definition: glext.h:6217
char actualHost[64]
Definition: ncftp.h:153
double kBytesPerSec
Definition: ncftp.h:203
size_t dataSocketRBufSize
Definition: ncftp.h:230
int ftype
Definition: ncftp.h:278
int type
Definition: ncftp.h:258
time_t mdtm
Definition: ncftp.h:259
struct FileInfoList * FileInfoListPtr
int GetResponse(const FTPCIPtr, ResponsePtr)
Definition: rcmd.c:287
void UnvectorizeFileInfoList(FileInfoListPtr)
Definition: linelist.c:441
#define NcSignal
Definition: ncftp.h:604
char * GetPass(const char *const prompt)
Definition: util.c:186
struct sockaddr_in servDataAddr
Definition: ncftp.h:182
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)
Definition: io.c:2721
LineList msg
Definition: ncftp.h:90
struct FTPConnectionInfo * FTPCIPtr
Definition: ncftp.h:124
int malloc
Definition: ncftp.h:106
struct sockaddr_in ourDataAddr
Definition: ncftp.h:184
FTPPrintResponseProc printResponseProc
Definition: ncftp.h:226
longest_int startPoint
Definition: ncftp.h:159
size_t ctrlSocketRBufSize
Definition: ncftp.h:228
struct sockaddr_in servCtlAddr
Definition: ncftp.h:181
int hresult
Definition: ncftp.h:119
__kernel_time_t time_t
Definition: linux.h:252
int FTPDecodeURL(const FTPCIPtr cip, char *const url, LineListPtr cdlist, char *const fn, const size_t fnsize, int *const xtype, int *const wantnlst)
Definition: open.c:639
int curTransferType
Definition: ncftp.h:157
GLenum GLenum dst
Definition: glext.h:6340
void PrintResponse(const FTPCIPtr, LineListPtr)
Definition: rcmd.c:74
size_t bufSize
Definition: ncftp.h:104
int CopyLineList(LineListPtr, LineListPtr)
Definition: linelist.c:127
const char * lname
Definition: ncftp.h:209
unsigned int firewallPort
Definition: ncftp.h:220
int FTPFileExists(const FTPCIPtr cip, const char *const file)
Definition: cmds.c:1423
char gLibNcFTPVersion[64]
Definition: ftp.c:11
void StrRemoveTrailingSlashes(char *dst)
Definition: util.c:768
int LineToFileInfoList(LinePtr, FileInfoListPtr)
Definition: linelist.c:775
void GetUsrName(char *, size_t)
Definition: util.c:290
char srlBuf[768]
Definition: ncftp.h:239
char * buf
Definition: ncftp.h:101
int FTPGetOneFile(const FTPCIPtr cip, const char *const file, const char *const dstfile)
Definition: io.c:2712
int FTPQueryFeatures(const FTPCIPtr)
Definition: open.c:380
char * bufPtr
Definition: ncftp.h:102
void GetHomeDir(char *, size_t)
Definition: util.c:240
int hadEof
Definition: ncftp.h:95
size_t bufSize
Definition: ncftp.h:187
int FTPOpenHost(const FTPCIPtr cip)
Definition: open.c:818
struct LineList LineList
void Scramble(unsigned char *dst, size_t dsize, unsigned char *src, char *key)
Definition: util.c:607
struct FileInfo FileInfo
void(* FTPGetPassphraseProc)(const FTPCIPtr, LineListPtr pwPrompt, char *pass, size_t dsize)
Definition: ncftp.h:132
#define StrRFindLocalPathDelim(a)
Definition: ncftp.h:495
struct Response Response
#define TVFSPathToLocalPath(s)
Definition: ncftp.h:498
void DisposeFileInfoListContents(FileInfoListPtr)
Definition: linelist.c:152
unsigned int abortTimeout
Definition: ncftp.h:144
int FTPMkdir(const FTPCIPtr cip, const char *const newDir, const int recurse)
Definition: cmds.c:641
int(* FTPFtwProc)(const FTPCIPtr cip, const char *fn, int flag)
Definition: ncftp.h:131
int FTPFileExistsNlst(const FTPCIPtr cip, const char *const file)
Definition: cmds.c:1209
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786
int FTPFileSizeAndModificationTime(const FTPCIPtr cip, const char *const file, longest_int *const size, const int type, time_t *const mdtm)
Definition: cmds.c:1433
void InitLineList(LineListPtr)
Definition: linelist.c:54
SReadlineInfo ctrlSrl
Definition: ncftp.h:240
int FTPFileExists2(const FTPCIPtr cip, const char *const file, const int tryMDTM, const int trySIZE, const int tryMLST, const int trySTAT, const int tryNLST)
Definition: cmds.c:1350
void FTPStopIOTimer(const FTPCIPtr)
Definition: io.c:159
int FTPPutFiles3(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, 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 reserved)
ResponsePtr InitResponse(void)
Definition: rcmd.c:38
char * StrDup(const char *)
Definition: linelist.c:12
unsigned int connTimeout
Definition: ncftp.h:142
struct LineList * LineListPtr
char * line
Definition: ncftp.h:81
#define StrFindLocalPathDelim(a)
Definition: ncftp.h:494
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)
Definition: io.c:2739
int FTPSetTransferType(const FTPCIPtr, int)
Definition: cmds.c:836
int ComputeRNames(FileInfoListPtr, const char *, int, int)
Definition: linelist.c:579
struct FTPLibraryInfo FTPLibraryInfo
int eofOkay
Definition: ncftp.h:94
int FTPInitConnectionInfo(const FTPLIPtr lip, const FTPCIPtr cip, size_t bufsize)
Definition: open.c:984
int FTPGetFiles(const FTPCIPtr cip, const char *const pattern, const char *const dstdir, const int recurse, const int doGlob)
Definition: io.c:2730
struct Line Line
void DisposeLineListContents(LineListPtr)
Definition: linelist.c:33
time_t mdtm
Definition: ncftp.h:206
longest_int size
Definition: ncftp.h:260
void FTPShutdownHost(const FTPCIPtr cip)
Definition: open.c:564
int numDownloads
Definition: ncftp.h:234
int uid
Definition: ncftp.h:282
int dataPortMode
Definition: ncftp.h:152
int FilenameExtensionIndicatesASCII(const char *const pathName, const char *const extnList)
Definition: util.c:963
int FTPFileType(const FTPCIPtr cip, const char *const file, int *const ftype)
Definition: cmds.c:1475
GLubyte * pattern
Definition: glext.h:7787
char * FTPGetLocalCWD(char *buf, size_t size)
Definition: util.c:29
FTPGetPassphraseProc passphraseProc
Definition: ncftp.h:242
Definition: path.c:42
int FTPMListOneFile(const FTPCIPtr cip, const char *const file, const MLstItemPtr mlip)
Definition: cmds.c:947
#define printf
Definition: config.h:203
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
Definition: fci.c:126
int FTPSymlink(const FTPCIPtr cip, const char *const lfrom, const char *const lto)
Definition: cmds.c:1585
FileInfoPtr next
Definition: ncftp.h:252