(...) lzma/xz hacks

Juergen Lock nox at FreeBSD.org
Mon Sep 13 15:51:42 PDT 2010


On 09/11/2010 20:25, I wrote:
> [...]
> And finally, I've generated liblzma bindings using bcd, adjusted them
> for D2,
>
> http://people.freebsd.org/~nox/tmp/d/lzma.d
>
> (sorry about the httpd treating .d as application/octet-stream) - and

Fixed now (the httpd.)

> then made a small threaded .xz compression hack to try out D2,
>
> http://people.freebsd.org/~nox/tmp/d/xzj.d
>
> This is very much a WIP but can already be used to compress
> files or stdin to another file or stdout (so it can be used in
> pipes and with tar's --use-compress-program), using all cores.
> Binaries at:
>
> http://people.freebsd.org/~nox/tmp/d/freebsd8/xzj
> http://people.freebsd.org/~nox/tmp/d/linux/xzj
>
> (both i386 of course) Run with -h for a small usage message
> and see the source for more info.
>
> Comments are welcome, also if anyone wants to test/port it to
> non-FreeBSD/Linux and/or check if the lzma bindings are OK...
> Also, should I submit the bindings somewhere? I checked the
> struct sizes and they matched:
>
> http://people.freebsd.org/~nox/tmp/d/lzmastructsizes-c.c
> http://people.freebsd.org/~nox/tmp/d/lzmastructsizes.d
>
> These are direct C bindings only tho i.e. I did not make a wrapper
> class like std.zlib...
>
> Ok so that's it for now, cheers,
> Juergen
>
> PS: I've meanwhile found another WIP threaded .xz compressor written
> in C, but it is specific to tarfiles (it even indexes them and can
> extract a single file quickly), and it uses a private branch(?)
> of liblzma:
>
> http://github.com/vasi/pixz
> http://github.com/vinzenz/liblzma

..and turns out pixz is not really using a private branch of liblzma
but just an old version of it (that still has lzma_index_init() taking
two args and that also still has lzma_index_record().)


More information about the Digitalmars-d mailing list