1
0
Fork 0

Merging upstream version 1.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-17 19:16:11 +01:00
parent 89511a6202
commit 3c06b8f6c4
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
14 changed files with 74 additions and 73 deletions

View file

@ -1,12 +1,6 @@
2010-12-07 Antonio Diaz Diaz <ant_diaz@teleline.es>
2011-01-11 Antonio Diaz Diaz <ant_diaz@teleline.es>
* Version 1.1-rc2 released.
* main.c (open_instream): Do not show the message
" and `--stdout' was not specified" for directories, etc.
2010-08-08 Antonio Diaz Diaz <ant_diaz@teleline.es>
* Version 1.1-rc1 released.
* Version 1.1 released.
* Code has been converted to `C89 + long long' from C99.
* main.c: Fixed warning about fchown return value being ignored.
* decoder.c: `-tvvvv' now shows compression ratio.
@ -15,16 +9,18 @@
compress less but faster. (-1 now takes 43% less time for only
20% larger compressed size).
* encoder.c: Compression of option -9 has been slightly increased.
* main.c (open_instream): Do not show the message
" and `--stdout' was not specified" for directories, etc.
* New examples have been added to the manual.
2010-04-05 Antonio Diaz Diaz <ant_diaz@teleline.es>
* Version 1.0 released.
* Initial release.
* Translated to C from the C++ source for lzip 1.10.
* Translated to C from the C++ source of lzip 1.10.
Copyright (C) 2010 Antonio Diaz Diaz.
Copyright (C) 2010, 2011 Antonio Diaz Diaz.
This file is a collection of facts, and thus it is not copyrightable,
but just in case, you have unlimited permission to copy, distribute and

View file

@ -50,7 +50,7 @@ After running `configure', you can run `make' and `make install' as
explained above.
Copyright (C) 2010 Antonio Diaz Diaz.
Copyright (C) 2010, 2011 Antonio Diaz Diaz.
This file is free documentation: you have unlimited permission to copy,
distribute and modify it.

2
README
View file

@ -65,7 +65,7 @@ range encoding), Igor Pavlov (for putting all the above together in
LZMA), and Julian Seward (for bzip2's CLI and the idea of unzcrash).
Copyright (C) 2010 Antonio Diaz Diaz.
Copyright (C) 2010, 2011 Antonio Diaz Diaz.
This file is free documentation: you have unlimited permission to copy,
distribute and modify it.

View file

@ -1,5 +1,5 @@
/* Clzip - Data compressor based on the LZMA algorithm
Copyright (C) 2010 Antonio Diaz Diaz.
Copyright (C) 2010, 2011 Antonio Diaz Diaz.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -172,7 +172,7 @@ static const uint8_t magic_string[4] = { 'L', 'Z', 'I', 'P' };
typedef uint8_t File_header[6]; /* 0-3 magic bytes */
/* 4 version */
/* 5 coded_dict_size; */
/* 5 coded_dict_size */
enum { Fh_size = 6 };
static inline void Fh_set_magic( File_header data )

8
configure vendored
View file

@ -1,16 +1,14 @@
#! /bin/sh
# configure script for Clzip - Data compressor based on the LZMA algorithm
# Copyright (C) 2010 Antonio Diaz Diaz.
# Copyright (C) 2010, 2011 Antonio Diaz Diaz.
#
# This configure script is free software: you have unlimited permission
# to copy, distribute and modify it.
#
# Date of this version: 2010-12-07
args=
no_create=
pkgname=clzip
pkgversion=1.1-rc2
pkgversion=1.1
progname=clzip
srctrigger=clzip.h
@ -167,7 +165,7 @@ echo "LDFLAGS = ${LDFLAGS}"
rm -f Makefile
cat > Makefile << EOF
# Makefile for Clzip - Data compressor based on the LZMA algorithm
# Copyright (C) 2010 Antonio Diaz Diaz.
# Copyright (C) 2010, 2011 Antonio Diaz Diaz.
# This file was generated automatically by configure. Do not edit.
#
# This Makefile is free software: you have unlimited permission

View file

@ -1,5 +1,5 @@
/* Clzip - Data compressor based on the LZMA algorithm
Copyright (C) 2010 Antonio Diaz Diaz.
Copyright (C) 2010, 2011 Antonio Diaz Diaz.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,5 +1,5 @@
/* Clzip - Data compressor based on the LZMA algorithm
Copyright (C) 2010 Antonio Diaz Diaz.
Copyright (C) 2010, 2011 Antonio Diaz Diaz.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1.
.TH CLZIP "1" "December 2010" "Clzip 1.1-rc2" "User Commands"
.TH CLZIP "1" "January 2011" "Clzip 1.1" "User Commands"
.SH NAME
Clzip \- reduces the size of files
.SH SYNOPSIS
@ -31,7 +31,7 @@ overwrite existing output files
keep (don't delete) input files
.TP
\fB\-m\fR, \fB\-\-match\-length=\fR<n>
set match length limit in bytes [80]
set match length limit in bytes [36]
.TP
\fB\-o\fR, \fB\-\-output=\fR<file>
if reading stdin, place the output into <file>
@ -69,7 +69,7 @@ Report bugs to lzip\-bug@nongnu.org
.br
Clzip home page: http://www.nongnu.org/lzip/clzip.html
.SH COPYRIGHT
Copyright \(co 2010 Antonio Diaz Diaz.
Copyright \(co 2011 Antonio Diaz Diaz.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
.br
This is free software: you are free to change and redistribute it.

View file

@ -12,7 +12,7 @@ File: clzip.info, Node: Top, Next: Introduction, Up: (dir)
Clzip Manual
************
This manual is for Clzip (version 1.1-rc2, 7 December 2010).
This manual is for Clzip (version 1.1, 11 January 2011).
* Menu:
@ -25,7 +25,7 @@ This manual is for Clzip (version 1.1-rc2, 7 December 2010).
* Concept Index:: Index of concepts
Copyright (C) 2010 Antonio Diaz Diaz.
Copyright (C) 2010, 2011 Antonio Diaz Diaz.
This manual is free documentation: you have unlimited permission to
copy, distribute and modify it.
@ -73,8 +73,8 @@ multivolume compressed tar archives.
The amount of memory required for compression is about 5 MiB plus 1
or 2 times the dictionary size limit (1 if input file size is less than
dictionary size limit, else 2) plus 8 times the dictionary size really
used. For decompression it is a little more than the dictionary size
really used.
used. The amount of memory required for decompression is only a few tens
of KiB larger than the dictionary size really used.
Clzip will automatically use the smallest possible dictionary size
without exceeding the given limit. Keep in mind that the decompression
@ -477,12 +477,12 @@ Concept Index

Tag Table:
Node: Top226
Node: Introduction905
Node: Algorithm4439
Node: Invoking Clzip6963
Node: File Format11904
Node: Examples13860
Node: Problems15629
Node: Concept Index16155
Node: Introduction907
Node: Algorithm4484
Node: Invoking Clzip7008
Node: File Format11949
Node: Examples13905
Node: Problems15674
Node: Concept Index16200

End Tag Table

View file

@ -5,8 +5,8 @@
@finalout
@c %**end of header
@set UPDATED 7 December 2010
@set VERSION 1.1-rc2
@set UPDATED 11 January 2011
@set VERSION 1.1
@dircategory Data Compression
@direntry
@ -44,7 +44,7 @@ This manual is for Clzip (version @value{VERSION}, @value{UPDATED}).
@end menu
@sp 1
Copyright @copyright{} 2010 Antonio Diaz Diaz.
Copyright @copyright{} 2010, 2011 Antonio Diaz Diaz.
This manual is free documentation: you have unlimited permission
to copy, distribute and modify it.
@ -91,8 +91,8 @@ compressed tar archives.
The amount of memory required for compression is about 5 MiB plus 1 or 2
times the dictionary size limit (1 if input file size is less than
dictionary size limit, else 2) plus 8 times the dictionary size really
used. For decompression it is a little more than the dictionary size
really used.
used. The amount of memory required for decompression is only a few tens
of KiB larger than the dictionary size really used.
Clzip will automatically use the smallest possible dictionary size
without exceeding the given limit. Keep in mind that the decompression

View file

@ -1,5 +1,5 @@
/* Clzip - Data compressor based on the LZMA algorithm
Copyright (C) 2010 Antonio Diaz Diaz.
Copyright (C) 2010, 2011 Antonio Diaz Diaz.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View file

@ -1,5 +1,5 @@
/* Clzip - Data compressor based on the LZMA algorithm
Copyright (C) 2010 Antonio Diaz Diaz.
Copyright (C) 2010, 2011 Antonio Diaz Diaz.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

67
main.c
View file

@ -1,5 +1,5 @@
/* Clzip - Data compressor based on the LZMA algorithm
Copyright (C) 2010 Antonio Diaz Diaz.
Copyright (C) 2010, 2011 Antonio Diaz Diaz.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -74,7 +74,7 @@ long long int llabs( long long int number );
const char * const Program_name = "Clzip";
const char * const program_name = "clzip";
const char * const program_year = "2010";
const char * const program_year = "2011";
const char * invocation_name = 0;
#ifdef O_BINARY
@ -104,10 +104,15 @@ bool delete_output_on_interrupt = false;
/* assure at least a minimum size for buffer `buf' */
inline void * resize_buffer( void * buf, const int min_size )
static void * resize_buffer( void * buf, const int min_size )
{
if( buf ) buf = realloc( buf, min_size );
else buf = malloc( min_size );
if( !buf )
{
show_error( "Not enough memory.", 0, false );
cleanup_and_fail( 1 );
}
return buf;
}
@ -124,7 +129,7 @@ static void show_help()
printf( " -d, --decompress decompress\n" );
printf( " -f, --force overwrite existing output files\n" );
printf( " -k, --keep keep (don't delete) input files\n" );
printf( " -m, --match-length=<n> set match length limit in bytes [80]\n" );
printf( " -m, --match-length=<n> set match length limit in bytes [36]\n" );
printf( " -o, --output=<file> if reading stdin, place the output into <file>\n" );
printf( " -q, --quiet suppress all messages\n" );
printf( " -s, --dictionary-size=<n> set dictionary size limit in bytes [8MiB]\n" );
@ -237,20 +242,6 @@ static int get_dict_size( const char * const arg )
}
static int extension_index( const char * const name )
{
int i;
for( i = 0; known_extensions[i].from; ++i )
{
const char * const ext = known_extensions[i].from;
if( strlen( name ) > strlen( ext ) &&
strncmp( name + strlen( name ) - strlen( ext ), ext, strlen( ext ) ) == 0 )
return i;
}
return -1;
}
static int open_instream( const char * const name, struct stat * const in_statsp,
const enum Mode program_mode, const int eindex,
const bool force, const bool to_stdout )
@ -304,6 +295,20 @@ static void set_c_outname( const char * const name, const bool multifile )
}
static int extension_index( const char * const name )
{
int i;
for( i = 0; known_extensions[i].from; ++i )
{
const char * const ext = known_extensions[i].from;
if( strlen( name ) > strlen( ext ) &&
strncmp( name + strlen( name ) - strlen( ext ), ext, strlen( ext ) ) == 0 )
return i;
}
return -1;
}
static void set_d_outname( const char * const name, const int i )
{
if( i >= 0 )
@ -386,9 +391,10 @@ static void close_and_set_permissions( const struct stat * const in_statsp )
bool error = false;
if( in_statsp )
{
if( fchmod( outfd, in_statsp->st_mode ) != 0 ||
( fchown( outfd, in_statsp->st_uid, in_statsp->st_gid ) != 0 &&
errno != EPERM ) ) error = true;
if( ( fchown( outfd, in_statsp->st_uid, in_statsp->st_gid ) != 0 &&
errno != EPERM ) ||
fchmod( outfd, in_statsp->st_mode ) != 0 )
error = true;
/* fchown will in many cases return with EPERM, which can be safely ignored. */
}
if( close( outfd ) == 0 ) outfd = -1;
@ -634,7 +640,8 @@ void show_error( const char * const msg, const int errcode, const bool help )
fprintf( stderr, "\n" );
}
if( help && invocation_name && invocation_name[0] )
fprintf( stderr, "Try `%s --help' for more information.\n", invocation_name );
fprintf( stderr, "Try `%s --help' for more information.\n",
invocation_name );
}
}
@ -653,11 +660,11 @@ void internal_error( const char * const msg )
int readblock( const int fd, uint8_t * const buf, const int size )
{
int rest = size;
errno = 0;
while( rest > 0 )
while( true )
{
int n;
errno = 0;
if( rest <= 0 ) break;
n = read( fd, buf + size - rest, rest );
if( n > 0 ) rest -= n;
else if( n == 0 ) break;
@ -673,11 +680,11 @@ int readblock( const int fd, uint8_t * const buf, const int size )
int writeblock( const int fd, const uint8_t * const buf, const int size )
{
int rest = size;
errno = 0;
while( rest > 0 )
while( true )
{
int n;
errno = 0;
if( rest <= 0 ) break;
n = write( fd, buf + size - rest, rest );
if( n > 0 ) rest -= n;
else if( errno && errno != EINTR && errno != EAGAIN ) break;
@ -705,6 +712,10 @@ int main( const int argc, const char * const argv[] )
struct Lzma_options encoder_options = option_mapping[6]; /* default = "-6" */
long long member_size = LLONG_MAX;
long long volume_size = LLONG_MAX;
const char * input_filename = "";
const char * default_output_filename = "";
const char ** filenames = 0;
int num_filenames = 0;
int infd = -1;
enum Mode program_mode = m_compress;
int argind = 0;
@ -714,10 +725,6 @@ int main( const int argc, const char * const argv[] )
bool force = false;
bool keep_input_files = false;
bool to_stdout = false;
const char * input_filename = "";
const char * default_output_filename = "";
const char ** filenames = 0;
int num_filenames = 0;
struct Pretty_print pp;
const struct ap_Option options[] =

View file

@ -1,6 +1,6 @@
#! /bin/sh
# check script for Clzip - Data compressor based on the LZMA algorithm
# Copyright (C) 2010 Antonio Diaz Diaz.
# Copyright (C) 2010, 2011 Antonio Diaz Diaz.
#
# This script is free software: you have unlimited permission
# to copy, distribute and modify it.