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