summaryrefslogtreecommitdiff
path: root/include/sqfs
AgeCommit message (Collapse)Author
2019-09-20Integrate the data reader into libsquashfsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-20Cleanup: split "dir.h" into "dir_reader.h" and "dir_writer.h"David Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-20Move data_reader_dump function out of data readerDavid Oberhollenzer
This commit adds two new functions for getting a file block by index, or a files fragment. The data_reader_dump function is rewritten in terms of those two functions and moved to a seperate file. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-20Add fstree like tree deserialization function to dir readerDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-19Add directory reader data structureDavid Oberhollenzer
This moves a lot of the stuff that is done manually in the tree deserializer to a generic helper in libsquashfs. Due to how the fstree is implemented, as a work around, the inode needs to be temporarily stored in the tree node, but some of the directory details could be removed. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-15Move condensed-sparse-file handling to libsquashfsDavid Oberhollenzer
Add another helper function for getting a blocks from a condensed sparse file, then rewrite the data writer to use that instead, using an sqfs_file_t pointer instead of direct file i/o. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-15Move sparse_map_t to libsquashfs headers, rename it to sqfs_sparse_map_tDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-15Replace file descriptor IO in data_writer with sqfs_file_tDavid Oberhollenzer
First, this commit moves the create-blocks-from-fd function over to libsquashfs and ports it to work on an sqfs_file_t instead. Second, the function in the data_writer that reads from a file descriptor is adjusted to use an sqfs_file_t instead. Finally, the tools that use it have to be adjusted accordingly. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-15Add an sqfs_file_t implementation for reading from STDINDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-15Add helper function to directory writer to create a basic inodeDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-13Make block process helper function internalDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-10Make the thread pool queue backlog user configurableDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-10API cleanup: eliminate boolean argumentsDavid Oberhollenzer
Replace them with flag fields which can be extended in the future without breaking the ABI. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-10Cleanup: mark arguments const where possibleDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-09Add doxygen annotations to all public headersDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-09Add xattr data structure declarations to predef headerDavid Oberhollenzer
Apparantly they were overlooked the last time. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-09Change license of libsquashfs.soDavid Oberhollenzer
This this commit, the code that is compiled and linked to produce libsquashfs.so (and *only* libsquashfs.so) is released under the terms and conditions of the GNU Lesser General Public license, allowing 3rd party programs to dynamically link against it and still being able to release their programs under a license of their choosing. The libutil library is also relicensed, because it is statically linked into libsquashfs.so. This does not affect the command line programs that remain under the GPLv3. At the current time, the two libraries do not contain any 3rd party contributions and thus do not require anybodys consent other than mine to change the licensing terms (unlike e.g. libfstree.a). The libfstree.a and libsqfshelper.a utility libraries will also remain under the GPLv3 license. Going forward, some parts of libsqfshelper.a will be moved to libsquashfs.so. The parts absorbed by libsquashfs.so will then also have their licensing conditions changed *at that time*. For the public headers, this commit adds the full boiler-plate comment about the license, for the source files and internal headers, only the SPDX identifier is changed. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-09Remove ad-hoc image size accountingDavid Oberhollenzer
Much simpler to just set the correct size in the end, before writing the super block. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-08Replace direct file I/O with abstraction layerDavid Oberhollenzer
This should make it easier to use libsquashfs with custom setups that embedd a squashfs image inside something else. Also, it should make it easier to port to non unix-like platforms. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-07Remove printing to stderr in libsquashfs with returning error numbersDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-07Move meta reader/writer functions to respective headersDavid Oberhollenzer
The dir.h and inode.h headers contained meta data reader/writer related functions. This commit moves them to the propper headers. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-07Move data structure forward declarations to predef headerDavid Oberhollenzer
This in turn allows for removing most of the header inclusions within the public headers. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-07Remove config.h inclusions from public headersDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-05Cleanup: move inclusion of type headers to predef.hDavid Oberhollenzer
Instead of including stddef/stdint/stdbool etc... all over the place, move it to predef.h which is included from all other headers. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-05Fix API visibility for libsquashfs.soDavid Oberhollenzer
This commit adds a "predef.h" header to libsquashfs that exposes two macros, SQFS_API and SQFS_INTERNAL that are used to explicilty set the visibiliy of stuff that ends up in libsquashfs to default or hidden. For compatibillity with Windows which may at some point eventually be considered, the SQFS_API define is set to dllexport IF the cpp symbol SQFS_BUILDING_DLL is defined and set to import otherwise. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-05Cleanup naming scheme of compressorDavid Oberhollenzer
Add sqfs_* prefix to compressor, move implementation prefix up front. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-05Cleanup: add SQFS_*/sqfs_* prefix to block processorDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-05Cleanup: add sqfs_* prefix to id tableDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-05Cleanup: add sqfs_* prefix to meta readerDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-05Cleanup: add sqfs_* prefix to meta writerDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-05Cleanup: unify sqfs/SQFS name prefix for xattr readerDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-05Cleanup: move "create_block" from block processor over to data writerDavid Oberhollenzer
It only has one user and is quite specialized actually. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-04Store number of file blocks in generic inode structDavid Oberhollenzer
This simplifies things a little bit. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-04Split fstree inode serialization, move independend part to libsquashfs.soDavid Oberhollenzer
This commit adds a function to libsquashfs.so for writing generic inodes to a meta writer and another function to libsqfshelper.a that turns a tree node to an inode. That way, the tree serialization code can be expressed in terms of those functions and a bulk of the independend code can be moved over to libsquashfs.so Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-04Add fstree independend directory writer to libsquashfs.soDavid Oberhollenzer
This commit adds a directory writer to libsquashfs that wrapps a meta data writer and provides a higher-level interface for writing directory entries. Under the hood it enforces the rules that squashfs insists upon. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-02Move fstree independend parts of xattr_reader to libsquashfs.soDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-01Internalize the layout of the id_table_t structureDavid Oberhollenzer
As an opaque struct it has a chance to change its layout in the future without breaking ABI compatibiliy. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-01Move command line processing stuff out of compressor codeDavid Oberhollenzer
This commit moves stuff like printing help text, command line option processing and enumerating available processors on stdout out of the generic compressor code. The option string is replaced with a structure that directly exposese the tweakable parameters for all compressors. A function for parsing the command line arguments into this structure is added in sqfshelper. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-01Add C++ gurads to publicly exported functionsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-01API cleanup: Shuffle declarations aroundDavid Oberhollenzer
Move declarations for stuff that is defined in libsquashfs.so into the public headers and declarations for stuff that isn't, out of there. Also move the meta reader/writer helper functions to their respective headers. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-01Break up squashfs.h into topic related headersDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-09-01Install libsquashfs.so headers on the system in "sqfs" subdirectoryDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>