50 |
proc ::tcldrop::idx::Register {idx info} { |
proc ::tcldrop::idx::Register {idx info} { |
51 |
variable idxlist |
variable idxlist |
52 |
set idxlist($idx) $info |
set idxlist($idx) $info |
|
array set idxinfo $info |
|
53 |
} |
} |
54 |
|
|
55 |
# Unregisters all connections matching idxmask: |
# Unregisters all connections matching idxmask: |
69 |
# FixMe: Should this be doing error checking/returning errors? |
# FixMe: Should this be doing error checking/returning errors? |
70 |
proc ::tcldrop::idx::GetInfo {idx infotype} { |
proc ::tcldrop::idx::GetInfo {idx infotype} { |
71 |
if {![valididx $idx]} { |
if {![valididx $idx]} { |
72 |
error "invalid idx: $idx" |
return -code error "invalid idx: $idx" |
73 |
} else { |
} else { |
74 |
variable idxlist |
variable idxlist |
75 |
array set idxinfo $idxlist($idx) |
array set idxinfo $idxlist($idx) |
76 |
if {[info exists idxinfo($infotype)]} { |
if {[info exists idxinfo($infotype)]} { |
77 |
return $idxinfo($infotype) |
return $idxinfo($infotype) |
78 |
} else { |
} else { |
79 |
error "no such type: $infotype" |
return -code error "no such type: $infotype" |
80 |
} |
} |
81 |
} |
} |
82 |
} |
} |