Merge branch 'master' of https://github.com/jerome-benoit/TD_C
[TD_C.git] / TP_9 / exo2 / clist.h
1 #ifndef CLIST_H
2 #define CLIST_H
3
4 /** Linked list of int */
5 typedef struct link_s {
6 int value;
7 struct link_s* next;
8 } link_t;
9
10 link_t* list_new(int value);
11 link_t* list_append(link_t* head, int value);
12 link_t* list_prepend(link_t* head, int value);
13 link_t* list_insert(link_t* head, unsigned index, int value);
14 link_t* list_delete(link_t* head, unsigned index);
15 link_t* list_concat(link_t* first, link_t* second);
16 link_t* list_sort(link_t* head);
17 link_t* list_merge_sort(link_t* head);
18 unsigned list_count(link_t* head);
19 void list_set(link_t* head, unsigned index, int value);
20 int list_get(link_t* head, unsigned index);
21 void list_clear(link_t* head);
22 void list_display_values(link_t* head);
23
24 #endif /* CLIST_H */