http://swpat.ffii.org/
Action against software patents
http://www.gnome.org/
Gnome2 Logo
http://www.w3.org/Status
W3C Logo
http://www.redhat.com/
Red Hat Logo
http://xmlsoft.org/
Made with Libxml2 Logo
Module nanoftp from libxml2
API Menu
../index.html
Main Menu
../docs.html
Developer Menu
../examples/index.html
Code Examples
index.html
API Menu
libxml-parser.html
Parser API
libxml-tree.html
Tree API
libxml-xmlreader.html
Reader API
../guidelines.html
XML Guidelines
../ChangeLog.html
ChangeLog
API Indexes
../APIchunk0.html
Alphabetic
../APIconstructors.html
Constructors
../APIfunctions.html
Functions/Types
../APIfiles.html
Modules
../APIsymbols.html
Symbols
Related links
http://mail.gnome.org/archives/xml/
Mail archive
http://xmlsoft.org/XSLT/
XSLT libxslt
http://phd.cs.unibo.it/gdome2/
DOM gdome2
http://www.aleksey.com/xmlsec/
XML-DSig xmlsec
ftp://xmlsoft.org/
FTP
http://www.zlatkovic.com/projects/libxml/
Windows binaries
http://www.blastwave.org/packages.php/libxml2
Solaris binaries
http://www.explain.com.au/oss/libxml2xslt.html
MacOsX binaries
http://libxmlplusplus.sourceforge.net/
C++ bindings
http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4
PHP bindings
http://sourceforge.net/projects/libxml2-pas/
Pascal bindings
http://rubyforge.org/projects/xml-tools/
Ruby bindings
http://tclxml.sourceforge.net/
Tcl bindings
http://bugzilla.gnome.org/buglist.cgi?product=libxml2
Bug Tracker
libxml-list.html
Prev
libxml-list.html
list
index.html
Up
index.html
API documentation
../index.html
Home
../index.html
The XML C parser and toolkit of Gnome
libxml-nanohttp.html
nanohttp
libxml-nanohttp.html
Next
minimal FTP implementation allowing to fetch resources like external subset.
Table of Contents
Function type:
#ftpDataCallback
ftpDataCallback
void
#ftpDataCallback
ftpDataCallback
(void * userData,
const char * data,
int len)
Function type:
#ftpListCallback
ftpListCallback
void
#ftpListCallback
ftpListCallback
(void * userData,
const char * filename,
const char * attrib,
const char * owner,
const char * group,
unsigned long size,
int links,
int year,
const char * month,
int day,
int hour,
int minute)
int
#xmlNanoFTPCheckResponse
xmlNanoFTPCheckResponse
(void * ctx)
void
#xmlNanoFTPCleanup
xmlNanoFTPCleanup
(void)
int
#xmlNanoFTPClose
xmlNanoFTPClose
(void * ctx)
int
#xmlNanoFTPCloseConnection
xmlNanoFTPCloseConnection
(void * ctx)
int
#xmlNanoFTPConnect
xmlNanoFTPConnect
(void * ctx)
void *
#xmlNanoFTPConnectTo
xmlNanoFTPConnectTo
(const char * server,
int port)
int
#xmlNanoFTPCwd
xmlNanoFTPCwd
(void * ctx,
const char * directory)
int
#xmlNanoFTPDele
xmlNanoFTPDele
(void * ctx,
const char * file)
void
#xmlNanoFTPFreeCtxt
xmlNanoFTPFreeCtxt
(void * ctx)
int
#xmlNanoFTPGet
xmlNanoFTPGet
(void * ctx,
libxml-nanoftp.html#ftpDataCallback
ftpDataCallback
callback,
void * userData,
const char * filename)
int
#xmlNanoFTPGetConnection
xmlNanoFTPGetConnection
(void * ctx)
int
#xmlNanoFTPGetResponse
xmlNanoFTPGetResponse
(void * ctx)
int
#xmlNanoFTPGetSocket
xmlNanoFTPGetSocket
(void * ctx,
const char * filename)
void
#xmlNanoFTPInit
xmlNanoFTPInit
(void)
int
#xmlNanoFTPList
xmlNanoFTPList
(void * ctx,
libxml-nanoftp.html#ftpListCallback
ftpListCallback
callback,
void * userData,
const char * filename)
void *
#xmlNanoFTPNewCtxt
xmlNanoFTPNewCtxt
(const char * URL)
void *
#xmlNanoFTPOpen
xmlNanoFTPOpen
(const char * URL)
void
#xmlNanoFTPProxy
xmlNanoFTPProxy
(const char * host,
int port,
const char * user,
const char * passwd,
int type)
int
#xmlNanoFTPQuit
xmlNanoFTPQuit
(void * ctx)
int
#xmlNanoFTPRead
xmlNanoFTPRead
(void * ctx,
void * dest,
int len)
void
#xmlNanoFTPScanProxy
xmlNanoFTPScanProxy
(const char * URL)
int
#xmlNanoFTPUpdateURL
xmlNanoFTPUpdateURL
(void * ctx,
const char * URL)
Description
Function type: ftpDataCallback
Function type: ftpDataCallback
void	ftpDataCallback			(void * userData,
const char * data,
int len)
A callback for the
libxml-nanoftp.html#xmlNanoFTPGet
xmlNanoFTPGet
command.
userData
:
the user provided context
data
:
the data received
len
:
its size in bytes
Function type: ftpListCallback
Function type: ftpListCallback
void	ftpListCallback			(void * userData,
const char * filename,
const char * attrib,
const char * owner,
const char * group,
unsigned long size,
int links,
int year,
const char * month,
int day,
int hour,
int minute)
A callback for the
libxml-nanoftp.html#xmlNanoFTPList
xmlNanoFTPList
command. Note that only one of year and day:minute are specified.
userData
:
user provided data for the callback
filename
:
the file name (including "->" when links are shown)
attrib
:
the
libxml-SAX.html#attribute
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
Function: xmlNanoFTPCheckResponse
int	xmlNanoFTPCheckResponse		(void * ctx)
Check if there is a response from the FTP server after a command.
ctx
:
an FTP context
Returns
:
the code number, or 0
Function: xmlNanoFTPCleanup
void	xmlNanoFTPCleanup		(void)
Cleanup the FTP protocol layer. This cleanup proxy informations.
Function: xmlNanoFTPClose
int	xmlNanoFTPClose			(void * ctx)
Close the connection and both control and transport
ctx
:
an FTP context
Returns
:
-1 incase of error, 0 otherwise
Function: xmlNanoFTPCloseConnection
int	xmlNanoFTPCloseConnection	(void * ctx)
Close the data connection from the server
ctx
:
an FTP context
Returns
:
-1 incase of error, 0 otherwise
Function: xmlNanoFTPConnect
int	xmlNanoFTPConnect		(void * ctx)
Tries to open a control connection
ctx
:
an FTP context
Returns
:
-1 in case of error, 0 otherwise
Function: xmlNanoFTPConnectTo
void *	xmlNanoFTPConnectTo		(const char * server,
int port)
Tries to open a control connection to the given server/port
server
:
an FTP server name
port
:
the port (use 21 if 0)
Returns
:
an fTP context or NULL if it failed
Function: xmlNanoFTPCwd
int	xmlNanoFTPCwd			(void * ctx,
const char * directory)
Tries to change the remote directory
ctx
:
an FTP context
directory
:
a directory on the server
Returns
:
-1 incase of error, 1 if CWD worked, 0 if it failed
Function: xmlNanoFTPDele
int	xmlNanoFTPDele			(void * ctx,
const char * file)
Tries to delete an item (file or directory) from server
ctx
:
an FTP context
file
:
a file or directory on the server
Returns
:
-1 incase of error, 1 if DELE worked, 0 if it failed
Function: xmlNanoFTPFreeCtxt
void	xmlNanoFTPFreeCtxt		(void * ctx)
Frees the context after closing the connection.
ctx
:
an FTP context
Function: xmlNanoFTPGet
int	xmlNanoFTPGet			(void * ctx,
libxml-nanoftp.html#ftpDataCallback
ftpDataCallback
callback,
void * userData,
const char * filename)
Fetch the given file from the server. All data are passed back in the callbacks. The last callback has a size of 0 block.
ctx
:
an FTP context
callback
:
the user callback
userData
:
the user callback data
filename
:
the file to retrieve
Returns
:
-1 incase of error, 0 otherwise
Function: xmlNanoFTPGetConnection
int	xmlNanoFTPGetConnection		(void * ctx)
Try to open a data connection to the server. Currently only passive mode is supported.
ctx
:
an FTP context
Returns
:
-1 incase of error, 0 otherwise
Function: xmlNanoFTPGetResponse
int	xmlNanoFTPGetResponse		(void * ctx)
Get the response from the FTP server after a command.
ctx
:
an FTP context
Returns
:
the code number
Function: xmlNanoFTPGetSocket
int	xmlNanoFTPGetSocket		(void * ctx,
const char * filename)
Initiate fetch of the given file from the server.
ctx
:
an FTP context
filename
:
the file to retrieve (or NULL if path is in context).
Returns
:
the socket for the data connection, or <0 in case of error
Function: xmlNanoFTPInit
void	xmlNanoFTPInit			(void)
Initialize the FTP protocol layer. Currently it just checks for proxy informations, and get the hostname
Function: xmlNanoFTPList
int	xmlNanoFTPList			(void * ctx,
libxml-nanoftp.html#ftpListCallback
ftpListCallback
callback,
void * userData,
const char * filename)
Do a listing on the server. All files info are passed back in the callbacks.
ctx
:
an FTP context
callback
:
the user callback
userData
:
the user callback data
filename
:
optional files to list
Returns
:
-1 incase of error, 0 otherwise
Function: xmlNanoFTPNewCtxt
void *	xmlNanoFTPNewCtxt		(const char * URL)
Allocate and initialize a new FTP context.
URL
:
The URL used to initialize the context
Returns
:
an FTP context or NULL in case of error.
Function: xmlNanoFTPOpen
void *	xmlNanoFTPOpen			(const char * URL)
Start to fetch the given ftp:// resource
URL
:
the URL to the resource
Returns
:
an FTP context, or NULL
Function: xmlNanoFTPProxy
void	xmlNanoFTPProxy			(const char * host,
int port,
const char * user,
const char * passwd,
int type)
Setup the FTP proxy informations. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.
host
:
the proxy host name
port
:
the proxy port
user
:
the proxy user name
passwd
:
the proxy password
type
:
the type of proxy 1 for using SITE, 2 for USER a@b
Function: xmlNanoFTPQuit
int	xmlNanoFTPQuit			(void * ctx)
Send a QUIT command to the server
ctx
:
an FTP context
Returns
:
-1 in case of error, 0 otherwise
Function: xmlNanoFTPRead
int	xmlNanoFTPRead			(void * ctx,
void * dest,
int len)
This function tries to read @len bytes from the existing FTP connection and saves them in @dest. This is a blocking call.
ctx
:
the FTP context
dest
:
a buffer
len
:
the buffer length
Returns
:
the number of byte read. 0 is an indication of an end of connection. -1 indicates a parameter error.
Function: xmlNanoFTPScanProxy
void	xmlNanoFTPScanProxy		(const char * URL)
(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy informations.
URL
:
The proxy URL used to initialize the proxy context
Function: xmlNanoFTPUpdateURL
int	xmlNanoFTPUpdateURL		(void * ctx,
const char * URL)
Update an FTP context by parsing the URL and finding new path it indicates. If there is an error in the protocol, hostname, port or other information, the error is raised. It indicates a new connection has to be established.
ctx
:
an FTP context
URL
:
The URL used to update the context
Returns
:
0 if Ok, -1 in case of error (other host).
../bugs.html
Daniel Veillard
