Essentially I'm just trying to make a simple Lua interpreter, and want to redirect the console output into my own gadget. Overriding the print function and/or multiple return values could probably be made to suffice but if there's a way to get the console output and use that, I'd much prefer it.
I'm thinking that the answer might lie in recompiling the Lua module itself, overriding printf and fprintf with a #define and then writing custom functions to send the data elsewhere if the stream is stdout ( or indeed stderr ) but I'm not sure how to go about that, and I'm hoping there might be another ( easier ) way.
I'm thinking that the answer might lie in recompiling the Lua module itself, overriding printf and fprintf with a #define and then writing custom functions to send the data elsewhere if the stream is stdout ( or indeed stderr ) but I'm not sure how to go about that, and I'm hoping there might be another ( easier ) way.