aboutsummaryrefslogtreecommitdiffstats
path: root/c_ldirs.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-08 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-08 20:20:20 +0100
commit8acbdf8f2318728831f7006651c2484eff9e367f (patch)
tree199ed6f16be4313c983108c3ea7614e299ebabb6 /c_ldirs.go
parentfactor (diff)
downloadhardflip-8acbdf8f2318728831f7006651c2484eff9e367f.tar.gz
hardflip-8acbdf8f2318728831f7006651c2484eff9e367f.tar.bz2
hardflip-8acbdf8f2318728831f7006651c2484eff9e367f.tar.xz
hardflip-8acbdf8f2318728831f7006651c2484eff9e367f.tar.zst
hardflip-8acbdf8f2318728831f7006651c2484eff9e367f.zip
cool
Diffstat (limited to 'c_ldirs.go')
-rw-r--r--c_ldirs.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/c_ldirs.go b/c_ldirs.go
index af24c28..ee8977b 100644
--- a/c_ldirs.go
+++ b/c_ldirs.go
@@ -96,16 +96,23 @@ func (ldirs *DirsList) sel(id int) *DirsNode {
}
// returns a string with the full path of the dir
-func (ldirs *DirsList) path(node *DirsNode) string {
+func (dir *DirsNode) path() string {
var path string
- if node == nil {
+ if dir == nil {
return ""
}
- curr := node
+ curr := dir
for curr != nil {
path = curr.Name + "/" + path
curr = curr.Parent
}
return path
}
+
+func (dir *DirsNode) count_hosts() int {
+ if dir.lhost.head == nil {
+ return 0
+ }
+ return dir.lhost.last.ID + 1
+}