aboutsummaryrefslogtreecommitdiffstats
path: root/c_litems.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-02 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-02 20:20:20 +0100
commitcba23583019b67b936ed15e001aebe42d6225f0e (patch)
tree9b9533d76a3feb69ef43ae371ed76fb52391694b /c_litems.go
parentbuilding (diff)
downloadhardflip-cba23583019b67b936ed15e001aebe42d6225f0e.tar.gz
hardflip-cba23583019b67b936ed15e001aebe42d6225f0e.tar.bz2
hardflip-cba23583019b67b936ed15e001aebe42d6225f0e.tar.xz
hardflip-cba23583019b67b936ed15e001aebe42d6225f0e.tar.zst
hardflip-cba23583019b67b936ed15e001aebe42d6225f0e.zip
wip
Diffstat (limited to 'c_litems.go')
-rw-r--r--c_litems.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/c_litems.go b/c_litems.go
index a623812..a104e6c 100644
--- a/c_litems.go
+++ b/c_litems.go
@@ -63,6 +63,24 @@ type ItemsList struct {
last *ItemsNode
}
+func (litems *ItemsList) is_dir(id int) bool {
+ curr := litems.head
+
+ if curr == nil {
+ return false
+ }
+ for curr.next != nil && curr.ID != id {
+ curr = curr.next
+ }
+ if curr.ID != id {
+ return false
+ }
+ if curr.Dirs != nil {
+ return true
+ }
+ return false
+}
+
func (litems *ItemsList) add_back(node *ItemsNode) {
new_node := node