Re: [Rd] C versions of serialize/unserialize in packages

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Thu, 31 Jul 2008 19:39:14 +0100 (BST)

On Thu, 31 Jul 2008, Prof Brian Ripley wrote:

> On Thu, 31 Jul 2008, Roger D. Peng wrote:
>
>> Are the functions 'R_Unserialize' and 'R_InitFileInPStream' allowed to
>> be used in R packages? I guess I'm just not clear on the implications
>> of this comment in 'Rinternals.h':
>>
>> /* The connection interface is not yet available to packages. To
>> allow limited use of connection pointers this defines the opaque
>> pointer type. */
>
> It applies to R_InitFile(In|Out)PStream only, and is conditionalized by
> NEED_CONNECTION_PSTREAMS. You can't create a Rconnection pointer in your own
> C code in a public way. (The 'yet' has been there for nearly 7 years.)

Sorry the cut-and-paste went wrong: R_InitConn(In|Out)PStream only.

>
> So what you are asking about is outside the conditional for that comment.
>
>
>> I have a function in the 'filehash' package that unserializes a bunch
>> of objects from a file and it seems to run much faster in C than in R.
>> But I don't want to release something that uses a non-public
>> function/interface.
>>
>> Thanks,
>> -roger
>> --
>> Roger D. Peng | http://www.biostat.jhsph.edu/~rpeng/
>>
>> ______________________________________________
>> R-devel_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
> --
> Brian D. Ripley, ripley_at_stats.ox.ac.uk
> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel: +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UK Fax: +44 1865 272595
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu 31 Jul 2008 - 18:49:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 01 Aug 2008 - 03:35:54 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive