aboutsummaryrefslogtreecommitdiffstats
path: root/c_init.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-03 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-03 20:20:20 +0100
commit7e595f4ba400b32ece930de0847d994f6f2fbe24 (patch)
tree39ffae8e4930f687cc6ed48c9b5860624df985f7 /c_init.go
parentwip (diff)
downloadhardflip-7e595f4ba400b32ece930de0847d994f6f2fbe24.tar.gz
hardflip-7e595f4ba400b32ece930de0847d994f6f2fbe24.tar.bz2
hardflip-7e595f4ba400b32ece930de0847d994f6f2fbe24.tar.xz
hardflip-7e595f4ba400b32ece930de0847d994f6f2fbe24.tar.zst
hardflip-7e595f4ba400b32ece930de0847d994f6f2fbe24.zip
unique id maybe?
Diffstat (limited to 'c_init.go')
-rw-r--r--c_init.go23
1 files changed, 14 insertions, 9 deletions
diff --git a/c_init.go b/c_init.go
index dc42774..3c22e2b 100644
--- a/c_init.go
+++ b/c_init.go
@@ -62,6 +62,9 @@ type HardOpts struct {
FoldAll bool
}
+
+var global_id uint64
+
// this function recurses into the specified root directory in order to load
// every yaml file into memory
func c_recurse_data_dir(dir, root string, opts HardOpts,
@@ -80,11 +83,12 @@ func c_recurse_data_dir(dir, root string, opts HardOpts,
opts.FoldAll,
nil,
}
- item_node := ItemsNode{}
- item_node.Dirs = &dir_node
- item_node.Host = nil
+ // item_node := ItemsNode{}
+ // item_node.Dirs = &dir_node
+ // item_node.Host = nil
ldirs.add_back(&dir_node)
- litems.add_back(&item_node)
+ global_id++
+ // litems.add_back(&item_node)
for _, file := range files {
filename := file.Name()
if file.IsDir() == true {
@@ -95,13 +99,14 @@ func c_recurse_data_dir(dir, root string, opts HardOpts,
if host_node == nil {
return
}
- item_node := ItemsNode{}
- item_node.Dirs = nil
- item_node.Host = host_node
- litems.add_back(&item_node)
+ // item_node := ItemsNode{}
+ // item_node.Dirs = nil
+ // item_node.Host = host_node
+ // litems.add_back(&item_node)
host_node.Filename = filename
- host_node.Dir = &dir_node
+ host_node.Parent = &dir_node
dir_node.lhost.add_back(host_node)
+ global_id++
}
}
}