lua-users home
lua-l archive

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


Hello,
This is my first post to lua-l. Sorry about my english, but its not my native language..

I have begun porting my little (unfinished) applications from lua-4.0 to lua-5.0, but I have found big problem with userdata incompatibility between versions 4 and 5.

Under lua-4.0 I have make heavy usage of tagged userdata. Almost any data created by my applications was stored in lua and then handled by lua code. Under lua-5 there is no lua_pushusertag, so I can not store pointers to structures created by external libraries (postgresql, xlib, gtk etc).

   * lua_newuserdata() is not what I need, because I already have
     allocated memory...
   * lua_pushlightuserdata() have no sense for me, because I need to
     know something about stored pointer and realy need use garbage
     collector..
   * I have found lua_boxpointer() macro but it has no use for me (just
     imagine what will happen when you use boxpointer twice for the
     same data pointer -- it can happen when you use callbacks -- now
try to use garbagecollector).
Any advice?
I really have no idea how to solve this problem, Help!

Andrzej Borsuk

--
    _
   (;[   SPAM?
  \/>)   Proszę wysyłać na moje podstawowe konto
 `ab~^   mailto:root@localhost