10 list
* make_new(list
* next
, void* item
){
14 ptr
= malloc(sizeof(struct list
));
26 void remove_from_list(list
* prev
, list
* node
){
27 prev
->next
= node
->next
;
29 node
->next
= freelist
;
35 return make_new(NULL
, NULL
);
38 void push(list
* L
, void* item
){
39 list
* ptr
= make_new(L
->next
, item
);
45 void* item
= L
->next
->item
;
46 remove_from_list(L
, L
->next
);
55 void append(list
* L
, void* item
){
60 ptr
->next
= make_new(NULL
, item
);
63 void recycle(list
* L
){
66 ptr
->next
->item
= NULL
;
86 void print_list(list
* L
, void (*print
)(void* item
)){
98 void println_list(list
* L
, void (*print
)(void* item
)){
103 void list_print_free(){
104 list
* ptr
= freelist
;
116 void print(void* item
){