Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* push functions and arguments */
- lua_getglobal(L, "f"); /* function to be called */
- lua_pushnumber(L, x); /* push 1st argument */
- lua_pushnumber(L, y); /* push 2nd argument */
- /* do the call (2 arguments, 1 result) */
- if (lua_pcall(L, 2, 1, 0) != 0)
- error(L, "error running function `f': %s", lua_tostring(L, -1));
Add Comment
Please, Sign In to add comment