The R Project SVN R

Rev

Rev 61527 | Rev 67557 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61527 Rev 62016
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Copyright (C) 2000-2012   The R Core Team.
3
 *  Copyright (C) 2000-2013   The R Core Team.
4
 *
4
 *
5
 *  This program is free software; you can redistribute it and/or modify
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
6
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation; either version 2 of the License, or
7
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  (at your option) any later version.
8
 *  (at your option) any later version.
Line 17... Line 17...
17
 *  http://www.r-project.org/Licenses/
17
 *  http://www.r-project.org/Licenses/
18
 */
18
 */
19
 
19
 
20
#ifndef R_CONNECTIONS_H_
20
#ifndef R_CONNECTIONS_H_
21
#define R_CONNECTIONS_H_
21
#define R_CONNECTIONS_H_
22
#include <R_ext/Boolean.h>
-
 
23
 
22
 
24
/* NB: this is a private header, and not installed.  The internals of
-
 
25
   connections are private and subject to change without notice. */
23
/* the visible part of the connections */
26
 
-
 
27
#if defined(HAVE_OFF_T) && defined(HAVE_FSEEKO) && defined(HAVE_SYS_TYPES_H)
-
 
28
#include <sys/types.h>
24
#include <R_ext/Connections.h>
29
#endif
-
 
30
 
-
 
31
/* this allows the opaque pointer definition to be made available 
-
 
32
   in Rinternals.h */
-
 
33
#ifndef HAVE_RCONNECTION_TYPEDEF
-
 
34
typedef struct Rconn  *Rconnection;
-
 
35
#endif
-
 
36
struct Rconn {
-
 
37
    char* class;
-
 
38
    char* description;
-
 
39
    int enc; /* the encoding of 'description' */
-
 
40
    char mode[5];
-
 
41
    Rboolean text, isopen, incomplete, canread, canwrite, canseek, blocking, 
-
 
42
	isGzcon;
-
 
43
    Rboolean (*open)(struct Rconn *);
-
 
44
    void (*close)(struct Rconn *); /* routine closing after auto open */
-
 
45
    void (*destroy)(struct Rconn *); /* when closing connection */
-
 
46
    int (*vfprintf)(struct Rconn *, const char *, va_list);
-
 
47
    int (*fgetc)(struct Rconn *);
-
 
48
    int (*fgetc_internal)(struct Rconn *);
-
 
49
    double (*seek)(struct Rconn *, double, int, int);
-
 
50
    void (*truncate)(struct Rconn *);
-
 
51
    int (*fflush)(struct Rconn *);
-
 
52
    size_t (*read)(void *, size_t, size_t, struct Rconn *);
-
 
53
    size_t (*write)(const void *, size_t, size_t, struct Rconn *);
-
 
54
    int nPushBack, posPushBack; /* number of lines, position on top line */
-
 
55
    char **PushBack;
-
 
56
    int save, save2;
-
 
57
    char encname[101];
-
 
58
    /* will be iconv_t, which is a pointer. NULL if not in use */
-
 
59
    void *inconv, *outconv;
-
 
60
    /* The idea here is that no MBCS char will ever not fit */
-
 
61
    char iconvbuff[25], oconvbuff[50], *next, init_out[25];
-
 
62
    short navail, inavail;
-
 
63
    Rboolean EOF_signalled;
-
 
64
    Rboolean UTF8out;
-
 
65
    void *id;
-
 
66
    void *ex_ptr;
-
 
67
    void *private;
-
 
68
    int status; /* for pipes etc */
-
 
69
};
-
 
70
 
25
 
-
 
26
/* NB: this is a private header, and not installed.  The internals of
-
 
27
       connections are private and subject to change without notice.
-
 
28
       A subset can be accessed using R_ext/Connections.h but read
-
 
29
       the warning in that file for details. */
71
 
30
 
72
typedef enum {HTTPsh, FTPsh, HTTPSsh} UrlScheme;
31
typedef enum {HTTPsh, FTPsh, HTTPSsh} UrlScheme;
73
 
32
 
74
/* used in internet module */
33
/* used in internet module */
75
typedef struct urlconn {
34
typedef struct urlconn {