summaryrefslogtreecommitdiff
path: root/lib/fstree
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-18 16:11:09 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-18 16:11:36 +0100
commit2262af9f82d8a07751acea042844906649053a9f (patch)
treec104323ccec9610f60e9d56535366d9ddbbfeb69 /lib/fstree
parentf4604f8d0bb66ad7a777877dd01b069a82e1b18d (diff)
Cleanup: internalize some fstree functions
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstree')
-rw-r--r--lib/fstree/Makemodule.am2
-rw-r--r--lib/fstree/fstree.c4
-rw-r--r--lib/fstree/fstree_sort.c4
-rw-r--r--lib/fstree/internal.h23
-rw-r--r--lib/fstree/post_process.c4
-rw-r--r--lib/fstree/source_date_epoch.c5
6 files changed, 29 insertions, 13 deletions
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 <goliath@infraroot.at>
*/
-#include "config.h"
-
-#include "fstree.h"
+#include "internal.h"
#include <string.h>
#include <stdlib.h>
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 <goliath@infraroot.at>
* Copyright (C) 2019 Zachary Dremann <dremann@gmail.com>
*/
-#include "config.h"
-
-#include "fstree.h"
+#include "internal.h"
#include <string.h>
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 <goliath@infraroot.at>
+ */
+#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 <goliath@infraroot.at>
*/
-#include "config.h"
-
-#include "fstree.h"
+#include "internal.h"
#include <stdlib.h>
#include <stdio.h>
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 <goliath@infraroot.at>
*/
-#include "config.h"
-#include "fstree.h"
+#include "internal.h"
#include <stdlib.h>
#include <stdio.h>