2 * nanohttp.c: minimalist FTP implementation to fetch external subsets.
4 * See Copyright for the status of this software.
10 #define __NANO_FTP_H__
12 #include <libxml/xmlversion.h>
14 #ifdef LIBXML_FTP_ENABLED
22 * @userData: user provided data for the callback
23 * @filename: the file name (including "->" when links are shown)
24 * @attrib: the attribute string
25 * @owner: the owner string
26 * @group: the group string
27 * @size: the file size
28 * @links: the link count
35 * A callback for the xmlNanoFTPList command.
36 * Note that only one of year and day:minute are specified.
38 typedef void (*ftpListCallback) (void *userData,
39 const char *filename, const char *attrib,
40 const char *owner, const char *group,
41 unsigned long size, int links, int year,
42 const char *month, int day, int hour,
46 * @userData: the user provided context
47 * @data: the data received
48 * @len: its size in bytes
50 * A callback for the xmlNanoFTPGet command.
52 typedef void (*ftpDataCallback) (void *userData,
59 void xmlNanoFTPInit (void);
60 void xmlNanoFTPCleanup (void);
63 * Creating/freeing contexts.
65 void * xmlNanoFTPNewCtxt (const char *URL);
66 void xmlNanoFTPFreeCtxt (void * ctx);
67 void * xmlNanoFTPConnectTo (const char *server,
70 * Opening/closing session connections.
72 void * xmlNanoFTPOpen (const char *URL);
73 int xmlNanoFTPConnect (void *ctx);
74 int xmlNanoFTPClose (void *ctx);
75 int xmlNanoFTPQuit (void *ctx);
76 void xmlNanoFTPScanProxy (const char *URL);
77 void xmlNanoFTPProxy (const char *host,
82 int xmlNanoFTPUpdateURL (void *ctx,
86 * Rather internal commands.
88 int xmlNanoFTPGetResponse (void *ctx);
89 int xmlNanoFTPCheckResponse (void *ctx);
92 * CD/DIR/GET handlers.
94 int xmlNanoFTPCwd (void *ctx,
96 int xmlNanoFTPDele (void *ctx,
99 int xmlNanoFTPGetConnection (void *ctx);
100 int xmlNanoFTPCloseConnection(void *ctx);
101 int xmlNanoFTPList (void *ctx,
102 ftpListCallback callback,
105 int xmlNanoFTPGetSocket (void *ctx,
106 const char *filename);
107 int xmlNanoFTPGet (void *ctx,
108 ftpDataCallback callback,
110 const char *filename);
111 int xmlNanoFTPRead (void *ctx,
117 #endif /* LIBXML_FTP_ENABLED */
119 #endif /* __NANO_FTP_H__ */