Hello!
On Wed, Aug 27, 2014 at 5:43 AM, Ajay Bodhe wrote:
> I want to call some C code from LUA modules.
> I see there are three ways to do so Lua BInding, Lua Interface & Luajit ffi.
> Whats the difference in each approach?
> If I use Luajit FFI, will the Nginx standard data(eg: ngx_http_request_t *)
> be available in C code?
It's not recommended to use FFI to call into nginx's raw C API
directly because nginx's C API is not an ABI at all while FFI works
best with an ABI.
It's recommended to create your own nginx C modules that expose new
Lua APIs via ngx_lua's public C API.
> Can someone provide the example?
>
See the following examples:
https://github.com/bakins/nginx-example-lua-module
https://github.com/openresty/lua-upstream-nginx-module
Regards,
-agentzh