lua-users home
lua-l archive

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


Lua list <lua@bazar2.conectiva.com.br> schrieb am 02.06.03 13:47:33:
> 
> Hallo,
> 
> Robert Kücken wrote:
> > Hi,
> > how can I register and call a self-written C-function in a Lua-Script?
> > thanks
> >
> 
> 	You must write a C function with a specific signature (int 
> ()(lua_State*)) that follows a protocol for using the stack, so you are 
> better reading the Lua reference manual. What you should look for is the 
> lua_pushcfunction() function and the lua_register() macro.
> 
> --
> Alex Queiroz
> 
Hm, 
I took the example from the manual, the foo-function as my C-function. Sorry, but I don't know how to use the lua_register() macro and the lua_pushcfunction() function. Could you give me an example, please?
thank you alex
________________________________________________________________
Mit der Grupppen-SMS von WEB.DE FreeMail können Sie eine SMS an alle 
Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179