lua-users home
lua-l archive

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


I'm trying to get a grasp on userdata in Lua, and I've read through the
archives, the refmanual, robert's book, the Web, and any sample source
code I've found, and I'm still pretty confused.

I want to pass a pointer into Lua.  It looks like lua_pushusertag() is
the way to go.  I'm really unclear what "tag" is supposed to do.  Is it
because Lua can't differentiate between two different user data items
with the same value, and the tag is used to differentiate between them?

All I'm trying to do is set a global variable to hold a pointer to some
data.  Lua doesn't access it, it simply passes the pointer BACK to the
application when necessary.  Granted, I could skip over this on the C
side, but either way I'd like to know the right way to do this from
C->Lua.

Thanks,


Brian