Guest User

Untitled

a guest
Jun 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. /* push functions and arguments */
  2. lua_getglobal(L, "f"); /* function to be called */
  3. lua_pushnumber(L, x); /* push 1st argument */
  4. lua_pushnumber(L, y); /* push 2nd argument */
  5.  
  6. /* do the call (2 arguments, 1 result) */
  7. if (lua_pcall(L, 2, 1, 0) != 0)
  8. error(L, "error running function `f': %s", lua_tostring(L, -1));
  9.  
  10. /* do something with the result */
Add Comment
Please, Sign In to add comment