inteface
| 1464 | |
| 1465 | // inteface |
| 1466 | int 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 |
| 1504 | int asCModule::UnbindAllImportedFunctions() |