[Rprotobuf-yada] linking against R shared library

Dirk Eddelbuettel edd at debian.org
Sat Nov 7 18:46:12 CET 2009

On 7 November 2009 at 17:48, Romain Francois wrote:
| On 11/07/2009 04:51 PM, Dirk Eddelbuettel wrote:
| >
| >
| > This compiles, but is otherwise nonsensical.  Does this get you going?
| I think I still need to call getConnection to get the Rconn* that 
| corresponds to the connection index. What do you pass as pdata here ?

Dunno, I never used these. I just thought I'd help you to get it out of
Rinternals and to make it available.  

I would have to look at the R sources to see what they do with the
connections.  I guess I misunderstood your snippet

     Rconnection con   ;
     struct R_outpstream_st out;
     R_pstream_format_t type = R_pstream_binary_format ;
     SEXP (*hook)(SEXP, SEXP) = NULL ;
     con = getConnection(Rf_asInteger(connection));
     R_InitConnOutPStream(&out, con, type, 0, hook, R_NilValue );

as you're ahead of me and only missing getConnection. My bad.

Looking at $R/src/main/connections.c, getConnection is clearly hidden so I am
not sure what we can do ... short of patching R or re-implementing the
connection business outside of R.  Either way, this sucks :-/


Three out of two people have difficulties with fractions.

More information about the Rprotobuf-yada mailing list