From kjell.konis at epfl.ch  Thu May 15 15:35:53 2008
From: kjell.konis at epfl.ch (Kjell Konis)
Date: Thu, 15 May 2008 15:35:53 +0200
Subject: [Rd] interrupting native code
Message-ID: <B2675BBE-97A5-4012-A855-6955F6EE8246@epfl.ch>

Hello,

I have some native code that I would like to allow users to interrupt.  
However, I would like to do it more gracefully than with  
R_CheckUserInterrupt(). The solution I came up with is to call the  
following abort function periodically - if it returns 1 then I clean  
up and return.

int __WINAPI RlpSolveAbortFunction(lprec *lp, void *userhandle)
{
   if(R_interrupts_pending)
     return(1);

   return(0);
}

This seems to work fine on Mac (sans Aqua) and Linux. Is this going to  
be portable?  Also, is there anything else I need to do?  For instance  
set R_interrupts_pending to 0 after I respond to it?

Thanks.
Kjell



[Rd] interrupting native code
Kjell Konis