Thanks Igor. I meant a pointer to an array, sorry. Here's the function prototype: int run_command(const char *command, char *argv[]); I could then simply pass this to execve like so: status = execve(command, argv, envp); On 06.11.2012, at 15:12, Igor Stasenko <siguctua@gmail.com> wrote:
well, you have to decompose it to fn(arg1, arg2, arg3 ... )
because NB does not supports vararg functions.
But if function takes a pointer to array, then you can just use external memory buffer and fill it with anything you want. What exactly function you wanna use?
On 6 November 2012 11:06, Max Leske <maxleske@gmail.com> wrote:
Hi
Working with NativeBoost I'm trying to figure out if there is a way I can pass an array of arguments to a function like so:
MyExample run: 'echo' args: { 'foo' }.
nbRun: str args: args <primitive: #primitiveNativeCall module: #NativeBoostPlugin error: errorCode > ^ self nbCall: #( int run_command (String str, Array args) ) module: 'librunner.dylib'
The intention is of course to be able to pass arguments to execve() (for example). I guess I could simply parse a string on the C-side but I'd rather not.
Any suggestions?
Cheers, Max
-- Best regards, Igor Stasenko.