4 enum {FTP_DIR, FTP_FILE}; /* ftp_dirent type */
42 int ctl, lis, data; /* sockets */
49 struct ftp_op *qhead, *qtail;
51 int (*cproc)(struct ftp *ftp, int code, const char *buf, void *cls);
52 void (*dproc)(struct ftp *ftp, const char *buf, int sz, void *cls);
53 void *cproc_cls, *dproc_cls;
60 struct ftp_dirent *dirent; /* dynamic array */
66 struct ftp *ftp_alloc(void);
67 void ftp_free(struct ftp *ftp);
69 void ftp_auth(const char *user, const char *pass);
71 int ftp_connect(struct ftp *ftp, const char *host, int port);
72 void ftp_close(struct ftp *ftp);
74 int ftp_sockets(struct ftp *ftp, int *sockv, int maxsize);
76 int ftp_handle(struct ftp *ftp, int s);
78 int ftp_queue(struct ftp *ftp, int op, const char *arg);
79 int ftp_waitresp(struct ftp *ftp, long timeout);
81 int ftp_update(struct ftp *ftp);
82 int ftp_pwd(struct ftp *ftp);
83 int ftp_chdir(struct ftp *ftp, const char *dirname);
84 int ftp_mkdir(struct ftp *ftp, const char *dirname);
85 int ftp_rmdir(struct ftp *ftp, const char *dirname);
86 int ftp_delete(struct ftp *ftp, const char *fname);
87 int ftp_list(struct ftp *ftp);
88 int ftp_retrieve(struct ftp *ftp, const char *fname);
89 int ftp_store(struct ftp *ftp, const char *fname);
91 const char *ftp_curdir(struct ftp *ftp);
92 int ftp_num_dirent(struct ftp *ftp);
93 struct ftp_dirent *ftp_dirent(struct ftp *ftp, int idx);
95 int ftp_direntcmp(const void *a, const void *b);