[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lzip-bug] [lzlib] Help with Scheme bindings (for GNU Guix)
From: |
Antonio Diaz Diaz |
Subject: |
Re: [Lzip-bug] [lzlib] Help with Scheme bindings (for GNU Guix) |
Date: |
Tue, 23 Apr 2019 19:25:59 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 |
Pierre Neidhardt wrote:
3. In both functions, should we *compress_write everything first, then
*compress_read as much as we can? Or chain write-read calls like in
bbexample.c?
If you want it simple, you may even alternate write/read calls in a loop
without checking LZ_(de)compress_write_size. See this patch to bbexample.c:
--- bbexample.c~ 2019-01-02 12:51:19.000000000 +0100
+++ bbexample.c 2019-04-23 18:52:01.000000000 +0200
@@ -128,8 +128,6 @@
while( true )
{
int rd;
- if( LZ_compress_write_size( encoder ) > 0 )
- {
if( written < size )
{
const int wr = LZ_compress_write( encoder, data + written,
@@ -138,7 +136,6 @@
written += wr;
}
if( written >= size ) LZ_compress_finish( encoder );
- }
rd = LZ_compress_read( encoder, new_data + new_pos,
new_data_size - new_pos );
if( rd < 0 ) { error = true; break; }
@@ -187,8 +184,6 @@
while( true )
{
int rd;
- if( LZ_decompress_write_size( decoder ) > 0 )
- {
if( written < size )
{
const int wr = LZ_decompress_write( decoder, data + written,
@@ -197,7 +192,6 @@
written += wr;
}
if( written >= size ) LZ_decompress_finish( decoder );
- }
rd = LZ_decompress_read( decoder, new_data + new_pos,
new_data_size - new_pos );
if( rd < 0 ) { error = true; break; }
- [Lzip-bug] [lzlib] Help with Scheme bindings (for GNU Guix), Pierre Neidhardt, 2019/04/23
- Re: [Lzip-bug] [lzlib] Help with Scheme bindings (for GNU Guix), Antonio Diaz Diaz, 2019/04/23
- Re: [Lzip-bug] [lzlib] Help with Scheme bindings (for GNU Guix),
Antonio Diaz Diaz <=
- Re: [Lzip-bug] [lzlib] Help with Scheme bindings (for GNU Guix), Pierre Neidhardt, 2019/04/24
- Re: [Lzip-bug] [lzlib] Help with Scheme bindings (for GNU Guix), Antonio Diaz Diaz, 2019/04/24
- Re: [Lzip-bug] [lzlib] Help with Scheme bindings (for GNU Guix), Pierre Neidhardt, 2019/04/24
- Re: [Lzip-bug] [lzlib] Help with Scheme bindings (for GNU Guix), Antonio Diaz Diaz, 2019/04/24
- Re: [Lzip-bug] [lzlib] Help with Scheme bindings (for GNU Guix), Pierre Neidhardt, 2019/04/24
- Re: [Lzip-bug] [lzlib] Help with Scheme bindings (for GNU Guix), Antonio Diaz Diaz, 2019/04/24