aboutsummaryrefslogtreecommitdiffstats
path: root/c_ldirs.go
diff options
context:
space:
mode:
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
+}