[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: structures
- From: Tobias Käs <tobias.kaes@...>
- Date: Wed, 3 Sep 2003 15:43:26 +0200
You can construct a lua table from the data, but then the C structure won't
get updated.
The normal way is to create a (full) userdate with the "__index" and
"__newindex" metamethods set. Those functions (which you need to supply
yourself) have to manage reading and writing to the structure.
There are wrappers like toloa which can automate the task, from what I
heared, but I never used them myself since I mostly have very specialized
access functions.
----- Original Message -----
From: "Robert Kücken" <robert.kuecken@web.de>
To: <lua@bazar2.conectiva.com.br>
Sent: Wednesday, September 03, 2003 11:44 AM
Subject: structures
> Hi,
> how can I pass structures from C to Lua? I tried it with the function
lua_pushlightuserdata, but it's only the pointer, what the lua-script gets.
So how I can access the elements of the structure?
> Thanks
> robert
>
____________________________________________________________________________
__
> 38xTestsieger - WEB.DE FreeMail - Deutschlands beste E-Mail
> zum Patent angemeldetem 3-Wege-Spam-Schutz- http://f.web.de/?mc=021130
>