GCC Code Coverage Report


Directory: ./
File: lib/mylist/my_find_node.c
Date: 2024-06-05 02:24:39
Exec Total Coverage
Lines: 0 6 0.0%
Functions: 0 1 0.0%
Branches: 0 10 0.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2023
3 ** my_find_node
4 ** File description:
5 ** Finds a node in a linked list and return it
6 */
7
8 #include "mylist.h"
9
10 linked_list_t *my_find_node(linked_list_t const *begin, void const *data_ref,
11 int (*cmp) ())
12 {
13 for (linked_list_t *tmp = (linked_list_t *)begin; tmp != NULL; tmp =
14 tmp->next) {
15 if ((cmp == NULL && tmp->data == data_ref)
16 || (cmp != NULL && cmp(tmp->data, data_ref) == 0))
17 return tmp;
18 }
19 return NULL;
20 }
21