-void merge(struct *file_list list1, struct *file_list list2) {
- if(list1->head && list2->head) {
- struct file_list result;
- result.head = list1.head;
- } else {
- if(list1.head) {
- return list1;
- } else {
- return list2;
- }
- }
-}
-
-struct file_with_size *create(char *name, struct file_with_size *current) {
- struct file_with_size *result;
- result = safe_malloc(sizeof(struct file_with_size));
- result->filename = strdup(name);
- result->size = file_or_dir_size(name);
- result->next = current;
- return result;
+void create(struct file_list *list, const char *name) {
+ list->head = safe_malloc(sizeof(struct file_with_size));
+ list->tail = 0;
+ list->head->filename = strdup(name);
+ list->head->size = file_or_dir_size(name);
+ list->head->next = 0;