lcpp
uses cpp
to preprocess C header files and extract #define'd
constants.
lcpp = require "lcpp"
constants = lcpp.include("foo.h", {"inc"})
for name, val in pairs(constants) do
print(name, val)
end
The include
function takes two parameters:
- name of the header file to parse
- optional list of directories to search for header files
and returns a table with all the constants defined in the main header file.
make test