lua-users home
lua-l archive

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


At the same time, could you make the output from print.c use a similar mechanism please? It would be useful to redirect listing output without having to modify the code.

Luiz Henrique de Figueiredo wrote:
I was wondering what possible issues and solutions might be to change
the FILE pointer Lua uses for functions like print and error at the
configuration or runtime startup level might be.
    
Lua 5.2 will provide a macro in luaconf.h for outputting strings via print.
The default will be this:

/*
@@ luai_writestring defines how 'print' prints its results. 
** CHANGE it if your system does not have a useful stdout.
*/ 
#define luai_writestring(s,l)	fwrite((s), sizeof(char), (l), stdout)