MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _internalExecute

Function _internalExecute

Engine/source/console/console.cpp:1547–1579  ·  view source on GitHub ↗

Internal execute for global function which does not save the stack

Source from the content-addressed store, hash-verified

1545
1546// Internal execute for global function which does not save the stack
1547ConsoleValue _internalExecute(S32 argc, ConsoleValue argv[])
1548{
1549 StringTableEntry funcName = StringTable->insert(argv[0].getString());
1550
1551 const char** argv_str = static_cast<const char**>(malloc((argc - 1) * sizeof(char *)));
1552 for (int i = 0; i < argc - 1; i++)
1553 {
1554 argv_str[i] = argv[i + 1].getString();
1555 }
1556 bool result;
1557 const char* methodRes = CInterface::CallFunction(NULL, funcName, argv_str, argc - 1, &result);
1558 free(argv_str);
1559 if (result)
1560 {
1561 ConsoleValue ret;
1562 ret.setString(methodRes);
1563 return std::move(ret);
1564 }
1565
1566 Namespace::Entry *ent;
1567
1568 ent = Namespace::global()->lookup(funcName);
1569
1570 if(!ent)
1571 {
1572 warnf(ConsoleLogEntry::Script, "%s: Unknown command.", funcName);
1573
1574 STR.clearFunctionOffset();
1575 return std::move(ConsoleValue());
1576 }
1577
1578 return std::move(ent->execute(argc, argv, &gEvalState));
1579}
1580
1581ConsoleValue execute(S32 argc, ConsoleValue argv[])
1582{

Callers 2

executeFunction · 0.85
_execMethod · 0.85

Calls 15

freeFunction · 0.85
clearFunctionOffsetMethod · 0.80
getNamespaceMethod · 0.80
setIntMethod · 0.80
warnfFunction · 0.70
ConsoleValueClass · 0.70
getIdMethod · 0.65
globalClass · 0.50
dFreeFunction · 0.50
insertMethod · 0.45
getStringMethod · 0.45
setStringMethod · 0.45

Tested by

no test coverage detected