[Rd] R_CallMethodDef: 'type' and 'style' fields?

Steve Jaffe sjaffe at riskspan.com
Fri Oct 9 15:34:59 CEST 2009


Thanks. I did misread the documentation, which says on p 68:

Routines for use with the .C and .Fortran interfaces are described with
similar data structures [referring to R_CallMethodDef],
but which have two additional fields for describing the type and “style” of
each argument

So it is R_CMethodDef which has the 'type' and 'style' fields. Just to
confirm, if I specify a 'style' of R_ARG_IN does this suppress the copying
when using .C()? 

Actually, having now re-thought what I'm trying to do, it seems simpler just
to use DUP=False in the .C call. In which case it would seem to be a good
idea for me to make the signature of my  C function declare the non-output
arguments to be const (eg  const int* rather than int*). 

Thanks for your help.


Duncan Temple Lang wrote:
> 
> 
> 
> Steve Jaffe wrote:
>> In Writing R Extensions it is said that R_CallMethodDef has two optional
>> fields, 'type' and 'style' (where 'style' is said to distinguish
>> in/out/inout arguments).
> 
> Can you point us to the particular section and line that says
> this. I think it is for the R_CMethodDef structure, not the
> R_CallMethodDef.
> 
> Indeed, in Rdynload.h
> 
> typedef enum {R_ARG_IN, R_ARG_OUT, R_ARG_IN_OUT, R_IRRELEVANT}
> R_NativeArgStyle;
> 

-- 
View this message in context: http://www.nabble.com/R_CallMethodDef%3A-%27type%27-and-%27style%27-fields--tp25803313p25821291.html
Sent from the R devel mailing list archive at Nabble.com.



More information about the R-devel mailing list