mirror of
https://github.com/chrim05/nds-console.git
synced 2025-06-18 13:45:33 -04:00
implemented the call process function but not found the execv corrispective for libnds
This commit is contained in:
parent
915d44ba2c
commit
bddf384420
6
.vscode/c_cpp_properties.json
vendored
6
.vscode/c_cpp_properties.json
vendored
@ -3,12 +3,12 @@
|
||||
{
|
||||
"name": "Linux",
|
||||
"includePath": [
|
||||
"C:/devkitpro/devkitARM/arm-none-eabi/include",
|
||||
"C:/devkitpro/libnds/include",
|
||||
"/opt/devkitpro/devkitARM/arm-none-eabi/include",
|
||||
"/opt/devkitpro/libnds/include",
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"defines": ["ARM9"],
|
||||
"compilerPath": "C:/devkitPro/devkitARM/bin/arm-none-eabi-g++.exe",
|
||||
"compilerPath": "/opt/devkitpro/devkitARM/bin/arm-none-eabi-g++",
|
||||
"cStandard": "gnu17",
|
||||
"cppStandard": "gnu++14",
|
||||
"intelliSenseMode": "windows-gcc-x64"
|
||||
|
@ -308,8 +308,17 @@ void NScript::Evaluator::builtinPrint(CallNode call)
|
||||
|
||||
NScript::Node NScript::Evaluator::evaluateCallProcess(CallNode call, Position pos)
|
||||
{
|
||||
panic("evaluateCallProcess not implemented yet");
|
||||
return Node::none(pos);
|
||||
auto processPath = cstringRealloc(getFullPath(expectNonEmptyStringAndGetString(call.name), true).c_str());
|
||||
auto processArgv = new char*[call.args.size() + 2];
|
||||
|
||||
processArgv[0] = (char*)processPath;
|
||||
|
||||
for (uint64_t i = 1; i < call.args.size(); i++)
|
||||
processArgv[i] = (char*)cstringRealloc(expectStringLengthAndGetString(evaluateNode(call.args[i]), [] (uint64_t l) { return true; }).c_str());
|
||||
|
||||
processArgv[call.args.size()] = (char*)nullptr;
|
||||
|
||||
return Node(NodeKind::Num, (NodeValue) { .num = float64(execv(processPath, processArgv)) }, pos);
|
||||
}
|
||||
|
||||
NScript::Node NScript::Evaluator::evaluateCall(CallNode call, Position pos)
|
||||
|
Loading…
Reference in New Issue
Block a user