diff options
Diffstat (limited to 'c_hardflip.go')
-rw-r--r-- | c_hardflip.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/c_hardflip.go b/c_hardflip.go index 2e6dd5c..f54320b 100644 --- a/c_hardflip.go +++ b/c_hardflip.go @@ -55,6 +55,7 @@ package main type HardPtr interface { is_dir() bool + get_id() int get_self_dirs() *DirsNode get_self_host() *HostNode } @@ -77,6 +78,21 @@ func c_reset_ptr(data *HardData) { } } +func (data *HardData) sel_unique_id(id int) { + for ptr := data.ldirs.head; ptr != nil; ptr = ptr.next { + if ptr.ID == id { + data.ptr = ptr + return + } + for ptr := ptr.lhost.head; ptr != nil; ptr = ptr.next { + if ptr.ID == id { + data.ptr = ptr + return + } + } + } +} + func main() { data_dir := c_get_data_dir() opts := HardOpts{true, true, false} |