Displaying 2 results from an estimated 2 matches for "rtextconn".
2005 Aug 22
2
RFC: "loop connections"
...rn ans;
}
-/* ------------------- text connections --------------------- */
+/* ------------------- loop connections --------------------- */
/* read a R character vector into a buffer */
static void text_init(Rconnection con, SEXP text)
{
int i, nlines = length(text), nchars = 0;
- Rtextconn this = (Rtextconn)con->private;
+ Rloopconn this = (Rloopconn)con->private;
for(i = 0; i < nlines; i++)
nchars += strlen(CHAR(STRING_ELT(text, i))) + 1;
@@ -1668,19 +1668,35 @@
this->cur = this->save = 0;
}
-static Rboolean text_open(Rconnection con)
+/* read a R...
2005 Sep 18
0
Updated rawConnection() patch
...*/
/* read a R character vector into a buffer */
static void text_init(Rconnection con, SEXP text)
@@ -1702,6 +1691,22 @@
this->cur = this->save = 0;
}
+/* read a R raw vector into a buffer */
+static void raw_init(Rconnection con, SEXP raw)
+{
+ int nbytes = length(raw);
+ Rtextconn this = (Rtextconn)con->private;
+
+ this->data = (char *) malloc(nbytes);
+ if(!this->data) {
+ free(this); free(con->description); free(con->class); free(con);
+ error(_("cannot allocate memory for raw connection"));
+ }
+ memcpy(this->data, RAW(raw), nbytes...