2000-01-25 21:31:22 +03:00
/*
* nanohttp . c : minimalist FTP implementation to fetch external subsets .
*
* See Copyright for the status of this software .
*
* Daniel . Veillard @ w3 . org
*/
# ifndef __NANO_FTP_H__
# define __NANO_FTP_H__
2000-04-03 23:48:13 +04:00
# include <libxml/xmlversion.h>
# ifdef LIBXML_FTP_ENABLED
2000-01-25 21:31:22 +03:00
# ifdef __cplusplus
extern " C " {
# endif
2000-01-25 22:27:27 +03:00
/**
* ftpListCallback :
2000-01-30 23:00:07 +03:00
* @ userData : user provided data for the callback
* @ filename : the file name ( including " -> " when links are shown )
* @ attrib : the attribute string
* @ owner : the owner string
* @ group : the group string
* @ size : the file size
* @ links : the link count
* @ year : the year
* @ month : the month
* @ day : the day
* @ hour : the hour
* @ minute : the minute
*
2000-01-25 22:27:27 +03:00
* A callback for the xmlNanoFTPList command
2000-01-30 23:00:07 +03:00
* Note that only one of year and day : minute are specified
2000-01-25 22:27:27 +03:00
*/
2000-01-25 21:31:22 +03:00
typedef void ( * ftpListCallback ) ( void * userData ,
const char * filename , const char * attrib ,
const char * owner , const char * group ,
unsigned long size , int links , int year ,
2000-01-30 23:00:07 +03:00
const char * month , int day , int hour ,
int minute ) ;
2000-01-25 22:27:27 +03:00
/**
* ftpDataCallback :
* A callback for the xmlNanoFTPGet command
*/
2000-01-25 21:31:22 +03:00
typedef void ( * ftpDataCallback ) ( void * userData , const char * data , int len ) ;
2000-01-25 22:27:27 +03:00
/*
* Init
*/
void xmlNanoFTPInit ( void ) ;
2000-01-30 23:00:07 +03:00
void xmlNanoFTPCleanup ( void ) ;
2000-01-25 21:31:22 +03:00
2000-01-25 22:27:27 +03:00
/*
* Creating / freeing contexts
*/
void * xmlNanoFTPNewCtxt ( const char * URL ) ;
void xmlNanoFTPFreeCtxt ( void * ctx ) ;
void * xmlNanoFTPConnectTo ( const char * server ,
int port ) ;
/*
* Opening / closing session connections
*/
void * xmlNanoFTPOpen ( const char * URL ) ;
int xmlNanoFTPConnect ( void * ctx ) ;
2000-01-25 21:31:22 +03:00
int xmlNanoFTPClose ( void * ctx ) ;
2000-01-25 22:27:27 +03:00
int xmlNanoFTPQuit ( void * ctx ) ;
2000-01-30 23:00:07 +03:00
void xmlNanoFTPScanProxy ( const char * URL ) ;
void xmlNanoFTPProxy ( const char * host ,
int port ,
const char * user ,
const char * passwd ,
int type ) ;
int xmlNanoFTPUpdateURL ( void * ctx ,
const char * URL ) ;
2000-01-25 22:27:27 +03:00
/*
* Rathern internal commands
*/
int xmlNanoFTPGetResponse ( void * ctx ) ;
int xmlNanoFTPCheckResponse ( void * ctx ) ;
/*
* CD / DIR / GET handlers
*/
int xmlNanoFTPCwd ( void * ctx ,
char * directory ) ;
int xmlNanoFTPGetConnection ( void * ctx ) ;
int xmlNanoFTPCloseConnection ( void * ctx ) ;
int xmlNanoFTPList ( void * ctx ,
ftpListCallback callback ,
void * userData ,
char * filename ) ;
int xmlNanoFTPGetSocket ( void * ctx ,
const char * filename ) ;
int xmlNanoFTPGet ( void * ctx ,
ftpDataCallback callback ,
void * userData ,
2000-01-25 21:31:22 +03:00
const char * filename ) ;
int xmlNanoFTPRead ( void * ctx ,
void * dest ,
int len ) ;
2000-01-25 22:27:27 +03:00
2000-01-25 21:31:22 +03:00
# ifdef __cplusplus
}
2000-04-03 23:48:13 +04:00
# endif /* LIBXML_FTP_ENABLED */
2000-01-25 21:31:22 +03:00
# endif
# endif /* __NANO_FTP_H__ */