| 15 |
|
|
| 16 |
|
|
| 17 |
/***** System headers *******************************************************/ |
/***** System headers *******************************************************/ |
| 18 |
|
#include <string.h> |
| 19 |
|
#include <errno.h> |
| 20 |
#ifdef FTP_DEBUG |
#ifdef FTP_DEBUG |
| 21 |
#include <stdio.h> |
#include <stdio.h> |
| 22 |
#endif |
#endif |
| 23 |
|
|
| 24 |
|
|
| 25 |
/***** Local headers ********************************************************/ |
/***** Local headers ********************************************************/ |
| 26 |
/***** Constat values *******************************************************/ |
/***** Constat values *******************************************************/ |
| 27 |
/***** Macros ***************************************************************/ |
/***** Macros ***************************************************************/ |
| 28 |
/***** Typedefs *************************************************************/ |
/***** Typedefs *************************************************************/ |
| 29 |
#define DEBUGPRINT1(f,a1) printf((f),(a1)); |
#ifdef FTP_DEBUG |
| 30 |
|
#define DEBUGPRINT1(f,a1) printf( "(" __FILE__ ") " f,(a1)) |
| 31 |
|
#else |
| 32 |
|
#define DEBUGPRINT1(f,a1) |
| 33 |
|
#endif |
| 34 |
|
|
| 35 |
|
#define copy_strerror() \ |
| 36 |
|
strncpy( ftp->error_message, strerror(errno), sizeof(ftp->error_message)-1 ); |
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
/***** Global variables *****************************************************/ |
/***** Global variables *****************************************************/ |
| 41 |
/***** Function prototypes **************************************************/ |
/***** Function prototypes **************************************************/ |
| 42 |
int sendn( int sd, const char *buf, int len, int flags ); |
int sendn( int sd, const char *buf, int len, int flags ); |
|
int recv_line( int sd, char *buf, int bufsiz, int flags ); |
|
| 43 |
int ftp_send_command( LIBOFTP *ftp, const char *cmd ); |
int ftp_send_command( LIBOFTP *ftp, const char *cmd ); |
| 44 |
int ftp_receive_response( LIBOFTP *ftp, char *res_buf, int bufsiz ); |
int ftp_receive_response( LIBOFTP *ftp, char *res_buf, int bufsiz ); |
|
int ftp_set_so_rcvtimeo( int sock, int sec, int usec ); |
|
| 45 |
int ftp_getready_active( LIBOFTP *ftp, const char *cmd, const char *fname ); |
int ftp_getready_active( LIBOFTP *ftp, const char *cmd, const char *fname ); |
| 46 |
int ftp_getready_pasv( LIBOFTP *ftp, const char *cmd, const char *fname ); |
int ftp_getready_pasv( LIBOFTP *ftp, const char *cmd, const char *fname ); |
| 47 |
|
|