RAPI
R_ext/R-ftp-http.h
Go to the documentation of this file.
00001 /*
00002  *  R : A Computer Language for Statistical Data Analysis
00003  *  Copyright (C) 2001-2016 The R Core Team.
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU Lesser General Public License as published by
00007  *  the Free Software Foundation; either version 2.1 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU Lesser General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Lesser General Public License
00016  *  along with this program; if not, a copy is available at
00017  *  https://www.R-project.org/Licenses/
00018  */
00019 
00020 /* Advertized entry points, for that part of libxml included in
00021  * the internet module.
00022  */
00023 
00024 #ifndef R_FTP_HTTP_H_
00025 #define R_FTP_HTTP_H_
00026 
00027 /*
00028   allow for 'large' files (>= 2GB) on 32-bit systems, where supported.
00029 */
00030 /* required by C99/C11 */
00031 #ifndef NO_C_HEADERS
00032 # ifdef __cplusplus
00033 #  include <cstdint>
00034 # else
00035 #  include <stdint.h>
00036 # endif
00037 #endif
00038 typedef int_fast64_t DLsize_t; // used for download lengths and sizes
00039 
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043 
00044 void *R_HTTPOpen(const char *url);
00045 int   R_HTTPRead(void *ctx, char *dest, int len);
00046 void  R_HTTPClose(void *ctx);
00047 
00048 void *R_FTPOpen(const char *url);
00049 int   R_FTPRead(void *ctx, char *dest, int len);
00050 void  R_FTPClose(void *ctx);
00051 
00052 void *  RxmlNanoHTTPOpen(const char *URL, char **contentType, const char *headers, int cacheOK);
00053 int RxmlNanoHTTPRead(void *ctx, void *dest, int len);
00054 void    RxmlNanoHTTPClose(void *ctx);
00055 int     RxmlNanoHTTPReturnCode(void *ctx);
00056 char *  RxmlNanoHTTPStatusMsg(void *ctx);
00057 DLsize_t RxmlNanoHTTPContentLength(void *ctx);
00058 char *  RxmlNanoHTTPContentType(void *ctx);
00059 void    RxmlNanoHTTPTimeout(int delay);
00060 
00061 void *  RxmlNanoFTPOpen(const char *URL);
00062 int RxmlNanoFTPRead(void *ctx, void *dest, int len);
00063 int RxmlNanoFTPClose(void *ctx);
00064 void    RxmlNanoFTPTimeout(int delay);
00065 DLsize_t RxmlNanoFTPContentLength(void *ctx);
00066 
00067 void    RxmlMessage(int level, const char *format, ...);
00068 
00069 /* not currently used */
00070 
00071 void RxmlNanoFTPCleanup(void);
00072 void RxmlNanoHTTPCleanup(void);
00073 
00074 #ifdef __cplusplus
00075 }
00076 #endif
00077 
00078 #endif /* R_FTP_HTTP_H_ */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines