From 97345b52c3b56a4ad01e7974d62cc9dc837000b0 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Thu, 13 Apr 2023 16:38:57 +0200 Subject: [PATCH] implemented why2_list_t in why2_list_push --- src/core/lib/utils/llist.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/lib/utils/llist.c b/src/core/lib/utils/llist.c index 023c95a..958f953 100644 --- a/src/core/lib/utils/llist.c +++ b/src/core/lib/utils/llist.c @@ -22,19 +22,20 @@ along with this program. If not, see . #include #include -void why2_list_push(why2_node_t *llist_head, void *value) +void why2_list_push(why2_list_t *list, void *value) { //CREATE NODE + why2_node_t *head = list -> head; why2_node_t *new_node = malloc(sizeof(why2_node_t)); - why2_node_t *buffer = llist_head; + why2_node_t *buffer = head; //INSERT DATA new_node -> value = value; new_node -> next = NULL; - if (llist_head == NULL) //INIT LIST + if (head == NULL) //INIT LIST { - llist_head = new_node; + head = new_node; } else { while (buffer -> next != NULL) buffer = buffer -> next; //GET TO THE END OF LIST