80__attribute__((deprecated(
81 "Since 1.5.0. Use sqsh_file_reader_advance2() instead."))) int
146sqsh_file_iterator_new(const struct
SqshFile *file,
int *err);
210 deprecated("Since 1.5.0. Use sqsh_file_iterator_skip2() instead.")))
212sqsh_file_iterator_skip(
214 size_t desired_size);
251 size_t desired_size);
303#define SQSH_INODE_NO_FRAGMENT 0xFFFFFFFF
307#define SQSH_INODE_NO_XATTR 0xFFFFFFFF
309__attribute__((deprecated(
310 "Since 1.5.0. libsqsh should never return this."))) static const
int
311 SQSH_FILE_TYPE_UNKNOWN = -1;
449__attribute__((deprecated(
"Since 1.5.0. Use sqsh_file_blockcount2() instead.")))
534 "instead."))) uint32_t
#define SQSH_NO_UNUSED
Warn if return value is unused.
size_t sqsh_index_t
typedef used for indexing
SqshFileType
enum that represents the file type.
@ SQSH_FILE_TYPE_DIRECTORY
An iterator over the contents of a file.
A reader over the contents of a file.
const uint8_t * sqsh_file_reader_data(const struct SqshFileReader *reader)
Gets a pointer to the current data in the file reader.
int sqsh_file_reader_advance2(struct SqshFileReader *reader, uint64_t offset, size_t size)
Advances the file reader by a certain amount of data and presents size bytes of data to the user.
size_t sqsh_file_reader_size(const struct SqshFileReader *reader)
Gets the size of the current data in the file reader.
int sqsh_file_reader_free(struct SqshFileReader *reader)
Cleans up resources used by a SqshFileReader struct.
struct SqshFileReader * sqsh_file_reader_new(const struct SqshFile *file, int *err)
Initializes a SqshFileReader struct.
int sqsh_file_reader_advance(struct SqshFileReader *reader, sqsh_index_t offset, size_t size)
Advances the file reader by a certain amount of data and presents size bytes of data to the user.
bool sqsh_file_is_extended(const struct SqshFile *context)
returns whether the file is an extended structure.
SQSH_NO_UNUSED struct SqshFile * sqsh_open_by_ref(struct SqshArchive *archive, uint64_t inode_ref, int *err)
Initializes a file context in heap.
uint32_t sqsh_file_modified_time(const struct SqshFile *context)
Getter for the file modification time in seconds since epoch.
uint64_t sqsh_file_size(const struct SqshFile *context)
Getter for the file size. 0 if the file has no size.
uint32_t sqsh_file_hard_link_count(const struct SqshFile *context)
Getter for the inode hard link count.
uint64_t sqsh_file_block_count2(const struct SqshFile *context)
Getter for the amount of blocks of the file content. This is only internally used and will be used wh...
uint64_t sqsh_file_blocks_start(const struct SqshFile *context)
Getter for the start block of the file content. This is only internally used and will be used while r...
uint64_t sqsh_file_inode_ref(const struct SqshFile *context)
returns the inode reference to this file.
uint32_t sqsh_file_uid(const struct SqshFile *context)
returns the owner user id of the file.
SQSH_NO_UNUSED struct SqshFile * sqsh_open(struct SqshArchive *archive, const char *path, int *err)
Initialize the file context from a path.
enum SqshFileType sqsh_file_type(const struct SqshFile *context)
returns the type of the file.
bool sqsh_file_has_fragment(const struct SqshFile *context)
returns true if the file has a fragment block.
uint32_t sqsh_file_inode(const struct SqshFile *context)
Getter for the inode number.
uint32_t sqsh_file_directory_block_offset(const struct SqshFile *context)
retrieve the directory block offset. This is only internally used and will be used while iterating ov...
uint32_t sqsh_file_directory_parent_inode(const struct SqshFile *context)
retrieve the parent inode of the directory.
bool sqsh_file_block_is_compressed(const struct SqshFile *context, uint32_t index)
Checks whether a certain block is compressed.
SQSH_NO_UNUSED char * sqsh_file_symlink_dup(const struct SqshFile *context)
creates a heap allocated copy of the target of a symbolic link.
uint32_t sqsh_file_fragment_block_offset(const struct SqshFile *context)
retrieve the fragment block offset. This is only internally used and will be used while retrieving th...
uint32_t sqsh_file_device_id(const struct SqshFile *context)
returns the device id of the device inode.
uint16_t sqsh_file_directory_block_offset2(const struct SqshFile *context)
retrieve the directory block offset. This is only internally used and will be used while iterating ov...
uint32_t sqsh_file_block_count(const struct SqshFile *context)
Getter for the amount of blocks of the file content. This is only internally used and will be used wh...
uint32_t sqsh_file_block_size(const struct SqshFile *context, uint32_t index)
Getter the size of a block of the file content. This is only internally used and will be used while r...
uint32_t sqsh_file_gid(const struct SqshFile *context)
returns the owner group id of the file.
int sqsh_file_symlink_resolve(struct SqshFile *context)
resolves the symlink target. After calling this function the file is in place changed to the target o...
uint16_t sqsh_file_permission(const struct SqshFile *context)
Getter for the permissions of the file.
const char * sqsh_file_symlink(const struct SqshFile *context)
returns the target of a symbolic link. Be aware that the returned value is not zero terminated.
uint32_t sqsh_file_directory_block_start(const struct SqshFile *context)
retrieve the directory block start. This is only internally used and will be used while iterating ove...
uint32_t sqsh_file_symlink_size(const struct SqshFile *context)
returns the length of the target of a symbolic link in bytes.
uint32_t sqsh_file_fragment_block_index(const struct SqshFile *context)
retrieve the fragment block index. This is only internally used
int sqsh_close(struct SqshFile *file)
cleans up an file context and frees the memory.
uint32_t sqsh_file_xattr_index(const struct SqshFile *context)
returns index of the extended attribute inside of the xattr table.
SQSH_NO_UNUSED struct SqshFile * sqsh_lopen(struct SqshArchive *archive, const char *path, int *err)
Initialize the file context from a path. This function is identical to sqsh_open() but if the path is...
int sqsh_file_symlink_resolve_all(struct SqshFile *context)
resolves all symlink target targets until a file is hit. This function is similar to sqsh_file_symlin...