From 2777dfe050359c359233b2f00dfb5c3b2dba4ed6 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 18 Dec 2019 15:55:03 +0100 Subject: Cleanup: merge the fstree post processing functions Instead of having 3 different functions for sorting the tree, numbering the nodes and generating a file list, that all have to be used in the right order, this commit merges them into a single "fstree_post_process" function. Signed-off-by: David Oberhollenzer --- include/fstree.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'include/fstree.h') diff --git a/include/fstree.h b/include/fstree.h index ab44e3e..dd1440e 100644 --- a/include/fstree.h +++ b/include/fstree.h @@ -155,14 +155,15 @@ tree_node_t *fstree_add_generic(fstree_t *fs, const char *path, int fstree_from_file(fstree_t *fs, const char *filename, FILE *fp); /* - Allocates inode numbers for all nodes. Directory entries are numbered in - ascending order. + This function performs all the necessary post processing steps on the file + system tree, i.e. recursively sorting all directory entries by name, + allocating inode numbers and stringing all files nodes together into a + linked list. - The total inode count is stored in unique_inode_count. + The total inode count is stored in unique_inode_count. The head of the file + list is pointed to by fs->files. */ -void fstree_gen_inode_numbers(fstree_t *fs); - -void fstree_gen_file_list(fstree_t *fs); +void fstree_post_process(fstree_t *fs); /* Generate a string holding the full path of a node. Returned @@ -175,9 +176,6 @@ char *fstree_get_path(tree_node_t *node); /* ASCIIbetically sort a linked list of tree nodes */ tree_node_t *tree_node_list_sort(tree_node_t *head); -/* ASCIIbetically sort all sub directories recursively */ -void tree_node_sort_recursive(tree_node_t *root); - /* If the environment variable SOURCE_DATE_EPOCH is set to a parsable number that fits into an unsigned 32 bit value, return its value. Otherwise, -- cgit v1.2.3