| 386 | } |
| 387 | |
| 388 | SQRESULT sq_setparamscheck(HSQUIRRELVM v,SQInteger nparamscheck,std::optional<std::string_view> typemask) |
| 389 | { |
| 390 | SQObject o = stack_get(v, -1); |
| 391 | if(!sq_isnativeclosure(o)) |
| 392 | return sq_throwerror(v, "native closure expected"); |
| 393 | SQNativeClosure *nc = _nativeclosure(o); |
| 394 | nc->_nparamscheck = nparamscheck; |
| 395 | if(typemask.has_value()) { |
| 396 | SQIntVec res; |
| 397 | if(!CompileTypemask(res, *typemask)) |
| 398 | return sq_throwerror(v, "invalid typemask"); |
| 399 | nc->_typecheck.copy(res); |
| 400 | } |
| 401 | else { |
| 402 | nc->_typecheck.resize(0); |
| 403 | } |
| 404 | if(nparamscheck == SQ_MATCHTYPEMASKSTRING) { |
| 405 | nc->_nparamscheck = nc->_typecheck.size(); |
| 406 | } |
| 407 | return SQ_OK; |
| 408 | } |
| 409 | |
| 410 | SQRESULT sq_bindenv(HSQUIRRELVM v,SQInteger idx) |
| 411 | { |
no test coverage detected