local navigation
[oftp] / src / ftp.h
index e8bcf10..5765b62 100644 (file)
--- a/src/ftp.h
+++ b/src/ftp.h
@@ -6,6 +6,7 @@ enum {FTP_DIR, FTP_FILE};       /* ftp_dirent type */
 enum {
        FTP_PWD,
        FTP_CHDIR,
+       FTP_CDUP,
        FTP_MKDIR,
        FTP_RMDIR,
        FTP_DEL,
@@ -20,6 +21,10 @@ enum {
        FTP_CONN_ACT
 };
 
+enum {
+       FTP_MOD_DIR     = 0x100
+};
+
 struct ftp_op {
        int op;
        char *arg;
@@ -30,14 +35,16 @@ struct ftp_op {
 struct ftp_dirent {
        char *name;
        int type;
+       long size;
 };
 
 struct ftp {
        int ctl, lis, data;     /* sockets */
        int lis_port;
 
-       int status;
+       int status, busy;
        char *user, *pass;
+       int passive;
 
        struct ftp_op *qhead, *qtail;
 
@@ -49,8 +56,8 @@ struct ftp {
        int num_crecv;
        char drecv[256];
 
-       char *curdir_rem, *curdir_loc;
-       struct ftp_dirent *dent_rem, *dent_loc;
+       char *curdir;
+       struct ftp_dirent *dirent;              /* dynamic array */
 
        int last_resp;
        int modified;
@@ -81,5 +88,10 @@ int ftp_list(struct ftp *ftp);
 int ftp_retrieve(struct ftp *ftp, const char *fname);
 int ftp_store(struct ftp *ftp, const char *fname);
 
+const char *ftp_curdir(struct ftp *ftp);
+int ftp_num_dirent(struct ftp *ftp);
+struct ftp_dirent *ftp_dirent(struct ftp *ftp, int idx);
+
+int ftp_direntcmp(const void *a, const void *b);
 
 #endif /* FTP_H_ */