~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Open Mash Cross Reference
mash/tcl/demo/webreplay

Component: ~ [ mash ] ~ [ apps ] ~ [ gsm ] ~ [ lib ] ~ [ otcl ] ~ [ srm ] ~ [ tcl8.3 ] ~ [ tclcl ] ~ [ tk8.3 ] ~ [ tutorials ] ~

  1 #!/bin/sh
  2 # the exec restarts using tclsh which in turn ignores
  3 # the command because of this backslash: \
  4 exec tclsh "$0" "$@"
  5 
  6 # webreplay --
  7 #
  8 #       FIXME: This file needs a description here.
  9 #
 10 # Copyright (c) 1997-2002 The Regents of the University of California.
 11 # All rights reserved.
 12 #
 13 # Redistribution and use in source and binary forms, with or without
 14 # modification, are permitted provided that the following conditions are met:
 15 #
 16 # A. Redistributions of source code must retain the above copyright notice,
 17 #    this list of conditions and the following disclaimer.
 18 # B. Redistributions in binary form must reproduce the above copyright notice,
 19 #    this list of conditions and the following disclaimer in the documentation
 20 #    and/or other materials provided with the distribution.
 21 # C. Neither the names of the copyright holders nor the names of its
 22 #    contributors may be used to endorse or promote products derived from this
 23 #    software without specific prior written permission.
 24 #
 25 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
 26 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 27 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 28 # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
 29 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 30 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 31 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 32 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 33 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 34 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 35 
 36 set first 1
 37 set f [open webtrace r]
 38 while 1 {
 39         set s [gets $f]
 40         if [eof $f] {
 41                 break
 42         }
 43         set words [split $s]
 44         if $first {
 45                 set first 0
 46                 set traceBase [lindex $words 0]
 47                 set nowBase [clock seconds]
 48                 set offset [expr $nowBase - $traceBase]
 49         }
 50         set ts [lindex $words 0]
 51         set url [lindex $words 1]
 52 
 53         set ts [expr $ts + $offset]
 54         set delay [expr $ts - [clock seconds]]
 55         if { $delay > 0 } {
 56                 after [expr $delay * 1000]
 57         }
 58         exec netscape -remote openURL($url)
 59         puts $url
 60 }

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.