[R-pkg-devel] How to pass a connection into a C function (R 3.2)

Tom Quarendon tom.quarendon at teamwpc.co.uk
Thu Jan 21 17:39:59 CET 2016


I would like to implement a package that contains a C function that writes to a connection.
So the R_ext/Connections.h defines what a connection IS, but not how to get one.

What seems to work is to manually declare
Rconnection getConnection(int n);
In my C file, and while this works, and I can then use the connection object, it fails package validation with:

“Found non-API call to R: ‘getConnection’
Compiled code should not call non-API entry points in R.”

So how am I supposed to do this? Is there a way? Or do I just live with the check warning (ideally not)?

Thanks.

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list