⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 libxml2-nanoftp.html

📁 xml开源解析代码.版本为libxml2-2.6.29,可支持GB3212.网络消息发送XML时很有用.
💻 HTML
📖 第 1 页 / 共 2 页
字号:
        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPCleanup"/>xmlNanoFTPCleanup ()</h3><pre class="programlisting">void	xmlNanoFTPCleanup		(void)<br/></pre><p>Cleanup the FTP protocol layer. This cleanup proxy informations.</p></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPClose"/>xmlNanoFTPClose ()</h3><pre class="programlisting">int	xmlNanoFTPClose			(void * ctx)<br/></pre><p>Close the connection and both control and transport</p><div class="variablelist"><table border="0"><col align="left"/><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>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPCloseConnection"/>xmlNanoFTPCloseConnection ()</h3><pre class="programlisting">int	xmlNanoFTPCloseConnection	(void * ctx)<br/></pre><p>Close the data connection from the server</p><div class="variablelist"><table border="0"><col align="left"/><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>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPConnect"/>xmlNanoFTPConnect ()</h3><pre class="programlisting">int	xmlNanoFTPConnect		(void * ctx)<br/></pre><p>Tries to open a control connection</p><div class="variablelist"><table border="0"><col align="left"/><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>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPConnectTo"/>xmlNanoFTPConnectTo ()</h3><pre class="programlisting">void *	xmlNanoFTPConnectTo		(const char * server, <br/>					 int port)<br/></pre><p>Tries to open a control connection to the given server/port</p><div class="variablelist"><table border="0"><col align="left"/><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><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an fTP context or NULL if it failed</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPCwd"/>xmlNanoFTPCwd ()</h3><pre class="programlisting">int	xmlNanoFTPCwd			(void * ctx, <br/>					 const char * directory)<br/></pre><p>Tries to change the remote directory</p><div class="variablelist"><table border="0"><col align="left"/><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"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 1 if CWD worked, 0 if it failed</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPDele"/>xmlNanoFTPDele ()</h3><pre class="programlisting">int	xmlNanoFTPDele			(void * ctx, <br/>					 const char * file)<br/></pre><p>Tries to delete an item (file or directory) from server</p><div class="variablelist"><table border="0"><col align="left"/><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"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 1 if DELE worked, 0 if it failed</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPFreeCtxt"/>xmlNanoFTPFreeCtxt ()</h3><pre class="programlisting">void	xmlNanoFTPFreeCtxt		(void * ctx)<br/></pre><p>Frees the context after closing the connection.</p><div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGet"/>xmlNanoFTPGet ()</h3><pre class="programlisting">int	xmlNanoFTPGet			(void * ctx, <br/>					 <a href="libxml2-nanoftp.html#ftpDataCallback">ftpDataCallback</a> callback, <br/>					 void * userData, <br/>					 const char * filename)<br/></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><div class="variablelist"><table border="0"><col align="left"/><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"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGetConnection"/>xmlNanoFTPGetConnection ()</h3><pre class="programlisting">int	xmlNanoFTPGetConnection		(void * ctx)<br/></pre><p>Try to open a data connection to the server. Currently only passive mode is supported.</p><div class="variablelist"><table border="0"><col align="left"/><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>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGetResponse"/>xmlNanoFTPGetResponse ()</h3><pre class="programlisting">int	xmlNanoFTPGetResponse		(void * ctx)<br/></pre><p>Get the response from the FTP server after a command.</p><div class="variablelist"><table border="0"><col align="left"/><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>Returns</tt></i>:</span></td><td>the code number</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGetSocket"/>xmlNanoFTPGetSocket ()</h3><pre class="programlisting">int	xmlNanoFTPGetSocket		(void * ctx, <br/>					 const char * filename)<br/></pre><p>Initiate fetch of the given file from the server.</p><div class="variablelist"><table border="0"><col align="left"/><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"><i><tt>Returns</tt></i>:</span></td><td>the socket for the data connection, or &lt;0 in case of error</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPInit"/>xmlNanoFTPInit ()</h3><pre class="programlisting">void	xmlNanoFTPInit			(void)<br/></pre><p>Initialize the FTP protocol layer. Currently it just checks for proxy informations, and get the hostname</p></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPList"/>xmlNanoFTPList ()</h3><pre class="programlisting">int	xmlNanoFTPList			(void * ctx, <br/>					 <a href="libxml2-nanoftp.html#ftpListCallback">ftpListCallback</a> callback, <br/>					 void * userData, <br/>					 const char * filename)<br/></pre><p>Do a listing on the server. All files info are passed back in the callbacks.</p><div class="variablelist"><table border="0"><col align="left"/><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"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPNewCtxt"/>xmlNanoFTPNewCtxt ()</h3><pre class="programlisting">void *	xmlNanoFTPNewCtxt		(const char * URL)<br/></pre><p>Allocate and initialize a new FTP context.</p><div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL used to initialize the context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an FTP context or NULL in case of error.</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPOpen"/>xmlNanoFTPOpen ()</h3><pre class="programlisting">void *	xmlNanoFTPOpen			(const char * URL)<br/></pre><p>Start to fetch the given ftp:// resource</p><div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the URL to the resource</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an FTP context, or NULL</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPProxy"/>xmlNanoFTPProxy ()</h3><pre class="programlisting">void	xmlNanoFTPProxy			(const char * host, <br/>					 int port, <br/>					 const char * user, <br/>					 const char * passwd, <br/>					 int type)<br/></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><div class="variablelist"><table border="0"><col align="left"/><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@b</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPQuit"/>xmlNanoFTPQuit ()</h3><pre class="programlisting">int	xmlNanoFTPQuit			(void * ctx)<br/></pre><p>Send a QUIT command to the server</p><div class="variablelist"><table border="0"><col align="left"/><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>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div></div>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPRead"/>xmlNanoFTPRead ()</h3><pre class="programlisting">int	xmlNanoFTPRead			(void * ctx, <br/>					 void * dest, <br/>					 int len)<br/></pre><p>This function tries to read @len bytes from the existing FTP connection and saves them in @dest. This is a blocking call.</p><div class="variablelist"><table border="0"><col align="left"/><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"><i><tt>Returns</tt></i>:</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>        <hr/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPScanProxy"/>xmlNanoFTPScanProxy ()</h3><pre class="programlisting">void	xmlNanoFTPScanProxy		(const char * URL)<br/></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><div class="variablelist"><table border="0"><col align="left"/><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/>        <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPUpdateURL"/>xmlNanoFTPUpdateURL ()</h3><pre class="programlisting">int	xmlNanoFTPUpdateURL		(void * ctx, <br/>					 const char * URL)<br/></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><div class="variablelist"><table border="0"><col align="left"/><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"><i><tt>Returns</tt></i>:</span></td><td>0 if Ok, -1 in case of error (other host).</td></tr></tbody></table></div></div>        <hr/>      </div>    </div>  </body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -