[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'.
From: |
Pierre Neidhardt |
Subject: |
[bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'. |
Date: |
Sat, 25 May 2019 19:24:33 +0200 |
As an Lzip enthusiast, I have some questions ;)
I see you are using make-lzip-input-port/compressed in a subsequent
patch, but this does not map how it's done for gzip et al., the latter
being invoked via it's system command "gzip -c ...". Why did you decide
to do it differently for lzip?
Much of the code induced by make-lzip-input-port/compressed seems to
repeat the lzread! / lzwrite business, maybe there is a way to factor
some of it?
> +(define (lzwrite! encoder source source-offset source-count
> + target target-offset target-count)
> + "Write up to SOURCE-COUNT bytes from SOURCE to ENCODER, and read up to
> +TARGET-COUNT bytes into TARGET at TARGET-OFFSET. Return two values: the
> +number of bytes read from SOURCE, and the number of bytes written to TARGET."
> + (define read
> + (if (< 0 (lz-compress-write-size encoder))
> + (match (lz-compress-write encoder source source-offset source-count)
> + (0 (lz-compress-finish encoder) 0)
> + (n n))
> + 0))
> +
> + (let loop ()
> + (match (lz-compress-read encoder target target-offset target-count)
> + (0 (loop))
> + (written (values read written)))))
Why looping on 0? If there is no byte to read, wouldn't this loop indefinitely?
--
Pierre Neidhardt
https://ambrevar.xyz/
signature.asc
Description: PGP signature
- [bug#35880] [PATCH 5/7] self: Add dependency on lzlib., (continued)
- [bug#35880] [PATCH 5/7] self: Add dependency on lzlib., Ludovic Courtès, 2019/05/24
- [bug#35880] [PATCH 6/7] gnu: guix: Add dependency on lzlib., Ludovic Courtès, 2019/05/24
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for., Ludovic Courtès, 2019/05/24
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for., Pierre Neidhardt, 2019/05/25
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for., Ludovic Courtès, 2019/05/26
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for., Pierre Neidhardt, 2019/05/26
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for., Ludovic Courtès, 2019/05/26
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for., Pierre Neidhardt, 2019/05/27
- [bug#35880] [PATCH 7/7] lzlib: 'lzread!' never returns more than it was asked for., Ludovic Courtès, 2019/05/27
[bug#35880] [PATCH 4/7] publish: Add support for lzip., Ludovic Courtès, 2019/05/24
[bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'.,
Pierre Neidhardt <=
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Ludovic Courtès, 2019/05/26
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Ludovic Courtès, 2019/05/27
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Pierre Neidhardt, 2019/05/27
- bug#35880: [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Ludovic Courtès, 2019/05/27
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Pierre Neidhardt, 2019/05/27
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Ludovic Courtès, 2019/05/28
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Pierre Neidhardt, 2019/05/28
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Ludovic Courtès, 2019/05/28
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Pierre Neidhardt, 2019/05/29
- [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'., Ludovic Courtès, 2019/05/31