A Lua script is using one of my C defined functions as bellow:
function lua_func()
local var = 5
-- Do some stuff here, possibly using var.
c_func(var)
-- Do other stuff here, that must not use var.
end
This C function takes an argument that the caller has created and does what it needs.
This argument to the C function must be of single-use, i.e. after the C function has used it, I don't want it to be accessible any more to the rest of the Lua script.
I am looking for a way for the C function to "consume" this argument. To use it, and then set it to nil, so it is no longer usable.
Is this possible, and if so how?