This commit is contained in:
cozis
2022-08-16 18:54:49 +02:00
parent 4d4e365002
commit 3209afb513
5 changed files with 55 additions and 52 deletions
+17
View File
@@ -56,6 +56,23 @@ struct xRuntime {
Heap *heap;
};
const char *Runtime_GetCurrentScriptAbsolutePath(Runtime *runtime)
{
Executable *exe = Runtime_GetCurrentExecutable(runtime);
assert(exe != NULL);
Source *src = Executable_GetSource(exe);
if(src == NULL)
return NULL;
const char *path = Source_GetAbsolutePath(src);
if(path == NULL)
return NULL;
assert(path[0] != '\0');
return path;
}
Stack *Runtime_GetStack(Runtime *runtime)
{
return Stack_Copy(runtime->stack, 1);