You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by da...@apache.org on 2003/04/08 04:28:06 UTC

cvs commit: tcl-rivet/src/buildscripts graph.tcl

davidw      2003/04/07 19:28:06

  Modified:    .        ChangeLog
               src      make.tcl
               src/buildscripts graph.tcl
  Log:
  * src/make.tcl: Use package require to load aardvark.
  
  Revision  Changes    Path
  1.106     +7 -0      tcl-rivet/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/ChangeLog,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- ChangeLog	30 Mar 2003 08:02:29 -0000	1.105
  +++ ChangeLog	8 Apr 2003 02:28:06 -0000	1.106
  @@ -1,3 +1,10 @@
  +2003-04-07  David N. Welton  <da...@dedasys.com>
  +
  +	* src/make.tcl: Use package require to load aardvark.
  +
  +	* src/buildscripts/graph.tcl: This file should provide the
  +	  'struct' package.
  +
   2003-03-30  David N. Welton  <da...@dedasys.com>
   
   	* doc/rivet.xml: Fixed example configuration directive.
  
  
  
  1.34      +4 -2      tcl-rivet/src/make.tcl
  
  Index: make.tcl
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/make.tcl,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- make.tcl	26 Mar 2003 09:39:42 -0000	1.33
  +++ make.tcl	8 Apr 2003 02:28:06 -0000	1.34
  @@ -6,10 +6,12 @@
   #
   # This file is responsible for the top-level "make" style processing.
   
  +set auto_path "$auto_path [file join [file dirname [info script]] buildscripts]"
  +package require aardvark
  +
   foreach script {
       helpers.tcl
       graph.tcl
  -    aardvark.tcl
       parsetclConfig.tcl
       findapxs.tcl
   } {
  
  
  
  1.5       +38 -38    tcl-rivet/src/buildscripts/graph.tcl
  
  Index: graph.tcl
  ===================================================================
  RCS file: /home/cvs/tcl-rivet/src/buildscripts/graph.tcl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- graph.tcl	8 Apr 2003 02:08:23 -0000	1.4
  +++ graph.tcl	8 Apr 2003 02:28:06 -0000	1.5
  @@ -33,7 +33,7 @@
       #	inArcs		array mapping nodes to the list of incoming arcs
       #	outArcs		array mapping nodes to the list of outgoing arcs
       #	arcNodes	array mapping arcs to the two nodes (start & end)
  -    
  +
       # counter is used to give a unique name for unnamed graph
       variable counter 0
   
  @@ -103,7 +103,7 @@
   
   proc ::struct::graph::graph {{name ""}} {
       variable counter
  -    
  +
       if { [llength [info level 0]] == 1 } {
   	incr counter
   	set name "graph${counter}"
  @@ -166,7 +166,7 @@
       if { [llength [info level 0]] == 2 } {
   	error "wrong # args: should be \"$name option ?arg arg ...?\""
       }
  -    
  +
       # Split the args into command and args components
       if { [llength [info commands ::struct::graph::_$cmd]] == 0 } {
   	variable commands
  @@ -277,7 +277,7 @@
       if { ![__arc_exists $name $arc] } {
   	error "arc \"$arc\" does not exist in graph \"$name\""
       }
  -    
  +
       upvar ::struct::graph::graph${name}::arc${arc} data
   
       if { ![info exists data($key)] } {
  @@ -306,7 +306,7 @@
       if { [llength $args] } {
   	error "wrong # args: should be none"
       }
  -    
  +
       upvar ::struct::graph::graph${name}::arc${arc} data
   
       return [array get data]
  @@ -330,7 +330,7 @@
   
       if { [llength $args] } {
   	error "wrong # args: should be none"
  -    }    
  +    }
   
       upvar ::struct::graph::graph${name}::arc${arc} data
   
  @@ -358,7 +358,7 @@
       if { ![string equal $flag "-key"] } {
   	error "invalid option \"$flag\": should be -key"
       }
  -    
  +
       upvar ::struct::graph::graph${name}::arc${arc} data
   
       return [info exists data($key)]
  @@ -390,15 +390,15 @@
       if { [__arc_exists $name $arc] } {
   	error "arc \"$arc\" already exists in graph \"$name\""
       }
  -    
  +
       if { ![__node_exists $name $source] } {
   	error "source node \"$source\" does not exist in graph \"$name\""
       }
  -    
  +
       if { ![__node_exists $name $target] } {
   	error "target node \"$target\" does not exist in graph \"$name\""
       }
  -    
  +
       upvar ::struct::graph::graph${name}::inArcs    inArcs
       upvar ::struct::graph::graph${name}::outArcs   outArcs
       upvar ::struct::graph::graph${name}::arcNodes  arcNodes
  @@ -438,7 +438,7 @@
   	error "wrong # args: should be \"$name arc set $arc ?-key key?\
   		?value?\""
       }
  -    
  +
       set key "data"
       set haveValue 0
       if { [llength $args] > 1 } {
  @@ -490,7 +490,7 @@
   	error "wrong # args: should be \"$name arc append $arc ?-key key?\
   		value\""
       }
  -    
  +
       if { [llength $args] == 3 } {
   	foreach {flag key} $args break
   	if { ![string equal $flag "-key"] } {
  @@ -528,7 +528,7 @@
   	error "wrong # args: should be \"$name arc lappend $arc ?-key key?\
   		value\""
       }
  -    
  +
       if { [llength $args] == 3 } {
   	foreach {flag key} $args break
   	if { ![string equal $flag "-key"] } {
  @@ -599,7 +599,7 @@
       if { ![__arc_exists $name $arc] } {
   	error "arc \"$arc\" does not exist in graph \"$name\""
       }
  -    
  +
       if { ![string match "${flag}*" "-key"] } {
   	error "invalid option \"$flag\": should be \"$name arc unset\
   		$arc ?-key key?\""
  @@ -917,11 +917,11 @@
   # Results:
   #	value	value associated with the key given.
   
  -proc ::struct::graph::_getall {name args} { 
  +proc ::struct::graph::_getall {name args} {
       if { [llength $args] } {
   	error "wrong # args: should be none"
       }
  -    
  +
       upvar ::struct::graph::graph${name}::graphData data
       return [array get data]
   }
  @@ -936,7 +936,7 @@
   # Results:
   #	value	list of known keys
   
  -proc ::struct::graph::_keys {name args} { 
  +proc ::struct::graph::_keys {name args} {
       if { [llength $args] } {
   	error "wrong # args: should be none"
       }
  @@ -961,7 +961,7 @@
       if { ![string equal $flag "-key"] } {
   	error "invalid option \"$flag\": should be -key"
       }
  -    
  +
       upvar ::struct::graph::graph${name}::graphData data
       return [info exists data($key)]
   }
  @@ -1153,7 +1153,7 @@
       if { ![__node_exists $name $node] } {
   	error "node \"$node\" does not exist in graph \"$name\""
       }
  -    
  +
       upvar ::struct::graph::graph${name}::node${node} data
   
       if { ![info exists data($key)] } {
  @@ -1174,7 +1174,7 @@
   # Results:
   #	value	value associated with the key given.
   
  -proc ::struct::graph::__node_getall {name node args} { 
  +proc ::struct::graph::__node_getall {name node args} {
       if { ![__node_exists $name $node] } {
   	error "node \"$node\" does not exist in graph \"$name\""
       }
  @@ -1182,7 +1182,7 @@
       if { [llength $args] } {
   	error "wrong # args: should be none"
       }
  -    
  +
       upvar ::struct::graph::graph${name}::node${node} data
   
       return [array get data]
  @@ -1199,11 +1199,11 @@
   # Results:
   #	value	value associated with the key given.
   
  -proc ::struct::graph::__node_keys {name node args} { 
  +proc ::struct::graph::__node_keys {name node args} {
       if { ![__node_exists $name $node] } {
   	error "node \"$node\" does not exist in graph \"$name\""
       }
  -    
  +
       if { [llength $args] } {
   	error "wrong # args: should be none"
       }
  @@ -1230,11 +1230,11 @@
       if { ![__node_exists $name $node] } {
   	error "node \"$node\" does not exist in graph \"$name\""
       }
  -    
  +
       if { ![string equal $flag "-key"] } {
   	error "invalid option \"$flag\": should be -key"
       }
  -    
  +
       upvar ::struct::graph::graph${name}::node${node} data
   
       return [info exists data($key)]
  @@ -1264,7 +1264,7 @@
       if { [__node_exists $name $node] } {
   	error "node \"$node\" already exists in graph \"$name\""
       }
  -    
  +
       upvar ::struct::graph::graph${name}::inArcs      inArcs
       upvar ::struct::graph::graph${name}::outArcs     outArcs
       upvar ::struct::graph::graph${name}::node${node} data
  @@ -1293,7 +1293,7 @@
       if {![__node_exists $name $node] } {
   	error "node \"$node\" does not exist in graph \"$name\""
       }
  -    
  +
       if {![__arc_exists $name $arc] } {
   	error "arc \"$arc\" does not exist in graph \"$name\""
       }
  @@ -1336,7 +1336,7 @@
   	error "wrong # args: should be \"$name node set $node ?-key key?\
   		?value?\""
       }
  -    
  +
       set key "data"
       set haveValue 0
       if { [llength $args] > 1 } {
  @@ -1387,7 +1387,7 @@
   	error "wrong # args: should be \"$name node append $node ?-key key?\
   		value\""
       }
  -    
  +
       if { [llength $args] == 3 } {
   	foreach {flag key} $args break
   	if { ![string equal $flag "-key"] } {
  @@ -1424,7 +1424,7 @@
   	error "wrong # args: should be \"$name node lappend $node ?-key key?\
   		value\""
       }
  -    
  +
       if { [llength $args] == 3 } {
   	foreach {flag key} $args break
   	if { ![string equal $flag "-key"] } {
  @@ -1455,7 +1455,7 @@
       if { ![__node_exists $name $node] } {
   	error "node \"$node\" does not exist in graph \"$name\""
       }
  -    
  +
       if { ![string match "${flag}*" "-key"] } {
   	error "invalid option \"$flag\": should be \"$name node unset\
   		$node ?-key key?\""
  @@ -1807,7 +1807,7 @@
   
   proc ::struct::graph::_unset {name {flag -key} {key data}} {
       upvar ::struct::graph::graph${name}::graphData data
  -    
  +
       if { ![string match "${flag}*" "-key"] } {
   	error "invalid option \"$flag\": should be \"$name unset\
   		?-key key?\""
  @@ -1878,7 +1878,7 @@
   	    }
   	}
       }
  -    
  +
       # Make sure we have a command to run, otherwise what's the point?
       if { [string equal $cmd ""] } {
   	error "no command specified: should be \"$usage\""
  @@ -1896,7 +1896,7 @@
   	    error "invalid search type \"$type\": should be dfs, or bfs"
   	}
       }
  -    
  +
       # Validate that the given order is good
       switch -glob -- $order {
   	"both" {
  @@ -1984,7 +1984,7 @@
   		} else {
   		    # First visit. Remember it.
   		    set visited($node) .
  -	    
  +
   		    # Add this node's neighbours.
   		    set next [_nodes $name $dir $node]
   		    set len  [llength $next]
  @@ -2023,7 +2023,7 @@
   		    set cmdcpy $cmd
   		    lappend cmdcpy enter $name $node
   		    uplevel 2 $cmdcpy
  -	    
  +
   		    # Add this node's neighbours.
   		    set next [_nodes $name $dir $node]
   		    set len  [llength $next]
  @@ -2050,7 +2050,7 @@
   		set cmdcpy $cmd
   		lappend cmdcpy enter $name $node
   		uplevel 2 $cmdcpy
  -	    
  +
   		set visited($node) .
   
   		# Add this node's neighbours.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-cvs-help@tcl.apache.org