Gnome XML Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# nanoftp

## Name

nanoftp --

## Synopsis

    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);
    void        (*ftpDataCallback)              (void *userData,
                                                 const char *data,
                                                 int len);
    void        xmlNanoFTPInit                  (void);
    void        xmlNanoFTPCleanup               (void);
    void*       xmlNanoFTPNewCtxt               (const char *URL);
    void        xmlNanoFTPFreeCtxt              (void *ctx);
    void*       xmlNanoFTPConnectTo             (const char *server,
                                                 int port);
    void*       xmlNanoFTPOpen                  (const char *URL);
    int         xmlNanoFTPConnect               (void *ctx);
    int         xmlNanoFTPClose                 (void *ctx);
    int         xmlNanoFTPQuit                  (void *ctx);
    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);
    int         xmlNanoFTPGetResponse           (void *ctx);
    int         xmlNanoFTPCheckResponse         (void *ctx);
    int         xmlNanoFTPCwd                   (void *ctx,
                                                 char *directory);
    int         xmlNanoFTPDele                  (void *ctx,
                                                 char *file);
    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,
                                                 const char *filename);
    int         xmlNanoFTPRead                  (void *ctx,
                                                 void *dest,
                                                 int len);

## Description

## Details

### 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 xmlNanoFTPList command. Note that only one of year and day:minute are specified.

`userData` : |
`filename` : |
`attrib` : |
`owner` : |
`group` : |
`Param6` : |
`links` : |
`year` : |
`month` : |
`day` : |
`hour` : |
`minute` : |

### ftpDataCallback ()

    void        (*ftpDataCallback)              (void *userData,
                                                 const char *data,
                                                 int len);

A callback for the xmlNanoFTPGet command.

`userData` : |
`data` : |
`len` : |

### xmlNanoFTPInit ()

    void        xmlNanoFTPInit                  (void);

Initialize the FTP protocol layer. Currently it just checks for proxy informations, and get the hostname

### xmlNanoFTPCleanup ()

    void        xmlNanoFTPCleanup               (void);

Cleanup the FTP protocol layer. This cleanup proxy informations.

### xmlNanoFTPNewCtxt ()

    void*       xmlNanoFTPNewCtxt               (const char *URL);

Allocate and initialize a new FTP context.

`URL` : |

### xmlNanoFTPFreeCtxt ()

    void        xmlNanoFTPFreeCtxt              (void *ctx);

Frees the context after closing the connection.

`ctx` : |

### xmlNanoFTPConnectTo ()

    void*       xmlNanoFTPConnectTo             (const char *server,
                                                 int port);

Tries to open a control connection to the given server/port

`server` : |
`port` : |

### xmlNanoFTPOpen ()

    void*       xmlNanoFTPOpen                  (const char *URL);

Start to fetch the given ftp:// resource

`URL` : |

### xmlNanoFTPConnect ()

    int         xmlNanoFTPConnect               (void *ctx);

Tries to open a control connection

`ctx` : |
Returns : |

### xmlNanoFTPClose ()

    int         xmlNanoFTPClose                 (void *ctx);

Close the connection and both control and transport

`ctx` : |
Returns : |

### xmlNanoFTPQuit ()

    int         xmlNanoFTPQuit                  (void *ctx);

Send a QUIT command to the server

`ctx` : |
Returns : |

### 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` : |

### 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` : |
`port` : |
`user` : |
`passwd` : |
`type` : |

### 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` : |
`URL` : |
Returns : |

### xmlNanoFTPGetResponse ()

    int         xmlNanoFTPGetResponse           (void *ctx);

Get the response from the FTP server after a command.

`ctx` : |
Returns : |

### xmlNanoFTPCheckResponse ()

    int         xmlNanoFTPCheckResponse         (void *ctx);

Check if there is a response from the FTP server after a command.

`ctx` : |
Returns : |

### xmlNanoFTPCwd ()

    int         xmlNanoFTPCwd                   (void *ctx,
                                                 char *directory);

Tries to change the remote directory

`ctx` : |
`directory` : |
Returns : |

### xmlNanoFTPDele ()

    int         xmlNanoFTPDele                  (void *ctx,
                                                 char *file);

Tries to delete an item (file or directory) from server

`ctx` : |
`file` : |
Returns : |

### xmlNanoFTPGetConnection ()

    int         xmlNanoFTPGetConnection         (void *ctx);

Try to open a data connection to the server. Currently only passive mode is supported.

`ctx` : |
Returns : |

### xmlNanoFTPCloseConnection ()

    int         xmlNanoFTPCloseConnection       (void *ctx);

Close the data connection from the server

`ctx` : |
Returns : |

### xmlNanoFTPList ()

    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` : |
`callback` : |
`userData` : |
`filename` : |
Returns : |

### xmlNanoFTPGetSocket ()

    int         xmlNanoFTPGetSocket             (void *ctx,
                                                 const char *filename);

Initiate fetch of the given file from the server.

`ctx` : |
`filename` : |
Returns : |

### xmlNanoFTPGet ()

    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` : |
`callback` : |
`userData` : |
`filename` : |
Returns : |

### 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` : |
`dest` : |
`len` : |
Returns : |

<<< Previous Page | Home | Up | Next Page >>>
nanohttp | xmlIO