[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Passing userdata to and from stack
- From: Bob Smith <bob@...>
- Date: Mon, 14 Jul 2003 18:23:13 -0600 (MDT)
Hi,
I have been reading the docs and going through the mailing list archive
but have yet found the answer to my question.
Let's say that in my C program, I have the following
lua_pushlightuserdata(L, someVoidPtr);
This I assume pushes someVoidPtr onto the stack of L
Now I want to call the script using lua_dofile(L, "script.lua");
- Do I need some other lines of code between lua_pushlightuserdata and
lua_dofile?
In my script my first task is to obtain this value from the stack
local tmpUserData = ???
- How do I get this value from the stack? There's lots of documentation
how to manipulate the stack on the C side but I can't seem to find
any on how to manipulate the stack (except using a return statement to
push values on the stack) inside a Lua script
Thanks,
Bob