/* SPDX-License-Identifier: Apache-2.0 */ /* Copyright 2025 Thorsten Töpper * * vim:ts=4:sw=4:expandtab */ #ifndef LIST_MANAGEMENT_H #define LIST_MANAGEMENT_H #include #include /* === DEFINITIONS === */ struct list_node { struct list_node *next; char fname[256]; char *symlink_target; struct stat ln_stat; }; struct list_head { struct list_node *first; }; struct list_node *create_node(char *fname, struct stat *ln_stat); struct list_head *create_list_sort_reversed(struct list_head *list); void destroy_list(struct list_head *list); struct list_head *get_data_from_directory(char *path); char *get_symlink_target_name(char *symlink, struct stat st); int insert_sorted_by_name(struct list_head *list, struct list_node *node); int insert_sorted_by_size(struct list_head *list, struct list_node *node); int insert_sorted_by_time(struct list_head *list, struct list_node *node); /* Makes it simpler in the output */ bool contains_resolved_symlinks(struct list_head *list); #endif