libsquashfs 1.3.0
A new set of tools and libraries for working with SquashFS images
|
Abstracts reading, writing and management of the fragment table. More...
#include <frag_table.h>
Public Member Functions | |
SQFS_API sqfs_frag_table_t * | sqfs_frag_table_create (sqfs_u32 flags) |
Create a fragment table. | |
SQFS_API int | sqfs_frag_table_read (sqfs_frag_table_t *tbl, sqfs_file_t *file, const sqfs_super_t *super, sqfs_compressor_t *cmp) |
Load a fragment table from a SquashFS image. | |
SQFS_API int | sqfs_frag_table_write (sqfs_frag_table_t *tbl, sqfs_file_t *file, sqfs_super_t *super, sqfs_compressor_t *cmp) |
Write a fragment table to a SquashFS image. | |
SQFS_API int | sqfs_frag_table_lookup (sqfs_frag_table_t *tbl, sqfs_u32 index, sqfs_fragment_t *out) |
Resolve a fragment block index to its description. | |
SQFS_API int | sqfs_frag_table_append (sqfs_frag_table_t *tbl, sqfs_u64 location, sqfs_u32 size, sqfs_u32 *index) |
Append a table entry to a fragment table. | |
SQFS_API int | sqfs_frag_table_set (sqfs_frag_table_t *tbl, sqfs_u32 index, sqfs_u64 location, sqfs_u32 size) |
Modify an existing entry in a fragment table. | |
SQFS_API size_t | sqfs_frag_table_get_size (sqfs_frag_table_t *tbl) |
Get the number of entries stored in a fragment table. | |
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. | |
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) |
Abstracts reading, writing and management of the fragment table.
SQFS_API int sqfs_frag_table_append | ( | sqfs_frag_table_t * | tbl, |
sqfs_u64 | location, | ||
sqfs_u32 | size, | ||
sqfs_u32 * | index | ||
) |
Append a table entry to a fragment table.
tbl | A pointer to the fragmen table object. |
location | The absolute on-disk location of the new fragment block. |
out | The size of the block. Has bit 24 set if compressed. |
index | If not NULL, returns the allocated table index. |
SQFS_API sqfs_frag_table_t * sqfs_frag_table_create | ( | sqfs_u32 | flags | ) |
Create a fragment table.
flags | Currently must be set to 0, otherwise this function fails. |
SQFS_API size_t sqfs_frag_table_get_size | ( | sqfs_frag_table_t * | tbl | ) |
Get the number of entries stored in a fragment table.
tbl | A pointer to the fragmen table object. |
SQFS_API int sqfs_frag_table_lookup | ( | sqfs_frag_table_t * | tbl, |
sqfs_u32 | index, | ||
sqfs_fragment_t * | out | ||
) |
Resolve a fragment block index to its description.
tbl | A pointer to the fragmen table object. |
index | The index into the table. |
out | Returns the data from the table on success. |
SQFS_API int sqfs_frag_table_read | ( | sqfs_frag_table_t * | tbl, |
sqfs_file_t * | file, | ||
const sqfs_super_t * | super, | ||
sqfs_compressor_t * | cmp | ||
) |
Load a fragment table from a SquashFS image.
tbl | The fragment table object to load into. |
file | The file to load the table from. |
super | The super block that describes the location and size of the table. |
cmp | The compressor to use for uncompressing the table. |
SQFS_API int sqfs_frag_table_set | ( | sqfs_frag_table_t * | tbl, |
sqfs_u32 | index, | ||
sqfs_u64 | location, | ||
sqfs_u32 | size | ||
) |
Modify an existing entry in a fragment table.
tbl | A pointer to the fragmen table object. |
index | The fragment table index. |
location | The absolute on-disk location of the fragment block. |
out | The size of the block. Has bit 24 set if compressed. |
SQFS_API int sqfs_frag_table_write | ( | sqfs_frag_table_t * | tbl, |
sqfs_file_t * | file, | ||
sqfs_super_t * | super, | ||
sqfs_compressor_t * | cmp | ||
) |
Write a fragment table to a SquashFS image.
The data from the table is compressed and appended to the given file. The information about the tables size and location are stored in the given super block. Super block flags are updated as well.
tbl | The fragment table object to store on disk. |
file | The file to append the table to. |
super | The super block that should be updated with the location and size of the table. |
cmp | The compressor to use for compressing the table. |