diff options
author | Joe <rbo@gmx.us> | 2023-12-26 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2023-12-26 20:20:20 +0100 |
commit | 1590c30cbb2627a6175f08ab83185a1d6a054f09 (patch) | |
tree | bff0a5ae616bce46dcaa100913922a7a80174c4f /c_ldirs.go | |
parent | cool (diff) | |
download | hardflip-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.go | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 +} |