/usr/share/swig/3.0.12/javascript/v8
NameSizeModeActions
arrays_javascript.i32510644editdlrm
ccomplex.i7700644editdlrm
cdata.i300644editdlrm
complex.i800644editdlrm
exception.i340644editdlrm
javascript.swg4390644editdlrm
javascriptcode.swg195990644editdlrm
javascriptcomplex.swg33280644editdlrm
javascriptfragments.swg5590644editdlrm
javascripthelpers.swg44200644editdlrm
javascriptinit.swg41820644editdlrm
javascriptkw.swg10150644editdlrm
javascriptprimtypes.swg44260644editdlrm
javascriptrun.swg246550644editdlrm
javascriptruntime.swg16700644editdlrm
javascriptstrings.swg17530644editdlrm
javascripttypemaps.swg13150644editdlrm
std_common.i1020644editdlrm
std_complex.i4740644editdlrm
std_deque.i280644editdlrm
std_except.i350644editdlrm
std_map.i23370644editdlrm
std_pair.i6890644editdlrm
std_string.i350644editdlrm
std_vector.i26330644editdlrm
stl.i2910644editdlrm
typemaps.i44140644editdlrm
Edit: /usr/share/swig/3.0.12/javascript/v8/javascriptcomplex.swg (3328B)
/* Defines the As/From converters for double/float complex, you need to provide complex Type, the Name you want to use in the converters, the complex Constructor method, and the Real and Imag complex accessor methods. See the std_complex.i and ccomplex.i for concrete examples. */ /* the common from converter */ %define %swig_fromcplx_conv(Type, Real, Imag) %fragment(SWIG_From_frag(Type),"header", fragment=SWIG_From_frag(double)) { SWIGINTERNINLINE v8::Handle SWIG_From_dec(Type)(%ifcplusplus(const Type&, Type) c) { SWIGV8_HANDLESCOPE_ESC(); v8::Local vals = SWIGV8_ARRAY_NEW(2); vals->Set(0, SWIG_From(double)(Real(c))); vals->Set(1, SWIG_From(double)(Imag(c))); SWIGV8_ESCAPE(vals); } } %enddef /* the double case */ %define %swig_cplxdbl_conv(Type, Constructor, Real, Imag) %fragment(SWIG_AsVal_frag(Type),"header", fragment=SWIG_AsVal_frag(double)) { SWIGINTERN int SWIG_AsVal_dec(Type) (v8::Handle o, Type* val) { SWIGV8_HANDLESCOPE(); if (o->IsArray()) { v8::Handle array = v8::Handle::Cast(o); if(array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2]."); double re, im; int res; res = SWIG_AsVal(double)(array->Get(0), &re); if(!SWIG_IsOK(res)) { return SWIG_TypeError; } res = SWIG_AsVal(double)(array->Get(1), &im); if(!SWIG_IsOK(res)) { return SWIG_TypeError; } if (val) *val = Constructor(re, im); return SWIG_OK; } else if(o->IsNumber()){ double d; int res = SWIG_AddCast(SWIG_AsVal(double)(o, &d)); if (SWIG_IsOK(res)) { if (val) *val = Constructor(d, 0.0); return res; } } return SWIG_TypeError; } } %swig_fromcplx_conv(Type, Real, Imag); %enddef /* the float case */ %define %swig_cplxflt_conv(Type, Constructor, Real, Imag) %fragment(SWIG_AsVal_frag(Type),"header", fragment=SWIG_AsVal_frag(float)) { SWIGINTERN int SWIG_AsVal_dec(Type) (v8::Handle o, Type* val) { SWIGV8_HANDLESCOPE(); if (o->IsArray()) { v8::Handle array = v8::Handle::Cast(o); if(array->Length() != 2) SWIG_Error(SWIG_TypeError, "Illegal argument for complex: must be array[2]."); double re, im; int res; res = SWIG_AsVal(double)(array->Get(0), &re); if(!SWIG_IsOK(res)) { return SWIG_TypeError; } res = SWIG_AsVal(double)(array->Get(1), &im); if(!SWIG_IsOK(res)) { return SWIG_TypeError; } if ((-FLT_MAX <= re && re <= FLT_MAX) && (-FLT_MAX <= im && im <= FLT_MAX)) { if (val) *val = Constructor(%numeric_cast(re, float), %numeric_cast(im, float)); return SWIG_OK; } else { return SWIG_OverflowError; } } else if(o->IsNumber()){ float re; int res = SWIG_AddCast(SWIG_AsVal(float)(o, &re)); if (SWIG_IsOK(res)) { if (val) *val = Constructor(re, 0.0); return res; } } return SWIG_TypeError; } } %swig_fromcplx_conv(Type, Real, Imag); %enddef #define %swig_cplxflt_convn(Type, Constructor, Real, Imag) \ %swig_cplxflt_conv(Type, Constructor, Real, Imag) #define %swig_cplxdbl_convn(Type, Constructor, Real, Imag) \ %swig_cplxdbl_conv(Type, Constructor, Real, Imag)