0
votes

I am new to tcl. I have the following code in tcl:

proc ::SMB::SmbSetDefaultConfig {{names all}}  {
variable SmbInfo 
variable SmbPortId

if {$names == "all"} {
set ports $SmbPortId
} else {
set ports $names
}

 foreach name $ports {
    set SmbInfo($name-SmbSetTxActive) 0
    set SmbInfo($name-SmbSetSpeed) 1000
    set SmbInfo($name-SmbSetDuplex) FDX
 }
}

I am trying to know the data structure of SmbInfo which is declared as a variable. The other parameters (SmbSetTxActive, SmbSetSpeed, SmbSetDuplex) look like are creating an associative array with $name. But, I could not find the type of variable which helps to create such structure. Please help.

1

1 Answers

0
votes

Tcl's arrays are associative arrays. Under the covers, they're implemented using a hash table that (effectively) uses strings as keys and which maps to a Tcl_Var structure, which in turn contains the current value for that element and some bit flags (used to denote a bunch of things, such as the meaning of that value).