progress
[oftp] / src / ftp.h
1 #ifndef FTP_H_
2 #define FTP_H_
3
4 enum {FTP_DIR, FTP_FILE};       /* ftp_dirent type */
5
6 struct ftp_dirent {
7         char *name;
8         int type;
9 };
10
11 struct ftp {
12         int ctl, data;  /* sockets */
13
14         char *cwd;
15         struct ftp_dirent *dent;
16         int num_dent;
17 };
18
19 struct ftp *ftp_alloc(void);
20 void ftp_free(struct ftp *ftp);
21
22 int ftp_connect(struct ftp *ftp, const char *host, int port);
23 void ftp_close(struct ftp *ftp);
24
25 int ftp_update(struct ftp *ftp);
26 int ftp_chdir(struct ftp *ftp, const char *dirname);
27
28
29 #endif  /* FTP_H_ */