From c973bcc1039b64ec00acaf8e8d61b9f5229da56f Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 7 Oct 2019 15:26:32 +0200 Subject: Cleanup: move libutil related headers to "util" sub directory Signed-off-by: David Oberhollenzer --- difftool/sqfsdiff.h | 2 +- include/common.h | 6 ++- include/compat.h | 95 ----------------------------------------- include/fstree.h | 2 +- include/str_table.h | 53 ----------------------- include/tar.h | 2 +- include/util.h | 67 ----------------------------- include/util/compat.h | 95 +++++++++++++++++++++++++++++++++++++++++ include/util/str_table.h | 53 +++++++++++++++++++++++ include/util/util.h | 67 +++++++++++++++++++++++++++++ lib/common/data_reader_dump.c | 1 - lib/common/data_writer.c | 1 - lib/fstree/fstree.c | 2 +- lib/fstree/fstree_from_file.c | 2 +- lib/fstree/gen_inode_table.c | 2 +- lib/sqfs/comp/compressor.c | 1 - lib/sqfs/comp/internal.h | 2 +- lib/sqfs/data_reader.c | 2 +- lib/sqfs/data_writer/internal.h | 2 +- lib/sqfs/dir_reader.c | 2 +- lib/sqfs/dir_writer.c | 2 +- lib/sqfs/id_table.c | 2 +- lib/sqfs/meta_reader.c | 2 +- lib/sqfs/meta_writer.c | 2 +- lib/sqfs/read_inode.c | 2 +- lib/sqfs/read_super.c | 2 +- lib/sqfs/read_table.c | 2 +- lib/sqfs/read_tree.c | 2 +- lib/sqfs/readdir.c | 2 +- lib/sqfs/super.c | 2 +- lib/sqfs/write_inode.c | 2 +- lib/sqfs/write_table.c | 2 +- lib/sqfs/xattr_reader.c | 2 +- lib/sqfs/xattr_writer.c | 4 +- lib/tar/internal.h | 2 +- lib/tar/skip.c | 2 +- lib/util/Makemodule.am | 4 +- lib/util/alloc.c | 2 +- lib/util/canonicalize_name.c | 2 +- lib/util/str_table.c | 4 +- mkfs/mkfs.h | 2 +- tar/sqfs2tar.c | 1 - tests/canonicalize_name.c | 2 +- tests/str_table.c | 2 +- tests/tar_fuzz.c | 2 +- tests/tar_gnu.c | 2 +- tests/tar_pax.c | 2 +- tests/tar_sparse_gnu.c | 2 +- tests/tar_sparse_gnu1.c | 2 +- tests/tar_sparse_gnu2.c | 2 +- tests/tar_ustar.c | 2 +- tests/tar_xattr_bsd.c | 2 +- tests/tar_xattr_schily.c | 2 +- unpack/rdsquashfs.h | 2 +- 54 files changed, 265 insertions(+), 267 deletions(-) delete mode 100644 include/compat.h delete mode 100644 include/str_table.h delete mode 100644 include/util.h create mode 100644 include/util/compat.h create mode 100644 include/util/str_table.h create mode 100644 include/util/util.h diff --git a/difftool/sqfsdiff.h b/difftool/sqfsdiff.h index 8cef23a..173b927 100644 --- a/difftool/sqfsdiff.h +++ b/difftool/sqfsdiff.h @@ -10,7 +10,7 @@ #include "config.h" #include "common.h" #include "fstree.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/include/common.h b/include/common.h index 369c21f..17d709e 100644 --- a/include/common.h +++ b/include/common.h @@ -25,9 +25,11 @@ #include "sqfs/xattr.h" #include "sqfs/dir.h" #include "sqfs/io.h" -#include "compat.h" + +#include "util/compat.h" +#include "util/util.h" + #include "fstree.h" -#include "util.h" #include "tar.h" #include diff --git a/include/compat.h b/include/compat.h deleted file mode 100644 index 74d0b6f..0000000 --- a/include/compat.h +++ /dev/null @@ -1,95 +0,0 @@ -/* SPDX-License-Identifier: LGPL-3.0-or-later */ -/* - * util.h - * - * Copyright (C) 2019 David Oberhollenzer - */ -#ifndef COMPAT_H -#define COMPAT_H - -#if defined(__APPLE__) -#include - -#define htole16(x) OSSwapHostToLittleInt16(x) -#define htole32(x) OSSwapHostToLittleInt32(x) -#define htole64(x) OSSwapHostToLittleInt64(x) - -#define le32toh(x) OSSwapLittleToHostInt32(x) -#define le16toh(x) OSSwapLittleToHostInt16(x) -#define le64toh(x) OSSwapLittleToHostInt64(x) -#elif defined(__OpenBSD__) -#include -#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) -#include - -#define le16toh(x) letoh16(x) -#define le32toh(x) letoh32(x) -#define le64toh(x) letoh64(x) -#elif defined(_WIN32) || defined(__WINDOWS__) -#define htole16(x) (x) -#define htole32(x) (x) -#define htole64(x) (x) - -#define le16toh(x) (x) -#define le32toh(x) (x) -#define le64toh(x) (x) -#else -#include -#endif - -#if defined(_WIN32) || defined(__WINDOWS__) -#define S_IFSOCK SQFS_INODE_MODE_SOCK -#define S_IFLNK SQFS_INODE_MODE_LNK -#define S_IFREG SQFS_INODE_MODE_REG -#define S_IFBLK SQFS_INODE_MODE_BLK -#define S_IFDIR SQFS_INODE_MODE_DIR -#define S_IFCHR SQFS_INODE_MODE_CHR -#define S_IFIFO SQFS_INODE_MODE_FIFO -#define S_IFMT SQFS_INODE_MODE_MASK - -#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) -#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) -#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) -#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) -#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) - -#define S_ISUID SQFS_INODE_SET_UID -#define S_ISGID SQFS_INODE_SET_GID -#define S_ISVTX SQFS_INODE_STICKY - -#define S_IRWXU SQFS_INODE_OWNER_MASK -#define S_IRUSR SQFS_INODE_OWNER_R -#define S_IWUSR SQFS_INODE_OWNER_W -#define S_IXUSR SQFS_INODE_OWNER_X - -#define S_IRWXG SQFS_INODE_GROUP_MASK -#define S_IRGRP SQFS_INODE_GROUP_R -#define S_IWGRP SQFS_INODE_GROUP_W -#define S_IXGRP SQFS_INODE_GROUP_X - -#define S_IRWXO SQFS_INODE_OTHERS_MASK -#define S_IROTH SQFS_INODE_OTHERS_R -#define S_IWOTH SQFS_INODE_OTHERS_W -#define S_IXOTH SQFS_INODE_OTHERS_X - -/* lifted from musl libc */ -#define major(x) \ - ((unsigned)( (((x)>>31>>1) & 0xfffff000) | (((x)>>8) & 0x00000fff) )) - -#define minor(x) \ - ((unsigned)( (((x)>>12) & 0xffffff00) | ((x) & 0x000000ff) )) - -#define makedev(x,y) ( \ - (((x)&0xfffff000ULL) << 32) | \ - (((x)&0x00000fffULL) << 8) | \ - (((y)&0xffffff00ULL) << 12) | \ - (((y)&0x000000ffULL)) ) -#else -#include -#include -#include -#endif - -#endif /* COMPAT_H */ diff --git a/include/fstree.h b/include/fstree.h index a63c593..5caac51 100644 --- a/include/fstree.h +++ b/include/fstree.h @@ -15,7 +15,7 @@ #include #include "sqfs/predef.h" -#include "compat.h" +#include "util/compat.h" typedef struct tree_node_t tree_node_t; typedef struct file_info_t file_info_t; diff --git a/include/str_table.h b/include/str_table.h deleted file mode 100644 index 60be1d1..0000000 --- a/include/str_table.h +++ /dev/null @@ -1,53 +0,0 @@ -/* SPDX-License-Identifier: LGPL-3.0-or-later */ -/* - * str_table.h - * - * Copyright (C) 2019 David Oberhollenzer - */ -#ifndef STR_TABLE_H -#define STR_TABLE_H - -#include "sqfs/predef.h" - -typedef struct str_bucket_t { - struct str_bucket_t *next; - char *str; - size_t index; - size_t refcount; -} str_bucket_t; - -/* Stores strings in a hash table and assigns an incremental, unique ID to - each string. Subsequent additions return the existing ID. The ID can be - used for (hopefully) constant time lookup of the original string. */ -typedef struct { - str_bucket_t **buckets; - size_t num_buckets; - - char **strings; - size_t num_strings; - size_t max_strings; -} str_table_t; - -/* `size` is the number of hash table buckets to use internally. */ -SQFS_INTERNAL int str_table_init(str_table_t *table, size_t size); - -SQFS_INTERNAL void str_table_cleanup(str_table_t *table); - -/* Resolve a string to an incremental, unique ID. */ -SQFS_INTERNAL -int str_table_get_index(str_table_t *table, const char *str, size_t *idx); - -/* Resolve a unique ID to the string it represents. - Returns NULL if the ID is unknown, i.e. out of bounds. */ -SQFS_INTERNAL -const char *str_table_get_string(str_table_t *table, size_t index); - -SQFS_INTERNAL void str_table_reset_ref_count(str_table_t *table); - -SQFS_INTERNAL void str_table_add_ref(str_table_t *table, size_t index); - -SQFS_INTERNAL void str_table_del_ref(str_table_t *table, size_t index); - -SQFS_INTERNAL size_t str_table_get_ref_count(str_table_t *table, size_t index); - -#endif /* STR_TABLE_H */ diff --git a/include/tar.h b/include/tar.h index f71757e..c5d48ef 100644 --- a/include/tar.h +++ b/include/tar.h @@ -8,7 +8,7 @@ #define TAR_H #include "config.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/include/util.h b/include/util.h deleted file mode 100644 index 881b59c..0000000 --- a/include/util.h +++ /dev/null @@ -1,67 +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" - -#if defined(__GNUC__) || defined(__clang__) -#define UI_ADD_OV __builtin_uadd_overflow -#define UL_ADD_OV __builtin_uaddl_overflow -#define ULL_ADD_OV __builtin_uaddll_overflow - -#define UI_MUL_OV __builtin_umul_overflow -#define UL_MUL_OV __builtin_umull_overflow -#define ULL_MUL_OV __builtin_umulll_overflow -#else -#error Sorry, I do not know how to trap integer overflows with this compiler -#endif - -#if SIZEOF_SIZE_T <= SIZEOF_INT -#define SZ_ADD_OV UI_ADD_OV -#define SZ_MUL_OV UI_MUL_OV -#elif SIZEOF_SIZE_T == SIZEOF_LONG -#define SZ_ADD_OV UL_ADD_OV -#define SZ_MUL_OV UL_MUL_OV -#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG -#define SZ_ADD_OV ULL_ADD_OV -#define SZ_MUL_OV ULL_MUL_OV -#else -#error Cannot determine maximum value of size_t -#endif - -/* - Helper for allocating data structures with flexible array members. - - 'base_size' is the size of the struct itself, 'item_size' the size of a - single array element and 'nmemb' the number of elements. - - Iternally checks for arithmetic overflows when allocating the combined thing. - */ -SQFS_INTERNAL -void *alloc_flex(size_t base_size, size_t item_size, size_t nmemb); - -/* Basically the same as calloc, but *ALWAYS* does overflow checking */ -SQFS_INTERNAL -void *alloc_array(size_t item_size, size_t nmemb); - -/* - Convert back to forward slashed, remove all preceeding and trailing slashes, - collapse all sequences of slashes, remove all path components that are '.' - and returns failure state if one of the path components is '..'. - - Returns 0 on success. -*/ -SQFS_INTERNAL int canonicalize_name(char *filename); - -#endif /* UTIL_H */ diff --git a/include/util/compat.h b/include/util/compat.h new file mode 100644 index 0000000..74d0b6f --- /dev/null +++ b/include/util/compat.h @@ -0,0 +1,95 @@ +/* SPDX-License-Identifier: LGPL-3.0-or-later */ +/* + * util.h + * + * Copyright (C) 2019 David Oberhollenzer + */ +#ifndef COMPAT_H +#define COMPAT_H + +#if defined(__APPLE__) +#include + +#define htole16(x) OSSwapHostToLittleInt16(x) +#define htole32(x) OSSwapHostToLittleInt32(x) +#define htole64(x) OSSwapHostToLittleInt64(x) + +#define le32toh(x) OSSwapLittleToHostInt32(x) +#define le16toh(x) OSSwapLittleToHostInt16(x) +#define le64toh(x) OSSwapLittleToHostInt64(x) +#elif defined(__OpenBSD__) +#include +#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) +#include + +#define le16toh(x) letoh16(x) +#define le32toh(x) letoh32(x) +#define le64toh(x) letoh64(x) +#elif defined(_WIN32) || defined(__WINDOWS__) +#define htole16(x) (x) +#define htole32(x) (x) +#define htole64(x) (x) + +#define le16toh(x) (x) +#define le32toh(x) (x) +#define le64toh(x) (x) +#else +#include +#endif + +#if defined(_WIN32) || defined(__WINDOWS__) +#define S_IFSOCK SQFS_INODE_MODE_SOCK +#define S_IFLNK SQFS_INODE_MODE_LNK +#define S_IFREG SQFS_INODE_MODE_REG +#define S_IFBLK SQFS_INODE_MODE_BLK +#define S_IFDIR SQFS_INODE_MODE_DIR +#define S_IFCHR SQFS_INODE_MODE_CHR +#define S_IFIFO SQFS_INODE_MODE_FIFO +#define S_IFMT SQFS_INODE_MODE_MASK + +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) + +#define S_ISUID SQFS_INODE_SET_UID +#define S_ISGID SQFS_INODE_SET_GID +#define S_ISVTX SQFS_INODE_STICKY + +#define S_IRWXU SQFS_INODE_OWNER_MASK +#define S_IRUSR SQFS_INODE_OWNER_R +#define S_IWUSR SQFS_INODE_OWNER_W +#define S_IXUSR SQFS_INODE_OWNER_X + +#define S_IRWXG SQFS_INODE_GROUP_MASK +#define S_IRGRP SQFS_INODE_GROUP_R +#define S_IWGRP SQFS_INODE_GROUP_W +#define S_IXGRP SQFS_INODE_GROUP_X + +#define S_IRWXO SQFS_INODE_OTHERS_MASK +#define S_IROTH SQFS_INODE_OTHERS_R +#define S_IWOTH SQFS_INODE_OTHERS_W +#define S_IXOTH SQFS_INODE_OTHERS_X + +/* lifted from musl libc */ +#define major(x) \ + ((unsigned)( (((x)>>31>>1) & 0xfffff000) | (((x)>>8) & 0x00000fff) )) + +#define minor(x) \ + ((unsigned)( (((x)>>12) & 0xffffff00) | ((x) & 0x000000ff) )) + +#define makedev(x,y) ( \ + (((x)&0xfffff000ULL) << 32) | \ + (((x)&0x00000fffULL) << 8) | \ + (((y)&0xffffff00ULL) << 12) | \ + (((y)&0x000000ffULL)) ) +#else +#include +#include +#include +#endif + +#endif /* COMPAT_H */ diff --git a/include/util/str_table.h b/include/util/str_table.h new file mode 100644 index 0000000..60be1d1 --- /dev/null +++ b/include/util/str_table.h @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: LGPL-3.0-or-later */ +/* + * str_table.h + * + * Copyright (C) 2019 David Oberhollenzer + */ +#ifndef STR_TABLE_H +#define STR_TABLE_H + +#include "sqfs/predef.h" + +typedef struct str_bucket_t { + struct str_bucket_t *next; + char *str; + size_t index; + size_t refcount; +} str_bucket_t; + +/* Stores strings in a hash table and assigns an incremental, unique ID to + each string. Subsequent additions return the existing ID. The ID can be + used for (hopefully) constant time lookup of the original string. */ +typedef struct { + str_bucket_t **buckets; + size_t num_buckets; + + char **strings; + size_t num_strings; + size_t max_strings; +} str_table_t; + +/* `size` is the number of hash table buckets to use internally. */ +SQFS_INTERNAL int str_table_init(str_table_t *table, size_t size); + +SQFS_INTERNAL void str_table_cleanup(str_table_t *table); + +/* Resolve a string to an incremental, unique ID. */ +SQFS_INTERNAL +int str_table_get_index(str_table_t *table, const char *str, size_t *idx); + +/* Resolve a unique ID to the string it represents. + Returns NULL if the ID is unknown, i.e. out of bounds. */ +SQFS_INTERNAL +const char *str_table_get_string(str_table_t *table, size_t index); + +SQFS_INTERNAL void str_table_reset_ref_count(str_table_t *table); + +SQFS_INTERNAL void str_table_add_ref(str_table_t *table, size_t index); + +SQFS_INTERNAL void str_table_del_ref(str_table_t *table, size_t index); + +SQFS_INTERNAL size_t str_table_get_ref_count(str_table_t *table, size_t index); + +#endif /* STR_TABLE_H */ diff --git a/include/util/util.h b/include/util/util.h new file mode 100644 index 0000000..881b59c --- /dev/null +++ b/include/util/util.h @@ -0,0 +1,67 @@ +/* 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" + +#if defined(__GNUC__) || defined(__clang__) +#define UI_ADD_OV __builtin_uadd_overflow +#define UL_ADD_OV __builtin_uaddl_overflow +#define ULL_ADD_OV __builtin_uaddll_overflow + +#define UI_MUL_OV __builtin_umul_overflow +#define UL_MUL_OV __builtin_umull_overflow +#define ULL_MUL_OV __builtin_umulll_overflow +#else +#error Sorry, I do not know how to trap integer overflows with this compiler +#endif + +#if SIZEOF_SIZE_T <= SIZEOF_INT +#define SZ_ADD_OV UI_ADD_OV +#define SZ_MUL_OV UI_MUL_OV +#elif SIZEOF_SIZE_T == SIZEOF_LONG +#define SZ_ADD_OV UL_ADD_OV +#define SZ_MUL_OV UL_MUL_OV +#elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG +#define SZ_ADD_OV ULL_ADD_OV +#define SZ_MUL_OV ULL_MUL_OV +#else +#error Cannot determine maximum value of size_t +#endif + +/* + Helper for allocating data structures with flexible array members. + + 'base_size' is the size of the struct itself, 'item_size' the size of a + single array element and 'nmemb' the number of elements. + + Iternally checks for arithmetic overflows when allocating the combined thing. + */ +SQFS_INTERNAL +void *alloc_flex(size_t base_size, size_t item_size, size_t nmemb); + +/* Basically the same as calloc, but *ALWAYS* does overflow checking */ +SQFS_INTERNAL +void *alloc_array(size_t item_size, size_t nmemb); + +/* + Convert back to forward slashed, remove all preceeding and trailing slashes, + collapse all sequences of slashes, remove all path components that are '.' + and returns failure state if one of the path components is '..'. + + Returns 0 on success. +*/ +SQFS_INTERNAL int canonicalize_name(char *filename); + +#endif /* UTIL_H */ diff --git a/lib/common/data_reader_dump.c b/lib/common/data_reader_dump.c index 91b3141..4053f73 100644 --- a/lib/common/data_reader_dump.c +++ b/lib/common/data_reader_dump.c @@ -5,7 +5,6 @@ * Copyright (C) 2019 David Oberhollenzer */ #include "common.h" -#include "util.h" #include #include diff --git a/lib/common/data_writer.c b/lib/common/data_writer.c index 36de154..c5beba8 100644 --- a/lib/common/data_writer.c +++ b/lib/common/data_writer.c @@ -5,7 +5,6 @@ * Copyright (C) 2019 David Oberhollenzer */ #include "common.h" -#include "util.h" static sqfs_u8 buffer[4096]; diff --git a/lib/fstree/fstree.c b/lib/fstree/fstree.c index c18ffba..a2d9eee 100644 --- a/lib/fstree/fstree.c +++ b/lib/fstree/fstree.c @@ -7,7 +7,7 @@ #include "config.h" #include "fstree.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/fstree/fstree_from_file.c b/lib/fstree/fstree_from_file.c index 59e3833..eee7d5a 100644 --- a/lib/fstree/fstree_from_file.c +++ b/lib/fstree/fstree_from_file.c @@ -7,7 +7,7 @@ #include "config.h" #include "fstree.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/fstree/gen_inode_table.c b/lib/fstree/gen_inode_table.c index 988fa79..d97c645 100644 --- a/lib/fstree/gen_inode_table.c +++ b/lib/fstree/gen_inode_table.c @@ -7,7 +7,7 @@ #include "config.h" #include "fstree.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/sqfs/comp/compressor.c b/lib/sqfs/comp/compressor.c index 902ce92..2e2e3a3 100644 --- a/lib/sqfs/comp/compressor.c +++ b/lib/sqfs/comp/compressor.c @@ -11,7 +11,6 @@ #include #include "internal.h" -#include "util.h" typedef sqfs_compressor_t *(*compressor_fun_t) (const sqfs_compressor_config_t *cfg); diff --git a/lib/sqfs/comp/internal.h b/lib/sqfs/comp/internal.h index 52b7fe3..875a194 100644 --- a/lib/sqfs/comp/internal.h +++ b/lib/sqfs/comp/internal.h @@ -14,7 +14,7 @@ #include "sqfs/error.h" #include "sqfs/block.h" #include "sqfs/io.h" -#include "util.h" +#include "util/util.h" SQFS_INTERNAL int sqfs_generic_write_options(sqfs_file_t *file, const void *data, diff --git a/lib/sqfs/data_reader.c b/lib/sqfs/data_reader.c index 6a0db35..b105096 100644 --- a/lib/sqfs/data_reader.c +++ b/lib/sqfs/data_reader.c @@ -14,7 +14,7 @@ #include "sqfs/table.h" #include "sqfs/inode.h" #include "sqfs/io.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/sqfs/data_writer/internal.h b/lib/sqfs/data_writer/internal.h index ea66290..9c64b6c 100644 --- a/lib/sqfs/data_writer/internal.h +++ b/lib/sqfs/data_writer/internal.h @@ -16,7 +16,7 @@ #include "sqfs/error.h" #include "sqfs/block.h" #include "sqfs/io.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/sqfs/dir_reader.c b/lib/sqfs/dir_reader.c index f8950d7..e1ff9bc 100644 --- a/lib/sqfs/dir_reader.c +++ b/lib/sqfs/dir_reader.c @@ -14,7 +14,7 @@ #include "sqfs/inode.h" #include "sqfs/error.h" #include "sqfs/dir.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/sqfs/dir_writer.c b/lib/sqfs/dir_writer.c index a4aebe6..5ce29b6 100644 --- a/lib/sqfs/dir_writer.c +++ b/lib/sqfs/dir_writer.c @@ -13,7 +13,7 @@ #include "sqfs/error.h" #include "sqfs/block.h" #include "sqfs/dir.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/sqfs/id_table.c b/lib/sqfs/id_table.c index a320eca..4080015 100644 --- a/lib/sqfs/id_table.c +++ b/lib/sqfs/id_table.c @@ -11,7 +11,7 @@ #include "sqfs/super.h" #include "sqfs/table.h" #include "sqfs/error.h" -#include "compat.h" +#include "util/compat.h" #include #include diff --git a/lib/sqfs/meta_reader.c b/lib/sqfs/meta_reader.c index 820e223..e8a17ad 100644 --- a/lib/sqfs/meta_reader.c +++ b/lib/sqfs/meta_reader.c @@ -12,7 +12,7 @@ #include "sqfs/error.h" #include "sqfs/block.h" #include "sqfs/io.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/sqfs/meta_writer.c b/lib/sqfs/meta_writer.c index 26e7618..5db4fe7 100644 --- a/lib/sqfs/meta_writer.c +++ b/lib/sqfs/meta_writer.c @@ -12,7 +12,7 @@ #include "sqfs/error.h" #include "sqfs/block.h" #include "sqfs/io.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/sqfs/read_inode.c b/lib/sqfs/read_inode.c index 7e59445..e47395a 100644 --- a/lib/sqfs/read_inode.c +++ b/lib/sqfs/read_inode.c @@ -12,7 +12,7 @@ #include "sqfs/super.h" #include "sqfs/inode.h" #include "sqfs/dir.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/sqfs/read_super.c b/lib/sqfs/read_super.c index 6ac2ac4..437ee07 100644 --- a/lib/sqfs/read_super.c +++ b/lib/sqfs/read_super.c @@ -10,7 +10,7 @@ #include "sqfs/super.h" #include "sqfs/error.h" #include "sqfs/io.h" -#include "util.h" +#include "util/util.h" #include diff --git a/lib/sqfs/read_table.c b/lib/sqfs/read_table.c index 096ac1a..747c8bc 100644 --- a/lib/sqfs/read_table.c +++ b/lib/sqfs/read_table.c @@ -12,7 +12,7 @@ #include "sqfs/table.h" #include "sqfs/block.h" #include "sqfs/io.h" -#include "util.h" +#include "util/util.h" #include diff --git a/lib/sqfs/read_tree.c b/lib/sqfs/read_tree.c index 3a43769..f9c2a4e 100644 --- a/lib/sqfs/read_tree.c +++ b/lib/sqfs/read_tree.c @@ -15,7 +15,7 @@ #include "sqfs/inode.h" #include "sqfs/error.h" #include "sqfs/dir.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/sqfs/readdir.c b/lib/sqfs/readdir.c index 8899475..d800cb7 100644 --- a/lib/sqfs/readdir.c +++ b/lib/sqfs/readdir.c @@ -10,7 +10,7 @@ #include "sqfs/meta_reader.h" #include "sqfs/error.h" #include "sqfs/dir.h" -#include "compat.h" +#include "util/compat.h" #include #include diff --git a/lib/sqfs/super.c b/lib/sqfs/super.c index 8e39b55..15b185d 100644 --- a/lib/sqfs/super.c +++ b/lib/sqfs/super.c @@ -10,7 +10,7 @@ #include "sqfs/super.h" #include "sqfs/error.h" #include "sqfs/io.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/sqfs/write_inode.c b/lib/sqfs/write_inode.c index 2e69b80..c78c852 100644 --- a/lib/sqfs/write_inode.c +++ b/lib/sqfs/write_inode.c @@ -11,7 +11,7 @@ #include "sqfs/error.h" #include "sqfs/inode.h" #include "sqfs/dir.h" -#include "compat.h" +#include "util/compat.h" static int write_block_sizes(sqfs_meta_writer_t *ir, const sqfs_inode_generic_t *n) diff --git a/lib/sqfs/write_table.c b/lib/sqfs/write_table.c index 1931b83..b8946a5 100644 --- a/lib/sqfs/write_table.c +++ b/lib/sqfs/write_table.c @@ -13,7 +13,7 @@ #include "sqfs/table.h" #include "sqfs/block.h" #include "sqfs/io.h" -#include "util.h" +#include "util/util.h" #include diff --git a/lib/sqfs/xattr_reader.c b/lib/sqfs/xattr_reader.c index d5b003b..250b4bd 100644 --- a/lib/sqfs/xattr_reader.c +++ b/lib/sqfs/xattr_reader.c @@ -14,7 +14,7 @@ #include "sqfs/error.h" #include "sqfs/block.h" #include "sqfs/io.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/lib/sqfs/xattr_writer.c b/lib/sqfs/xattr_writer.c index 22d4639..18ca657 100644 --- a/lib/sqfs/xattr_writer.c +++ b/lib/sqfs/xattr_writer.c @@ -15,8 +15,8 @@ #include "sqfs/block.h" #include "sqfs/io.h" -#include "str_table.h" -#include "util.h" +#include "util/str_table.h" +#include "util/util.h" #include #include diff --git a/lib/tar/internal.h b/lib/tar/internal.h index 435cb73..77393ed 100644 --- a/lib/tar/internal.h +++ b/lib/tar/internal.h @@ -9,7 +9,7 @@ #include "config.h" -#include "util.h" +#include "util/util.h" #include "tar.h" #include diff --git a/lib/tar/skip.c b/lib/tar/skip.c index 0ebe013..e5c9772 100644 --- a/lib/tar/skip.c +++ b/lib/tar/skip.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "util.h" +#include "util/util.h" #include "tar.h" #include diff --git a/lib/util/Makemodule.am b/lib/util/Makemodule.am index 77f6c05..d6d3928 100644 --- a/lib/util/Makemodule.am +++ b/lib/util/Makemodule.am @@ -1,5 +1,5 @@ -libutil_la_SOURCES = include/util.h include/compat.h -libutil_la_SOURCES += lib/util/str_table.c include/str_table.h +libutil_la_SOURCES = include/util/util.h include/util/compat.h +libutil_la_SOURCES += lib/util/str_table.c include/util/str_table.h libutil_la_SOURCES += lib/util/alloc.c lib/util/canonicalize_name.c libutil_la_CFLAGS = $(AM_CFLAGS) libutil_la_CPPFLAGS = $(AM_CPPFLAGS) diff --git a/lib/util/alloc.c b/lib/util/alloc.c index da99d01..526a4d5 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/canonicalize_name.c b/lib/util/canonicalize_name.c index 4abbbe9..33e1c0b 100644 --- a/lib/util/canonicalize_name.c +++ b/lib/util/canonicalize_name.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "util.h" +#include "util/util.h" static void normalize_slashes(char *filename) { diff --git a/lib/util/str_table.c b/lib/util/str_table.c index 3554544..78206e8 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/mkfs/mkfs.h b/mkfs/mkfs.h index 046a2a0..d89302c 100644 --- a/mkfs/mkfs.h +++ b/mkfs/mkfs.h @@ -11,7 +11,7 @@ #include "common.h" #include "fstree.h" -#include "util.h" +#include "util/util.h" #ifdef HAVE_SYS_XATTR_H #include diff --git a/tar/sqfs2tar.c b/tar/sqfs2tar.c index ec1deac..3e64b45 100644 --- a/tar/sqfs2tar.c +++ b/tar/sqfs2tar.c @@ -6,7 +6,6 @@ */ #include "config.h" #include "common.h" -#include "util.h" #include "tar.h" #include diff --git a/tests/canonicalize_name.c b/tests/canonicalize_name.c index 64ca766..cabf716 100644 --- a/tests/canonicalize_name.c +++ b/tests/canonicalize_name.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "util.h" +#include "util/util.h" #include #include diff --git a/tests/str_table.c b/tests/str_table.c index 8b30b35..e4ac7a8 100644 --- a/tests/str_table.c +++ b/tests/str_table.c @@ -12,7 +12,7 @@ #include #include -#include "str_table.h" +#include "util/str_table.h" #define STR(x) #x #define STRVALUE(x) STR(x) diff --git a/tests/tar_fuzz.c b/tests/tar_fuzz.c index 4dc20f5..aa82a50 100644 --- a/tests/tar_fuzz.c +++ b/tests/tar_fuzz.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "util.h" +#include "util/util.h" #include "tar.h" #include diff --git a/tests/tar_gnu.c b/tests/tar_gnu.c index 5aa112c..b58c9f7 100644 --- a/tests/tar_gnu.c +++ b/tests/tar_gnu.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "util.h" +#include "util/util.h" #include "tar.h" #include diff --git a/tests/tar_pax.c b/tests/tar_pax.c index 79301b6..f0fdef0 100644 --- a/tests/tar_pax.c +++ b/tests/tar_pax.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "util.h" +#include "util/util.h" #include "tar.h" #include diff --git a/tests/tar_sparse_gnu.c b/tests/tar_sparse_gnu.c index 7cd6132..3546571 100644 --- a/tests/tar_sparse_gnu.c +++ b/tests/tar_sparse_gnu.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "util.h" +#include "util/util.h" #include "tar.h" #include diff --git a/tests/tar_sparse_gnu1.c b/tests/tar_sparse_gnu1.c index 366b0f4..19106cd 100644 --- a/tests/tar_sparse_gnu1.c +++ b/tests/tar_sparse_gnu1.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "util.h" +#include "util/util.h" #include "tar.h" #include diff --git a/tests/tar_sparse_gnu2.c b/tests/tar_sparse_gnu2.c index cfc7eb3..2171850 100644 --- a/tests/tar_sparse_gnu2.c +++ b/tests/tar_sparse_gnu2.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "util.h" +#include "util/util.h" #include "tar.h" #include diff --git a/tests/tar_ustar.c b/tests/tar_ustar.c index 1a03784..20a0bd0 100644 --- a/tests/tar_ustar.c +++ b/tests/tar_ustar.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "util.h" +#include "util/util.h" #include "tar.h" #include diff --git a/tests/tar_xattr_bsd.c b/tests/tar_xattr_bsd.c index 50c0150..36d8ac1 100644 --- a/tests/tar_xattr_bsd.c +++ b/tests/tar_xattr_bsd.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "util.h" +#include "util/util.h" #include "tar.h" #include diff --git a/tests/tar_xattr_schily.c b/tests/tar_xattr_schily.c index 033941a..e543351 100644 --- a/tests/tar_xattr_schily.c +++ b/tests/tar_xattr_schily.c @@ -6,7 +6,7 @@ */ #include "config.h" -#include "util.h" +#include "util/util.h" #include "tar.h" #include diff --git a/unpack/rdsquashfs.h b/unpack/rdsquashfs.h index c2af24a..a36d283 100644 --- a/unpack/rdsquashfs.h +++ b/unpack/rdsquashfs.h @@ -10,7 +10,7 @@ #include "config.h" #include "common.h" #include "fstree.h" -#include "util.h" +#include "util/util.h" #ifdef HAVE_SYS_XATTR_H #include -- cgit v1.2.3