Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
imamhs authored Sep 16, 2023
1 parent 6b64d61 commit d250c26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/imamll.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,14 @@ int imamLL_element_remove (struct imamLL *list, struct imamLL_element *element,
}
}

struct imamLL_element *imamLL_element_get (struct imamLL *list, const void *element_data, size_t data_size)
struct imamLL_element *imamLL_element_get (struct imamLL *list, const void *element_data, size_t data_size, uint8_t follow_cursor)
{
int found = 0;
struct imamLL_element *tmp = list->first;
struct imamLL_element *tmp = NULL;

if (follow_cursor == 0) tmp = list->first;
else tmp = list->current;

if (tmp == NULL) {
list->error = EMPTY_LIST;
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/imamll.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ extern void imamLL_element_remove_number (struct imamLL *list, int8_t direction,

/* returns the pointer of a matching element */
/* Return Value: upon successful returns pointer to first found element in a list, otherwise returns NULL and sets appropriate error no to error variable of a list*/
extern struct imamLL_element *imamLL_element_get (struct imamLL *list, const void *element_data, size_t data_size);
extern struct imamLL_element *imamLL_element_get (struct imamLL *list, const void *element_data, size_t data_size, uint8_t follow_cursor);

/* returns the pointer of the next element in the list */
/* Return Value: upon successful returns pointer to the next element in a list, otherwise returns NULL*/
Expand Down

0 comments on commit d250c26

Please sign in to comment.