Merge remote-tracking branch 'origin/master' into gsoc2012-scilab
Conflicts: Examples/Makefile.in
This commit is contained in:
commit
21e17eaa73
795 changed files with 16905 additions and 11792 deletions
|
|
@ -1,20 +1,15 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS = example.c
|
||||
TARGET = example
|
||||
TARGET = swigexample
|
||||
INTERFACE = example.i
|
||||
|
||||
all::
|
||||
check: build
|
||||
$(MAKE) -f $(TOP)/Makefile octave_run
|
||||
|
||||
build:
|
||||
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
|
||||
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' octave
|
||||
|
||||
static::
|
||||
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
|
||||
TARGET='myoctave' INTERFACE='$(INTERFACE)' octave_static
|
||||
|
||||
clean::
|
||||
clean:
|
||||
$(MAKE) -f $(TOP)/Makefile octave_clean
|
||||
rm -f $(TARGET).py
|
||||
|
||||
check: all
|
||||
$(MAKE) -f $(TOP)/Makefile octave_run
|
||||
|
|
|
|||
|
|
@ -6,4 +6,3 @@ extern int sub(int,int);
|
|||
extern int mul(int,int);
|
||||
|
||||
extern int (*funcvar)(int,int);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* File : example.i */
|
||||
%module example
|
||||
%module swigexample
|
||||
%{
|
||||
#include "example.h"
|
||||
%}
|
||||
|
|
@ -13,4 +13,3 @@ extern int do_op(int a, int b, int (*op)(int, int));
|
|||
%constant int (*MUL)(int,int) = mul;
|
||||
|
||||
extern int (*funcvar)(int,int);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/octave
|
||||
# file: runme.m
|
||||
|
||||
example
|
||||
swigexample
|
||||
|
||||
a = 37
|
||||
b = 42
|
||||
|
|
@ -11,12 +11,11 @@ b = 42
|
|||
printf("Trying some C callback functions\n");
|
||||
printf(" a = %i\n", a);
|
||||
printf(" b = %i\n", b);
|
||||
printf(" ADD(a,b) = %i\n", example.do_op(a,b,example.ADD));
|
||||
printf(" SUB(a,b) = %i\n", example.do_op(a,b,example.SUB));
|
||||
printf(" MUL(a,b) = %i\n", example.do_op(a,b,example.MUL));
|
||||
printf(" ADD(a,b) = %i\n", swigexample.do_op(a,b,swigexample.ADD));
|
||||
printf(" SUB(a,b) = %i\n", swigexample.do_op(a,b,swigexample.SUB));
|
||||
printf(" MUL(a,b) = %i\n", swigexample.do_op(a,b,swigexample.MUL));
|
||||
|
||||
printf("Here is what the C callback function objects look like in Octave\n");
|
||||
example.ADD
|
||||
example.SUB
|
||||
example.MUL
|
||||
|
||||
swigexample.ADD
|
||||
swigexample.SUB
|
||||
swigexample.MUL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue