From aefdcd65e170df417c0f80f1c4c3214301d447c0 Mon Sep 17 00:00:00 2001
From: Simon Marchetto
Date: Wed, 19 Mar 2014 12:05:38 +0100
Subject: [PATCH] scilab: document struct array member
---
Doc/Manual/Scilab.html | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/Doc/Manual/Scilab.html b/Doc/Manual/Scilab.html
index 001fe8b71..c16b5d084 100644
--- a/Doc/Manual/Scilab.html
+++ b/Doc/Manual/Scilab.html
@@ -608,7 +608,7 @@ For example of a struct with two members:
typedef struct {
int x;
- int y;
+ int arr[4];
} Foo;
%}
@@ -618,8 +618,8 @@ typedef struct {
Several functions are generated:
- a creation function new_Foo() which returns a pointer to a new created struct Foo.
-- the two getter functions Foo_x_get(), Foo_y_get(), to get the values of x and y for the struct pointer given in parameter
-- the two setter functions Foo_x_set(), Foo_y_set(), to set the values of x and y for the struct pointer given in parameter.
+- the two getter functions Foo_x_get(), Foo_arr_get(), to get the values of x and y for the struct pointer given in parameter
+- the two setter functions Foo_x_set(), Foo_arr_set(), to set the values of x and y for the struct pointer given in parameter.
- a destruction function delete_Foo() to release the struct pointer.
@@ -629,16 +629,23 @@ Following is an example of use:
---> a = new_Foo();
---> Foo_x_set(a, 100);
---> Foo_x_get(a)
+--> f = new_Foo();
+--> Foo_x_set(f, 100);
+--> Foo_x_get(f)
ans =
100.
---> delete_Foo(a);
+--> Foo_arr_set(f, [0:3]);
+--> Foo_arr_get(f)
+ans =
+
+ 0. 1. 2. 3.
+
+--> delete_Foo(f);
+
Members of a structure that itself are a structure are also accepted and wrapped as a pointer:
@@ -866,6 +873,7 @@ The default mapped type for C/C++ non-primitive types is the Scilab pointer. Tha
Typemaps are available by default for arrays. Primitive type arrays are automatically converted from/to Scilab matrices.
+Conversion is done also for arrays that are member of a structure or a class.