Register a C function which can be called from LUA, with LUA. A pointer to the function and its identifier are also stored in a table for future reference.

int DXScript::addCFunction(const char *_identifier, lua_CFunction _cFunction)


Type Name Description
const char* _identifier The identifier (the function name) which will be used in a LUA script.
lua_CFunction _cFunction A function pointer to a C function which can be called from a LUA script. This function should be stored in the DXScriptFunction class.


Zero for success, nonzero for failure. For more detail of a failure, this function returns a member of the eScriptReturns enumeration.


DXScript *dxscr = new DXScript();
DXScriptFunction *dxscrf = new DXScriptFunction (dxscr);
dxscr->addCFunction("callC", dxscrf->getFromCallTable("callC"));