Merge: contrib/header_keeper: a cog in the toolchains to generate FFI wrapper for...
authorJean Privat <jean@pryen.org>
Sat, 21 Mar 2015 06:12:59 +0000 (13:12 +0700)
committerJean Privat <jean@pryen.org>
Sat, 21 Mar 2015 06:12:59 +0000 (13:12 +0700)
commit34fbfd700aba901f399385b375af81b6d3b76237
tree216609bc3267879db1cb95d7e4ed4506af25a036
parent1d30ecd0b6da661cc26dc6b21451b6d348a88125
parentc76504f2b71c37b9520748b670fb64e24ef914ba
Merge: contrib/header_keeper: a cog in the toolchains to generate FFI wrapper for C-like languages

This is needed by @Tagachi for the Objective-C wrapper.

Once again, everything is in the doc:

### Filters preprocessed C-like header files to remove included files

This tool is used in the process of parsing header files to extract
information on the declared services (the functions and structures).
This information is then used to generate bindings for Nit code
to access these services.

The C preprocessor extends macros, inline files marked with `#include`,
and more. This tool acts after the C preprocessor, in a way to keep
everything but the included files. It searches for line pragmas
to identify the source of each line. The result is printed to stdout.

Typical usage on the output of `gcc -E` (it would be the same with `clang`):

~~~
gcc -E /usr/include/SDL/SDL_image.h | header_keeper SDL_image.h > preprocessed_header.h
~~~

This module can also be used as a library. The main service is the method `header_keeper`.

Pull-Request: #1210
Reviewed-by: ArthurDelamare <>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>