navigation
[oftp] / src / ftp.h
index 13cc415..86aadab 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,
@@ -21,6 +22,11 @@ enum {
 };
 
 enum {
+       FTP_REMOTE,
+       FTP_LOCAL
+};
+
+enum {
        FTP_MOD_REMDIR  = 0x100,
        FTP_MOD_LOCDIR  = 0x200
 };
@@ -36,8 +42,6 @@ struct ftp_dirent {
        char *name;
        int type;
        long size;
-
-       struct ftp_dirent *next;
 };
 
 struct ftp {
@@ -57,8 +61,8 @@ struct ftp {
        int num_crecv;
        char drecv[256];
 
-       char *curdir_rem, *curdir_loc;
-       struct ftp_dirent *dent_rem, *dent_loc;
+       char *curdir[2];
+       struct ftp_dirent *dirent[2];           /* dynamic array */
 
        int last_resp;
        int modified;
@@ -89,5 +93,9 @@ 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 whichdir);
+int ftp_num_dirent(struct ftp *ftp, int whichdir);
+struct ftp_dirent *ftp_dirent(struct ftp *ftp, int whichdir, int idx);
+
 
 #endif /* FTP_H_ */