$LastChangedDate$Scilab2C Functions AnnotationsScilab to C Converter : Functions Annotations How ToDescription
The annotation of every Scilab function is mandatory. Only the main function of the Scilab program you are translating doesn’t need any annotation.
The main function can not return any output argument and can not accept any input argument.
It is important to specify for each output argument of the Scilab function, its size and type in order to have the possibility to allocate the correct memory space at translation time.
When the size of the returned output can be estimated only at run time, as happens for find-like functions that return an output whose size is related to the condition tested by the function,
the user must be able to specify at least the maximum size that can be returned by the function.
If it is not possible then the function should dynamically allocate memory and so can not be translated by Sci2C.
Function annotation must specify:
the number of input arguments. (See NIN tag)the number of output arguments. (See NOUT tag)the type and precision of each output argument. (See TP tag)the size of every output argument. (See SZ tag)the default precision for the data declared in the function body.Simple Example
This will declare a function with the following informations:
1 input argument.2 output arguments.first output argument has the same type than first input argument.first output argument has the same width than first input argument.first output argument has the same height than first input argument.second output argument has the same type than first input argument.second output argument has the same width than first input argument.second output argument has the same height than first input argument.Simple Example
This will declare a function with the following informations:
2 input arguments.2 output arguments.first output argument has the same type than first input argument.first output argument is a row vetor.first output argument's height is the product of the first input width by height.second output argument has the same type than first input argument.second output argument is a row vector.second output argument's height is the product of the first input width by height.See Also
Sciab2C Annotations,
Scilab2C Code Generator
AuthorsBruno JOFRETRaffaele NUTRICATO