From 2087cc237cd0fe1ed29ebf891648bacb46f4833b Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 26 Jun 2022 16:45:52 +0200 Subject: Cleanup: move libutil headers to sub directory Move all the libutil stuff from the toplevel include/ to a util/ sub directory and fix up the includes that make use of them. Signed-off-by: David Oberhollenzer --- lib/util/Makemodule.am | 13 +++++++------ lib/util/alloc.c | 2 +- lib/util/array.c | 2 +- lib/util/hash_table.c | 2 +- lib/util/is_memory_zero.c | 2 +- lib/util/mempool.c | 2 +- lib/util/rbtree.c | 2 +- lib/util/str_table.c | 4 ++-- lib/util/threadpool.c | 6 +++--- lib/util/threadpool_serial.c | 4 ++-- lib/util/xxhash.c | 2 +- 11 files changed, 21 insertions(+), 20 deletions(-) (limited to 'lib/util') diff --git a/lib/util/Makemodule.am b/lib/util/Makemodule.am index c66c786..01ffa31 100644 --- a/lib/util/Makemodule.am +++ b/lib/util/Makemodule.am @@ -1,11 +1,12 @@ -libutil_a_SOURCES = include/util.h include/str_table.h include/hash_table.h +libutil_a_SOURCES = include/util/util.h include/util/str_table.h +libutil_a_SOURCES += include/util/hash_table.h libutil_a_SOURCES += lib/util/str_table.c lib/util/alloc.c -libutil_a_SOURCES += lib/util/rbtree.c include/rbtree.h -libutil_a_SOURCES += lib/util/array.c include/array.h +libutil_a_SOURCES += lib/util/rbtree.c include/util/rbtree.h +libutil_a_SOURCES += lib/util/array.c include/util/array.h libutil_a_SOURCES += lib/util/xxhash.c lib/util/hash_table.c libutil_a_SOURCES += lib/util/fast_urem_by_const.h -libutil_a_SOURCES += include/threadpool.h -libutil_a_SOURCES += include/w32threadwrap.h +libutil_a_SOURCES += include/util/threadpool.h +libutil_a_SOURCES += include/util/w32threadwrap.h libutil_a_SOURCES += lib/util/threadpool_serial.c libutil_a_SOURCES += lib/util/is_memory_zero.c libutil_a_CFLAGS = $(AM_CFLAGS) @@ -27,7 +28,7 @@ endif endif if CUSTOM_ALLOC -libutil_a_SOURCES += lib/util/mempool.c include/mempool.h +libutil_a_SOURCES += lib/util/mempool.c include/util/mempool.h endif noinst_LIBRARIES += libutil.a diff --git a/lib/util/alloc.c b/lib/util/alloc.c index e8305d8..359fef5 100644 --- a/lib/util/alloc.c +++ b/lib/util/alloc.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/util/array.c b/lib/util/array.c index 3697a07..40bac50 100644 --- a/lib/util/array.c +++ b/lib/util/array.c @@ -6,7 +6,7 @@ */ #include "config.h" #include "compat.h" -#include "array.h" +#include "util/array.h" #include "sqfs/error.h" diff --git a/lib/util/hash_table.c b/lib/util/hash_table.c index a78aeee..0010e9f 100644 --- a/lib/util/hash_table.c +++ b/lib/util/hash_table.c @@ -45,7 +45,7 @@ #include #include "fast_urem_by_const.h" -#include "hash_table.h" +#include "util/hash_table.h" # define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) diff --git a/lib/util/is_memory_zero.c b/lib/util/is_memory_zero.c index 3974ee2..aabd45d 100644 --- a/lib/util/is_memory_zero.c +++ b/lib/util/is_memory_zero.c @@ -5,7 +5,7 @@ * Copyright (C) 2021 David Oberhollenzer */ #include "config.h" -#include "util.h" +#include "util/util.h" #include diff --git a/lib/util/mempool.c b/lib/util/mempool.c index 5191fa2..229ab28 100644 --- a/lib/util/mempool.c +++ b/lib/util/mempool.c @@ -4,7 +4,7 @@ * * Copyright (C) 2021 David Oberhollenzer */ -#include "mempool.h" +#include "util/mempool.h" #include #include diff --git a/lib/util/rbtree.c b/lib/util/rbtree.c index 8839f82..8b43e43 100644 --- a/lib/util/rbtree.c +++ b/lib/util/rbtree.c @@ -7,7 +7,7 @@ #include "config.h" #include "sqfs/error.h" -#include "rbtree.h" +#include "util/rbtree.h" #include #include diff --git a/lib/util/str_table.c b/lib/util/str_table.c index 2816ff8..2d3e354 100644 --- a/lib/util/str_table.c +++ b/lib/util/str_table.c @@ -11,8 +11,8 @@ #include #include "sqfs/error.h" -#include "str_table.h" -#include "util.h" +#include "util/str_table.h" +#include "util/util.h" /* R5 hash function (borrowed from reiserfs) */ static sqfs_u32 strhash(const char *s) diff --git a/lib/util/threadpool.c b/lib/util/threadpool.c index d20fe8b..c7357cd 100644 --- a/lib/util/threadpool.c +++ b/lib/util/threadpool.c @@ -4,14 +4,14 @@ * * Copyright (C) 2021 David Oberhollenzer */ -#include "threadpool.h" -#include "util.h" +#include "util/threadpool.h" +#include "util/util.h" #include #include #if defined(_WIN32) || defined(__WINDOWS__) -#include "w32threadwrap.h" +#include "util/w32threadwrap.h" #define THREAD_FUN(funname, argname) DWORD WINAPI funname(LPVOID argname) #define THREAD_EXIT_SUCCESS (0) diff --git a/lib/util/threadpool_serial.c b/lib/util/threadpool_serial.c index 834cfa7..fb24ee8 100644 --- a/lib/util/threadpool_serial.c +++ b/lib/util/threadpool_serial.c @@ -4,8 +4,8 @@ * * Copyright (C) 2021 David Oberhollenzer */ -#include "threadpool.h" -#include "util.h" +#include "util/threadpool.h" +#include "util/util.h" #include #include diff --git a/lib/util/xxhash.c b/lib/util/xxhash.c index 0644e75..60467fb 100644 --- a/lib/util/xxhash.c +++ b/lib/util/xxhash.c @@ -35,7 +35,7 @@ * - xxHash source repository: https://github.com/Cyan4973/xxHash */ #include "config.h" -#include "util.h" +#include "util/util.h" #include -- cgit v1.2.3