aboutsummaryrefslogtreecommitdiffstats
path: root/c_init.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-05 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-05 20:20:20 +0100
commit4b06549cd72411db72ae231e5ad6b1ae16ca0fbf (patch)
tree7ec03fae7cb66b388d3939658523e8be603c6387 /c_init.go
parenttodolist (diff)
downloadhardflip-4b06549cd72411db72ae231e5ad6b1ae16ca0fbf.tar.gz
hardflip-4b06549cd72411db72ae231e5ad6b1ae16ca0fbf.tar.bz2
hardflip-4b06549cd72411db72ae231e5ad6b1ae16ca0fbf.tar.xz
hardflip-4b06549cd72411db72ae231e5ad6b1ae16ca0fbf.tar.zst
hardflip-4b06549cd72411db72ae231e5ad6b1ae16ca0fbf.zip
cool
Diffstat (limited to 'c_init.go')
-rw-r--r--c_init.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/c_init.go b/c_init.go
index b5caf6a..222c796 100644
--- a/c_init.go
+++ b/c_init.go
@@ -113,10 +113,18 @@ func c_load_data_dir(dir string, opts HardOpts) *DirsList {
return &ldirs
}
+// fills litems sorting with dirs last
+// other sorting algos are concievable
func c_load_litems(ldirs *DirsList) *ItemsList {
litems := ItemsList{}
- for dir := ldirs.head; dir != nil; dir = dir.next {
+ for ptr := ldirs.head; ptr != nil; ptr = ptr.next {
+ item := ItemsNode{ Dirs: ptr, Host: nil }
+ litems.add_back(&item)
+ for ptr := ptr.lhost.head; ptr != nil; ptr = ptr.next {
+ item := ItemsNode{ Dirs: nil, Host: ptr }
+ litems.add_back(&item)
+ }
}
return &litems
}