Re: NativeCall interface for a char ** argument

2016-05-25 Thread Fernando Santagata
On Wed, May 25, 2016 at 8:50 PM, Brandon Allbery wrote: > > On Wed, May 25, 2016 at 2:41 PM, Fernando Santagata < > nando.santag...@gmail.com> wrote: > >> >> gbooleannotify_get_server_info (char **ret_name, >> char **ret_vendor, >>

Re: NativeCall interface for a char ** argument

2016-05-25 Thread Brandon Allbery
On Wed, May 25, 2016 at 2:41 PM, Fernando Santagata < nando.santag...@gmail.com> wrote: > > gbooleannotify_get_server_info (char **ret_name, > char **ret_vendor, > char **ret_version, >

Re: NativeCall interface for a char ** argument

2016-05-25 Thread Fernando Santagata
On Wed, May 25, 2016 at 6:20 PM, Brandon Allbery wrote: > On Wed, May 25, 2016 at 11:50 AM, Fernando Santagata < > nando.santag...@gmail.com> wrote: > >> When I write a C program I'm able to call that function and I receive the >> strings, so I guess my problem is just a mapping one. > > > It can

Re: NativeCall interface for a char ** argument

2016-05-25 Thread Brandon Allbery
On Wed, May 25, 2016 at 11:50 AM, Fernando Santagata < nando.santag...@gmail.com> wrote: > When I write a C program I'm able to call that function and I receive the > strings, so I guess my problem is just a mapping one. It can also mean a preallocated array of strings, though; C is sloppy about

Re: NativeCall interface for a char ** argument

2016-05-25 Thread Fernando Santagata
In that case it's a pointer to a pointer: since in C a function can't multiple values, when one wants to return two strings, one needs to use several char ** arguments in the function call. The caller passes a reference to a pointer and the function returns the address of a malloc-ed memory area wi

Re: NativeCall interface for a char ** argument

2016-05-25 Thread Bennett Todd
A C char** is an array (of unknown length) of pounters to C strings ( each of unknown length). I don't know NativeCall, can't tell you how it should be declared, but I hope that highlights the issue.

NativeCall interface for a char ** argument

2016-05-25 Thread Fernando Santagata
Hello, Please excuse my naivety, I'm trying to use NativeCall to interface a Perl6 program with a C library and I have a problem mapping a char ** argument. The C function has this prototype: void function(char **arg1, char **arg2); I read that declaring a sub with Str rw parameters would do th