![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The Lua interpreter addon interface.
Adds a wide-ranging integration of the Murl framework to the Lua programming language, see http://www.lua.org/license.html
Get the Lua interpreter version information number.
Integer GetVersionNumber()
Get the Lua interpreter version information string.
String GetVersion()
Get the Lua interpreter release information string.
String GetRelease()
Get the Lua interpreter copyright information string.
String GetCopyright()
Get the Lua interpreter authors information string.
String GetAuthors()
Open a Lua standard library. Lua offers the following standard libraries:
The Lua Basic Functions library is opened automatically at addon's Init().
Boolean OpenLibrary(String name)
name | The name of the Lua standard library to open. |
Read a Lua chunk from a file.
String ReadChunk(Murl.IFileInterface fileInterface, String fileName)
fileInterface | The file interface. |
fileName | The name of the file to load. |
Read a Lua chunk from a resource.
String ReadResourceChunk(Murl.Resource.ICollection resourceCollection, String resourceId)
resourceCollection | The resource collection. |
resourceId | The identifier of the resoure. |
Load (or map) a Lua chunk from a file. The loaded data must be unloaded by UnLoadChunk().
Murl.ConstData LoadChunk(Murl.IFileInterface fileInterface, String fileName)
fileInterface | The file interface. |
fileName | The name of the file to load. |
Unload (or unmap) a Lua chunk from a file.
Boolean, Murl.ConstData UnLoadChunk(Murl.IFileInterface fileInterface, Murl.ConstData chunk)
fileInterface | The file interface. |
chunk | The chunk data object to unload. |
Load (or map) a Lua chunk from a resource. The loaded data must be unloaded by UnLoadResourceChunk().
Murl.ConstData LoadResourceChunk(Murl.Resource.ICollection resourceCollection, String resourceId)
resourceCollection | The resource collection. |
resourceId | The identifier of the resoure. |
Unload (or unmap) a Lua chunk from a resource.
Boolean UnLoadResourceChunk(Murl.Resource.ICollection resourceCollection, String resourceId)
resourceCollection | The resource collection. |
resourceId | The identifier of the resoure. |
Validate a Lua chunk data object.
Boolean, Murl.Result ValidateChunk(Murl.ConstData chunk, String chunkName, Murl.Result result)
chunk | The Lua chunk data object to validate. |
chunkName | The name of the chunk used for error messages. |
result | This return value is set for syntactic script errors. |
Compile a Lua chunk data object. Warning! Compiled chunks are architecture dependent, e.g. chunks compiled on a 64 bit system are incompatible with 32 bit systems.
Murl.Data CompileChunk(Murl.ConstData chunk, String chunkName, Boolean stripDebugInfo)
chunk | The Lua chunk data object to compile. |
chunkName | The name of the chunk used for error messages. |
stripDebugInfo | Create without debug information about the function if true. |
Create an IApp interface object from a chunk. The Lua script gets the chunkName as parameter. The Lua script must return an IAppPtr instance.
Murl.SharedPointer.IApp CreateIApp(Murl.ConstData chunk, String chunkName)
chunk | The Lua chunk data object to execute. |
chunkName | The name of the chunk used for error messages. |
Create a Logic::IAppProcessor interface object from a chunk. The Lua script gets the resourceId and the info as parameter. The Lua script return an Logic::IAppProcessorPtr instance.
Murl.SharedPointer.LogicIAppProcessor CreateIAppProcessor(Murl.ConstData chunk, String resourceId, String info)
chunk | The Lua chunk data object to execute. |
resourceId | The name of the chunk used for error messages. |
info | A string with additional information passed to the script. |
Create a Logic::IAppGraph interface object from a chunk. The Lua script gets the resourceId and the info as parameter. The Lua script must return an Logic::IAppGraphPtr instance.
Murl.SharedPointer.LogicIAppGraph CreateIAppGraph(Murl.ConstData chunk, String resourceId, String info)
chunk | The Lua chunk data object to execute. |
resourceId | The name of the chunk used for error messages. |
info | A string with additional information passed to the script. |
Get a Double value from a global Lua table. Preforms the Lua operation value = table[key].
Boolean, Number GetGlobal(Number value, String table, String key)
value | Return the value of table[key]. |
table | The name of the table. |
key | The name of the key in the table to get the value from. |
Get a String value from a global Lua table. Preforms the Lua operation value = table[key].
Boolean, String GetGlobal(String value, String table, String key)
value | Return the value of table[key]. |
table | The name of the table. |
key | The name of the key in the table to get the value from. |
Set a Double value to a global Lua table. Preforms the Lua operation table[key] = value. If the table does not exist, a new table is created.
Boolean SetGlobal(String table, String key, Number value)
table | The name of the table. |
key | The name of the key in the table to set the value. |
value | The value to set table[key]. |
Set a String value to a global Lua table. Preforms the Lua operation table[key] = value. If the table does not exist, a new table is created.
Boolean SetGlobal(String table, String key, String value)
table | The name of the table. |
key | The name of the key in the table to set the value. |
value | The value to set table[key]. |
Performs a full garbage-collection cycle.
Boolean CollectGarbage()