scilab: add missing lib sciexception.swg
This commit is contained in:
parent
7bc8201719
commit
01aec38ae9
1 changed files with 46 additions and 0 deletions
46
Lib/scilab/sciexception.swg
Normal file
46
Lib/scilab/sciexception.swg
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
/*
|
||||||
|
* Exception typemaps (throws)
|
||||||
|
*/
|
||||||
|
|
||||||
|
%typemap(throws, noblock=1) int, unsigned int, signed int,
|
||||||
|
int&,unsigned int&, signed int&,
|
||||||
|
long, unsigned long, signed long,
|
||||||
|
short, unsigned short,signed short,
|
||||||
|
long long, unsigned long long,
|
||||||
|
unsigned char, signed char,
|
||||||
|
long&, unsigned long&, signed long&,
|
||||||
|
short&, unsigned short&, signed short&,
|
||||||
|
long long&, unsigned long long&,
|
||||||
|
unsigned char&, signed char& {
|
||||||
|
char obj[20];
|
||||||
|
sprintf(obj, "%d", $1);
|
||||||
|
%raise(obj, "$type", $descriptor);
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(throws, noblock=1) enum SWIGTYPE {
|
||||||
|
char obj[20];
|
||||||
|
sprintf(obj, "%d", $1);
|
||||||
|
%raise(obj, "$type", $descriptor);
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(throws, noblock=1) float, double,
|
||||||
|
float&, double& {
|
||||||
|
char obj[20];
|
||||||
|
sprintf(obj, "%5.3f", $1);
|
||||||
|
%raise(obj, "$type", $descriptor);
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(throws, noblock=1) char*, char[ANY] {
|
||||||
|
%raise($1, "$type", $descriptor);
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(throws, noblock=1) SWIGTYPE,
|
||||||
|
SWIGTYPE*,
|
||||||
|
SWIGTYPE [ANY],
|
||||||
|
SWIGTYPE & {
|
||||||
|
%raise(NULL, "$type", $descriptor);
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(throws, noblock=1) (...) {
|
||||||
|
SWIG_exception_fail(SWIG_RuntimeError,"unknown exception");
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue