public string GetFunctionInfo()
{
LuaDLL.lua_getglobal(L, "FormatFunctionInfo"); //-> f, FormatFunctionInfo
if (LuaDLL.lua_isfunction(L, -1))
{
LuaDLL.lua_pushvalue(L, -2); //-> f, FormatFunctionInfo, f
if (PCall(1, 1)) //-> f, callbackInfo
{
string callbackInfo = LuaDLL.lua_tostring(L, -1);
LuaDLL.lua_pop(L, 2);
return(callbackInfo);
}
else //-> f, err
{
string errInfo = LuaDLL.lua_tostring(L, -1);
LuaDLL.lua_pop(L, 2);
return(errInfo);
}
}
else //-> f, xx
{
LuaDLL.lua_pop(L, 2);
return("failed to call FormatFunctionInfo");
}
}