Data Structures Lerax  v3.0-104-ge031
Opinionated Data Structures & Algorithms
Loading...
Searching...
No Matches
list-gen.h
Go to the documentation of this file.
1
12
13#ifndef LIST_GEN_H
14#define LIST_GEN_H
15#include <stdbool.h>
16#include <stddef.h>
17
18typedef struct ListGen ListGen;
19
20struct ListGen {
21 int key;
22 void *data;
24};
25
32
40
48
57
66ListGen* list_gen_insert_with_key(ListGen *l, int key, void *data);
67
76
85
94
103
110
117
126
133
134#endif
ListGen * list_gen_search_by_key(ListGen *l, int key)
Searches for a key in the list.
ListGen * list_gen_remove(ListGen *l, void *data)
Removes data from the list.
bool list_gen_empty(ListGen *l)
Checks if the list is empty.
void list_gen_free(ListGen *l)
Frees the memory allocated for the list.
ListGen * list_gen_copy(ListGen *l)
Creates a copy of the list.
void list_gen_println_reverse(ListGen *l)
Prints the list in reverse order.
ListGen * list_gen_insert_with_key(ListGen *l, int key, void *data)
Inserts data with a key into the list.
ListGen * list_gen_remove_by_key(ListGen *l, int key)
Removes a key from the list.
ListGen * list_gen_insert(ListGen *l, void *data)
Inserts data into the list.
void list_gen_println(ListGen *l)
Prints the list.
ListGen * list_gen_concat(ListGen *l1, ListGen *l2)
Concatenates two lists.
ListGen * list_gen_search(ListGen *l, void *data)
Searches for data in the list.
ListGen * list_gen_create()
Creates a new generic list.
Definition list-gen.h:20
void * data
Definition list-gen.h:22
int key
Definition list-gen.h:21
ListGen * next
Definition list-gen.h:23