- Scilab Online Help
- API Scilab
- Scilab Gateway API
- How to
- CheckColumn
- CheckDimProp
- CheckDims
- CheckLength
- CheckLhs
- CheckRhs
- CheckRow
- CheckSameDims
- CheckScalar
- CheckSquare
- CheckVector
- CreateListVarFrom
- CreateListVarFromPtr
- CreateVar
- FindOpt
- FirstOpt
- GetListRhsVar
- GetRhsVar
- GetType
- IsOpt
- Lhs
- LhsVar
- NumOpt
- OverLoad
- Rhs
- Scierror
- Scilab C Types
- get_optionals
- istk
- sci_types
- sciprint
- stk
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
However, this page did not exist in the previous stable version.
OverLoad
C gateway function which tells Scilab to look for another overloaded function
Calling Sequence
OverLoad(StackPos)
Arguments
- StackPos
the position in the Scilab memory of the parameter for which we want to take into account for the overloading process (input argument)
Description
A C gateway function which tells Scilab to look for another overloaded function. Scilab then appends to the name of the function a prefix (like %sp_ if the parameter taken into account is sparse) and look for the overloaded function. You must include stack-c.h to benefit from this function.
Be careful with the Scilab name of the function. Indeed, the current overloading process of Scilab works only on Scilab primitives (Scilab function wrote in C) which must have a Scilab name which is maximum 8 char wide.
WARNING: This API is deprecated from Scilab 5.2.0 and is going to be removed with Scilab 6.0. Please use API Scilab (the new Scilab API).
Examples
In this example, the C interface function takes one input parameters and prints the integer corresponding to the type of the variable sent as parameter in the Scilab console.
#include <stack-c.h> #include <sciprint.h> int sci_check_properties_2(char * fname) { int m1,n1,l1; CheckRhs(1,1); CheckLhs(0,1) ; switch(VarType(1)) { case sci_matrix: GetRhsVar(1, "d", &m1, &n1, &l1); sciprint("1 is a scalar matrix\n"); break; case sci_strings: GetRhsVar(1, "c", &m1, &n1, &l1); sciprint("1 is a string\n"); break; case sci_sparse: sciprint("1 is a sparse trying to overload\n"); OverLoad(1); } LhsVar(1) = 0; return 0; } </programlisting> <para>The builder.sce script look like this:</para> <programlisting role = "example"><![CDATA[ // This is the builder.sce // must be run from this directory lines(0); ilib_name = 'lib_check_properties'; files = ['check_properties.c']; libs = []; table =['chprop2', 'sci_check_properties_2']; // We must be careful when we choose a scilab function name in case of overloading. // We Scilab name function must be 8 char max. ldflags = ""; cflags = ""; fflags = ""; ilib_build(ilib_name,table,files,libs,'Makelib',ldflags,cflags,fflags);
And now, an example of use of this new function:
See Also
<< NumOpt | Scilab Gateway API | Rhs >> |