From 1590c30cbb2627a6175f08ab83185a1d6a054f09 Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 26 Dec 2023 20:20:20 +0100 Subject: up --- c_ldirs.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'c_ldirs.go') 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 +} -- cgit v1.2.3