1 2 3 4 5 6
static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { lua_CFunction f; *(void**)&f = dlsym(lib, sym); if (f == NULL) lua_pushstring(L, dlerror()); return f; }