]> git.entuzijast.net Git - imunes.git/commit
First in a series of commits aimed at (ab)using TCL namespaces for
authormarko <marko>
Wed, 2 Jan 2008 12:08:46 +0000 (12:08 +0000)
committermarko <marko>
Wed, 2 Jan 2008 12:08:46 +0000 (12:08 +0000)
commit56630b8b46ece76cd35fc6af953d3b9850e80963
tree643b0a6b510093fa587c7059d5dc0e0f72df1e49
parent858de4f3f09400f8c0c1f6a564a5784c76094ed6
First in a series of commits aimed at (ab)using TCL namespaces for
removing configuration and per-object (node, link, canvas, annotation)
variables from the global namespace.  Once completed, this storage
reorganization should allow us to manage multiple independent IMUNES
configs in parallel and simplify implementation of cut/copy/paste
functionality in the GUI.

This change introduces a new top-level namespace ::cf, which holds
all configuration instances in subordinated namespaces.  So far only
::cf::cfg0 is used.

The new global variable "curconf" selects the working configuration
instance.  Inside most procedures, access to previously global
variables is replaced by variable aliasing to the appropriate
::cf namespace.  The change typically looks like this:

-    global $target
+    upvar 0 ::cf::[set ::curcfg]::$target $target

So far only storage for objects visible in a canvas has beend pushed out
of the global namespace.  Deciding on how to deal with the various GUI
options (option show) needs more thought.

Bug found by:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
21 files changed:
annotations.tcl
canvas.tcl
cfgparse.tcl
editor.tcl
exec.tcl
filemgmt.tcl
gpgui.tcl
graph_partitioning.tcl
host.tcl
imunes.tcl
initgui.tcl
ipsec.tcl
ipv4.tcl
ipv6.tcl
linkcfg.tcl
nodecfg.tcl
ns2imunes.tcl
pc.tcl
quagga.tcl
static.tcl
xorp.tcl