aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-07-02 19:50:05 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-07-10 09:22:04 +0200
commite7ecb1f92ae618a56ee8eabb6cbf98365de3695a (patch)
tree8d6d53df2c1654ecf5f4c587d8b7b2592a68c4f2 /include
parentec593e0b94656a5481f82ee0f33728ced297ac48 (diff)
Move sqfs_dir_entry_t code from libio into libsquashfs
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/fstree.h2
-rw-r--r--include/io/dir_iterator.h2
-rw-r--r--include/sqfs/dir_entry.h (renamed from include/io/dir_entry.h)26
-rw-r--r--include/sqfs/predef.h1
4 files changed, 18 insertions, 13 deletions
diff --git a/include/fstree.h b/include/fstree.h
index 0d60616..402d6a2 100644
--- a/include/fstree.h
+++ b/include/fstree.h
@@ -15,7 +15,7 @@
#include <stdio.h>
#include "sqfs/predef.h"
-#include "io/dir_entry.h"
+#include "sqfs/dir_entry.h"
#include "compat.h"
typedef struct fstree_defaults_t fstree_defaults_t;
diff --git a/include/io/dir_iterator.h b/include/io/dir_iterator.h
index 18c0e9a..1801123 100644
--- a/include/io/dir_iterator.h
+++ b/include/io/dir_iterator.h
@@ -7,7 +7,7 @@
#ifndef IO_DIR_ITERATOR_H
#define IO_DIR_ITERATOR_H
-#include "io/dir_entry.h"
+#include "sqfs/dir_entry.h"
#include "sqfs/predef.h"
/**
diff --git a/include/io/dir_entry.h b/include/sqfs/dir_entry.h
index 8ff8cf0..5f80bab 100644
--- a/include/io/dir_entry.h
+++ b/include/sqfs/dir_entry.h
@@ -1,26 +1,28 @@
-/* SPDX-License-Identifier: GPL-3.0-or-later */
+/* SPDX-License-Identifier: LGPL-3.0-or-later */
/*
* dir_entry.h
*
* Copyright (C) 2023 David Oberhollenzer <goliath@infraroot.at>
*/
-#ifndef IO_DIR_ENTRY_H
-#define IO_DIR_ENTRY_H
+#ifndef SQFS_DIR_ENTRY_H
+#define SQFS_DIR_ENTRY_H
#include "sqfs/predef.h"
typedef enum {
- DIR_ENTRY_FLAG_MOUNT_POINT = 0x0001,
+ SQFS_DIR_ENTRY_FLAG_MOUNT_POINT = 0x0001,
- DIR_ENTRY_FLAG_HARD_LINK = 0x0002,
-} DIR_ENTRY_FLAG;
+ SQFS_DIR_ENTRY_FLAG_HARD_LINK = 0x0002,
+
+ SQFS_DIR_ENTRY_FLAG_ALL = 0x0003,
+} SQFS_DIR_ENTRY_FLAG;
/**
* @struct sqfs_dir_entry_t
*
* @brief A directory entry returned by a @ref dir_iterator_t
*/
-typedef struct {
+struct sqfs_dir_entry_t {
/**
* @brief Total size of file entries
*/
@@ -71,7 +73,7 @@ typedef struct {
sqfs_u16 mode;
/**
- * @brief Combination of DIR_ENTRY_FLAG values
+ * @brief Combination of SQFS_DIR_ENTRY_FLAG values
*/
sqfs_u16 flags;
@@ -82,16 +84,18 @@ typedef struct {
* Windows with encoding-aware APIs, the name is converted to UTF-8.
*/
char name[];
-} sqfs_dir_entry_t;
+};
#ifdef __cplusplus
extern "C" {
#endif
-sqfs_dir_entry_t *dir_entry_create(const char *name);
+SQFS_API sqfs_dir_entry_t *sqfs_dir_entry_create(const char *name,
+ sqfs_u16 mode,
+ sqfs_u16 flags);
#ifdef __cplusplus
}
#endif
-#endif /* IO_DIR_ENTRY_H */
+#endif /* SQFS_DIR_ENTRY_H */
diff --git a/include/sqfs/predef.h b/include/sqfs/predef.h
index 989649a..12ed7c7 100644
--- a/include/sqfs/predef.h
+++ b/include/sqfs/predef.h
@@ -98,6 +98,7 @@ typedef struct sqfs_readdir_state_t sqfs_readdir_state_t;
typedef struct sqfs_xattr_t sqfs_xattr_t;
typedef struct sqfs_istream_t sqfs_istream_t;
typedef struct sqfs_ostream_t sqfs_ostream_t;
+typedef struct sqfs_dir_entry_t sqfs_dir_entry_t;
typedef struct sqfs_fragment_t sqfs_fragment_t;
typedef struct sqfs_dir_header_t sqfs_dir_header_t;