lua-users home
lua-l archive

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

> 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.