JenovaSDK API Reference
Developed by Hamid.Memar (MemarDesign™ LLC.)
 
Loading...
Searching...
No Matches
C Scripting Utilities (Clektron)

Functions

bool ExecuteScript (StringPtr ctronScript, bool noEntrypoint=false)
 Executes a Clektron script from a native string.
 
bool ExecuteScript (const godot::String &ctronScript, bool noEntrypoint=false)
 Executes a Clektron script from a String.
 
bool ExecuteScriptFromFile (StringPtr ctronScriptFile, bool noEntrypoint=false)
 Executes a Clektron script from a file on disk using a native string file path.
 
bool ExecuteScriptFromFile (const godot::String &ctronScriptFile, bool noEntrypoint=false)
 Executes a Clektron script from a file on disk using a String file path.
 
bool BindSymbol (FunctionPtr symbolPtr, StringPtr symbolName, StringPtr returnType, int paramCount,...)
 Registers a C++ symbol with the Clektron script engine, making it globally accessible within the framework.
 
bool BindSymbol (FunctionPtr symbolPtr, const godot::String &symbolName, const godot::String &returnType, int paramCount,...)
 Registers a C++ symbol with the Clektron script engine, making it globally accessible within the framework.
 

Detailed Description

This collection of functions provides a set of utilities for executing and managing Clektron (Electron-C) scripts.

Function Documentation

◆ ExecuteScript() [1/2]

bool ExecuteScript ( StringPtr ctronScript,
bool noEntrypoint = false )

Executes a Clektron script from a native string.

Parameters
ctronScriptThe string containing Clektron script to execute.
noEntrypointIf false script engine expects bool ClektronMain() be defined within the script, If true, script execution proceeds without requiring a entrypoint.
Returns
true if the script was compiled and executed successfully. false if compilation failed. An error message will be printed to the terminal.

◆ ExecuteScript() [2/2]

bool ExecuteScript ( const godot::String & ctronScript,
bool noEntrypoint = false )

Executes a Clektron script from a String.

Parameters
ctronScriptThe string containing Clektron script to execute.
noEntrypointIf false script engine expects bool ClektronMain() be defined within the script, If true, script execution proceeds without requiring a entrypoint.
Returns
true if the script was compiled and executed successfully. false if compilation failed. An error message will be printed to the terminal.

◆ ExecuteScriptFromFile() [1/2]

bool ExecuteScriptFromFile ( StringPtr ctronScriptFile,
bool noEntrypoint = false )

Executes a Clektron script from a file on disk using a native string file path.

Parameters
ctronScriptFileThe file path of the file (.ctron/.ct/.c) containing Clektron script to execute.
noEntrypointIf false script engine expects bool ClektronMain() be defined within the script, If true, script execution proceeds without requiring a entrypoint.
Returns
true if the script was compiled and executed successfully. false if compilation failed. An error message will be printed to the terminal.

◆ ExecuteScriptFromFile() [2/2]

bool ExecuteScriptFromFile ( const godot::String & ctronScriptFile,
bool noEntrypoint = false )

Executes a Clektron script from a file on disk using a String file path.

Parameters
ctronScriptFileThe file path of the file (.ctron/.ct/.c) containing Clektron script to execute.
noEntrypointIf false script engine expects bool ClektronMain() be defined within the script, If true, script execution proceeds without requiring a entrypoint.
Returns
true if the script was compiled and executed successfully. false if compilation failed. An error message will be printed to the terminal.

◆ BindSymbol() [1/2]

bool BindSymbol ( FunctionPtr symbolPtr,
StringPtr symbolName,
StringPtr returnType,
int paramCount,
... )

Registers a C++ symbol with the Clektron script engine, making it globally accessible within the framework.

Parameters
symbolPtrPointer of the function symbol to bind.
symbolNameThe name of the function symbol to bind, which will be accessible in scripts.
returnTypeThe return type of the symbol to bind; use void if the symbol does not return a value.
paramCountThe number of parameters of the symbol to bind; use 0 if the symbol does not have any parameters.
parametersThe arguments to use in the symbol to bind. All paramaters types must be passed as native strings

Valid types for return or parameter types include bool, String, Size, Instance, Buffer, FunctionPtr and all the standard C types.

Returns
true if the symbol was bound successfully, false if the pointer is invalid or the symbol already exists.

◆ BindSymbol() [2/2]

bool BindSymbol ( FunctionPtr symbolPtr,
const godot::String & symbolName,
const godot::String & returnType,
int paramCount,
... )

Registers a C++ symbol with the Clektron script engine, making it globally accessible within the framework.

Parameters
symbolPtrPointer of the function symbol to bind.
symbolNameThe name of the function symbol to bind, which will be accessible in scripts.
returnTypeThe return type of the symbol to bind; use void if the symbol does not return a value.
paramCountThe number of parameters of the symbol to bind; use 0 if the symbol does not have any parameters.
parametersThe arguments to use in the symbol to bind. All paramaters types must be passed as native strings

Valid types for return or parameter types include bool, String, Size, Instance, Buffer, FunctionPtr and all the standard C types.

Returns
true if the symbol was bound successfully, false if the pointer is invalid or the symbol already exists.