[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: ANN: Alien 0.3.1
- From: "Fabio Mascarenhas" <mascarenhas@...>
- Date: Wed, 13 Feb 2008 10:08:50 -0200
Arrays (even multidimensional) or numeric types can be built with struct.pack and then converted to a buffer, which can then be unpacked later. But by void list(char** strings) you probably mean an array of pointers to zero-terminated strings, though. There is currently no way to do that. I am adding arrays to the next version, which will let you do that:
local t = { alien.buffer "foo", alien.buffer "bar", ... } -- to keep the buffers alive
local array = alien.array(10, "pointer")
for i = 1, 10 do array[i] = t[i] end
list(array)
-- if list modifies the strings in array just access the buffers in t
This was not a priority, as I don't see string arrays much in library APIs.
--
Fabio Mascarenhas
On Feb 13, 2008 9:14 AM, Bradley Smith <
gmane@baysmith.com> wrote:
Fabio Mascarenhas wrote:
>
How do you pass in arrays of values? For example, passing in and getting
out values for the C function "void list(char** strings)".