(root)/
gettext-0.22.4/
libtextstyle/
lib/
libxml/
nanoftp.in.h
       1  /* libxml2 - Library for parsing XML documents
       2   * Copyright (C) 2006-2019 Free Software Foundation, Inc.
       3   *
       4   * This file is not part of the GNU gettext program, but is used with
       5   * GNU gettext.
       6   *
       7   * The original copyright notice is as follows:
       8   */
       9  
      10  /*
      11   * Copyright (C) 1998-2012 Daniel Veillard.  All Rights Reserved.
      12   *
      13   * Permission is hereby granted, free of charge, to any person obtaining a copy
      14   * of this software and associated documentation files (the "Software"), to deal
      15   * in the Software without restriction, including without limitation the rights
      16   * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
      17   * copies of the Software, and to permit persons to whom the Software is fur-
      18   * nished to do so, subject to the following conditions:
      19   *
      20   * The above copyright notice and this permission notice shall be included in
      21   * all copies or substantial portions of the Software.
      22   *
      23   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
      24   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
      25   * NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
      26   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
      27   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
      28   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
      29   * THE SOFTWARE.
      30   *
      31   * Author: Daniel Veillard
      32   */
      33  
      34  /*
      35   * Summary: minimal FTP implementation
      36   * Description: minimal FTP implementation allowing to fetch resources
      37   *              like external subset.
      38   */
      39  
      40  #ifndef __NANO_FTP_H__
      41  #define __NANO_FTP_H__
      42  
      43  #include <libxml/xmlversion.h>
      44  
      45  #ifdef LIBXML_FTP_ENABLED
      46  
      47  /* Needed for portability to Windows 64 bits */
      48  #if defined(_WIN32) && !defined(__CYGWIN__)
      49  #include <winsock2.h>
      50  #else
      51  /**
      52   * SOCKET:
      53   *
      54   * macro used to provide portability of code to windows sockets
      55   */
      56  #define SOCKET int
      57  /**
      58   * INVALID_SOCKET:
      59   *
      60   * macro used to provide portability of code to windows sockets
      61   * the value to be used when the socket is not valid
      62   */
      63  #undef  INVALID_SOCKET
      64  #define INVALID_SOCKET (-1)
      65  #endif
      66  
      67  #ifdef __cplusplus
      68  extern "C" {
      69  #endif
      70  
      71  /**
      72   * ftpListCallback:
      73   * @userData:  user provided data for the callback
      74   * @filename:  the file name (including "->" when links are shown)
      75   * @attrib:  the attribute string
      76   * @owner:  the owner string
      77   * @group:  the group string
      78   * @size:  the file size
      79   * @links:  the link count
      80   * @year:  the year
      81   * @month:  the month
      82   * @day:  the day
      83   * @hour:  the hour
      84   * @minute:  the minute
      85   *
      86   * A callback for the xmlNanoFTPList command.
      87   * Note that only one of year and day:minute are specified.
      88   */
      89  typedef void (*ftpListCallback) (void *userData,
      90  	                         const char *filename, const char *attrib,
      91  	                         const char *owner, const char *group,
      92  				 unsigned long size, int links, int year,
      93  				 const char *month, int day, int hour,
      94  				 int minute);
      95  /**
      96   * ftpDataCallback:
      97   * @userData: the user provided context
      98   * @data: the data received
      99   * @len: its size in bytes
     100   *
     101   * A callback for the xmlNanoFTPGet command.
     102   */
     103  typedef void (*ftpDataCallback) (void *userData,
     104  				 const char *data,
     105  				 int len);
     106  
     107  /*
     108   * Init
     109   */
     110  XMLPUBFUN void XMLCALL
     111  	xmlNanoFTPInit		(void);
     112  XMLPUBFUN void XMLCALL
     113  	xmlNanoFTPCleanup	(void);
     114  
     115  /*
     116   * Creating/freeing contexts.
     117   */
     118  XMLPUBFUN void * XMLCALL
     119  	xmlNanoFTPNewCtxt	(const char *URL);
     120  XMLPUBFUN void XMLCALL
     121  	xmlNanoFTPFreeCtxt	(void * ctx);
     122  XMLPUBFUN void * XMLCALL
     123  	xmlNanoFTPConnectTo	(const char *server,
     124  				 int port);
     125  /*
     126   * Opening/closing session connections.
     127   */
     128  XMLPUBFUN void * XMLCALL
     129  	xmlNanoFTPOpen		(const char *URL);
     130  XMLPUBFUN int XMLCALL
     131  	xmlNanoFTPConnect	(void *ctx);
     132  XMLPUBFUN int XMLCALL
     133  	xmlNanoFTPClose		(void *ctx);
     134  XMLPUBFUN int XMLCALL
     135  	xmlNanoFTPQuit		(void *ctx);
     136  XMLPUBFUN void XMLCALL
     137  	xmlNanoFTPScanProxy	(const char *URL);
     138  XMLPUBFUN void XMLCALL
     139  	xmlNanoFTPProxy		(const char *host,
     140  				 int port,
     141  				 const char *user,
     142  				 const char *passwd,
     143  				 int type);
     144  XMLPUBFUN int XMLCALL
     145  	xmlNanoFTPUpdateURL	(void *ctx,
     146  				 const char *URL);
     147  
     148  /*
     149   * Rather internal commands.
     150   */
     151  XMLPUBFUN int XMLCALL
     152  	xmlNanoFTPGetResponse	(void *ctx);
     153  XMLPUBFUN int XMLCALL
     154  	xmlNanoFTPCheckResponse	(void *ctx);
     155  
     156  /*
     157   * CD/DIR/GET handlers.
     158   */
     159  XMLPUBFUN int XMLCALL
     160  	xmlNanoFTPCwd		(void *ctx,
     161  				 const char *directory);
     162  XMLPUBFUN int XMLCALL
     163  	xmlNanoFTPDele		(void *ctx,
     164  				 const char *file);
     165  
     166  XMLPUBFUN SOCKET XMLCALL
     167  	xmlNanoFTPGetConnection	(void *ctx);
     168  XMLPUBFUN int XMLCALL
     169  	xmlNanoFTPCloseConnection(void *ctx);
     170  XMLPUBFUN int XMLCALL
     171  	xmlNanoFTPList		(void *ctx,
     172  				 ftpListCallback callback,
     173  				 void *userData,
     174  				 const char *filename);
     175  XMLPUBFUN SOCKET XMLCALL
     176  	xmlNanoFTPGetSocket	(void *ctx,
     177  				 const char *filename);
     178  XMLPUBFUN int XMLCALL
     179  	xmlNanoFTPGet		(void *ctx,
     180  				 ftpDataCallback callback,
     181  				 void *userData,
     182  				 const char *filename);
     183  XMLPUBFUN int XMLCALL
     184  	xmlNanoFTPRead		(void *ctx,
     185  				 void *dest,
     186  				 int len);
     187  
     188  #ifdef __cplusplus
     189  }
     190  #endif
     191  #endif /* LIBXML_FTP_ENABLED */
     192  #endif /* __NANO_FTP_H__ */