libsquashfs 1.3.0
A new set of tools and libraries for working with SquashFS images
|
Abstracts file I/O to make it easy to embedd SquashFS. More...
#include <io.h>
Data Fields | |
sqfs_object_t | base |
int(* | read_at )(sqfs_file_t *file, sqfs_u64 offset, void *buffer, size_t size) |
Read a chunk of data from an absolute position. | |
int(* | write_at )(sqfs_file_t *file, sqfs_u64 offset, const void *buffer, size_t size) |
Write a chunk of data at an absolute position. | |
sqfs_u64(* | get_size )(const sqfs_file_t *file) |
Get the number of bytes currently stored in the file. | |
int(* | truncate )(sqfs_file_t *file, sqfs_u64 size) |
Extend or shrink a file to a specified size. | |
Data Fields inherited from sqfs_object_t | |
void(* | destroy )(struct sqfs_object_t *instance) |
struct sqfs_object_t *(* | copy )(const struct sqfs_object_t *orig) |
Additional Inherited Members | |
Static Public Member Functions inherited from sqfs_object_t | |
static SQFS_INLINE void | sqfs_destroy (void *obj) |
Destroy an object and free all its memory. | |
static SQFS_INLINE void * | sqfs_copy (const void *obj) |
Create a deep copy of an object if possible. | |
Abstracts file I/O to make it easy to embedd SquashFS.
Files are only copyable if they are read only, i.e. if a file has been opened with write access, sqfs_copy will always return NULL. The other data types inside libsquashfs assume this to hold for all implementations of this interface.
sqfs_object_t base |
sqfs_u64(* get_size) (const sqfs_file_t *file) |
int(* read_at) (sqfs_file_t *file, sqfs_u64 offset, void *buffer, size_t size) |
Read a chunk of data from an absolute position.
file | A pointer to the file object. |
offset | An absolute offset to read data from. |
buffer | A pointer to a buffer to copy the data to. |
size | The number of bytes to read from the file. |
int(* truncate) (sqfs_file_t *file, sqfs_u64 size) |
Extend or shrink a file to a specified size.
file | A pointer to the file object. |
size | The new capacity of the file in bytes. |
int(* write_at) (sqfs_file_t *file, sqfs_u64 offset, const void *buffer, size_t size) |
Write a chunk of data at an absolute position.
file | A pointer to the file object. |
offset | An absolute offset to write data to. |
buffer | A pointer to a buffer to write to the file. |
size | The number of bytes to write from the buffer. |