Skip to content

Commit 8703673

Browse files
committed
[[ Script ]] Added MCScriptGetNameOfModule API.
1 parent 4a596d4 commit 8703673

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

libscript/include/script.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ bool MCScriptLookupModule(MCNameRef name, MCScriptModuleRef& r_module);
146146
// Ensure that the module is valid and has resolved all its dependencies.
147147
bool MCScriptEnsureModuleIsUsable(MCScriptModuleRef module);
148148

149+
// Get the name of the module.
150+
MCNameRef MCScriptGetNameOfModule(MCScriptModuleRef module);
151+
149152
// Returns true if the module is a library.
150153
bool MCScriptIsModuleALibrary(MCScriptModuleRef module);
151154

libscript/src/script-module.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,11 @@ bool MCScriptLookupModule(MCNameRef p_name, MCScriptModuleRef& r_module)
371371
return false;
372372
}
373373

374+
MCNameRef MCScriptGetNameOfModule(MCScriptModuleRef self)
375+
{
376+
return self -> name;
377+
}
378+
374379
bool MCScriptIsModuleALibrary(MCScriptModuleRef self)
375380
{
376381
return self -> module_kind == kMCScriptModuleKindLibrary;

0 commit comments

Comments
 (0)