aboutsummaryrefslogtreecommitdiffstats
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
commit6b52e3051cd00fa39e8a7504e41a931cc874cb0e (patch)
treede1079d3ed60fcbd3fbd3de8ff1535e9455d7c4d
parentturns out we need litems in the end (diff)
downloadhardflip-6b52e3051cd00fa39e8a7504e41a931cc874cb0e.tar.gz
hardflip-6b52e3051cd00fa39e8a7504e41a931cc874cb0e.tar.bz2
hardflip-6b52e3051cd00fa39e8a7504e41a931cc874cb0e.tar.xz
hardflip-6b52e3051cd00fa39e8a7504e41a931cc874cb0e.tar.zst
hardflip-6b52e3051cd00fa39e8a7504e41a931cc874cb0e.zip
fuck all of this hosts only
-rw-r--r--c_hardflip.go1
-rw-r--r--c_init.go5
-rw-r--r--c_ldirs.go2
-rw-r--r--c_lhosts.go4
-rw-r--r--c_litems.go2
-rw-r--r--i_ui.go1
6 files changed, 5 insertions, 10 deletions
diff --git a/c_hardflip.go b/c_hardflip.go
index f54320b..085956e 100644
--- a/c_hardflip.go
+++ b/c_hardflip.go
@@ -94,6 +94,7 @@ func (data *HardData) sel_unique_id(id int) {
}
func main() {
+ // TODO: no ldirs just hosts raw hosts
data_dir := c_get_data_dir()
opts := HardOpts{true, true, false}
litems, ldirs := c_load_data_dir(data_dir, opts)
diff --git a/c_init.go b/c_init.go
index 9c189c1..770bd8c 100644
--- a/c_init.go
+++ b/c_init.go
@@ -62,9 +62,6 @@ type HardOpts struct {
FoldAll bool
}
-
-var global_id int
-
// 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,
@@ -87,7 +84,6 @@ func c_recurse_data_dir(dir, root string, opts HardOpts,
// item_node.Dirs = &dir_node
// item_node.Host = nil
ldirs.add_back(&dir_node)
- global_id++
// litems.add_back(&item_node)
for _, file := range files {
filename := file.Name()
@@ -106,7 +102,6 @@ func c_recurse_data_dir(dir, root string, opts HardOpts,
host_node.Filename = filename
// host_node.Parent = &dir_node
dir_node.lhost.add_back(host_node)
- global_id++
}
}
}
diff --git a/c_ldirs.go b/c_ldirs.go
index 7188d5b..f8867dc 100644
--- a/c_ldirs.go
+++ b/c_ldirs.go
@@ -68,13 +68,13 @@ type DirsList struct {
// adds a directory node to the list
func (ldirs *DirsList) add_back(node *DirsNode) {
- node.ID = global_id
if ldirs.head == nil {
ldirs.head = node
ldirs.last = ldirs.head
return
}
last := ldirs.last
+ node.ID = last.ID + 1
last.next = node
ldirs.last = last.next
}
diff --git a/c_lhosts.go b/c_lhosts.go
index bddc1c0..e2d7d5e 100644
--- a/c_lhosts.go
+++ b/c_lhosts.go
@@ -43,7 +43,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* hardflip: src/c_lhosts.go
- * Thu 04 Jan 2024 11:50:55 AM CET
+ * Fri Jan 05 12:29:56 2024
* Joe
*
* the hosts linked list
@@ -84,13 +84,13 @@ type HostList struct {
// adds a host node to the list
func (lhost *HostList) add_back(node *HostNode) {
- node.ID = global_id
if lhost.head == nil {
lhost.head = node
lhost.last = lhost.head
return
}
last := lhost.last
+ node.ID = last.ID + 1
last.next = node
lhost.last = last.next
}
diff --git a/c_litems.go b/c_litems.go
index 7183ea5..7fa93c3 100644
--- a/c_litems.go
+++ b/c_litems.go
@@ -43,7 +43,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* hardflip: src/c_litems.go
- * Wed Dec 27 18:55:37 2023
+ * Fri Jan 05 12:29:08 2024
* Joe
*
* the dir and hosts linked list
diff --git a/i_ui.go b/i_ui.go
index c2b116a..ca3cbe4 100644
--- a/i_ui.go
+++ b/i_ui.go
@@ -288,7 +288,6 @@ func i_host_panel_host(ui HardUI, icons bool,
}
func i_host_panel(ui HardUI, icons bool, ldirs *DirsList) {
- // TODO: this must work
i_draw_box(ui.s, 0, 0,
ui.dim[W] / 3, ui.dim[H] - 2,
" Hosts ", false)