lua-users home
lua-l archive

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


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