2 * Summary: minimal FTP implementation
3 * Description: minimal FTP implementation allowing to fetch resources
4 * like external subset.
6 * Copy: See Copyright for the status of this software.
8 * Author: Daniel Veillard
11 #ifndef __NANO_FTP_H__
12 #define __NANO_FTP_H__
14 #include <libxml/xmlversion.h>
16 #ifdef LIBXML_FTP_ENABLED
24 * @userData: user provided data for the callback
25 * @filename: the file name (including "->" when links are shown)
26 * @attrib: the attribute string
27 * @owner: the owner string
28 * @group: the group string
29 * @size: the file size
30 * @links: the link count
37 * A callback for the xmlNanoFTPList command.
38 * Note that only one of year and day:minute are specified.
40 typedef void (*ftpListCallback) (void *userData,
41 const char *filename, const char *attrib,
42 const char *owner, const char *group,
43 unsigned long size, int links, int year,
44 const char *month, int day, int hour,
48 * @userData: the user provided context
49 * @data: the data received
50 * @len: its size in bytes
52 * A callback for the xmlNanoFTPGet command.
54 typedef void (*ftpDataCallback) (void *userData,
61 XMLPUBFUN void XMLCALL
62 xmlNanoFTPInit (void);
63 XMLPUBFUN void XMLCALL
64 xmlNanoFTPCleanup (void);
67 * Creating/freeing contexts.
69 XMLPUBFUN void * XMLCALL
70 xmlNanoFTPNewCtxt (const char *URL);
71 XMLPUBFUN void XMLCALL
72 xmlNanoFTPFreeCtxt (void * ctx);
73 XMLPUBFUN void * XMLCALL
74 xmlNanoFTPConnectTo (const char *server,
77 * Opening/closing session connections.
79 XMLPUBFUN void * XMLCALL
80 xmlNanoFTPOpen (const char *URL);
82 xmlNanoFTPConnect (void *ctx);
84 xmlNanoFTPClose (void *ctx);
86 xmlNanoFTPQuit (void *ctx);
87 XMLPUBFUN void XMLCALL
88 xmlNanoFTPScanProxy (const char *URL);
89 XMLPUBFUN void XMLCALL
90 xmlNanoFTPProxy (const char *host,
96 xmlNanoFTPUpdateURL (void *ctx,
100 * Rather internal commands.
102 XMLPUBFUN int XMLCALL
103 xmlNanoFTPGetResponse (void *ctx);
104 XMLPUBFUN int XMLCALL
105 xmlNanoFTPCheckResponse (void *ctx);
108 * CD/DIR/GET handlers.
110 XMLPUBFUN int XMLCALL
111 xmlNanoFTPCwd (void *ctx,
112 const char *directory);
113 XMLPUBFUN int XMLCALL
114 xmlNanoFTPDele (void *ctx,
117 XMLPUBFUN int XMLCALL
118 xmlNanoFTPGetConnection (void *ctx);
119 XMLPUBFUN int XMLCALL
120 xmlNanoFTPCloseConnection(void *ctx);
121 XMLPUBFUN int XMLCALL
122 xmlNanoFTPList (void *ctx,
123 ftpListCallback callback,
125 const char *filename);
126 XMLPUBFUN int XMLCALL
127 xmlNanoFTPGetSocket (void *ctx,
128 const char *filename);
129 XMLPUBFUN int XMLCALL
130 xmlNanoFTPGet (void *ctx,
131 ftpDataCallback callback,
133 const char *filename);
134 XMLPUBFUN int XMLCALL
135 xmlNanoFTPRead (void *ctx,
142 #endif /* LIBXML_FTP_ENABLED */
143 #endif /* __NANO_FTP_H__ */