enum {
FTP_PWD,
FTP_CHDIR,
+ FTP_CDUP,
FTP_MKDIR,
FTP_RMDIR,
FTP_DEL,
};
enum {
- FTP_MOD_REMDIR = 0x100,
- FTP_MOD_LOCDIR = 0x200
+ FTP_MOD_DIR = 0x100
};
struct ftp_op {
char *name;
int type;
long size;
-
- struct ftp_dirent *next;
};
struct ftp {
int status, busy;
char *user, *pass;
+ int passive;
struct ftp_op *qhead, *qtail;
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;
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_ */