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:
Baozeng Ding 2009-07-27 02:57:09 +00:00
commit 8217f59d55
8 changed files with 118 additions and 27 deletions

View file

@ -1,3 +1,4 @@
#!/usr/bin/octave
# file: runme.m
example

View 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

View file

@ -0,0 +1,11 @@
%module example
%rename(Bar) Foo;
%inline %{
typedef struct {
int x;
} Foo;
%}

View 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