diff options
author | Joe <rbo@gmx.us> | 2024-01-04 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-01-04 20:20:20 +0100 |
commit | c099d658545476a39855e55bca8ef9c42c9f43a3 (patch) | |
tree | e67b7805501c773d4bf34e94030d847ef3ce0376 /c_ldirs.go | |
parent | tryna make it work (diff) | |
download | hardflip-c099d658545476a39855e55bca8ef9c42c9f43a3.tar.gz hardflip-c099d658545476a39855e55bca8ef9c42c9f43a3.tar.bz2 hardflip-c099d658545476a39855e55bca8ef9c42c9f43a3.tar.xz hardflip-c099d658545476a39855e55bca8ef9c42c9f43a3.tar.zst hardflip-c099d658545476a39855e55bca8ef9c42c9f43a3.zip |
mixed is good
Diffstat (limited to 'c_ldirs.go')
-rw-r--r-- | c_ldirs.go | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -52,7 +52,7 @@ package main type DirsNode struct { - ID uint64 + ID int Name string Parent *DirsNode Depth uint16 @@ -85,7 +85,7 @@ func (ldirs *DirsList) add_back(node *DirsNode) { } // return the list node with the according id -func (ldirs *DirsList) sel(id uint64) *DirsNode { +func (ldirs *DirsList) sel(id int) *DirsNode { curr := ldirs.head if curr == nil { @@ -115,10 +115,10 @@ func (ldirs *DirsList) path(node *DirsNode) string { return path } -func (ldirs *DirsList) count() (uint64, uint64) { +func (ldirs *DirsList) count() (int, int) { curr := ldirs.head - var count_dirs uint64 - var count_hosts uint64 + var count_dirs int + var count_hosts int for count_dirs = 0; curr != nil; count_dirs++ { count_hosts += curr.lhost.count() @@ -130,3 +130,11 @@ func (ldirs *DirsList) count() (uint64, uint64) { func (dir *DirsNode) is_dir() bool { return true } + +func (dir *DirsNode) get_self_dirs() *DirsNode { + return dir +} + +func (dir *DirsNode) get_self_host() *HostNode { + return nil +} |