The R Project SVN R

Rev

Rev 56585 | Rev 67505 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
29960 ripley 1
#ifndef R_INTERNET_MODULE_H
2
#define R_INTERNET_MODULE_H
3
 
4
 
5
#include <Rinternals.h>
6
 
7
 
60666 ripley 8
typedef SEXP (*R_DownloadRoutine)(SEXP args);
41811 ripley 9
typedef Rconnection (*R_NewUrlRoutine)(const char *description, const char * const mode);
56585 ripley 10
typedef Rconnection (*R_NewSockRoutine)(const char *host, int port, int server, const char *const mode, int timeout); 
29960 ripley 11
 
38735 rgentlem 12
typedef void * (*R_HTTPOpenRoutine)(const char *url, const char *headers, const int cacheOK);
29960 ripley 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);
27
typedef int    (*R_SockSelectRoutine)(int nsock, int *insockfd, int *ready, int *write, double timeout);
28
 
48990 urbaneks 29
typedef int    (*R_HTTPDCreateRoutine)(const char *ip, int port);
49434 ripley 30
typedef void   (*R_HTTPDStopRoutine)();
29960 ripley 31
 
32
typedef struct {
33
    R_DownloadRoutine download;
34
    R_NewUrlRoutine   newurl;
35
    R_NewSockRoutine  newsock;
36
 
37
    R_HTTPOpenRoutine  HTTPOpen;
38
    R_HTTPReadRoutine  HTTPRead;
39
    R_HTTPCloseRoutine HTTPClose;
40
 
41
    R_FTPOpenRoutine   FTPOpen;
42
    R_FTPReadRoutine   FTPRead;
43
    R_FTPCloseRoutine  FTPClose;
44
 
45
    R_SockOpenRoutine     sockopen;
46
    R_SockListenRoutine   socklisten;
47
    R_SockConnectRoutine  sockconnect;
48
    R_SockCloseRoutine    sockclose;
49
 
50
    R_SockReadRoutine     sockread;
51
    R_SockWriteRoutine    sockwrite;
52
    R_SockSelectRoutine   sockselect;
53
 
48990 urbaneks 54
    R_HTTPDCreateRoutine  HTTPDCreate;
49434 ripley 55
    R_HTTPDStopRoutine    HTTPDStop;
29960 ripley 56
} R_InternetRoutines;
57
 
58
R_InternetRoutines *R_setInternetRoutines(R_InternetRoutines *routines);
59
 
60
#endif /* ifndef R_INTERNET_MODULE_H */