[Rd] Could Rstd_Busy do something (src/unix/sys-std.c)?

Jakson Alves de Aquino jalvesaq at gmail.com
Sat Dec 15 12:36:13 CET 2012


Currently the function Rstd_Busy() does nothing (src/unix/sys-std.c):

    void attribute_hidden Rstd_Busy(int which)
    {
    }

The function is called through a pointer and R interfaces can change
this pointer and, thus, use a different function. I don't plan to
create a whole new interface to R, but I maintain a package whose aim
is to provide a new feature to R when it's running in a terminal
emulator on Unix systems:

    http://cran.r-project.org/web/packages/setwidth/index.html

The package setwidth updates the value of options("width") whenever R receives
SIGWINCH signal. The package does not set the value of any interface pointer,
but it may make R crash if the terminal emulator is resized while R is busy. I
could avoid the crash if I knew that R is busy at the moment that it receives
the SIGWINCH. Thus my question is: Could Rstd_Busy() set the value of a
variable so packages like setwidth could know that R is busy? The function
could be changed to something like:

    void attribute_hidden Rstd_Busy(int which)
    {
        R_is_busy = which;
    }

And the R_is_busy variable could be accessed either directly or through a "get"
function, like:

    int get_busy_state(){
        return R_is_busy;
    }

Thanks!

-- 
Jakson Alves de Aquino
Federal University of Ceará
Social Sciences Department
www.lepem.ufc.br/aquino.php



More information about the R-devel mailing list