There is an example at
https://github.com/luvit/luvit/tree/master/examples/native.  If I remember
correctly, It's mostly just like normal lua extensions.

You need to name the .dll/.so/.whatever to .luvit as seen here

https://github.com/luvit/luvit/blob/master/examples/native/Makefile#L9

The export signature needs to match the filename (the part before .luvit)

https://github.com/luvit/luvit/blob/master/examples/native/vector.h#L7

And you need to return a table in your function, not use the other module
functions.

https://github.com/luvit/luvit/blob/master/examples/native/vector.c#L74

Other than that, stay away from any APIs that use blocking I/O as they will
kill the performance of your luvit server.  If you must use blocking I/O,
do it in another thread.  Never block the main thread that the lua runs on.
 Also you should have access to the libuv apis from your addon which
provide lots of cross-platform I/O.

On Tue, May 20, 2014 at 9:45 AM, Gam <[email protected]> wrote:

> Hi all,
>
> I'm developping in C a Luvit module.
> For a clean integration which Luvit C API/methods I may / should / must
> use?
>
> Thanks,
>
> --
> You received this message because you are subscribed to the Google Groups
> "luvit" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"luvit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to