From thomas.friedrichsmeier at ruhr-uni-bochum.de  Tue Oct 11 18:00:53 2005
From: thomas.friedrichsmeier at ruhr-uni-bochum.de (Thomas Friedrichsmeier)
Date: Tue, 11 Oct 2005 18:00:53 +0200
Subject: [Rd] Catching warning and error output
In-Reply-To: <200510101655.46264.thomas.friedrichsmeier@ruhr-uni-bochum.de>
References: <200510101655.46264.thomas.friedrichsmeier@ruhr-uni-bochum.de>
Message-ID: <200510111800.53867.thomas.friedrichsmeier@ruhr-uni-bochum.de>

Dear R developers,

since nobody has pointed me to an existing solution so far, here is a more 
specific suggestion. Attached you will find two patches against R version 
2.2.0.

The first patch does two things:
1) Add a function R_WriteErrConsole similar to R_WriteConsole, and a 
corresponding ptr_R_WriteErrConsole.
2) Make inError, inWarning, and inPrintWarnings from errors.c accessible 
(read-only) in R_ext/Error.h
I believe these changes to be minimally invasive. I did not test-compile on 
windows, but the change in gnuwin32 should be trivial.

The second patch adds a test/example to tests/Embedding, showing how this 
added API can be used to identify warnings and errors in the output stream.

If you need any further comments / different format of patches, or anything 
else in order to evaluate this proposal, please let me know.

Thanks!
Thomas


[Rd] Catching warning and error output
Thomas Friedrichsmeier