lua-users home
lua-l archive

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


On Thu, Mar 24, 2011 at 05:35, Thomas Harning Jr. <harningt@gmail.com> wrote:
> On Wed, Mar 23, 2011 at 9:54 PM, Alexander Gladysh <agladysh@gmail.com> wrote:
>> On Thu, Mar 24, 2011 at 04:50, Luiz Henrique de Figueiredo
>> <lhf@tecgraf.puc-rio.br> wrote:

>>>> I want to bind to Lua a third-party argv function, taking a list of
>>>> strings as input:

>>>>     foo * bar(baz * pSelf, int argc, char ** argv, size_t * argvlen);

>>>> The question: what is a best way write bindings for bar() in Lua C API?

> One option that would be to convert the argv into a Lua array, then
> you would be without limitations.

> Ex:
> foo * bar(baz * pSelf, int argc, char ** argv, size_t * argvlen)
> {

<skip>

Please note that bar() is a third party function that I'm writing
bindings for. I can not change its definition. Please see the links
I've provided in the original post to see a specific example.

Alexander.