87f97a7a5f994be611ff29afe8e9d50df386f719
5 link_t
* list_new(int value
) {
7 link_t_new
= malloc(sizeof(link_t
));
8 link_t_new
->value
= value
;
9 link_t_new
->next
= NULL
;
13 void list_append(link_t
* head
, int value
) {
15 while (head
->next
!= NULL
) {
18 head
->next
= list_new(value
);
21 unsigned list_count(link_t
* head
) {
22 // And if head is not defined?
25 while (head
->next
!= NULL
) {
32 int list_get(link_t
* head
, unsigned index
) {
34 if (index
< list_count(head
)) {
35 for (unsigned i
= 0; i
< index
; i
++) {
44 void list_clear(link_t
* link
) {
46 while (link
!= NULL
) {
47 link_t
* next_link
= link
->next
;