From 94b547d27f953fefa0ed080611eb916f58702e87 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 25 Nov 2019 13:28:28 +0100 Subject: Cleanup: remove what is left of libutil Signed-off-by: David Oberhollenzer --- include/common.h | 4 +++- include/compat.h | 6 ++++-- include/tar.h | 2 +- include/util/util.h | 21 --------------------- 4 files changed, 8 insertions(+), 25 deletions(-) delete mode 100644 include/util/util.h (limited to 'include') diff --git a/include/common.h b/include/common.h index 66f6f76..cdcce39 100644 --- a/include/common.h +++ b/include/common.h @@ -26,7 +26,6 @@ #include "sqfs/dir.h" #include "sqfs/io.h" -#include "util/util.h" #include "compat.h" #include "fstree.h" #include "tar.h" @@ -73,6 +72,9 @@ typedef struct { bool quiet; } sqfs_writer_cfg_t; +#define container_of(ptr, type, member) \ + ((type *)((char *)ptr - offsetof(type, member))) + /* High level helper function to serialize an entire file system tree to a squashfs inode table and directory table. diff --git a/include/compat.h b/include/compat.h index 82b1c7e..9051d88 100644 --- a/include/compat.h +++ b/include/compat.h @@ -1,12 +1,14 @@ -/* SPDX-License-Identifier: LGPL-3.0-or-later */ +/* SPDX-License-Identifier: GPL-3.0-or-later */ /* - * util.h + * compat.h * * Copyright (C) 2019 David Oberhollenzer */ #ifndef COMPAT_H #define COMPAT_H +#include "sqfs/predef.h" + #if defined(__GNUC__) || defined(__clang__) # if defined(__GNUC__) && __GNUC__ < 5 # if SIZEOF_SIZE_T <= SIZEOF_INT diff --git a/include/tar.h b/include/tar.h index dacea42..c496095 100644 --- a/include/tar.h +++ b/include/tar.h @@ -8,7 +8,7 @@ #define TAR_H #include "config.h" -#include "util/util.h" +#include "compat.h" #include #include diff --git a/include/util/util.h b/include/util/util.h deleted file mode 100644 index ed1102b..0000000 --- a/include/util/util.h +++ /dev/null @@ -1,21 +0,0 @@ -/* SPDX-License-Identifier: LGPL-3.0-or-later */ -/* - * util.h - * - * Copyright (C) 2019 David Oberhollenzer - */ -#ifndef UTIL_H -#define UTIL_H - -#include "config.h" -#include "sqfs/predef.h" - -#include -#include - -#include "compat.h" - -#define container_of(ptr, type, member) \ - ((type *)((char *)ptr - offsetof(type, member))) - -#endif /* UTIL_H */ -- cgit v1.2.3