nanoftp.h

00001 /*
00002 
00003  * Summary: minimal FTP implementation
00004 
00005  * Description: minimal FTP implementation allowing to fetch resources
00006 
00007  *              like external subset.
00008 
00009  *
00010 
00011  * Copy: See Copyright for the status of this software.
00012 
00013  *
00014 
00015  * Author: Daniel Veillard
00016 
00017  */
00018 
00019  
00020 
00021 #ifndef __NANO_FTP_H__
00022 
00023 #define __NANO_FTP_H__
00024 
00025 
00026 
00027 #include <libxml/xmlversion.h>
00028 
00029 
00030 
00031 #ifdef LIBXML_FTP_ENABLED
00032 
00033 
00034 
00035 #ifdef __cplusplus
00036 
00037 extern "C" {
00038 
00039 #endif
00040 
00041 
00042 
00079 typedef void (*ftpListCallback) (void *userData,
00080 
00081                                  const char *filename, const char *attrib,
00082 
00083                                  const char *owner, const char *group,
00084 
00085                                  unsigned long size, int links, int year,
00086 
00087                                  const char *month, int day, int hour,
00088 
00089                                  int minute);
00090 
00107 typedef void (*ftpDataCallback) (void *userData,
00108 
00109                                  const char *data,
00110 
00111                                  int len);
00112 
00113 
00114 
00115 /*
00116 
00117  * Init
00118 
00119  */
00120 
00121 XMLPUBFUN void XMLCALL
00122 
00123         xmlNanoFTPInit          (void);
00124 
00125 XMLPUBFUN void XMLCALL  
00126 
00127         xmlNanoFTPCleanup       (void);
00128 
00129 
00130 
00131 /*
00132 
00133  * Creating/freeing contexts.
00134 
00135  */
00136 
00137 XMLPUBFUN void * XMLCALL        
00138 
00139         xmlNanoFTPNewCtxt       (const char *URL);
00140 
00141 XMLPUBFUN void XMLCALL  
00142 
00143         xmlNanoFTPFreeCtxt      (void * ctx);
00144 
00145 XMLPUBFUN void * XMLCALL        
00146 
00147         xmlNanoFTPConnectTo     (const char *server,
00148 
00149                                  int port);
00150 
00151 /*
00152 
00153  * Opening/closing session connections.
00154 
00155  */
00156 
00157 XMLPUBFUN void * XMLCALL        
00158 
00159         xmlNanoFTPOpen          (const char *URL);
00160 
00161 XMLPUBFUN int XMLCALL   
00162 
00163         xmlNanoFTPConnect       (void *ctx);
00164 
00165 XMLPUBFUN int XMLCALL   
00166 
00167         xmlNanoFTPClose         (void *ctx);
00168 
00169 XMLPUBFUN int XMLCALL   
00170 
00171         xmlNanoFTPQuit          (void *ctx);
00172 
00173 XMLPUBFUN void XMLCALL  
00174 
00175         xmlNanoFTPScanProxy     (const char *URL);
00176 
00177 XMLPUBFUN void XMLCALL  
00178 
00179         xmlNanoFTPProxy         (const char *host,
00180 
00181                                  int port,
00182 
00183                                  const char *user,
00184 
00185                                  const char *passwd,
00186 
00187                                  int type);
00188 
00189 XMLPUBFUN int XMLCALL   
00190 
00191         xmlNanoFTPUpdateURL     (void *ctx,
00192 
00193                                  const char *URL);
00194 
00195 
00196 
00197 /*
00198 
00199  * Rather internal commands.
00200 
00201  */
00202 
00203 XMLPUBFUN int XMLCALL   
00204 
00205         xmlNanoFTPGetResponse   (void *ctx);
00206 
00207 XMLPUBFUN int XMLCALL   
00208 
00209         xmlNanoFTPCheckResponse (void *ctx);
00210 
00211 
00212 
00213 /*
00214 
00215  * CD/DIR/GET handlers.
00216 
00217  */
00218 
00219 XMLPUBFUN int XMLCALL   
00220 
00221         xmlNanoFTPCwd           (void *ctx,
00222 
00223                                  const char *directory);
00224 
00225 XMLPUBFUN int XMLCALL   
00226 
00227         xmlNanoFTPDele          (void *ctx,
00228 
00229                                  const char *file);
00230 
00231 
00232 
00233 XMLPUBFUN int XMLCALL   
00234 
00235         xmlNanoFTPGetConnection (void *ctx);
00236 
00237 XMLPUBFUN int XMLCALL   
00238 
00239         xmlNanoFTPCloseConnection(void *ctx);
00240 
00241 XMLPUBFUN int XMLCALL   
00242 
00243         xmlNanoFTPList          (void *ctx,
00244 
00245                                  ftpListCallback callback,
00246 
00247                                  void *userData,
00248 
00249                                  const char *filename);
00250 
00251 XMLPUBFUN int XMLCALL   
00252 
00253         xmlNanoFTPGetSocket     (void *ctx,
00254 
00255                                  const char *filename);
00256 
00257 XMLPUBFUN int XMLCALL   
00258 
00259         xmlNanoFTPGet           (void *ctx,
00260 
00261                                  ftpDataCallback callback,
00262 
00263                                  void *userData,
00264 
00265                                  const char *filename);
00266 
00267 XMLPUBFUN int XMLCALL   
00268 
00269         xmlNanoFTPRead          (void *ctx,
00270 
00271                                  void *dest,
00272 
00273                                  int len);
00274 
00275 
00276 
00277 #ifdef __cplusplus
00278 
00279 }
00280 
00281 #endif
00282 
00283 #endif /* LIBXML_FTP_ENABLED */
00284 
00285 #endif /* __NANO_FTP_H__ */
00286 

Generated on Wed Jul 26 13:30:46 2006 for XSB by  doxygen 1.4.5