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
commitf4b6dd6f56975101a8af8e428ec9fa45aa338e00 (patch)
treef9773421e27c5e0240e7e6fb0f299c0fa9dcd6b9 /c_init.go
parentlitems is necessary (diff)
downloadhardflip-f4b6dd6f56975101a8af8e428ec9fa45aa338e00.tar.gz
hardflip-f4b6dd6f56975101a8af8e428ec9fa45aa338e00.tar.bz2
hardflip-f4b6dd6f56975101a8af8e428ec9fa45aa338e00.tar.xz
hardflip-f4b6dd6f56975101a8af8e428ec9fa45aa338e00.tar.zst
hardflip-f4b6dd6f56975101a8af8e428ec9fa45aa338e00.zip
this is gonna be long
Diffstat (limited to '')
-rw-r--r--c_init.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/c_init.go b/c_init.go
index 770bd8c..ca8cd28 100644
--- a/c_init.go
+++ b/c_init.go
@@ -65,7 +65,7 @@ type HardOpts struct {
// 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,
- litems *ItemsList, ldirs *DirsList,
+ ldirs *DirsList,
name string, parent *DirsNode, depth uint16) {
files, err := os.ReadDir(root + dir)
if err != nil {
@@ -88,7 +88,7 @@ func c_recurse_data_dir(dir, root string, opts HardOpts,
for _, file := range files {
filename := file.Name()
if file.IsDir() == true {
- c_recurse_data_dir(dir + filename + "/", root, opts, litems, ldirs,
+ c_recurse_data_dir(dir + filename + "/", root, opts, ldirs,
file.Name(), &dir_node, depth + 1)
} else if filepath.Ext(filename) == ".yml" {
host_node := c_read_yaml_file(root + dir + filename)
@@ -106,10 +106,15 @@ func c_recurse_data_dir(dir, root string, opts HardOpts,
}
}
-func c_load_data_dir(dir string, opts HardOpts) (*ItemsList, *DirsList) {
- litems := ItemsList{}
+func c_load_data_dir(dir string, opts HardOpts) *DirsList {
ldirs := DirsList{}
- c_recurse_data_dir("", dir + "/", opts, &litems, &ldirs, "", nil, 1)
- return &litems, &ldirs
+ c_recurse_data_dir("", dir + "/", opts, &ldirs, "", nil, 1)
+ return &ldirs
+}
+
+func c_load_litems(ldirs *DirsList) *ItemsList {
+ litems := ItemsList{}
+
+ return &litems
}