lua-users home
lua-l archive

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


I've a little question about tolua(++) and other binding generators..

Consider a C++ class with a destructor. It is easy to use tolua to 
generate bindings that use the destructor putting it in the __gc field
of the metatable. nothing strange here.

Now consider the same situation in C, you can take the example of
Roberto in his book, the one with opendir and DIR*. we want to use 
closedir as the pseudo-destructor of the object representing the
directory handler. The book is really clean about what to do to by
hand. but doing all by hand makes it hard to keep up to date.

So the real question is: is there a way to tell tolua(++) that
we are working in C but we would like to add a "destructor" to our
usertype? and if tolua is not able to do this, maybe for a lack of
expressivity in the .pkg language, is there another binding generator
with these features?

Thanks
-- 
Enrico Tassi