lua-users home
lua-l archive

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


Hi,

I'm trying to use the luaswig to wrap some C functions. In one of its
examples has the function call like this:

    require("./1.so")

When running,

error: invalid control char;
  last token read: `0x7F' at line 1 in file `././1.so'
stack traceback:
   1:  function `require' [C]
   2:  main of file `t_1.lua' at line 1

I realized it's a new standard function but could not find any documentation
for it. How does it load shared library?

I also want to know, how does luaswig compare with toLua? I want to wrap and
group extern "C" functions and make them OO in the Lua. Something like (in
SWIG-python interface syntax):

%addmethods Queue {
    Queue(int capacity) { return q_new(capacity); }
    ~Queue() { q_delete(self); }
    BOOL isEmpty() { return q_isEmpty(self); }
    BOOL isFull() { return q_isFull(self); }
}

What's your recommendation?

Thanks for any pointers,

-Brian