From ripley at stats.ox.ac.uk  Mon Apr 21 19:44:05 2014
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon, 21 Apr 2014 18:44:05 +0100
Subject: [Rd] read.table() code fails outside of the utils package
In-Reply-To: <20140421170851.GA28440@piskorski.com>
References: <20140421155317.GA11783@piskorski.com>	<27A253DD-2564-4F6E-AD37-24737BCF4FFE@r-project.org>
	<20140421170851.GA28440@piskorski.com>
Message-ID: <535558E5.3030105@stats.ox.ac.uk>

On 21/04/2014 18:08, Andrew Piskorski wrote:
> On Mon, Apr 21, 2014 at 12:43:55PM -0400, Simon Urbanek wrote:
>
>> And that's how it should be - there is not reason why any other code should link to it. Why don't you just use
>>
>> .External(utils:::C_readtablehead, ...)
>
> Ah, that works fine, and is nice and simple.  So problem solved, thank
> you!
>
> I do still wonder though, with the C symbol made visible in utils.so,

That isn't true on platforms which support hiding entry points.  Try

% nm -g library/utils/libs/utils.so | grep readtablehead

on Linux.

> how come this still failed?:
>
>     .External("readtablehead", ..., PACKAGE="utils")
>     Error: "readtablehead" not available for .External() for package "utils"

Rather, you need to tell us why that should have worked ....  Maybe you 
failed to read in the code

R_init_utils(DllInfo *dll)
{
     R_registerRoutines(dll, NULL, CallEntries, NULL, ExtEntries);
     R_useDynamicSymbols(dll, FALSE);
     R_forceSymbols(dll, TRUE);
}

See 'Writing R Extensions'.

-- 
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



[Rd] read.table() code fails outside of the utils package
Prof Brian Ripley