summaryrefslogtreecommitdiff
path: root/include/sqfs/data.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-01 15:53:44 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-01 15:53:44 +0200
commita901d77efe116938bdaf5c0fc6075141ebb2bafc (patch)
treea6f97a891410c4159c80eafeb23b7d34c92f970f /include/sqfs/data.h
parent9533dc84d7addf792db4f4702b6fc7d7ddd20e78 (diff)
Break up squashfs.h into topic related headers
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/sqfs/data.h')
-rw-r--r--include/sqfs/data.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/sqfs/data.h b/include/sqfs/data.h
new file mode 100644
index 0000000..1b70f45
--- /dev/null
+++ b/include/sqfs/data.h
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-3.0-or-later */
+/*
+ * data.h
+ *
+ * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
+ */
+#ifndef SQFS_DATA_H
+#define SQFS_DATA_H
+
+#include "config.h"
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stddef.h>
+
+#define SQFS_META_BLOCK_SIZE 8192
+
+#define SQFS_IS_BLOCK_COMPRESSED(size) (((size) & (1 << 24)) == 0)
+#define SQFS_ON_DISK_BLOCK_SIZE(size) ((size) & ((1 << 24) - 1))
+#define SQFS_IS_SPARSE_BLOCK(size) (SQFS_ON_DISK_BLOCK_SIZE(size) == 0)
+
+typedef struct {
+ uint64_t start_offset;
+ uint32_t size;
+ uint32_t pad0;
+} sqfs_fragment_t;
+
+#endif /* SQFS_DATA_H */