Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:41:49

0001 /*
0002  * Summary: minimal FTP implementation
0003  * Description: minimal FTP implementation allowing to fetch resources
0004  *              like external subset. This module is DEPRECATED, do not
0005  *              use any of its functions.
0006  *
0007  * Copy: See Copyright for the status of this software.
0008  *
0009  * Author: Daniel Veillard
0010  */
0011 
0012 #ifndef __NANO_FTP_H__
0013 #define __NANO_FTP_H__
0014 
0015 #include <libxml/xmlversion.h>
0016 
0017 #if defined(LIBXML_FTP_ENABLED)
0018 
0019 /* Needed for portability to Windows 64 bits */
0020 #if defined(_WIN32)
0021 #include <winsock2.h>
0022 #else
0023 /**
0024  * SOCKET:
0025  *
0026  * macro used to provide portability of code to windows sockets
0027  */
0028 #define SOCKET int
0029 /**
0030  * INVALID_SOCKET:
0031  *
0032  * macro used to provide portability of code to windows sockets
0033  * the value to be used when the socket is not valid
0034  */
0035 #undef  INVALID_SOCKET
0036 #define INVALID_SOCKET (-1)
0037 #endif
0038 
0039 #ifdef __cplusplus
0040 extern "C" {
0041 #endif
0042 
0043 /**
0044  * ftpListCallback:
0045  * @userData:  user provided data for the callback
0046  * @filename:  the file name (including "->" when links are shown)
0047  * @attrib:  the attribute string
0048  * @owner:  the owner string
0049  * @group:  the group string
0050  * @size:  the file size
0051  * @links:  the link count
0052  * @year:  the year
0053  * @month:  the month
0054  * @day:  the day
0055  * @hour:  the hour
0056  * @minute:  the minute
0057  *
0058  * A callback for the xmlNanoFTPList command.
0059  * Note that only one of year and day:minute are specified.
0060  */
0061 typedef void (*ftpListCallback) (void *userData,
0062                              const char *filename, const char *attrib,
0063                              const char *owner, const char *group,
0064                  unsigned long size, int links, int year,
0065                  const char *month, int day, int hour,
0066                  int minute);
0067 /**
0068  * ftpDataCallback:
0069  * @userData: the user provided context
0070  * @data: the data received
0071  * @len: its size in bytes
0072  *
0073  * A callback for the xmlNanoFTPGet command.
0074  */
0075 typedef void (*ftpDataCallback) (void *userData,
0076                  const char *data,
0077                  int len);
0078 
0079 /*
0080  * Init
0081  */
0082 XML_DEPRECATED
0083 XMLPUBFUN void
0084     xmlNanoFTPInit      (void);
0085 XML_DEPRECATED
0086 XMLPUBFUN void
0087     xmlNanoFTPCleanup   (void);
0088 
0089 /*
0090  * Creating/freeing contexts.
0091  */
0092 XML_DEPRECATED
0093 XMLPUBFUN void *
0094     xmlNanoFTPNewCtxt   (const char *URL);
0095 XML_DEPRECATED
0096 XMLPUBFUN void
0097     xmlNanoFTPFreeCtxt  (void * ctx);
0098 XML_DEPRECATED
0099 XMLPUBFUN void *
0100     xmlNanoFTPConnectTo (const char *server,
0101                  int port);
0102 /*
0103  * Opening/closing session connections.
0104  */
0105 XML_DEPRECATED
0106 XMLPUBFUN void *
0107     xmlNanoFTPOpen      (const char *URL);
0108 XML_DEPRECATED
0109 XMLPUBFUN int
0110     xmlNanoFTPConnect   (void *ctx);
0111 XML_DEPRECATED
0112 XMLPUBFUN int
0113     xmlNanoFTPClose     (void *ctx);
0114 XML_DEPRECATED
0115 XMLPUBFUN int
0116     xmlNanoFTPQuit      (void *ctx);
0117 XML_DEPRECATED
0118 XMLPUBFUN void
0119     xmlNanoFTPScanProxy (const char *URL);
0120 XML_DEPRECATED
0121 XMLPUBFUN void
0122     xmlNanoFTPProxy     (const char *host,
0123                  int port,
0124                  const char *user,
0125                  const char *passwd,
0126                  int type);
0127 XML_DEPRECATED
0128 XMLPUBFUN int
0129     xmlNanoFTPUpdateURL (void *ctx,
0130                  const char *URL);
0131 
0132 /*
0133  * Rather internal commands.
0134  */
0135 XML_DEPRECATED
0136 XMLPUBFUN int
0137     xmlNanoFTPGetResponse   (void *ctx);
0138 XML_DEPRECATED
0139 XMLPUBFUN int
0140     xmlNanoFTPCheckResponse (void *ctx);
0141 
0142 /*
0143  * CD/DIR/GET handlers.
0144  */
0145 XML_DEPRECATED
0146 XMLPUBFUN int
0147     xmlNanoFTPCwd       (void *ctx,
0148                  const char *directory);
0149 XML_DEPRECATED
0150 XMLPUBFUN int
0151     xmlNanoFTPDele      (void *ctx,
0152                  const char *file);
0153 
0154 XML_DEPRECATED
0155 XMLPUBFUN SOCKET
0156     xmlNanoFTPGetConnection (void *ctx);
0157 XML_DEPRECATED
0158 XMLPUBFUN int
0159     xmlNanoFTPCloseConnection(void *ctx);
0160 XML_DEPRECATED
0161 XMLPUBFUN int
0162     xmlNanoFTPList      (void *ctx,
0163                  ftpListCallback callback,
0164                  void *userData,
0165                  const char *filename);
0166 XML_DEPRECATED
0167 XMLPUBFUN SOCKET
0168     xmlNanoFTPGetSocket (void *ctx,
0169                  const char *filename);
0170 XML_DEPRECATED
0171 XMLPUBFUN int
0172     xmlNanoFTPGet       (void *ctx,
0173                  ftpDataCallback callback,
0174                  void *userData,
0175                  const char *filename);
0176 XML_DEPRECATED
0177 XMLPUBFUN int
0178     xmlNanoFTPRead      (void *ctx,
0179                  void *dest,
0180                  int len);
0181 
0182 #ifdef __cplusplus
0183 }
0184 #endif
0185 #endif /* defined(LIBXML_FTP_ENABLED) || defined(LIBXML_LEGACY_ENABLED) */
0186 #endif /* __NANO_FTP_H__ */