lua-users home
lua-l archive

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Mukhsein Johari napisa?(a):
> On Apr 6, 2005 1:19 PM, Uzytkownik <uzytkownik2@poczta.onet.pl> wrote:
> 
>>-----BEGIN PGP SIGNED MESSAGE-----
>>Hash: RIPEMD160
>>
>>I'd like to call:
>>some_function(lua_var1, lua_var2, ..., lua_varn)
>>I don't know n - I've only string.
>>lua_varx could be var defined in lua (loaded in lua_State*) or for ex.
>>"xxx".
>>I'd like to get return value, too.
>>How I could do it?
>>Regards.
>>- --
> 
> 
> You need to be a bit more decriptive.
> 
> Do you mean call lua function from lua or from C? If the former, read this page
> http://www.lua.org/pil/5.2.html
> 
> If from C, I'm not sure - take a look at the C API section in the same
> book. (If you've not done so, its a good idea to read most of the
> chapters in parts 1, 2 and 3)
> 
> Hope this helps.

it really simple:
lua_getglobal(L, "my_function(lua_var1, lua_var2, ... luavarn)");
lua_call(L, 0, 1);
int/char*/... lua_to...(L, -1));
Regards.
- --
Linux user: #376500 (patrz http://counter.li.org/)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCU/2hTCh1hBPsbHURAy4/AJ9HIha/FWWAkVG4xzHF/cJzGlJK2ACfZgUd
nCPSpGcoo40zP7nrOh0ZEEg=
=93N4
-----END PGP SIGNATURE-----