diff options
author | Joe <rbo@gmx.us> | 2024-01-05 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-01-05 20:20:20 +0100 |
commit | f4b6dd6f56975101a8af8e428ec9fa45aa338e00 (patch) | |
tree | f9773421e27c5e0240e7e6fb0f299c0fa9dcd6b9 /c_init.go | |
parent | litems is necessary (diff) | |
download | hardflip-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 'c_init.go')
-rw-r--r-- | c_init.go | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -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 } |