lua-users home
lua-l archive

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


> To support rerouting of lua's output into one or more of our app's
views,
> I
> added a field to lua's global_State: a c function ptr, which I stuff
on
> open:
> 
>     itsLuaState = lua_open();
>     itsLuaState->l_G->outputHandler = &HandleLuaOutput;

To reroute output you can just register a function which takes a string
and say:

	print = my_output_handler
	_ALERT = my_error_handler