MCPcopy Create free account
hub / github.com/anjo76/angelscript / BindAllImportedFunctions

Method BindAllImportedFunctions

sdk/angelscript/source/as_module.cpp:1466–1501  ·  view source on GitHub ↗

inteface

Source from the content-addressed store, hash-verified

1464
1465// inteface
1466int asCModule::BindAllImportedFunctions()
1467{
1468 bool notAllFunctionsWereBound = false;
1469
1470 // Bind imported functions
1471 int c = GetImportedFunctionCount();
1472 for( int n = 0; n < c; ++n )
1473 {
1474 asCScriptFunction *importFunc = GetImportedFunction(n);
1475 if( importFunc == 0 ) return asERROR;
1476
1477 asCString str = importFunc->GetDeclarationStr(false, true);
1478
1479 // Get module name from where the function should be imported
1480 const char *moduleName = GetImportedFunctionSourceModule(n);
1481 if( moduleName == 0 ) return asERROR;
1482
1483 asCModule *srcMod = m_engine->GetModule(moduleName, false);
1484 asIScriptFunction *func = 0;
1485 if( srcMod )
1486 func = srcMod->GetFunctionByDecl(str.AddressOf());
1487
1488 if( func == 0 )
1489 notAllFunctionsWereBound = true;
1490 else
1491 {
1492 if( BindImportedFunction(n, func) < 0 )
1493 notAllFunctionsWereBound = true;
1494 }
1495 }
1496
1497 if( notAllFunctionsWereBound )
1498 return asCANT_BIND_ALL_FUNCTIONS;
1499
1500 return asSUCCESS;
1501}
1502
1503// interface
1504int asCModule::UnbindAllImportedFunctions()

Callers 8

test_debug.cppFile · 0.80
TestFunction · 0.80
testTypedefFunction · 0.80
TestScriptsFunction · 0.80
TestAndrewPriceFunction · 0.80
TestFunction · 0.80
test_import.cppFile · 0.80
TestFunction · 0.80

Calls 4

GetDeclarationStrMethod · 0.80
GetFunctionByDeclMethod · 0.80
GetModuleMethod · 0.45
AddressOfMethod · 0.45

Tested by 6

TestFunction · 0.64
testTypedefFunction · 0.64
TestScriptsFunction · 0.64
TestAndrewPriceFunction · 0.64
TestFunction · 0.64
TestFunction · 0.64