Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/liboftp.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 19 by hirohitohigashi, Wed Feb 25 14:45:21 2009 UTC revision 32 by hirohitohigashi, Sat Feb 28 15:03:18 2009 UTC
# Line 18  Line 18 
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
33  {  {
34      int socket;      int socket;
35      struct sockaddr_in sockaddr;      struct sockaddr_in saddr;
36      enum { UNIX = 1, Windows_NT = 2 } system_type;      enum { UNIX = 1, Windows_NT = 2 } system_type;
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;
# Line 37  typedef struct Line 46  typedef struct
46    
47  /***** Global variables *****************************************************/  /***** Global variables *****************************************************/
48  /***** Function prototypes **************************************************/  /***** Function prototypes **************************************************/
49  int ftp_connect( LIBOFTP *ftp, const char *host, int port );  int ftp_initialize( LIBOFTP *ftp );
50  int ftp_auth( LIBOFTP *ftp, const char *user, const char *pass );  int ftp_open( LIBOFTP *ftp, const char *host, int port );
51    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_pwd( LIBOFTP *ftp, char *buf, int bufsiz );  int ftp_site( LIBOFTP *ftp, const char *cmdline );
57    int ftp_delete( LIBOFTP *ftp, const char *fname );
58    int ftp_rename( LIBOFTP *ftp, const char *from, const char *to );
59    
60  int ftp_get_buffer( LIBOFTP *ftp, const char *fname, char *buf, int bufsiz );  int ftp_get_buffer( LIBOFTP *ftp, const char *fname, char *buf, int bufsiz );
61  int ftp_put_buffer( LIBOFTP *ftp, const char *fname, char *buf, int bufsiz );  int ftp_put_buffer( LIBOFTP *ftp, char *buf, int bufsiz, const char *fname );
62  int ftp_append_buffer( LIBOFTP *ftp, const char *fname, char *buf, int bufsiz );  int ftp_append_buffer( LIBOFTP *ftp, char *buf, int bufsiz, const char *fname );
63    int ftp_get_file( LIBOFTP *ftp, const char *fname, const char *local_fname );
64    int ftp_put_file( LIBOFTP *ftp, const char *local_fname, const char *fname );
65    int ftp_append_file( LIBOFTP *ftp, const char *local_fname, const char *fname );
66    int ftp_get_descriptor( LIBOFTP *ftp, const char *fname );
67    int ftp_get_descriptor_close( LIBOFTP *ftp, int desc );
68    int ftp_put_descriptor( LIBOFTP *ftp, const char *fname );
69    int ftp_put_descriptor_close( LIBOFTP *ftp, int desc );
70    int ftp_append_descriptor( LIBOFTP *ftp, const char *fname );
71    int ftp_append_descriptor_close( LIBOFTP *ftp, int desc );
72    
73    int ftp_list( LIBOFTP *ftp, const char *fglob, char *buf, int bufsiz );
74    int ftp_nlist( LIBOFTP *ftp, const char *fglob, char *buf, int bufsiz );
75    int ftp_mkdir( LIBOFTP *ftp, const char *dirname );
76    int ftp_rmdir( LIBOFTP *ftp, const char *dirname );
77    int ftp_pwd( LIBOFTP *ftp, char *buf, int bufsiz );
78    int ftp_cd( LIBOFTP *ftp, const char *dirname );
79    
80    
81    
82  /***** Inline functions *****************************************************/  /***** Inline functions *****************************************************/

Legend:
Removed from v.19  
changed lines
  Added in v.32

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26