diff options
author | Joe <rbo@gmx.us> | 2023-12-21 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2023-12-21 20:20:20 +0100 |
commit | 3edca0fd3c5b0411ef2dc95bfe9f34865b5fb55f (patch) | |
tree | c7983a4d1fe26c2de0398dc18d15b374e530a219 /c_ldirs.go | |
parent | icon option (diff) | |
download | hardflip-3edca0fd3c5b0411ef2dc95bfe9f34865b5fb55f.tar.gz hardflip-3edca0fd3c5b0411ef2dc95bfe9f34865b5fb55f.tar.bz2 hardflip-3edca0fd3c5b0411ef2dc95bfe9f34865b5fb55f.tar.xz hardflip-3edca0fd3c5b0411ef2dc95bfe9f34865b5fb55f.tar.zst hardflip-3edca0fd3c5b0411ef2dc95bfe9f34865b5fb55f.zip |
must rewrite inti
Diffstat (limited to '')
-rw-r--r-- | c_ldirs.go | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -39,7 +39,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * hardflip: src/c_ldirs.go - * Thu Dec 21 14:03:40 2023 + * Thu Dec 21 18:06:00 2023 * Joe * * the directories linked list @@ -57,3 +57,18 @@ type DirsNode struct { type DirsList struct { head *DirsNode } + +// adds a directory node to the list +func (ldirs *DirsList) add_back(node *DirsNode) { + new_node := node + + if ldirs.head == nil { + ldirs.head = new_node + return + } + curr := ldirs.head + for curr.next != nil { + curr = curr.next + } + curr.next = new_node +} |