The R Project SVN R

Rev

Rev 19500 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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