[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: passing structure from C to Lua
- From: Niniane Wang <niniane@...>
- Date: Fri, 22 Sep 2000 20:20:09 -0700
Let's say I have a structure defined in C:
struct MyStruct
{
int x;
int y;
float z;
};
I wish to pass this structure into a Lua function and access the member
variables, but I want to avoid the memory overhead of copying over the
individual values. I also wish to avoid passing in each field as a separate
parameter (imagine if the structure had 50 fields instead). Is there a way
to pass in a pointer as a userdata variable and directly access the data in
memory?
Thanks!
-Niniane Wang