Original Post
Hi! Existing Lua API: lua_register(lua_State *L, const char *s, lua_CFunction f,) I want: lua_register(lua_State *L, const char *s, lua_CFunction f, void* data) Is there a way to associate a C-pointer, (or any type of data) when calling lua_register() and get to this data from within my C-callback when Lua calls it? Normally in C API:s, like the Windows API, when you register a C-callback you can also supply a void* that your callback gets as argument when it's invoked. This let's you register the same C-callback many times but with different void*:s. This is what I miss with lua_register(). I need this for wrapping the lua_State in a C++ class and having clients register callback interfaces with the wrapper. I'm not thrilled to have to pass the data pointer into the Lua scripts and require the Lua script to pass them as argument to my C API... Any ideas? /Marcus