Age | Commit message (Collapse) | Author |
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Report an error number from the implementations, change the users to
forward that error number (which also means libtar write header/link
now returns an error code) and all subsequent binaries to use
sqfs_perror() instead of relying on the function to print an error
internally.
Also, make sure to preserve errno/GetLastError() in the implementations
and print out a stringified error in sqfs_perror() if the error code
indicates an I/O error.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Having a function to interpret the flags and open a native file handle
simplifies the istream/ostream/file code which shares that decoding
part, particularly on windows where the character set needs to be
transformed.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
For now, only the interfaces and helper functions are moved, the
concrete implementations remain in libio.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
istream_t becomes sqfs_istream_t and ostream_t becomes sqfs_ostream_t
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Instead of "open sparse", make that the default and turn it into
a "no sparse" flag.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Instead of a separate append-sparse function, simply accept NULL
as an input for append. For both Unix and Win32, a fallback needs
to be implemented. For XFRM, we can just memset the input buffer
to zero, same for the libsquashfs data writer.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
For the backends, this simplifies the code as both paths (open file
and open stdio) use the same basic code. Even when merging them only
in the backend, it would be done in a similar way. Making the
functions public allows other uses as well.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Since the user has to call istream_get_buffered_data afterwards anyway,
we can do the precache lazily.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
This properly maps to all of our use cases and makes istream_precache
obsolete.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Instead, go through helper functions, which in a next step can be
moved inside the implementation.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The structure and functions are renamed to sqfs_xattr_* instead,
an additional helper is added to accept an encoded xattr.
Documentation and unit test are added as well.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Instead, make the buffer const, let the user adjust the pointer and
size. The offset can then be inferred in precache.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
It touches internals of the istream, particularly the buffer, but
not of the ostream. It really belongs to istream_t.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The end goal is to remove direct buffer access from the istream_t
interfaces and make that opaque. For the tar implementation, this
already safes us needless buffer copying, as we essentially allow
the user to read-through from the underlying stream.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
In several places, there are ad-hoc istream_t implementations that
read from a memory buffer to test something else stacked on top.
This commit consolidates those ad-hoc implmentations into a proper
one in libio, and uses the chance to remove external files for some
older tests that rely on file I/O instead.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The existing istream_t wrapper is mered into this one as well, we
can open the files via the iterators open_file_ro function. Unit
tests and tar2sqfs are modified accordingly.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Again, with a dummy implementation for Unix and Windows backends.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
For the native versions, this is currently dummied out, always returning
an error number. The idea is to laster wrap the libtar interface around
a directory iterator, here we need that method to support the existing
use case in tar2sqfs.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
For regular iterator types, it's a no-op, for the tree iterator,
it skips the sub tree.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
By cobbling together the xattr lines manually in libtar, the
need (and thus the function itself) are removed.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Move it to a separate libxfrm library, where it can be independently
tested as well. The bulk of the new code is also mainly test cases
for the compressors.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|