7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
10 TITLE="Gnome XML Library Reference Manual"
11 HREF="book1.html"><LINK
13 TITLE="Libxml Library Reference"
14 HREF="libxml-lib.html"><LINK
17 HREF="libxml-nanohttp.html"><LINK
20 HREF="libxml-xmlio.html"></HEAD
43 >Gnome XML Library Reference Manual</FONT
52 HREF="libxml-nanohttp.html"
57 ><<< Previous Page</B
90 HREF="libxml-lib.html"
106 HREF="libxml-xmlio.html"
111 >Next Page >>></B
120 NAME="LIBXML-NANOFTP">nanoftp</H1
128 >nanoftp -- </DIV
130 CLASS="REFSYNOPSISDIV"
146 HREF="libxml-nanoftp.html#FTPLISTCALLBACK"
149 const char *filename,
164 HREF="libxml-nanoftp.html#FTPDATACALLBACK"
170 HREF="libxml-nanoftp.html#XMLNANOFTPINIT"
174 HREF="libxml-nanoftp.html#XMLNANOFTPCLEANUP"
175 >xmlNanoFTPCleanup</A
178 HREF="libxml-nanoftp.html#XMLNANOFTPNEWCTXT"
179 >xmlNanoFTPNewCtxt</A
182 HREF="libxml-nanoftp.html#XMLNANOFTPFREECTXT"
183 >xmlNanoFTPFreeCtxt</A
186 HREF="libxml-nanoftp.html#XMLNANOFTPCONNECTTO"
187 >xmlNanoFTPConnectTo</A
188 > (const char *server,
191 HREF="libxml-nanoftp.html#XMLNANOFTPOPEN"
195 HREF="libxml-nanoftp.html#XMLNANOFTPCONNECT"
196 >xmlNanoFTPConnect</A
199 HREF="libxml-nanoftp.html#XMLNANOFTPCLOSE"
203 HREF="libxml-nanoftp.html#XMLNANOFTPQUIT"
207 HREF="libxml-nanoftp.html#XMLNANOFTPSCANPROXY"
208 >xmlNanoFTPScanProxy</A
211 HREF="libxml-nanoftp.html#XMLNANOFTPPROXY"
219 HREF="libxml-nanoftp.html#XMLNANOFTPUPDATEURL"
220 >xmlNanoFTPUpdateURL</A
224 HREF="libxml-nanoftp.html#XMLNANOFTPGETRESPONSE"
225 >xmlNanoFTPGetResponse</A
228 HREF="libxml-nanoftp.html#XMLNANOFTPCHECKRESPONSE"
229 >xmlNanoFTPCheckResponse</A
232 HREF="libxml-nanoftp.html#XMLNANOFTPCWD"
237 HREF="libxml-nanoftp.html#XMLNANOFTPGETCONNECTION"
238 >xmlNanoFTPGetConnection</A
241 HREF="libxml-nanoftp.html#XMLNANOFTPCLOSECONNECTION"
242 >xmlNanoFTPCloseConnection</A
245 HREF="libxml-nanoftp.html#XMLNANOFTPLIST"
249 HREF="libxml-nanoftp.html#FTPLISTCALLBACK"
255 HREF="libxml-nanoftp.html#XMLNANOFTPGETSOCKET"
256 >xmlNanoFTPGetSocket</A
258 const char *filename);
260 HREF="libxml-nanoftp.html#XMLNANOFTPGET"
264 HREF="libxml-nanoftp.html#FTPDATACALLBACK"
268 const char *filename);
270 HREF="libxml-nanoftp.html#XMLNANOFTPREAD"
303 NAME="FTPLISTCALLBACK"
305 >ftpListCallback ()</H3
314 CLASS="PROGRAMLISTING"
315 >void (*ftpListCallback) (void *userData,
316 const char *filename,
334 >A callback for the xmlNanoFTPList command.
335 Note that only one of year and day:minute are specified.</P
339 CLASS="INFORMALTABLE"
366 > user provided data for the callback</TD
383 > the file name (including "->" when links are shown)</TD
400 > the attribute string</TD
417 > the owner string</TD
434 > the group string</TD
568 NAME="FTPDATACALLBACK"
570 >ftpDataCallback ()</H3
579 CLASS="PROGRAMLISTING"
580 >void (*ftpDataCallback) (void *userData,
587 >A callback for the xmlNanoFTPGet command.</P
591 CLASS="INFORMALTABLE"
618 > the user provided context</TD
635 > the data received</TD
652 > its size in bytes</TD
667 NAME="XMLNANOFTPINIT"
669 >xmlNanoFTPInit ()</H3
678 CLASS="PROGRAMLISTING"
679 >void xmlNanoFTPInit (void);</PRE
684 >Initialize the FTP protocol layer.
685 Currently it just checks for proxy informations,
686 and get the hostname</P
697 NAME="XMLNANOFTPCLEANUP"
699 >xmlNanoFTPCleanup ()</H3
708 CLASS="PROGRAMLISTING"
709 >void xmlNanoFTPCleanup (void);</PRE
714 >Cleanup the FTP protocol layer. This cleanup proxy informations.</P
725 NAME="XMLNANOFTPNEWCTXT"
727 >xmlNanoFTPNewCtxt ()</H3
736 CLASS="PROGRAMLISTING"
737 >void* xmlNanoFTPNewCtxt (const char *URL);</PRE
742 >Allocate and initialize a new FTP context.</P
746 CLASS="INFORMALTABLE"
773 > The URL used to initialize the context</TD
788 NAME="XMLNANOFTPFREECTXT"
790 >xmlNanoFTPFreeCtxt ()</H3
799 CLASS="PROGRAMLISTING"
800 >void xmlNanoFTPFreeCtxt (void *ctx);</PRE
805 >Frees the context after closing the connection.</P
809 CLASS="INFORMALTABLE"
851 NAME="XMLNANOFTPCONNECTTO"
853 >xmlNanoFTPConnectTo ()</H3
862 CLASS="PROGRAMLISTING"
863 >void* xmlNanoFTPConnectTo (const char *server,
869 >Tries to open a control connection to the given server/port</P
873 CLASS="INFORMALTABLE"
900 > an FTP server name</TD
917 > the port (use 21 if 0)</TD
932 NAME="XMLNANOFTPOPEN"
934 >xmlNanoFTPOpen ()</H3
943 CLASS="PROGRAMLISTING"
944 >void* xmlNanoFTPOpen (const char *URL);</PRE
949 >Start to fetch the given ftp:// resource</P
953 CLASS="INFORMALTABLE"
980 > the URL to the resource</TD
995 NAME="XMLNANOFTPCONNECT"
997 >xmlNanoFTPConnect ()</H3
1006 CLASS="PROGRAMLISTING"
1007 >int xmlNanoFTPConnect (void *ctx);</PRE
1012 >Tries to open a control connection</P
1016 CLASS="INFORMALTABLE"
1043 > an FTP context</TD
1061 >-1 in case of error, 0 otherwise</TD
1076 NAME="XMLNANOFTPCLOSE"
1078 >xmlNanoFTPClose ()</H3
1087 CLASS="PROGRAMLISTING"
1088 >int xmlNanoFTPClose (void *ctx);</PRE
1093 >Close the connection and both control and transport</P
1097 CLASS="INFORMALTABLE"
1124 > an FTP context</TD
1142 >-1 incase of error, 0 otherwise</TD
1157 NAME="XMLNANOFTPQUIT"
1159 >xmlNanoFTPQuit ()</H3
1168 CLASS="PROGRAMLISTING"
1169 >int xmlNanoFTPQuit (void *ctx);</PRE
1174 >Send a QUIT command to the server</P
1178 CLASS="INFORMALTABLE"
1205 > an FTP context</TD
1223 >-1 in case of error, 0 otherwise</TD
1238 NAME="XMLNANOFTPSCANPROXY"
1240 >xmlNanoFTPScanProxy ()</H3
1249 CLASS="PROGRAMLISTING"
1250 >void xmlNanoFTPScanProxy (const char *URL);</PRE
1255 >(Re)Initialize the FTP Proxy context by parsing the URL and finding
1256 the protocol host port it indicates.
1257 Should be like ftp://myproxy/ or ftp://myproxy:3128/
1258 A NULL URL cleans up proxy informations.</P
1262 CLASS="INFORMALTABLE"
1289 > The proxy URL used to initialize the proxy context</TD
1304 NAME="XMLNANOFTPPROXY"
1306 >xmlNanoFTPProxy ()</H3
1315 CLASS="PROGRAMLISTING"
1316 >void xmlNanoFTPProxy (const char *host,
1325 >Setup the FTP proxy informations.
1326 This can also be done by using ftp_proxy ftp_proxy_user and
1327 ftp_proxy_password environment variables.</P
1331 CLASS="INFORMALTABLE"
1358 > the proxy host name</TD
1375 > the proxy port</TD
1392 > the proxy user name</TD
1409 > the proxy password</TD
1426 > the type of proxy 1 for using SITE, 2 for USER a<TT
1446 NAME="XMLNANOFTPUPDATEURL"
1448 >xmlNanoFTPUpdateURL ()</H3
1457 CLASS="PROGRAMLISTING"
1458 >int xmlNanoFTPUpdateURL (void *ctx,
1459 const char *URL);</PRE
1464 >Update an FTP context by parsing the URL and finding
1465 new path it indicates. If there is an error in the
1466 protocol, hostname, port or other information, the
1467 error is raised. It indicates a new connection has to
1472 CLASS="INFORMALTABLE"
1499 > an FTP context</TD
1516 > The URL used to update the context</TD
1534 >0 if Ok, -1 in case of error (other host).</TD
1549 NAME="XMLNANOFTPGETRESPONSE"
1551 >xmlNanoFTPGetResponse ()</H3
1560 CLASS="PROGRAMLISTING"
1561 >int xmlNanoFTPGetResponse (void *ctx);</PRE
1566 >Get the response from the FTP server after a command.</P
1570 CLASS="INFORMALTABLE"
1597 > an FTP context</TD
1615 >the code number</TD
1630 NAME="XMLNANOFTPCHECKRESPONSE"
1632 >xmlNanoFTPCheckResponse ()</H3
1641 CLASS="PROGRAMLISTING"
1642 >int xmlNanoFTPCheckResponse (void *ctx);</PRE
1647 >Check if there is a response from the FTP server after a command.</P
1651 CLASS="INFORMALTABLE"
1678 > an FTP context</TD
1696 >the code number, or 0</TD
1711 NAME="XMLNANOFTPCWD"
1713 >xmlNanoFTPCwd ()</H3
1722 CLASS="PROGRAMLISTING"
1723 >int xmlNanoFTPCwd (void *ctx,
1724 char *directory);</PRE
1729 >Tries to change the remote directory</P
1733 CLASS="INFORMALTABLE"
1760 > an FTP context</TD
1777 > a directory on the server</TD
1795 >-1 incase of error, 1 if CWD worked, 0 if it failed</TD
1810 NAME="XMLNANOFTPGETCONNECTION"
1812 >xmlNanoFTPGetConnection ()</H3
1821 CLASS="PROGRAMLISTING"
1822 >int xmlNanoFTPGetConnection (void *ctx);</PRE
1827 >Try to open a data connection to the server. Currently only
1828 passive mode is supported.</P
1832 CLASS="INFORMALTABLE"
1859 > an FTP context</TD
1877 >-1 incase of error, 0 otherwise</TD
1892 NAME="XMLNANOFTPCLOSECONNECTION"
1894 >xmlNanoFTPCloseConnection ()</H3
1903 CLASS="PROGRAMLISTING"
1904 >int xmlNanoFTPCloseConnection (void *ctx);</PRE
1909 >Close the data connection from the server</P
1913 CLASS="INFORMALTABLE"
1940 > an FTP context</TD
1958 >-1 incase of error, 0 otherwise</TD
1973 NAME="XMLNANOFTPLIST"
1975 >xmlNanoFTPList ()</H3
1984 CLASS="PROGRAMLISTING"
1985 >int xmlNanoFTPList (void *ctx,
1987 HREF="libxml-nanoftp.html#FTPLISTCALLBACK"
1991 char *filename);</PRE
1996 >Do a listing on the server. All files info are passed back
1997 in the callbacks.</P
2001 CLASS="INFORMALTABLE"
2028 > an FTP context</TD
2045 > the user callback</TD
2062 > the user callback data</TD
2079 > optional files to list</TD
2097 >-1 incase of error, 0 otherwise</TD
2112 NAME="XMLNANOFTPGETSOCKET"
2114 >xmlNanoFTPGetSocket ()</H3
2123 CLASS="PROGRAMLISTING"
2124 >int xmlNanoFTPGetSocket (void *ctx,
2125 const char *filename);</PRE
2130 >Initiate fetch of the given file from the server.</P
2134 CLASS="INFORMALTABLE"
2161 > an FTP context</TD
2178 > the file to retrieve (or NULL if path is in context).</TD
2196 >the socket for the data connection, or <0 in case of error</TD
2211 NAME="XMLNANOFTPGET"
2213 >xmlNanoFTPGet ()</H3
2222 CLASS="PROGRAMLISTING"
2223 >int xmlNanoFTPGet (void *ctx,
2225 HREF="libxml-nanoftp.html#FTPDATACALLBACK"
2229 const char *filename);</PRE
2234 >Fetch the given file from the server. All data are passed back
2235 in the callbacks. The last callback has a size of 0 block.</P
2239 CLASS="INFORMALTABLE"
2266 > an FTP context</TD
2283 > the user callback</TD
2300 > the user callback data</TD
2317 > the file to retrieve</TD
2335 >-1 incase of error, 0 otherwise</TD
2350 NAME="XMLNANOFTPREAD"
2352 >xmlNanoFTPRead ()</H3
2361 CLASS="PROGRAMLISTING"
2362 >int xmlNanoFTPRead (void *ctx,
2369 >This function tries to read <TT
2374 > bytes from the existing FTP connection
2375 and saves them in <TT
2380 >. This is a blocking call.</P
2384 CLASS="INFORMALTABLE"
2411 > the FTP context</TD
2445 > the buffer length</TD
2463 >the number of byte read. 0 is an indication of an end of connection.
2464 -1 indicates a parameter error.</TD
2476 CLEAR="all"><BR><TABLE
2488 HREF="libxml-nanohttp.html"
2493 ><<< Previous Page</B
2526 HREF="libxml-lib.html"
2542 HREF="libxml-xmlio.html"
2547 >Next Page >>></B