Re: [Rd] Segmentation faults on SEXP conversion 20)

2009-11-15 Thread nabble . 30 . miller_2555
On Sun, Nov 15, 2009 at 9:16 PM, Duncan Murdoch - murd...@stats.uwo.ca <+nabble+miller_2555+1412c7fca2.murdoch#stats.uwo...@spamgourmet.com> wrote: > > Sorry, I missed something else that's obvious:  .Call needs a return value. >  The c function needs to include Rinternals.h, and the function needs

Re: [Rd] Segmentation faults on SEXP conversion

2009-11-15 Thread nabble . 30 . miller_2555
On 15/11/2009 8:25 PM, nabble.30.miller_2...@spamgourmet.com wrote: On Sun, Nov 15, 2009 at 2:52 PM, Duncan Murdoch - nabble.30.miller_2...@spamgourmet.com <> wrote: On 15/11/2009 1:41 PM, nabble.30.miller_2...@spamgourmet.com wrote: The "character" type in R corresponds to STRSXP in C, which i

Re: [Rd] Segmentation faults on SEXP conversion 20)

2009-11-15 Thread nabble . 30 . miller_2555
On Sun, Nov 15, 2009 at 8:30 PM, Duncan Murdoch - murd...@stats.uwo.ca <+nabble+miller_2555+1412c7fca2.murdoch#stats.uwo...@spamgourmet.com> wrote: > On 15/11/2009 8:25 PM, nabble.30.miller_2...@spamgourmet.com wrote: >> ptest.c: >> --- >> #include >

Re: [Rd] Segmentation faults on SEXP conversion

2009-11-15 Thread nabble . 30 . miller_2555
On 15/11/2009 8:25 PM, nabble.30.miller_2...@spamgourmet.com wrote: On Sun, Nov 15, 2009 at 2:52 PM, Duncan Murdoch - nabble.30.miller_2...@spamgourmet.com <> wrote: On 15/11/2009 1:41 PM, nabble.30.miller_2...@spamgourmet.com wrote: The "character" type in R corresponds to STRSXP in C, which i

Re: [Rd] Segmentation faults on SEXP conversion

2009-11-15 Thread nabble . 30 . miller_2555
On Sun, Nov 15, 2009 at 2:52 PM, Duncan Murdoch - murd...@stats.uwo.ca <+nabble+miller_2555+1412c7fca2.murdoch#stats.uwo...@spamgourmet.com> wrote: > On 15/11/2009 1:41 PM, nabble.30.miller_2...@spamgourmet.com wrote: >> > The "character" type in R corresponds to STRSXP in C, which is a vector of >

[Rd] Segmentation faults on SEXP conversion

2009-11-15 Thread nabble . 30 . miller_2555
Hello - I am making a first attempt at writing a simple C++ routine to print out R objects (this is a simple proof-of-concept as part of a larger package development). The relevant C++ routine is as follows: void Rwrite(SEXP fd, SEXP msg) { int *ofd = INTEGER(fd); const char * omsg = CHAR(asC