Some change about makefile and typemaps as a littlet change of Scilab API

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@11404 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Baozeng Ding 2009-07-16 08:45:50 +00:00
commit c6592a5b56
8 changed files with 116 additions and 104 deletions

View file

@ -7,9 +7,10 @@ INTERFACE = example.i
all:: all::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
scilab -nwni < runme.sci
clean:: clean::
$(MAKE) -f $(TOP)/Makefile scilab_clean $(MAKE) -f $(TOP)/Makefile scilab_clean
rm -f *.sce *.so lib*lib.c rm -f *.sce *.so lib*lib.c *_wrap.c
check: all check: all

View file

@ -7,9 +7,10 @@ INTERFACE = example.i
all:: all::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
scilab -nwni < runme.sci
clean:: clean::
$(MAKE) -f $(TOP)/Makefile scilab_clean $(MAKE) -f $(TOP)/Makefile scilab_clean
rm -f *.sce *.so lib*lib.c rm -f *.sce *.so lib*lib.c *_wrap.c
check: all check: all

View file

@ -7,9 +7,10 @@ INTERFACE = example.i
all:: all::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
scilab -nwni < runme.sci
clean:: clean::
$(MAKE) -f $(TOP)/Makefile scilab_clean $(MAKE) -f $(TOP)/Makefile scilab_clean
rm -f *.sce *.so lib*lib.c rm -f *.sce *.so lib*lib.c *_wrap.c
check: all check: all

View file

@ -7,9 +7,10 @@ INTERFACE = example.i
all:: all::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
scilab -nwni < runme.sci
clean:: clean::
$(MAKE) -f $(TOP)/Makefile scilab_clean $(MAKE) -f $(TOP)/Makefile scilab_clean
rm -f *.sce *.so lib*lib.c rm -f *.sce *.so lib*lib.c *_wrap.c
check: all check: all

View file

@ -7,9 +7,10 @@ INTERFACE = example.i
all:: all::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
scilab -nwni < runme.sci
clean:: clean::
$(MAKE) -f $(TOP)/Makefile scilab_clean $(MAKE) -f $(TOP)/Makefile scilab_clean
rm -f *.sce *.so lib*lib.c rm -f *.sce *.so lib*lib.c *_wrap.c
check: all check: all

View file

@ -7,9 +7,10 @@ INTERFACE = example.i
all:: all::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \ $(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
scilab -nwni < runme.sci
clean:: clean::
$(MAKE) -f $(TOP)/Makefile scilab_clean $(MAKE) -f $(TOP)/Makefile scilab_clean
rm -f *.sce *.so lib*lib.c rm -f *.sce *.so lib*lib.c *_wrap.c
check: all check: all

View file

@ -337,35 +337,35 @@
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
/* Basic C types */ /* Basic C types */
%typemap(out) signed char (int iRowsOut,int iColsOut,int* _piAddress) { %typemap(out) signed char (int iRowsOut,int iColsOut) {
char temp; char temp;
temp=(char)($result); temp=(char)($result);
iRowsOut=1; iRowsOut=1;
iColsOut=1; iColsOut=1;
createMatrixOfInteger8(iVarOut, iRowsOut, iColsOut, &temp, &_piAddress); createMatrixOfInteger8(iVarOut, iRowsOut, iColsOut, &temp);
LhsVar(iOutNum)=iVarOut; LhsVar(iOutNum)=iVarOut;
} }
%typemap(out) short (int iRowsOut,int iColsOut,int* _piAddress), %typemap(out) short (int iRowsOut,int iColsOut),
unsigned char (int iRowsOut,int iColsOut,int* _piAddress) { unsigned char (int iRowsOut,int iColsOut) {
short temp; short temp;
temp=(short)($result); temp=(short)($result);
iRowsOut=1; iRowsOut=1;
iColsOut=1; iColsOut=1;
createMatrixOfInteger16(iVarOut, iRowsOut, iColsOut, &temp, &_piAddress); createMatrixOfInteger16(iVarOut, iRowsOut, iColsOut, &temp);
LhsVar(iOutNum)=iVarOut; LhsVar(iOutNum)=iVarOut;
} }
%typemap(out) int (int iRowsOut,int iColsOut,int* _piAddress), %typemap(out) int (int iRowsOut,int iColsOut),
unsigned int (int iRowsOut,int iColsOut,int* _piAddress), unsigned int (int iRowsOut,int iColsOut),
unsigned short (int iRowsOut,int iColsOut,int* _piAddress), unsigned short (int iRowsOut,int iColsOut),
unsigned long (int iRowsOut,int iColsOut,int* _piAddress), unsigned long (int iRowsOut,int iColsOut),
long (int iRowsOut,int iColsOut,int* _piAddress) { long (int iRowsOut,int iColsOut) {
int temp; int temp;
temp=(int)($result); temp=(int)($result);
iRowsOut=1; iRowsOut=1;
iColsOut=1; iColsOut=1;
createMatrixOfInteger32(iVarOut, iRowsOut, iColsOut, &temp, &_piAddress); createMatrixOfInteger32(iVarOut, iRowsOut, iColsOut, &temp);
LhsVar(iOutNum)=iVarOut; LhsVar(iOutNum)=iVarOut;
} }
@ -392,35 +392,35 @@
} }
/* Pointers */ /* Pointers */
%typemap(out) signed char *(int iRowsOut,int iColsOut,int* _piAddress) { %typemap(out) signed char *(int iRowsOut,int iColsOut) {
char *temp; char *temp;
temp=(char *)($result); temp=(char *)($result);
iRowsOut=1; iRowsOut=1;
iColsOut=1; iColsOut=1;
createMatrixOfInteger8(iVarOut, iRowsOut, iColsOut, temp, &_piAddress); createMatrixOfInteger8(iVarOut, iRowsOut, iColsOut, temp);
LhsVar(iOutNum)=iVarOut; LhsVar(iOutNum)=iVarOut;
} }
%typemap(out) short *(int iRowsOut,int iColsOut,int* _piAddress), %typemap(out) short *(int iRowsOut,int iColsOut),
unsigned char *(int iRowsOut,int iColsOut,int* _piAddress) { unsigned char *(int iRowsOut,int iColsOut) {
short *temp; short *temp;
temp=(short *)($result); temp=(short *)($result);
iRowsOut=1; iRowsOut=1;
iColsOut=1; iColsOut=1;
createMatrixOfInteger16(iVarOut, iRowsOut, iColsOut, temp, &_piAddress); createMatrixOfInteger16(iVarOut, iRowsOut, iColsOut, temp);
LhsVar(iOutNum)=iVarOut; LhsVar(iOutNum)=iVarOut;
} }
%typemap(out) int *(int iRowsOut,int iColsOut,int* _piAddress), %typemap(out) int *(int iRowsOut,int iColsOut),
unsigned int *(int iRowsOut,int iColsOut,int* _piAddress), unsigned int *(int iRowsOut,int iColsOut),
unsigned short *(int iRowsOut,int iColsOut,int* _piAddress), unsigned short *(int iRowsOut,int iColsOut),
unsigned long *(int iRowsOut,int iColsOut,int* _piAddress), unsigned long *(int iRowsOut,int iColsOut),
long *(int iRowsOut,int iColsOut,int* _piAddress) { long *(int iRowsOut,int iColsOut) {
int *temp; int *temp;
temp=(int *)($result); temp=(int *)($result);
iRowsOut=1; iRowsOut=1;
iColsOut=1; iColsOut=1;
createMatrixOfInteger32(iVarOut, iRowsOut, iColsOut, temp, &_piAddress); createMatrixOfInteger32(iVarOut, iRowsOut, iColsOut, temp);
LhsVar(iOutNum)=iVarOut; LhsVar(iOutNum)=iVarOut;
} }
@ -549,22 +549,19 @@
* ----------------------------------------------------------------------------- */ * ----------------------------------------------------------------------------- */
/* Basic C types */ /* Basic C types */
%typemap(varout,noblock=1) signed char { %typemap(varout,noblock=1) signed char {
int* _piAddress; createMatrixOfInteger8(iVarOut, iRowsOut, iColsOut, &$result);
createMatrixOfInteger8(iVarOut, iRowsOut, iColsOut, &$result, &_piAddress);
LhsVar(iOutNum)=iVarOut; LhsVar(iOutNum)=iVarOut;
} }
%typemap(varout,noblock=1) short { %typemap(varout,noblock=1) short {
int* _piAddress; createMatrixOfInteger16(iVarOut, iRowsOut, iColsOut, &$result);
createMatrixOfInteger16(iVarOut, iRowsOut, iColsOut, &$result, &_piAddress);
LhsVar(iOutNum)=iVarOut; LhsVar(iOutNum)=iVarOut;
} }
%typemap(varout,noblock=1) unsigned char { %typemap(varout,noblock=1) unsigned char {
int* _piAddress;
short temp; short temp;
temp=$result; temp=$result;
createMatrixOfInteger16(iVarOut, iRowsOut, iColsOut, &temp, &_piAddress); createMatrixOfInteger16(iVarOut, iRowsOut, iColsOut, &temp);
LhsVar(iOutNum)=iVarOut; LhsVar(iOutNum)=iVarOut;
} }
@ -573,8 +570,7 @@
unsigned short, unsigned short,
unsigned long, unsigned long,
long { long {
int* _piAddress; createMatrixOfInteger32(iVarOut, iRowsOut, iColsOut, &$result);
createMatrixOfInteger32(iVarOut, iRowsOut, iColsOut, &$result, &_piAddress);
LhsVar(iOutNum)=iVarOut; LhsVar(iOutNum)=iVarOut;
} }

View file

@ -427,6 +427,14 @@ public:
Printf(f_header,"%s", globalVar); Printf(f_header,"%s", globalVar);
Printf(f_builder_code, "\"%s\",\"%s\";", getname, getname); Printf(f_builder_code, "\"%s\",\"%s\";", getname, getname);
Delete(rowname);
Delete(colname);
Delete(iscomplexname);
Delete(globalVar);
DelWrapper(setf);
DelWrapper(getf);
return SWIG_OK; return SWIG_OK;
} }
@ -453,6 +461,7 @@ public:
tempvalue = NewString("ascii"); tempvalue = NewString("ascii");
Printf(tempvalue, "(%i)", (int)*temp); Printf(tempvalue, "(%i)", (int)*temp);
value = Copy(tempvalue); value = Copy(tempvalue);
Delete(tempvalue);
} }
else{ else{
if(!Strcmp(type, "p.char")){ if(!Strcmp(type, "p.char")){
@ -467,6 +476,7 @@ public:
Printf(tempvalue, "%s",temp); Printf(tempvalue, "%s",temp);
value = Copy(tempvalue); value = Copy(tempvalue);
} }
Delete(tempvalue);
} }
/* write into the code string */ /* write into the code string */