17 #ifndef R_INTERNET_MODULE_H
18 #define R_INTERNET_MODULE_H
28 typedef Rconnection (*R_NewUrlRoutine)(
const char *description,
const char *
const mode);
29 typedef Rconnection (*R_NewSockRoutine)(
const char *host,
int port,
int server,
const char *
const mode,
int timeout);
31 typedef void * (*R_HTTPOpenRoutine)(
const char *url,
const char *headers,
const int cacheOK);
32 typedef int (*R_HTTPReadRoutine)(
void *ctx,
char *dest,
int len);
33 typedef void (*R_HTTPCloseRoutine)(
void *ctx);
35 typedef void * (*R_FTPOpenRoutine)(
const char *url);
36 typedef int (*R_FTPReadRoutine)(
void *ctx,
char *dest,
int len);
37 typedef void (*R_FTPCloseRoutine)(
void *ctx);
39 typedef void (*R_SockOpenRoutine)(
int *port);
40 typedef void (*R_SockListenRoutine)(
int *sockp,
char **buf,
int *len);
41 typedef void (*R_SockConnectRoutine)(
int *port,
char **host);
42 typedef void (*R_SockCloseRoutine)(
int *sockp);
44 typedef void (*R_SockReadRoutine)(
int *sockp,
char **buf,
int *maxlen);
45 typedef void (*R_SockWriteRoutine)(
int *sockp,
char **buf,
int *start,
int *end,
int *len);
46 typedef int (*R_SockSelectRoutine)(
int nsock,
int *insockfd,
int *ready,
int *write,
double timeout);
48 typedef int (*R_HTTPDCreateRoutine)(
const char *ip,
int port);
49 typedef void (*R_HTTPDStopRoutine)();
52 R_DownloadRoutine download;
53 R_NewUrlRoutine newurl;
54 R_NewSockRoutine newsock;
56 R_HTTPOpenRoutine HTTPOpen;
57 R_HTTPReadRoutine HTTPRead;
58 R_HTTPCloseRoutine HTTPClose;
60 R_FTPOpenRoutine FTPOpen;
61 R_FTPReadRoutine FTPRead;
62 R_FTPCloseRoutine FTPClose;
64 R_SockOpenRoutine sockopen;
65 R_SockListenRoutine socklisten;
66 R_SockConnectRoutine sockconnect;
67 R_SockCloseRoutine sockclose;
69 R_SockReadRoutine sockread;
70 R_SockWriteRoutine sockwrite;
71 R_SockSelectRoutine sockselect;
73 R_HTTPDCreateRoutine HTTPDCreate;
74 R_HTTPDStopRoutine HTTPDStop;
77 R_InternetRoutines *R_setInternetRoutines(R_InternetRoutines *routines);