Skip to content

gilzoide/inclua

Repository files navigation

Inclua

Wrapper generator from C to scripting languages, currently supporting LuaJIT FFI only. It uses clang via c_api_extract for parsing and understanding C header files.

By deafult generates metatypes for struct and union definitions and deduces __gc and other methods from C functions names and parameters, included in the __index table. inclua also supports adding native Lua definitions for any metamethods and other definitions for metatypes, reading them verbatim from a YAML or JSON file.

Installing

inclua is available on PyPI and may be installed using pip:

$ pip install inclua

Usage

On your shell:

$ inclua <input> [-i <pattern>...] [-n <namespace>...] [options] [-- <clang_args>...]

Check out the help for more information on arguments:

$ inclua -h

Check out the examples folder and csfml-luajit for examples of usage.

TODO

  • Try matching both typedef and struct|union name when searching for methods
  • Add support for generating Lua C bindings
  • Add more examples and document additional definitions input format
  • Test on Windows

About

C to scripting languages wrapper generator, INitialy for binding C to LUA

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published