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::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
scilab -nwni < runme.sci
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

View file

@ -7,9 +7,10 @@ INTERFACE = example.i
all::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
scilab -nwni < runme.sci
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

View file

@ -7,9 +7,10 @@ INTERFACE = example.i
all::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
scilab -nwni < runme.sci
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

View file

@ -7,9 +7,10 @@ INTERFACE = example.i
all::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
scilab -nwni < runme.sci
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

View file

@ -7,9 +7,10 @@ INTERFACE = example.i
all::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
scilab -nwni < runme.sci
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

View file

@ -7,9 +7,10 @@ INTERFACE = example.i
all::
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
scilab -nwni < runme.sci
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

View file

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

View file

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