[Rd] R Embedded waring and error callbacks

2009-05-26 Thread Christian Ledergerber
Hi,

I would like to display error messages and warnings which are generated in
R in my own GUI. For normal output we simply had to assign a callback
function to ptr_R_WriteConsole and  ptr_R_ShowMessage. According to google
there should be similar function pointers for error messages. Such as
ptr_R_WriteErrConsole. However, I could not find this function pointer in
my current R installation (R version 2.8.1 (2008-12-22)). Do I need to
install a different R version or is there by now a different way to receive
those callbacks?

Your help will be greatly appreciated!

Thanks, Christian

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] terminating R code evalutation asynchronously

2009-04-21 Thread Christian Ledergerber
Hi, 

I am new to this mailing list. Hence brief a introduction: I am working for
Comerge, developing an online trading platform (interacting with brokers
over the internet in realtime) which is mostly written in Pascal. We are
using R-embedded to offer the user a way to implement strategies in R and
test them. 

Currently we are facing the following problem: We need to implement an
emergency exit procedure. The idea is that we send the process a signal
(like Crtl-C) and do all the necessary cleanup after the signal has been
caught. There are a number of constraints and wishes: 

1. The signal handler should take only very little time. E.g. set a number
of flags etc. and then return and leave the rest of the work to the main
program. 
2. The signal handler is asynchronous by nature. 
3. We would like that this works even if the user is hanging in an infinite
loop in the R code. E.g. we need to kill the current R code evaluation in
the signal handler. 
4. The main program needs to keep running to finish the cleanup. 

I found that the following function which seems to do the trick:
jump_to_toplevel() however, I am unsure whether this is safe - e.g. is this
function "thread safe" or do we risk that the application crashes when the
signal handler is invoked? Is there another, safer way to terminate the
current R execution? Furthermore this function seems to crash if the R
engine is not currently inside a R_tryEval call.

Thanks! 

Christian Ledergerber

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel