Inline C for the Lua language home · download · installation · manual 1 - About LuatccLuatcc is a Lua binding for libtcc, which is the core library of TCC, the Tiny C Compiler. Primary goal of this module is to be an illustration for the Gem Interpreted C Modules from the book Lua Programming Gems. As this module may be of interest independently from the book, I made it available here. Luatcc features a module loader that allows to load C modules directly from sources. To activate the loader you just have to load the tcc.loader module, which will install itself in Lua 5.1 package system. libtcc binding is not complete. Only the functions necessary to implement the C source module loader have been bound. Also it is very low level (it maps directly to libtcc C API). However I'm open to suggestions or requests to add more bindings or to implement a higher level interface in the future. Just ask :-) SupportAll support is done through the Lua mailing list. Feel free to ask for further developments. I can't guarantee that I'll develop everything you ask, but as this module currently exists only for pedagogical purpose and is not actually used there is very little chance that I develop it anymore if you don't ask me to. CreditsThis module is written and maintained by Jér?me Vuarand. It is originally based on lua-tcc module by Javier Guerra and has been extended to support a bigger part of libtcc API and to work as a Lua module loader. Luatcc is available under a MIT-style license. 2 - DownloadLuatcc sources are available in its Mercurial repository:
Tarballs of the latest code can be downloaded directly from there: as gz, bz2 or zip. 3 - InstallationBuild instructionsTo build Luatcc edit Makefile to configure the install directories and options, then run make in the top directory:
TCCTo use Luatcc you need TCC. The recommended version is 0.9.25. Luatcc does work with 0.9.24 and 0.9.23, but you need to uncomment a line in the Makefile because there is no way to detect the 0.9.25 API change automatically. TCC is available at: Testing the moduleIn the test subdirectory you will find some test programs to check that everything is working properly. They are run by the "make test" target, look at each testx.lua file to have an idea of what each test does. 4 - ManualHere you can find a list of the functions present in the module and how to use them. Luatcc main module follows Lua 5.1 package system, see the Lua 5.1 manual for further explanations. 4.1 - Module functionsThese functions are global to the module.
|
|