| 18 |
|
|
| 19 |
/***** Local headers ********************************************************/ |
/***** Local headers ********************************************************/ |
| 20 |
/***** Constat values *******************************************************/ |
/***** Constat values *******************************************************/ |
| 21 |
|
/* LIBOFTP ERROR CODE */ |
| 22 |
|
#define LIBOFTP_NOERROR 0 |
| 23 |
|
#define LIBOFTP_ERROR_OS -1 |
| 24 |
|
#define LIBOFTP_ERROR_PROTOCOL -2 |
| 25 |
|
#define LIBOFTP_ERROR -3 |
| 26 |
|
#define LIBOFTP_ERROR_BUFFER -4 |
| 27 |
|
#define LIBOFTP_ERROR_TIMEOUT -5 |
| 28 |
|
|
| 29 |
|
|
| 30 |
/***** Macros ***************************************************************/ |
/***** Macros ***************************************************************/ |
| 31 |
/***** Typedefs *************************************************************/ |
/***** Typedefs *************************************************************/ |
| 32 |
typedef struct |
typedef struct |
| 37 |
enum { ASCII = 1, IMAGE = 3 } data_type; |
enum { ASCII = 1, IMAGE = 3 } data_type; |
| 38 |
int flag_passive; |
int flag_passive; |
| 39 |
int timeout_sec; |
int timeout_sec; |
| 40 |
|
|
| 41 |
int error_no; |
int reply_code; |
| 42 |
char error_message[256]; |
char error_message[256]; |
| 43 |
|
|
| 44 |
} LIBOFTP; |
} LIBOFTP; |
| 46 |
|
|
| 47 |
/***** Global variables *****************************************************/ |
/***** Global variables *****************************************************/ |
| 48 |
/***** Function prototypes **************************************************/ |
/***** Function prototypes **************************************************/ |
| 49 |
|
int ftp_initialize( LIBOFTP *ftp ); |
| 50 |
int ftp_open( LIBOFTP *ftp, const char *host, int port ); |
int ftp_open( LIBOFTP *ftp, const char *host, int port ); |
| 51 |
int ftp_user( LIBOFTP *ftp, const char *user, const char *pass ); |
int ftp_user( LIBOFTP *ftp, const char *user, const char *pass ); |
| 52 |
int ftp_passive( LIBOFTP *ftp, int flag ); |
int ftp_passive( LIBOFTP *ftp, int flag ); |
| 53 |
|
int ftp_timeout( LIBOFTP *ftp, int sec ); |
| 54 |
int ftp_type( LIBOFTP *ftp, const char *type ); |
int ftp_type( LIBOFTP *ftp, const char *type ); |
| 55 |
int ftp_quit( LIBOFTP *ftp ); |
int ftp_quit( LIBOFTP *ftp ); |
| 56 |
int ftp_site( LIBOFTP *ftp, const char *cmdline ); |
int ftp_site( LIBOFTP *ftp, const char *cmdline ); |