| <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>nanoftp</title><meta name="generator" content="DocBook XSL Stylesheets V1.58.1"><style xmlns="http://www.w3.org/TR/xhtml1/transitional" type="text/css"> |
| .synopsis, .classsynopsis { |
| background: #eeeeee; |
| border: solid 1px #aaaaaa; |
| padding: 0.5em; |
| } |
| .programlisting { |
| background: #eeeeff; |
| border: solid 1px #aaaaff; |
| padding: 0.5em; |
| } |
| .variablelist { |
| padding: 4px; |
| margin-left: 3em; |
| } |
| .navigation { |
| background: #ffeeee; |
| border: solid 1px #ffaaaa; |
| margin-top: 0.5em; |
| margin-bottom: 0.5em; |
| } |
| .navigation a { |
| color: #770000; |
| } |
| .navigation a:visited { |
| color: #550000; |
| } |
| .navigation .title { |
| font-size: 200%; |
| } |
| </style><link rel="home" href="index.html" title="Gnome XML Library Reference Manual"><link rel="up" href="libxml-lib.html" title="Libxml Library Reference"><link rel="previous" href="libxml-nanohttp.html" title="nanohttp"><link rel="next" href="libxml-xmlIO.html" title="xmlIO"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-nanohttp.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></img></a></td><td><a accesskey="u" href="libxml-lib.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></img></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></img></a></td><th width="100%" align="center">Gnome XML Library Reference Manual</th><td><a accesskey="n" href="libxml-xmlIO.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></img></a></td></tr></table><div class="refentry" lang="en"><a name="libxml-nanoftp"></a><div class="titlepage"></div><div class="refnamediv"><h2>nanoftp</h2><p>nanoftp — </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"> |
| |
| |
| |
| void (<a href="libxml-nanoftp.html#ftpListCallback">*ftpListCallback</a>) (void *userData, |
| const char *filename, |
| const char *attrib, |
| const char *owner, |
| const char *group, |
| unsigned <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="long-size">long size</GTKDOCLINK>, |
| int links, |
| int year, |
| const char *month, |
| int day, |
| int hour, |
| int minute); |
| void (<a href="libxml-nanoftp.html#ftpDataCallback">*ftpDataCallback</a>) (void *userData, |
| const char *data, |
| int len); |
| void <a href="libxml-nanoftp.html#xmlNanoFTPInit">xmlNanoFTPInit</a> (void); |
| void <a href="libxml-nanoftp.html#xmlNanoFTPCleanup">xmlNanoFTPCleanup</a> (void); |
| void* <a href="libxml-nanoftp.html#xmlNanoFTPNewCtxt">xmlNanoFTPNewCtxt</a> (const char *URL); |
| void <a href="libxml-nanoftp.html#xmlNanoFTPFreeCtxt">xmlNanoFTPFreeCtxt</a> (void *ctx); |
| void* <a href="libxml-nanoftp.html#xmlNanoFTPConnectTo">xmlNanoFTPConnectTo</a> (const char *server, |
| int port); |
| void* <a href="libxml-nanoftp.html#xmlNanoFTPOpen">xmlNanoFTPOpen</a> (const char *URL); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPConnect">xmlNanoFTPConnect</a> (void *ctx); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPClose">xmlNanoFTPClose</a> (void *ctx); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPQuit">xmlNanoFTPQuit</a> (void *ctx); |
| void <a href="libxml-nanoftp.html#xmlNanoFTPScanProxy">xmlNanoFTPScanProxy</a> (const char *URL); |
| void <a href="libxml-nanoftp.html#xmlNanoFTPProxy">xmlNanoFTPProxy</a> (const char *host, |
| int port, |
| const char *user, |
| const char *passwd, |
| int type); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPUpdateURL">xmlNanoFTPUpdateURL</a> (void *ctx, |
| const char *URL); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPGetResponse">xmlNanoFTPGetResponse</a> (void *ctx); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPCheckResponse">xmlNanoFTPCheckResponse</a> (void *ctx); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPCwd">xmlNanoFTPCwd</a> (void *ctx, |
| char *directory); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPDele">xmlNanoFTPDele</a> (void *ctx, |
| char *file); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPGetConnection">xmlNanoFTPGetConnection</a> (void *ctx); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPCloseConnection">xmlNanoFTPCloseConnection</a> (void *ctx); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPList">xmlNanoFTPList</a> (void *ctx, |
| <a href="libxml-nanoftp.html#ftpListCallback">ftpListCallback</a> callback, |
| void *userData, |
| char *filename); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPGetSocket">xmlNanoFTPGetSocket</a> (void *ctx, |
| const char *filename); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPGet">xmlNanoFTPGet</a> (void *ctx, |
| <a href="libxml-nanoftp.html#ftpDataCallback">ftpDataCallback</a> callback, |
| void *userData, |
| const char *filename); |
| int <a href="libxml-nanoftp.html#xmlNanoFTPRead">xmlNanoFTPRead</a> (void *ctx, |
| void *dest, |
| int len); |
| </pre></div><div class="refsect1" lang="en"><h2>Description</h2><p> |
| |
| </p></div><div class="refsect1" lang="en"><h2>Details</h2><div class="refsect2" lang="en"><h3><a name="ftpListCallback"></a>ftpListCallback ()</h3><pre class="programlisting">void (*ftpListCallback) (void *userData, |
| const char *filename, |
| const char *attrib, |
| const char *owner, |
| const char *group, |
| unsigned <GTKDOCLINK xmlns="http://www.w3.org/TR/xhtml1/transitional" HREF="long-size">long size</GTKDOCLINK>, |
| int links, |
| int year, |
| const char *month, |
| int day, |
| int hour, |
| int minute);</pre><p> |
| A callback for the xmlNanoFTPList command. |
| Note that only one of year and day:minute are specified.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>userData</tt></i> :</span></td><td> user provided data for the callback |
| </td></tr><tr><td><span class="term"><i><tt>filename</tt></i> :</span></td><td> the file name (including "->" when links are shown) |
| </td></tr><tr><td><span class="term"><i><tt>attrib</tt></i> :</span></td><td> the attribute string |
| </td></tr><tr><td><span class="term"><i><tt>owner</tt></i> :</span></td><td> the owner string |
| </td></tr><tr><td><span class="term"><i><tt>group</tt></i> :</span></td><td> the group string |
| </td></tr><tr><td><span class="term"><i><tt>Param6</tt></i> :</span></td><td> |
| </td></tr><tr><td><span class="term"><i><tt>links</tt></i> :</span></td><td> the link count |
| </td></tr><tr><td><span class="term"><i><tt>year</tt></i> :</span></td><td> the year |
| </td></tr><tr><td><span class="term"><i><tt>month</tt></i> :</span></td><td> the month |
| </td></tr><tr><td><span class="term"><i><tt>day</tt></i> :</span></td><td> the day |
| </td></tr><tr><td><span class="term"><i><tt>hour</tt></i> :</span></td><td> the hour |
| </td></tr><tr><td><span class="term"><i><tt>minute</tt></i> :</span></td><td> the minute |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="ftpDataCallback"></a>ftpDataCallback ()</h3><pre class="programlisting">void (*ftpDataCallback) (void *userData, |
| const char *data, |
| int len);</pre><p> |
| A callback for the xmlNanoFTPGet command.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>userData</tt></i> :</span></td><td> the user provided context |
| </td></tr><tr><td><span class="term"><i><tt>data</tt></i> :</span></td><td> the data received |
| </td></tr><tr><td><span class="term"><i><tt>len</tt></i> :</span></td><td> its size in bytes |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPInit"></a>xmlNanoFTPInit ()</h3><pre class="programlisting">void xmlNanoFTPInit (void);</pre><p> |
| Initialize the FTP protocol layer. |
| Currently it just checks for proxy informations, |
| and get the hostname</p><p> |
| |
| </p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPCleanup"></a>xmlNanoFTPCleanup ()</h3><pre class="programlisting">void xmlNanoFTPCleanup (void);</pre><p> |
| Cleanup the FTP protocol layer. This cleanup proxy informations.</p><p> |
| |
| </p></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPNewCtxt"></a>xmlNanoFTPNewCtxt ()</h3><pre class="programlisting">void* xmlNanoFTPNewCtxt (const char *URL);</pre><p> |
| Allocate and initialize a new FTP context.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>URL</tt></i> :</span></td><td> The URL used to initialize the context |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPFreeCtxt"></a>xmlNanoFTPFreeCtxt ()</h3><pre class="programlisting">void xmlNanoFTPFreeCtxt (void *ctx);</pre><p> |
| Frees the context after closing the connection.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPConnectTo"></a>xmlNanoFTPConnectTo ()</h3><pre class="programlisting">void* xmlNanoFTPConnectTo (const char *server, |
| int port);</pre><p> |
| Tries to open a control connection to the given server/port</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>server</tt></i> :</span></td><td> an FTP server name |
| </td></tr><tr><td><span class="term"><i><tt>port</tt></i> :</span></td><td> the port (use 21 if 0) |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPOpen"></a>xmlNanoFTPOpen ()</h3><pre class="programlisting">void* xmlNanoFTPOpen (const char *URL);</pre><p> |
| Start to fetch the given ftp:// resource</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>URL</tt></i> :</span></td><td> the URL to the resource |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPConnect"></a>xmlNanoFTPConnect ()</h3><pre class="programlisting">int xmlNanoFTPConnect (void *ctx);</pre><p> |
| Tries to open a control connection</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 in case of error, 0 otherwise |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPClose"></a>xmlNanoFTPClose ()</h3><pre class="programlisting">int xmlNanoFTPClose (void *ctx);</pre><p> |
| Close the connection and both control and transport</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 incase of error, 0 otherwise |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPQuit"></a>xmlNanoFTPQuit ()</h3><pre class="programlisting">int xmlNanoFTPQuit (void *ctx);</pre><p> |
| Send a QUIT command to the server</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 in case of error, 0 otherwise |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPScanProxy"></a>xmlNanoFTPScanProxy ()</h3><pre class="programlisting">void xmlNanoFTPScanProxy (const char *URL);</pre><p> |
| (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.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>URL</tt></i> :</span></td><td> The proxy URL used to initialize the proxy context |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPProxy"></a>xmlNanoFTPProxy ()</h3><pre class="programlisting">void xmlNanoFTPProxy (const char *host, |
| int port, |
| const char *user, |
| const char *passwd, |
| int type);</pre><p> |
| Setup the FTP proxy informations. |
| This can also be done by using ftp_proxy ftp_proxy_user and |
| ftp_proxy_password environment variables.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>host</tt></i> :</span></td><td> the proxy host name |
| </td></tr><tr><td><span class="term"><i><tt>port</tt></i> :</span></td><td> the proxy port |
| </td></tr><tr><td><span class="term"><i><tt>user</tt></i> :</span></td><td> the proxy user name |
| </td></tr><tr><td><span class="term"><i><tt>passwd</tt></i> :</span></td><td> the proxy password |
| </td></tr><tr><td><span class="term"><i><tt>type</tt></i> :</span></td><td> the type of proxy 1 for using SITE, 2 for USER a<i><tt>b</tt></i> |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPUpdateURL"></a>xmlNanoFTPUpdateURL ()</h3><pre class="programlisting">int xmlNanoFTPUpdateURL (void *ctx, |
| const char *URL);</pre><p> |
| 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.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr><tr><td><span class="term"><i><tt>URL</tt></i> :</span></td><td> The URL used to update the context |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>0 if Ok, -1 in case of error (other host). |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGetResponse"></a>xmlNanoFTPGetResponse ()</h3><pre class="programlisting">int xmlNanoFTPGetResponse (void *ctx);</pre><p> |
| Get the response from the FTP server after a command.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the code number |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPCheckResponse"></a>xmlNanoFTPCheckResponse ()</h3><pre class="programlisting">int xmlNanoFTPCheckResponse (void *ctx);</pre><p> |
| Check if there is a response from the FTP server after a command.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the code number, or 0 |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPCwd"></a>xmlNanoFTPCwd ()</h3><pre class="programlisting">int xmlNanoFTPCwd (void *ctx, |
| char *directory);</pre><p> |
| Tries to change the remote directory</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr><tr><td><span class="term"><i><tt>directory</tt></i> :</span></td><td> a directory on the server |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 incase of error, 1 if CWD worked, 0 if it failed |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPDele"></a>xmlNanoFTPDele ()</h3><pre class="programlisting">int xmlNanoFTPDele (void *ctx, |
| char *file);</pre><p> |
| Tries to delete an item (file or directory) from server</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr><tr><td><span class="term"><i><tt>file</tt></i> :</span></td><td> a file or directory on the server |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 incase of error, 1 if DELE worked, 0 if it failed |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGetConnection"></a>xmlNanoFTPGetConnection ()</h3><pre class="programlisting">int xmlNanoFTPGetConnection (void *ctx);</pre><p> |
| Try to open a data connection to the server. Currently only |
| passive mode is supported.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 incase of error, 0 otherwise |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPCloseConnection"></a>xmlNanoFTPCloseConnection ()</h3><pre class="programlisting">int xmlNanoFTPCloseConnection (void *ctx);</pre><p> |
| Close the data connection from the server</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 incase of error, 0 otherwise |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPList"></a>xmlNanoFTPList ()</h3><pre class="programlisting">int xmlNanoFTPList (void *ctx, |
| <a href="libxml-nanoftp.html#ftpListCallback">ftpListCallback</a> callback, |
| void *userData, |
| char *filename);</pre><p> |
| Do a listing on the server. All files info are passed back |
| in the callbacks.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr><tr><td><span class="term"><i><tt>callback</tt></i> :</span></td><td> the user callback |
| </td></tr><tr><td><span class="term"><i><tt>userData</tt></i> :</span></td><td> the user callback data |
| </td></tr><tr><td><span class="term"><i><tt>filename</tt></i> :</span></td><td> optional files to list |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 incase of error, 0 otherwise |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGetSocket"></a>xmlNanoFTPGetSocket ()</h3><pre class="programlisting">int xmlNanoFTPGetSocket (void *ctx, |
| const char *filename);</pre><p> |
| Initiate fetch of the given file from the server.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr><tr><td><span class="term"><i><tt>filename</tt></i> :</span></td><td> the file to retrieve (or NULL if path is in context). |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the socket for the data connection, or <0 in case of error |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGet"></a>xmlNanoFTPGet ()</h3><pre class="programlisting">int xmlNanoFTPGet (void *ctx, |
| <a href="libxml-nanoftp.html#ftpDataCallback">ftpDataCallback</a> callback, |
| void *userData, |
| const char *filename);</pre><p> |
| Fetch the given file from the server. All data are passed back |
| in the callbacks. The last callback has a size of 0 block.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> an FTP context |
| </td></tr><tr><td><span class="term"><i><tt>callback</tt></i> :</span></td><td> the user callback |
| </td></tr><tr><td><span class="term"><i><tt>userData</tt></i> :</span></td><td> the user callback data |
| </td></tr><tr><td><span class="term"><i><tt>filename</tt></i> :</span></td><td> the file to retrieve |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>-1 incase of error, 0 otherwise |
| </td></tr></tbody></table></div></div><hr xmlns="http://www.w3.org/TR/xhtml1/transitional"></hr><div class="refsect2" lang="en"><h3><a name="xmlNanoFTPRead"></a>xmlNanoFTPRead ()</h3><pre class="programlisting">int xmlNanoFTPRead (void *ctx, |
| void *dest, |
| int len);</pre><p> |
| This function tries to read <i><tt>len</tt></i> bytes from the existing FTP connection |
| and saves them in <i><tt>dest</tt></i>. This is a blocking call.</p><p> |
| |
| </p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><i><tt>ctx</tt></i> :</span></td><td> the FTP context |
| </td></tr><tr><td><span class="term"><i><tt>dest</tt></i> :</span></td><td> a buffer |
| </td></tr><tr><td><span class="term"><i><tt>len</tt></i> :</span></td><td> the buffer length |
| </td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>the number of byte read. 0 is an indication of an end of connection. |
| -1 indicates a parameter error. |
| </td></tr></tbody></table></div></div></div></div><table xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libxml-nanohttp.html"><b><< nanohttp</b></a></td><td align="right"><a accesskey="n" href="libxml-xmlIO.html"><b>xmlIO >></b></a></td></tr></table></body></html> |