From jalvesaq at gmail.com  Sat Dec 15 12:36:13 2012
From: jalvesaq at gmail.com (Jakson Alves de Aquino)
Date: Sat, 15 Dec 2012 08:36:13 -0300
Subject: [Rd] Could Rstd_Busy do something (src/unix/sys-std.c)?
Message-ID: <CAGBu4CNTtEcBEA6yB5tM8JkEDdVyTAr2xC+75Ay+dFM30=BTMg@mail.gmail.com>

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



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