[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: Alexander Gladysh <agladysh@...>
- Date: Thu, 24 Mar 2011 04:54:33 +0300
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?
> 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.
Good idea!
Also, utmost generality makes no sense here — AFAIR, the number of
arguments of a function in Lua is limited.
So, are there some LUAI_MAXARGS constant I can use? (Couldn't find it
from a first glance.)
Alexander.