[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Question on returning two-dimensional arrays from C to lua
- From: Klaus Ripke <paul-lua@...>
- Date: Thu, 3 Apr 2008 12:25:27 +0200
Hi
On Thu, Apr 03, 2008 at 12:05:42PM +0200, Michael Ring wrote:
> My problem is that I do not know how to put the 5 arrays that I have
> created on the stack in a new array.
>
> This is the syntax that is working for me right now:
>
> #!/usr/bin/env lua
> require "perfstat"
>
> adapter1,adapter2,adapter3,adapter4,adapter5 = perfstat.diskadapters();
try
array = { perfstat.diskadapters() }
"If the last field in the list has the form exp
and the expression is a function call or a vararg expression,
then all values returned by this expression enter the list consecutively."
http://www.lua.org/manual/5.1/manual.html#2.5.7
> Here's the relevant part of my C-Code for creating the arrays:
you may also want to call lua_checkstack
http://www.lua.org/manual/5.1/manual.html#lua_checkstack
regards
Klaus