summaryrefslogtreecommitdiff
path: root/ext/ftp/ftp.h
diff options
context:
space:
mode:
authorAndrew Skalski <askalski@php.net>1999-09-27 14:07:09 +0000
committerAndrew Skalski <askalski@php.net>1999-09-27 14:07:09 +0000
commit0413f524800e8830e2fdb161b61284a039504545 (patch)
treec571a63242a24bd0ae7edff33138428203f575c6 /ext/ftp/ftp.h
parent10591231ca090c3f3353d7d61a46c1606d7ffde8 (diff)
downloadphp-git-0413f524800e8830e2fdb161b61284a039504545.tar.gz
Added functions ftp_{pasv,size,mdtm,fget,fput}
PASV mode is now supported; file size and last-modified time can now be fetched from servers that support them; files now may be stored to and retrieved from open files, in addition to disk files.
Diffstat (limited to 'ext/ftp/ftp.h')
-rw-r--r--ext/ftp/ftp.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h
index 800a9a197f..ddfe9aa118 100644
--- a/ext/ftp/ftp.h
+++ b/ext/ftp/ftp.h
@@ -53,6 +53,8 @@ typedef struct ftpbuf
char *pwd; /* cached pwd */
char *syst; /* cached system type */
ftptype_t type; /* current transfer type */
+ int pasv; /* 0=off; 1=pasv; 2=ready */
+ struct sockaddr_in pasvaddr; /* passive mode address */
} ftpbuf_t;
typedef struct databuf
@@ -118,6 +120,11 @@ char** ftp_nlist(ftpbuf_t *ftp, const char *path);
*/
char** ftp_list(ftpbuf_t *ftp, const char *path);
+/* switches passive mode on or off
+ * returns true on success, false on error
+ */
+int ftp_pasv(ftpbuf_t *ftp, int pasv);
+
/* retrieves a file and saves its contents to outfp
* returns true on success, false on error
*/
@@ -130,4 +137,10 @@ int ftp_get(ftpbuf_t *ftp, FILE *outfp, const char *path,
int ftp_put(ftpbuf_t *ftp, const char *path, FILE *infp,
ftptype_t type);
+/* returns the size of the given file, or -1 on error */
+int ftp_size(ftpbuf_t *ftp, const char *path);
+
+/* returns the last modified time of the given file, or -1 on error */
+time_t ftp_mdtm(ftpbuf_t *ftp, const char *path);
+
#endif