On Mon, Sep 26, 2011 at 6:02 PM, J. Lewis Muir
On 9/26/11 4:39 PM, Bradley Pietrzak wrote:
> Thank you again for your responses. Unfortunately, I have encountered
> another problem, this time involving code that has been escaped to C. The
> new version of my program is shown below. Without the re-entrant option,
> the code runs perfectly fine. With the re-entrant option, however, I am met
> with several errors. The SNL user's manual says that the SNC automatically
> refers to variables in the struct UserVar by running the code " pVar->xxx",
> but that such references have to be handled manually for escaped C code. How
> do I handle such situations manually?
Hi, Brad.
In your example, you would need to do:
%% helloWorld(pVar->i);
Or, if you are wanting to do more things within your helloWorld
function, you could call it like this:
%% helloWorld(ssId, pVar);
with the function changed to:
void helloWorld(SS_ID ssId, struct UserVar *pVar) {
printf("Hello World! You have just called a C function, "
"and the variable i is %5.1f \n", pVar->i);
}
Lewis