Re: rebuilding expect with different timer
- From: Jeff Hobbs <jeffh@xxxxxxxxxxxxxxx>
- Date: Tue, 04 Jul 2006 07:54:49 -0700
James Harper XX (AS/EAB) wrote:
On 2006-07-04 08:00, Jeff Hobbs wrote:Donal K. Fellows wrote:
James Harper XX (AS/EAB) wrote:
Has anybody rebuilt expect to do this and if so any help on where to
start would be useful.
[...]
The two areas that will require the different timing information are the
sleep command and handling timeouts.
There is a time virtualization API in Tcl 8.5's C interface. I don't
know how Expect handles time, but if it does it on top of Tcl's time
handling core, it should pick up the virtual times if you set them up.
But I'm not an expert on actually using the virtual time stuff, so I
can't offer detailed help.
Indeed, this is exactly why those APIs were introduced - to allow for Tcl and extensions built on Tcl that use Tcl_Time-based APIs to get a skewed sense of time. The time virtualization API should be fully sufficient for simulating both slower and faster time.
I have had a look at the expect source code and in particular expect.c, I believe the timeout handling code use the system function time(&time_t). However the sleep procedure uses Tcl_CreateTimerHandler, is this a procedure that can use the API's you talk about? We have Tcl8.4 installed and it might not be possible to upgrade to 8.5 for a while.
Which expect source base are you looking at? In conjunction with this patch to Tcl, Expect and TclX received patches to ensure that they use Tcl_Time-based handling everywhere.
--
Jeff Hobbs, The Tcl Guy, http://www.activestate.com/
.
- Follow-Ups:
- Re: rebuilding expect with different timer
- From: James Harper XX (AS/EAB)
- Re: rebuilding expect with different timer
- References:
- rebuilding expect with different timer
- From: James Harper XX (AS/EAB)
- Re: rebuilding expect with different timer
- From: Donal K. Fellows
- Re: rebuilding expect with different timer
- From: Jeff Hobbs
- Re: rebuilding expect with different timer
- From: James Harper XX (AS/EAB)
- rebuilding expect with different timer
- Prev by Date: Re: ANNOUNCE: Tcl Windows API extension V0.9
- Next by Date: Re: length of binary data
- Previous by thread: Re: rebuilding expect with different timer
- Next by thread: Re: rebuilding expect with different timer
- Index(es):
Relevant Pages
|