lua-users home
lua-l archive

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


2013/8/26 Francisco <xxleite@gmail.com>:
> thanks everyone, i used most of tips ...
>
>
> --
> xico
> web developer at Jurema and Simbiose
> 55 11 97531.7438
> about.leite.us

At first, I'd not believe you're new to C, because it's very well written :-).

However, I would recommend using luaL_newlib instead of luaL_register
in luaopen_iwi, but luaL_newlib is not present in 9.1 so you may add
something like this.

#if LUA_VERSION_NUM >= 502
    luaL_newlib(L, iwi_methods);
#else
    luaL_register(L, LIBIWI, iwi_methods);
#endif

Or if you plan to support lua 5.2 only, then you can just use the first one.

-- 
Demelier David