CDSoft / lua-cpp

lcpp uses cpp to preprocess C header files and extract `#define'd` constants.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lua / CPP interface

lcpp uses cpp to preprocess C header files and extract #define'd constants.

Usage

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:

  1. name of the header file to parse
  2. optional list of directories to search for header files

and returns a table with all the constants defined in the main header file.

Tests

make test

About

lcpp uses cpp to preprocess C header files and extract `#define'd` constants.

License:GNU General Public License v3.0


Languages

Language:Lua 78.5%Language:Makefile 15.2%Language:C 6.3%