Prefer C++ lambdas to static module functions
Example of C compilation
Build (but not link)

* Added extern "C" guards in C headers.
* Added missing #includes.
* Added prototypes of new functions.
* Fixed semantic issues.
* Fixed typos and syntax errors.