Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Fran├žais - Portugu├¬s -

Please note that the recommended version of Scilab is 6.0.1. This page might be outdated.
However, this page did not exist in the previous stable version.

Scilab help >> API Scilab > Scilab Gateway API > GetListRhsVar

GetListRhsVar

a C gateway function which allows to access a parameter stored in a [mt]list transmitted to a Scilab function

Calling Sequence

GetListRhsVar(StackPos,ListPos, Type, &m_rows, &n_cols, &l_stack_pos);

Arguments

StackPos

the rank of the [mt]list to be accessed (input parameter)

ListPos

the rank in the list of the parameter to be accessed (input parameter)

Type

the Scilab type of the parameter to be accessed (input parameter). Can be (see Scilab C Type for more informations):

  • STRING_DATATYPE "c"

  • MATRIX_OF_STRING_DATATYPE "S"

  • MATRIX_OF_DOUBLE_DATATYPE "d"

  • MATRIX_OF_RATIONAL_DATATYPE "r"

  • MATRIX_OF_VARIABLE_SIZE_INTEGER_DATATYPE "I"

  • MATRIX_OF_INTEGER_DATATYPE "i"

  • MATRIX_OF_BOOLEAN_DATATYPE "b"

  • MATRIX_OF_COMPLEX_DATATYPE "z"

  • SPARSE_MATRIX_DATATYPE "s"

  • TYPED_LIST_DATATYPE "t"

  • MATRIX_ORIENTED_TYPED_LIST_DATATYPE "m"

  • SCILAB_POINTER_DATATYPE "p"

  • GRAPHICAL_HANDLE_DATATYPE "h"

  • EXTERNAL_DATATYPE "f"

  • MATRIX_OF_POLYNOMIAL_DATATYPE "x"

m_rows

the number of lines of the accessed parameter (output parameter)

n_cols

the number of columns of the accessed parameter (output parameter)

l_stack_pos

the position on the stack of the accessed parameter (output parameter)

Description

A C gateway function which allows to access a parameter stored in a [mt]list transmitted to a Scilab function

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 function has one input parameter. It gets a mlist and the prints some informations related to the content of the mlist.

#include <stack-c.h>
#include <sciprint.h>

int sci_print_list(char * fname)
{
  int m_list_in, n_list_in, l_list_in;
  int m_type,    n_type;
  int m_var1,    n_var1,    l_var1;
  int m_var2,    n_var2,    l_var2;
  char ** LabelList = NULL;
  
  CheckRhs(1,1); // We accept only 1 parameter
  
  GetRhsVar(1,"m",&m_list_in,&n_list_in,&l_list_in); // Get a mlist
  
  // Get the type and the name of the variables (the first element of the mlist)
  GetListRhsVar(1,1,"S",&m_type,&n_type,&LabelList);
  
  if (strcmp(LabelList[0],"mytype")!=0)
    {
      sciprint("error, you must ship a mlist or type mytype\n");
      return 0;
    }
    
  // Get the first variable (a string)
  GetListRhsVar(1,2,"c",&m_var1,&n_var1,&l_var1);
  sciprint("var1 = %s\n",cstk(l_var1));
  
  // Get the second variable (a double matrix)
  GetListRhsVar(1,3,"d",&m_var2,&n_var2,&l_var2);
  sciprint("var2 = [%f %f %f %f]\n",*stk(l_var2+0),
                                    *stk(l_var2+1),
                                    *stk(l_var2+2),
                                    *stk(l_var2+3));
    
  return 0;
}

This example is available in SCI/modules/core/example/print_list.

See Also

  • Scilab C Type — the C types available in a C gateway
  • istk — Return a pointer to an integer to access data stored at a given position in the Scilab memory
  • LhsVar — a C gateway function which specifies which parameters created inside the C gateway will be returned as an output argument into Scilab.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Mar 03 11:01:00 CET 2011