#ifndef __FTP_H
#define __FTP_H
#include "wput.h"

int send_msg(char * msg);
int get_msg(void);
int issue_cmd(char * cmd, char * value);

int do_connect(_fsession * fsession);

int do_login(_fsession * fsession);
int do_syst(void);
int do_cwd(_fsession * fsession);
int long_do_cwd(_fsession * fsession);
int try_do_cwd(_fsession * fsession, char * path, int mkd);

int do_size(_fsession * fsession);
int do_type(int type);

int do_send(_fsession * fsession);

int do_stor(_fsession * fsession);
int get_list(_fsession * fsession);
int do_list(_fsession * fsession);

int do_port(_fsession * fsession);
int do_proxy_port(void);

int do_passive(_fsession * fsession);

void do_quit();

/* for ftp-ls.c */

struct fileinfo * ftp_parse_ls (const char * listing, const enum stype system_type);
struct fileinfo * find_directory(_fsession * F);
struct fileinfo * fileinfo_find_file(struct fileinfo * F, char * name);
void fileinfo_free(void);
directory_list * add_directory(directory_list * A, struct fileinfo * K);

#endif
