added list into every llist-related identificator
This commit is contained in:
parent
ad3716d5c1
commit
b4cccf6d45
@ -25,9 +25,9 @@ typedef struct _why2_node
|
|||||||
struct _why2_node *next;
|
struct _why2_node *next;
|
||||||
} why2_node_t; //SINGLE LINKED LIST
|
} why2_node_t; //SINGLE LINKED LIST
|
||||||
|
|
||||||
void why2_push(why2_node_t *llist_head, void *value); //PUSH ELEMENT TO LIST BACK
|
void why2_list_push(why2_node_t *llist_head, void *value); //PUSH ELEMENT TO LIST BACK
|
||||||
void why2_remove(why2_node_t *llist_head, why2_node_t *node); //REMOVE ELEMENT
|
void why2_list_remove(why2_node_t *llist_head, why2_node_t *node); //REMOVE ELEMENT
|
||||||
void why2_remove_back(why2_node_t *llist_head); //REMOVE LAST ELEMENT
|
void why2_list_remove_back(why2_node_t *llist_head); //REMOVE LAST ELEMENT
|
||||||
why2_node_t *why2_find(why2_node_t *llist_head, void *value); //FIND ELEMENT IN LIST
|
why2_node_t *why2_list_find(why2_node_t *llist_head, void *value); //FIND ELEMENT IN LIST
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -22,7 +22,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
void why2_push(why2_node_t *llist_head, void *value)
|
void why2_list_push(why2_node_t *llist_head, void *value)
|
||||||
{
|
{
|
||||||
//CREATE NODE
|
//CREATE NODE
|
||||||
why2_node_t *new_node = malloc(sizeof(why2_node_t));
|
why2_node_t *new_node = malloc(sizeof(why2_node_t));
|
||||||
@ -43,7 +43,7 @@ void why2_push(why2_node_t *llist_head, void *value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void why2_remove(why2_node_t *llist_head, why2_node_t *node)
|
void why2_list_remove(why2_node_t *llist_head, why2_node_t *node)
|
||||||
{
|
{
|
||||||
if (node == NULL) return; //NULL NODE
|
if (node == NULL) return; //NULL NODE
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ void why2_remove(why2_node_t *llist_head, why2_node_t *node)
|
|||||||
free(node);
|
free(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
void why2_remove_back(why2_node_t *llist_head)
|
void why2_list_remove_back(why2_node_t *llist_head)
|
||||||
{
|
{
|
||||||
if (llist_head == NULL) return; //EMPTY LIST
|
if (llist_head == NULL) return; //EMPTY LIST
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ void why2_remove_back(why2_node_t *llist_head)
|
|||||||
free(deallocating_node);
|
free(deallocating_node);
|
||||||
}
|
}
|
||||||
|
|
||||||
why2_node_t *why2_find(why2_node_t *llist_head, void *value)
|
why2_node_t *why2_list_find(why2_node_t *llist_head, void *value)
|
||||||
{
|
{
|
||||||
if (llist_head == NULL) return NULL; //EMPTY LIST
|
if (llist_head == NULL) return NULL; //EMPTY LIST
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user