<feed xmlns='http://www.w3.org/2005/Atom'>
<title>squashfs-tools-ng.git/lib/compat, branch fixes-1.1.0</title>
<subtitle>A new set of tools and libraries for working with SquashFS images</subtitle>
<id>https://git.infraroot.at/squashfs-tools-ng.git/atom?h=fixes-1.1.0</id>
<link rel='self' href='https://git.infraroot.at/squashfs-tools-ng.git/atom?h=fixes-1.1.0'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/'/>
<updated>2022-03-10T20:53:29+00:00</updated>
<entry>
<title>Windows: redirect standard I/O and convert text to UTF-16</title>
<updated>2022-03-10T20:53:29+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2022-03-10T20:22:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=6447b191eef8bf8f4942569e55c9a0f297c67a8e'/>
<id>urn:sha1:6447b191eef8bf8f4942569e55c9a0f297c67a8e</id>
<content type='text'>
Preprocessor magic is used to redirect putc/fputc/fputs/printf/fprintf
to custom implementations.

The custom implementations try to figure out if we are printing to the
console and, if so, convert the resulting strings to UTF-16 and print
them through ConsoleWriteW. If the output is redirected to a file or
a pipe, the original (presummed) UTF-8 is kept.

Simply setting the console output codepage to UTF-8 does not work,
because the standard I/O facilities of MSVCRT either does not support
unicode (in non-wchar mode), or has half-broken support through fputs,
which can still break up multi-byte sequences through its internal
buffering.

Likewise, changing the codepage and using ConsoleWriteA, or trying to
use fputws did not work in a test VM either.

This approach is the one that worked most consistently among the
ones tried, but also has problems. E.g. it breaks when setting the
codepage to UTF-8 manually (using `chcp 65001`).

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix Windows main wrapper after mingw upgrade</title>
<updated>2021-12-14T19:54:40+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-12-14T19:44:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=8e1a2644968ce048feecd7f480ed4cce7dec7f6b'/>
<id>urn:sha1:8e1a2644968ce048feecd7f480ed4cce7dec7f6b</id>
<content type='text'>
Apparently, mingw implicitly included stdlib.h indirectly from either
windows.h or shellapi.h. After an upgrade, the windows build now
fails with EXIT_FAILURE being undefined.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Add a wrapper for the main function on Windows</title>
<updated>2021-12-05T09:29:32+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-11-26T12:53:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=4a4dbe027a082e546512b5ccb2999753651a9a28'/>
<id>urn:sha1:4a4dbe027a082e546512b5ccb2999753651a9a28</id>
<content type='text'>
A macro and forward declaration are added to compat.h that rename
the main() function programs using compat.h into sqfs_tools_main.

An actual main() function is added to libcompat.a, that uses the
shell API to get the UTF-16 command line arguments, convert them
to UTF-8 and call sqfs_tools_main.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Provide Musl derived fallbacks for getopt/getopt_long/getsubopt</title>
<updated>2021-03-24T22:35:30+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-24T15:21:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=cad65de2a9a9b7d29b98f0d2997772c057f92e29'/>
<id>urn:sha1:cad65de2a9a9b7d29b98f0d2997772c057f92e29</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix: libcompat: add missing stdio includes</title>
<updated>2021-03-20T16:46:14+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-20T16:37:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=b575a98826184fc34750ef2cce4fa1503938b7f2'/>
<id>urn:sha1:b575a98826184fc34750ef2cce4fa1503938b7f2</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Add libcompat fallback implementation for fnmatch</title>
<updated>2021-03-20T16:46:14+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2021-03-20T16:35:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=e678bd4b4289e536e998057bf9a9cf415f21b74c'/>
<id>urn:sha1:e678bd4b4289e536e998057bf9a9cf415f21b74c</id>
<content type='text'>
This has basically been copied over from Musl and slightly modifed.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Replace file/getline usage with istream</title>
<updated>2020-09-29T16:19:53+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2020-09-25T19:06:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=4b4cee0c0c99f531a45157fd27f5441e511db109'/>
<id>urn:sha1:4b4cee0c0c99f531a45157fd27f5441e511db109</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Add stream I/O abstraction library</title>
<updated>2020-09-16T07:34:35+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2020-09-04T16:26:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=1e255d0f6c472bb3c710aea1ea8dc5d27c0fba4a'/>
<id>urn:sha1:1e255d0f6c472bb3c710aea1ea8dc5d27c0fba4a</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: remove what is left of libutil</title>
<updated>2019-11-25T12:28:28+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-11-25T12:28:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=94b547d27f953fefa0ed080611eb916f58702e87'/>
<id>urn:sha1:94b547d27f953fefa0ed080611eb916f58702e87</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: move overflow safe alloc code into libsquashfs</title>
<updated>2019-11-25T12:20:08+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-11-25T12:13:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=fc9a644002dc501a5c224e5cc1a7dfba3ca2d1d8'/>
<id>urn:sha1:fc9a644002dc501a5c224e5cc1a7dfba3ca2d1d8</id>
<content type='text'>
There were only a hand full of instances outside libsquashfs that used
the alloc code. In most cases, the thing allocated hat its size derived
from something already in memory anyway, so it is safe to assume its
size fits into a size_t.

At the same time, the opencoded Windows path conversion functions are
all unified into a single helper function.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
</feed>
