Add forgotten compiler guards and one function for an R-API. This is
just a wrapper that sits on top and manages the struct for you. It is
only slightly different than what one might naturally do in C in that
you pass single parameters as pointers instead of by value because for
R, even single values are arrays (of length 1).