adding struct example
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@11457 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
37ebcb9e67
commit
8217f59d55
8 changed files with 118 additions and 27 deletions
|
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/octave
|
||||
# file: runme.m
|
||||
|
||||
example
|
||||
|
|
|
|||
17
Examples/scilab/struct/Makefile
Normal file
17
Examples/scilab/struct/Makefile
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS = example.i
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
|
||||
all::
|
||||
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
|
||||
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
|
||||
|
||||
|
||||
clean::
|
||||
$(MAKE) -f $(TOP)/Makefile scilab_clean
|
||||
rm -f *.sce *.so lib*lib.c *_wrap.c
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile scilab_run
|
||||
11
Examples/scilab/struct/example.i
Normal file
11
Examples/scilab/struct/example.i
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
%module example
|
||||
|
||||
%rename(Bar) Foo;
|
||||
|
||||
%inline %{
|
||||
typedef struct {
|
||||
int x;
|
||||
} Foo;
|
||||
|
||||
%}
|
||||
|
||||
14
Examples/scilab/struct/runme.sci
Normal file
14
Examples/scilab/struct/runme.sci
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// builder the *.so
|
||||
exec builder.sce
|
||||
|
||||
//loader the *.so
|
||||
exec loader.sce
|
||||
|
||||
//create a struct
|
||||
a=new_Bar();
|
||||
Bar_x_set(a,100);
|
||||
Bar_x_get(a)
|
||||
|
||||
exit
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue