lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wednesday 09, Xavier Wang wrote:
> 
> local B = require 'bindings'
> local type,   module,   class,   func =
>    B.type, B.module, B.class, B.func
> 
> B.basetypes(B)
> local voidptr, int, char = B.voidptr, B.int, B.char

Why not have a generator script that loads the definition file, instead of 
having the definition files load the generator as a module.  The generator can 
setup a special environment for the definition file so you don't have to 
include the above boilerplate code in each definition file.

> I'm try to add some mechanism to generate OO style interface over pure
> C library (like cairo), Are there any idea about it? I will begin this
> plan, and after I have some result, I will create a project on github,
> and reply this mail.

I have created a bindings generator [1] for C libraries.  It is designed to 
generate OO style interfaces for C functions.  It also supports generating 
wrapper C functions so Lua functions can be used as C callbacks.

Right now it doesn't support generating bindings for C++ code, but support 
could be added.

1. https://github.com/Neopallium/LuaNativeObjects

-- 
Robert G. Jakabosky