Gnome XML Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
void (*ftpListCallback) (void *userData, const char *filename, const char *attrib, const char *owner, const char *group, unsigned |
void (*ftpListCallback) (void *userData, const char *filename, const char *attrib, const char *owner, const char *group, unsigned |
userData : | |
filename : | |
attrib : | |
owner : | |
group : | |
size : | |
links : | |
year : | |
month : | |
day : | |
minute : |
void (*ftpDataCallback) (void *userData, const char *data, int len); |
userData : | |
data : | |
len : |
void* xmlNanoFTPNewCtxt (const char *URL); |
Allocate and initialize a new FTP context.
URL : | The URL used to initialize the context |
void xmlNanoFTPFreeCtxt (void *ctx); |
Frees the context after closing the connection.
ctx : | an FTP context |
void* xmlNanoFTPConnectTo (const char *server, int port); |
Tries to open a control connection to the given server/port
server : | an FTP server name |
port : |
void* xmlNanoFTPOpen (const char *URL); |
Start to fetch the given ftp:// resource
URL : | the URL to the resource |
int xmlNanoFTPConnect (void *ctx); |
Tries to open a control connection
ctx : | an FTP context |
Returns : | -1 in case of error, 0 otherwise |
int xmlNanoFTPClose (void *ctx); |
Close the connection and both control and transport
ctx : | an FTP context |
Returns : | -1 incase of error, 0 otherwise |
int xmlNanoFTPQuit (void *ctx); |
Send a QUIT command to the server
ctx : | an FTP context |
Returns : | -1 in case of error, 0 otherwise |
int xmlNanoFTPGetResponse (void *ctx); |
Get the response from the FTP server after a command.
ctx : | an FTP context |
Returns : | the code number |
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 |
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 |
int xmlNanoFTPCloseConnection (void *ctx); |
Close the data connection from the server
ctx : | an FTP context |
Returns : | -1 incase of error, 0 otherwise |
int xmlNanoFTPList (void *ctx, ftpListCallback callback, void *userData, 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 |
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 |
Returns : | the socket for the data connection, or <0 in case of error |
int xmlNanoFTPGet (void *ctx, 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 |
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. |