[Scilab-Dev] how to clear a variable in a C interface

Serge Steer Serge.Steer at scilab.org
Tue Aug 19 11:34:24 CEST 2008


I do not understand what you really want to do.

- do you want to mimic the clear function?
Note that  when you use GetRhsVar(1, "d", &m_var, &n_var, &l_var);  the
variable 1 is a temporary variable (typically the result of the
evaluation of an expression) and not a variable registered with a name
(typically result of an instruction evaluation like a=1)

do you want to free memory in the stack?
In this case the API which defines functions like GetRhsVar, ... does
not allow to modify the input variables shape. But it is probably
possible to replace the right most by empty matrix or null type
variable. Removing completely removing a variable or modifying an
variable which not at the end of the argument list requires more
development.

Serge Steer



Collette Yann a écrit :
> Hello,
>
> I am writing a C interface. I would like to clean up a variable in
> that C interface, but I don't know how to remove it.
>
> GetRhsVar(1, "d", &m_var, &n_var, &l_var);
>
> ....
>
> ClearRhsVar(&m_var, &n_var, &l_var); // I'm looking for this kind of
> function which will remove the variable l_var from the stack.
>
> YC
>
>




More information about the dev mailing list