Annotation of XML/nanoftp.h, revision 1.7
1.1 daniel 1: /*
2: * nanohttp.c: minimalist FTP implementation to fetch external subsets.
3: *
4: * See Copyright for the status of this software.
5: *
6: * Daniel.Veillard@w3.org
7: */
8:
9: #ifndef __NANO_FTP_H__
10: #define __NANO_FTP_H__
1.7 ! daniel 11:
! 12: #include <libxml/xmlversion.h>
! 13: #ifdef LIBXML_FTP_ENABLED
! 14:
1.1 daniel 15: #ifdef __cplusplus
16: extern "C" {
17: #endif
18:
1.3 daniel 19: /**
20: * ftpListCallback:
1.4 daniel 21: * @userData: user provided data for the callback
22: * @filename: the file name (including "->" when links are shown)
23: * @attrib: the attribute string
24: * @owner: the owner string
25: * @group: the group string
26: * @size: the file size
27: * @links: the link count
28: * @year: the year
29: * @month: the month
30: * @day: the day
31: * @hour: the hour
32: * @minute: the minute
33: *
1.3 daniel 34: * A callback for the xmlNanoFTPList command
1.4 daniel 35: * Note that only one of year and day:minute are specified
1.3 daniel 36: */
1.1 daniel 37: typedef void (*ftpListCallback) (void *userData,
38: const char *filename, const char* attrib,
39: const char *owner, const char *group,
40: unsigned long size, int links, int year,
1.4 daniel 41: const char *month, int day, int hour,
42: int minute);
1.3 daniel 43: /**
44: * ftpDataCallback:
45: * A callback for the xmlNanoFTPGet command
46: */
1.1 daniel 47: typedef void (*ftpDataCallback) (void *userData, const char *data, int len);
48:
1.3 daniel 49: /*
50: * Init
51: */
52: void xmlNanoFTPInit (void);
1.4 daniel 53: void xmlNanoFTPCleanup (void);
1.1 daniel 54:
1.3 daniel 55: /*
56: * Creating/freeing contexts
57: */
58: void * xmlNanoFTPNewCtxt (const char *URL);
59: void xmlNanoFTPFreeCtxt (void * ctx);
60: void * xmlNanoFTPConnectTo (const char *server,
61: int port);
62: /*
63: * Opening/closing session connections
64: */
65: void * xmlNanoFTPOpen (const char *URL);
66: int xmlNanoFTPConnect (void *ctx);
1.1 daniel 67: int xmlNanoFTPClose (void *ctx);
1.3 daniel 68: int xmlNanoFTPQuit (void *ctx);
1.4 daniel 69: void xmlNanoFTPScanProxy (const char *URL);
1.5 daniel 70: void xmlNanoFTPProxy (const char *host,
71: int port,
72: const char *user,
73: const char *passwd,
74: int type);
1.6 daniel 75: int xmlNanoFTPUpdateURL (void *ctx,
76: const char *URL);
1.3 daniel 77:
78: /*
79: * Rathern internal commands
80: */
81: int xmlNanoFTPGetResponse (void *ctx);
82: int xmlNanoFTPCheckResponse (void *ctx);
83:
84: /*
85: * CD/DIR/GET handlers
86: */
87: int xmlNanoFTPCwd (void *ctx,
88: char *directory);
89:
90: int xmlNanoFTPGetConnection (void *ctx);
91: int xmlNanoFTPCloseConnection(void *ctx);
92: int xmlNanoFTPList (void *ctx,
93: ftpListCallback callback,
94: void *userData,
95: char *filename);
96: int xmlNanoFTPGetSocket (void *ctx,
97: const char *filename);
98: int xmlNanoFTPGet (void *ctx,
99: ftpDataCallback callback,
100: void *userData,
1.1 daniel 101: const char *filename);
102: int xmlNanoFTPRead (void *ctx,
103: void *dest,
104: int len);
1.3 daniel 105:
1.1 daniel 106: #ifdef __cplusplus
107: }
1.7 ! daniel 108: #endif /* LIBXML_FTP_ENABLED */
1.1 daniel 109: #endif
110: #endif /* __NANO_FTP_H__ */
Webmaster