[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to pass arguments to argv function effectively in Lua C API
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 23 Mar 2011 22:50:25 -0300
> 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?
I'd simply limit the size of argv (ie, argc) to say 100 or 1000 and
use a local char** array filled from the Lua arguments. Not the utmost
general but easy to write and get right and probably good enough.