| 14945 |
duncan |
1 |
#ifndef R_INTERNET_MODULE_H
|
|
|
2 |
#define R_INTERNET_MODULE_H
|
|
|
3 |
|
|
|
4 |
|
| 19500 |
hornik |
5 |
#include <Rinternals.h>
|
| 14945 |
duncan |
6 |
|
|
|
7 |
|
|
|
8 |
typedef SEXP (*R_DownloadRoutine)(SEXP call, SEXP op, SEXP args, SEXP env);
|
|
|
9 |
typedef Rconnection (*R_NewUrlRoutine)(char *description, char *mode);
|
|
|
10 |
typedef Rconnection (*R_NewSockRoutine)(char *host, int port, int server, char *mode);
|
|
|
11 |
|
| 15377 |
ripley |
12 |
typedef void * (*R_HTTPOpenRoutine)(const char *url, const int cacheOK);
|
| 14945 |
duncan |
13 |
typedef int (*R_HTTPReadRoutine)(void *ctx, char *dest, int len);
|
|
|
14 |
typedef void (*R_HTTPCloseRoutine)(void *ctx);
|
|
|
15 |
|
|
|
16 |
typedef void * (*R_FTPOpenRoutine)(const char *url);
|
|
|
17 |
typedef int (*R_FTPReadRoutine)(void *ctx, char *dest, int len);
|
|
|
18 |
typedef void (*R_FTPCloseRoutine)(void *ctx);
|
|
|
19 |
|
|
|
20 |
typedef void (*R_SockOpenRoutine)(int *port);
|
|
|
21 |
typedef void (*R_SockListenRoutine)(int *sockp, char **buf, int *len);
|
|
|
22 |
typedef void (*R_SockConnectRoutine)(int *port, char **host);
|
|
|
23 |
typedef void (*R_SockCloseRoutine)(int *sockp);
|
|
|
24 |
|
|
|
25 |
typedef void (*R_SockReadRoutine)(int *sockp, char **buf, int *maxlen);
|
|
|
26 |
typedef void (*R_SockWriteRoutine)(int *sockp, char **buf, int *start, int *end, int *len);
|
| 26380 |
luke |
27 |
typedef int (*R_SockSelectRoutine)(int nsock, int *insockfd, int *ready, int *write, double timeout);
|
| 14945 |
duncan |
28 |
|
|
|
29 |
|
|
|
30 |
typedef struct {
|
|
|
31 |
R_DownloadRoutine download;
|
|
|
32 |
R_NewUrlRoutine newurl;
|
|
|
33 |
R_NewSockRoutine newsock;
|
|
|
34 |
|
|
|
35 |
R_HTTPOpenRoutine HTTPOpen;
|
|
|
36 |
R_HTTPReadRoutine HTTPRead;
|
|
|
37 |
R_HTTPCloseRoutine HTTPClose;
|
|
|
38 |
|
|
|
39 |
R_FTPOpenRoutine FTPOpen;
|
|
|
40 |
R_FTPReadRoutine FTPRead;
|
|
|
41 |
R_FTPCloseRoutine FTPClose;
|
|
|
42 |
|
|
|
43 |
R_SockOpenRoutine sockopen;
|
|
|
44 |
R_SockListenRoutine socklisten;
|
|
|
45 |
R_SockConnectRoutine sockconnect;
|
|
|
46 |
R_SockCloseRoutine sockclose;
|
|
|
47 |
|
|
|
48 |
R_SockReadRoutine sockread;
|
|
|
49 |
R_SockWriteRoutine sockwrite;
|
| 26380 |
luke |
50 |
R_SockSelectRoutine sockselect;
|
| 14945 |
duncan |
51 |
|
|
|
52 |
} R_InternetRoutines;
|
|
|
53 |
|
|
|
54 |
R_InternetRoutines *R_setInternetRoutines(R_InternetRoutines *routines);
|
|
|
55 |
|
|
|
56 |
#endif /* ifndef R_INTERNET_MODULE_H */
|