Commit 1e9535ff authored by Vladimír Čunát's avatar Vladimír Čunát

daemon/bindings: add lua_pushpointer()

Originally it's from another branch.
parent 8cecbf0d
......@@ -102,3 +102,15 @@ static inline int execute_callback(lua_State *L, int argc)
return ret;
/** Push a pointer as heavy/full userdata.
* It's useful as a replacement of lua_pushlightuserdata(),
* but note that it behaves differently in lua (converts to pointer-to-pointer).
static inline void lua_pushpointer(lua_State *L, void *p)
void *addr = lua_newuserdata(L, sizeof(void *));
memcpy(addr, &p, sizeof(void *));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment