From 2262af9f82d8a07751acea042844906649053a9f Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 18 Dec 2019 16:11:09 +0100 Subject: Cleanup: internalize some fstree functions Signed-off-by: David Oberhollenzer --- lib/fstree/Makemodule.am | 2 +- lib/fstree/fstree.c | 4 +--- lib/fstree/fstree_sort.c | 4 +--- lib/fstree/internal.h | 23 +++++++++++++++++++++++ lib/fstree/post_process.c | 4 +--- lib/fstree/source_date_epoch.c | 5 ++--- 6 files changed, 29 insertions(+), 13 deletions(-) create mode 100644 lib/fstree/internal.h (limited to 'lib') diff --git a/lib/fstree/Makemodule.am b/lib/fstree/Makemodule.am index 64c2650..33b508c 100644 --- a/lib/fstree/Makemodule.am +++ b/lib/fstree/Makemodule.am @@ -3,7 +3,7 @@ libfstree_a_SOURCES += lib/fstree/fstree_sort.c libfstree_a_SOURCES += lib/fstree/post_process.c lib/fstree/get_path.c libfstree_a_SOURCES += lib/fstree/mknode.c libfstree_a_SOURCES += lib/fstree/add_by_path.c -libfstree_a_SOURCES += include/fstree.h +libfstree_a_SOURCES += include/fstree.h lib/fstree/internal.h libfstree_a_SOURCES += lib/fstree/source_date_epoch.c libfstree_a_SOURCES += lib/fstree/canonicalize_name.c libfstree_a_CFLAGS = $(AM_CFLAGS) diff --git a/lib/fstree/fstree.c b/lib/fstree/fstree.c index 90e14ce..ce35b84 100644 --- a/lib/fstree/fstree.c +++ b/lib/fstree/fstree.c @@ -4,9 +4,7 @@ * * Copyright (C) 2019 David Oberhollenzer */ -#include "config.h" - -#include "fstree.h" +#include "internal.h" #include #include diff --git a/lib/fstree/fstree_sort.c b/lib/fstree/fstree_sort.c index 124106e..58ffadf 100644 --- a/lib/fstree/fstree_sort.c +++ b/lib/fstree/fstree_sort.c @@ -5,9 +5,7 @@ * Copyright (C) 2019 David Oberhollenzer * Copyright (C) 2019 Zachary Dremann */ -#include "config.h" - -#include "fstree.h" +#include "internal.h" #include diff --git a/lib/fstree/internal.h b/lib/fstree/internal.h new file mode 100644 index 0000000..e8e5eef --- /dev/null +++ b/lib/fstree/internal.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * internal.h + * + * Copyright (C) 2019 David Oberhollenzer + */ +#ifndef FSTREE_INTERNAL_H +#define FSTREE_INTERNAL_H + +#include "config.h" +#include "fstree.h" + +/* ASCIIbetically sort a linked list of tree nodes */ +tree_node_t *tree_node_list_sort(tree_node_t *head); + +/* + 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, + default to 0. + */ +sqfs_u32 get_source_date_epoch(void); + +#endif /* FSTREE_INTERNAL_H */ diff --git a/lib/fstree/post_process.c b/lib/fstree/post_process.c index 5e7f152..ea52e4f 100644 --- a/lib/fstree/post_process.c +++ b/lib/fstree/post_process.c @@ -4,9 +4,7 @@ * * Copyright (C) 2019 David Oberhollenzer */ -#include "config.h" - -#include "fstree.h" +#include "internal.h" #include #include diff --git a/lib/fstree/source_date_epoch.c b/lib/fstree/source_date_epoch.c index 9b47d56..1efa688 100644 --- a/lib/fstree/source_date_epoch.c +++ b/lib/fstree/source_date_epoch.c @@ -1,11 +1,10 @@ /* SPDX-License-Identifier: GPL-3.0-or-later */ /* - * source_date_epoch.h + * source_date_epoch.c * * Copyright (C) 2019 David Oberhollenzer */ -#include "config.h" -#include "fstree.h" +#include "internal.h" #include #include -- cgit v1.2.3