Small utility collection for dealing with file archives that have dependencies
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

37 lines
575 B

/* SPDX-License-Identifier: ISC */
#include <sys/stat.h>
#include <stdlib.h>
#include <stdio.h>
#include "filelist/image_entry.h"
void image_entry_free(image_entry_t *ent)
{
if (ent != NULL) {
switch (ent->mode & S_IFMT) {
case S_IFREG:
free(ent->data.file.location);
break;
case S_IFLNK:
free(ent->data.symlink.target);
break;
default:
break;
}
free(ent->name);
free(ent);
}
}
void image_entry_free_list(image_entry_t *list)
{
image_entry_t *ent;
while (list != NULL) {
ent = list;
list = list->next;
image_entry_free(ent);
}
}