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

Open Mash Cross Reference
mash/tcl/cache/main.tcl

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

  1 # main.tcl --
  2 #
  3 #       This is the main entry point for the cache tool.
  4 #       Tcl source code expansion with tcl-expand.tcl starts here.
  5 #       Tcl execution also starts here.
  6 #
  7 # Copyright (c) 1998-2002 The Regents of the University of California.
  8 # All rights reserved.
  9 #
 10 # Redistribution and use in source and binary forms, with or without
 11 # modification, are permitted provided that the following conditions are met:
 12 #
 13 # A. Redistributions of source code must retain the above copyright notice,
 14 #    this list of conditions and the following disclaimer.
 15 # B. Redistributions in binary form must reproduce the above copyright notice,
 16 #    this list of conditions and the following disclaimer in the documentation
 17 #    and/or other materials provided with the distribution.
 18 # C. Neither the names of the copyright holders nor the names of its
 19 #    contributors may be used to endorse or promote products derived from this
 20 #    software without specific prior written permission.
 21 #
 22 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
 23 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 24 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 25 # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
 26 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 27 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 28 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 29 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 30 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 31 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 32 
 33 import WebCacheProxy WebCacheControl WebCacheApplication WebCacheApplication/Layer
 34 
 35 proc main { args } {
 36 
 37         global cache
 38 
 39         set cacheType [lindex [lindex $args 0] 0]
 40         set args [lrange [lindex $args 0] 1 end]
 41 
 42         if { $args == "" || "$cacheType" == "-help" } {
 43                 # init will call usage since we pass -help
 44                 puts "cache: \[-layer|-lazy|-base\] \[other-options-listed-below] address"
 45                 set cache [new WebCacheApplication -help]
 46                 delete $cache
 47                 exit 1
 48         } elseif { "$cacheType" == "-layer" } {
 49                 set cache [new WebCacheApplication/Layer $args]
 50         } elseif { "$cacheType" == "-lazy" } {
 51                 set cache [new WebCacheApplication/Lazy $args]
 52         } elseif { "$cacheType" == "-base" }  {
 53                 set cache [new WebCacheApplication $args]
 54         }
 55 
 56         set proxy [new WebCacheProxy]
 57 
 58         $proxy set cache_ $cache
 59         $proxy open
 60 
 61         $cache set proxy_ $proxy
 62 
 63         wm withdraw .
 64 }
 65 
 66 main $argv
 67 
 68 

~ [ 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.