November 2017
Intermediate to advanced
670 pages
17h 35m
English
LuaJIT's FFI library makes it easy to call C functions and C data structures by parsing C declarations:
local ffi = require("ffi")Load LuaJIT's FF libraryffi.cdef[[int printf(const char *fmt, ...);]]Add a C declaration for the function.ffi.C.printf("Hello %s!", "world")
Call the named C function. Simple!