aboutsummaryrefslogtreecommitdiffstats
path: root/c_ldirs.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2023-12-26 20:20:20 +0100
committerJoe <rbo@gmx.us>2023-12-26 20:20:20 +0100
commit1590c30cbb2627a6175f08ab83185a1d6a054f09 (patch)
treebff0a5ae616bce46dcaa100913922a7a80174c4f /c_ldirs.go
parentcool (diff)
downloadhardflip-1590c30cbb2627a6175f08ab83185a1d6a054f09.tar.gz
hardflip-1590c30cbb2627a6175f08ab83185a1d6a054f09.tar.bz2
hardflip-1590c30cbb2627a6175f08ab83185a1d6a054f09.tar.xz
hardflip-1590c30cbb2627a6175f08ab83185a1d6a054f09.tar.zst
hardflip-1590c30cbb2627a6175f08ab83185a1d6a054f09.zip
up
Diffstat (limited to 'c_ldirs.go')
-rw-r--r--c_ldirs.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/c_ldirs.go b/c_ldirs.go
index ceee953..468b542 100644
--- a/c_ldirs.go
+++ b/c_ldirs.go
@@ -106,3 +106,15 @@ func (ldirs *DirsList) path(node *DirsNode) string {
}
return path
}
+
+func (ldirs *DirsList) count() (uint64, uint64) {
+ curr := ldirs.head
+ var count_dirs uint64
+ var count_hosts uint64
+
+ for count_dirs = 0; curr != nil; count_dirs++ {
+ count_hosts += curr.lhost.count()
+ curr = curr.next
+ }
+ return count_dirs, count_hosts
+}