Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - Português

Change language to:
English - Français - 日本語 - Русский

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.

Ajuda do Scilab >> API Scilab > legacy > Low level functions > UpdateStack

UpdateStack

A C gateway function which update stack information with your modifications.

Syntax

UpdateStack();

Description

A C gateway function which update stack information with your modifications.

Examples

This example takes a matrix of doubles as input and returns:

  • the number of lines (first output argument)

  • the number of rows (second output argument)

#include "api_scilab.h"
int sci_mysizedouble(char * fname, void* pvApiCtx)
{
    SciErr      sciErr;
    int         m_in_row;
    int         n_in_col;
    int*        piAddr = NULL;
    double*     pdblData = NULL;

    sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
    if(sciErr.iErr)
    {
        printError(&sciErr, 0);
        return 0;
    }

    /* get dimensions */
    sciErr = getMatrixOfDouble(pvApiCtx, piAddr, &m_in_row, &n_in_col, &pdblData);
    if(sciErr.iErr)
    {
        printError(&sciErr, 0);
        return 0;
    }

    sciErr = createMatrixOfInteger32(pvApiCtx, InputArgument + 1, 1, 1, &m_in_row); // the m_in_row parameter handles the number of lines of the matrix sent as argument
    sciErr = createMatrixOfInteger32(pvApiCtx, InputArgument + 2, 1, 1, &m_in_row); // store a same value, but will neither be used nor returned to Scilab
    sciErr = createMatrixOfInteger32(pvApiCtx, InputArgument + 3, 1, 1, &n_in_col); // the n_in_col parameter handles the number of columns of the matrix sent as argument

    AssignOutputVariable(1) = InputArgument + 1; // We set the parameter "InputArgument + 1" as an output argument
    AssignOutputVariable(2) = InputArgument + 3; // We set the parameter "InputArgument + 3" as an output argument
    UpdateStack();
    return 0;
}
Report an issue
<< String writing (Scilab gateway) Low level functions optionals >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 25 08:52:44 CET 2020