From musically.ut at gmail.com  Sun Oct 12 17:13:10 2014
From: musically.ut at gmail.com (Utkarsh Upadhyay)
Date: Sun, 12 Oct 2014 17:13:10 +0200
Subject: [Rd] Is this an incorrect use of the R-API?
Message-ID: <CALh3q9yLnnN8fs5Jq0LKU8D5pKh6ZDe5EDbUS2YYiMbh+-6LDA@mail.gmail.com>

Hi,

I am trying to create a small extension for R here for embedding the
current time on the R prompt: https://github.com/musically-ut/extPrompt

Things seem to be working overall, but `R CMD check .` raised a warning:

> File '[truncated]..Rcheck/extPrompt/libs/extPrompt.so?:
>  Found non-API call to R: ?ptr_R_ReadConsole?
>
> Compiled code should not call non-API entry points in R.

The concerned file is this:
https://github.com/musically-ut/extPrompt/blob/master/src/extPrompt.c and
occurs on line 38, I think [1].

I am trying to make the R_ReadConsole API call. However, since a different
plugin (like mine) could have overridden it already, I do not want to
directly invoke `R_ReadConsole` but the function which previously was at
`ptr_R_ReadConsole`.

Is this an incorrect use of the API?

Thanks!

Best Regards,
Utkarsh Upadhyay
http://musicallyut.in

[1]: I am impressed at how well the static code analysis works for R CMD
check.

	[[alternative HTML version deleted]]



[Rd] Is this an incorrect use of the R-API?
Utkarsh Upadhyay