X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2Fftp.h;fp=src%2Fftp.h;h=c9ebbe2941ab3dfa60b9c78b1fa8d988eb8e41f1;hb=c65c4562a19c45eda17d7d672afe15f5c8ce5fec;hp=2d69ce74b382f45cc83cc1aa39b7799212dcc3bd;hpb=4577dd26b3ecbf7ccc5ff55efa991334136866e1;p=oftp diff --git a/src/ftp.h b/src/ftp.h index 2d69ce7..c9ebbe2 100644 --- a/src/ftp.h +++ b/src/ftp.h @@ -3,6 +3,22 @@ enum {FTP_DIR, FTP_FILE}; /* ftp_dirent type */ +enum { + FTP_PWD, + FTP_CHDIR, + FTP_MKDIR, + FTP_RMDIR, + FTP_DEL, + FTP_LIST, + FTP_RETR, + FTP_STORE +}; + +struct ftp_op { + int op; + char *arg; +}; + struct ftp_dirent { char *name; int type; @@ -11,19 +27,30 @@ struct ftp_dirent { struct ftp { int ctl, data; /* sockets */ + int status; + char *user, *pass; + + void (*cproc)(struct ftp *ftp, int code, const char *buf, void *cls); + void (*dproc)(struct ftp *ftp, const char *buf, int sz, void *cls); + void *cproc_cls, *dproc_cls; + char crecv[256]; int num_crecv; char drecv[256]; int num_drecv; - char *cwd; + char *curdir_rem, *curdir_loc; struct ftp_dirent *dent; int num_dent; + + int modified; }; struct ftp *ftp_alloc(void); void ftp_free(struct ftp *ftp); +void ftp_auth(const char *user, const char *pass); + int ftp_connect(struct ftp *ftp, const char *host, int port); void ftp_close(struct ftp *ftp); @@ -33,6 +60,7 @@ int ftp_pending(struct ftp *ftp); int ftp_handle(struct ftp *ftp, int s); int ftp_update(struct ftp *ftp); +int ftp_pwd(struct ftp *ftp); int ftp_chdir(struct ftp *ftp, const char *dirname);