lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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