Eneboo - Documentación para desarrolladores
|
00001 /* 00002 * Summary: minimal FTP implementation 00003 * Description: minimal FTP implementation allowing to fetch resources 00004 * like external subset. 00005 * 00006 * Copy: See Copyright for the status of this software. 00007 * 00008 * Author: Daniel Veillard 00009 */ 00010 00011 #ifndef __NANO_FTP_H__ 00012 #define __NANO_FTP_H__ 00013 00014 #include <libxml/xmlversion.h> 00015 00016 #ifdef LIBXML_FTP_ENABLED 00017 00018 #ifdef __cplusplus 00019 extern "C" { 00020 #endif 00021 00040 typedef void (*ftpListCallback) (void *userData, 00041 const char *filename, const char *attrib, 00042 const char *owner, const char *group, 00043 unsigned long size, int links, int year, 00044 const char *month, int day, int hour, 00045 int minute); 00054 typedef void (*ftpDataCallback) (void *userData, 00055 const char *data, 00056 int len); 00057 00058 /* 00059 * Init 00060 */ 00061 XMLPUBFUN void XMLCALL 00062 xmlNanoFTPInit (void); 00063 XMLPUBFUN void XMLCALL 00064 xmlNanoFTPCleanup (void); 00065 00066 /* 00067 * Creating/freeing contexts. 00068 */ 00069 XMLPUBFUN void * XMLCALL 00070 xmlNanoFTPNewCtxt (const char *URL); 00071 XMLPUBFUN void XMLCALL 00072 xmlNanoFTPFreeCtxt (void * ctx); 00073 XMLPUBFUN void * XMLCALL 00074 xmlNanoFTPConnectTo (const char *server, 00075 int port); 00076 /* 00077 * Opening/closing session connections. 00078 */ 00079 XMLPUBFUN void * XMLCALL 00080 xmlNanoFTPOpen (const char *URL); 00081 XMLPUBFUN int XMLCALL 00082 xmlNanoFTPConnect (void *ctx); 00083 XMLPUBFUN int XMLCALL 00084 xmlNanoFTPClose (void *ctx); 00085 XMLPUBFUN int XMLCALL 00086 xmlNanoFTPQuit (void *ctx); 00087 XMLPUBFUN void XMLCALL 00088 xmlNanoFTPScanProxy (const char *URL); 00089 XMLPUBFUN void XMLCALL 00090 xmlNanoFTPProxy (const char *host, 00091 int port, 00092 const char *user, 00093 const char *passwd, 00094 int type); 00095 XMLPUBFUN int XMLCALL 00096 xmlNanoFTPUpdateURL (void *ctx, 00097 const char *URL); 00098 00099 /* 00100 * Rather internal commands. 00101 */ 00102 XMLPUBFUN int XMLCALL 00103 xmlNanoFTPGetResponse (void *ctx); 00104 XMLPUBFUN int XMLCALL 00105 xmlNanoFTPCheckResponse (void *ctx); 00106 00107 /* 00108 * CD/DIR/GET handlers. 00109 */ 00110 XMLPUBFUN int XMLCALL 00111 xmlNanoFTPCwd (void *ctx, 00112 const char *directory); 00113 XMLPUBFUN int XMLCALL 00114 xmlNanoFTPDele (void *ctx, 00115 const char *file); 00116 00117 XMLPUBFUN int XMLCALL 00118 xmlNanoFTPGetConnection (void *ctx); 00119 XMLPUBFUN int XMLCALL 00120 xmlNanoFTPCloseConnection(void *ctx); 00121 XMLPUBFUN int XMLCALL 00122 xmlNanoFTPList (void *ctx, 00123 ftpListCallback callback, 00124 void *userData, 00125 const char *filename); 00126 XMLPUBFUN int XMLCALL 00127 xmlNanoFTPGetSocket (void *ctx, 00128 const char *filename); 00129 XMLPUBFUN int XMLCALL 00130 xmlNanoFTPGet (void *ctx, 00131 ftpDataCallback callback, 00132 void *userData, 00133 const char *filename); 00134 XMLPUBFUN int XMLCALL 00135 xmlNanoFTPRead (void *ctx, 00136 void *dest, 00137 int len); 00138 00139 #ifdef __cplusplus 00140 } 00141 #endif 00142 #endif /* LIBXML_FTP_ENABLED */ 00143 #endif /* __NANO_FTP_H__ */