summaryrefslogtreecommitdiffstats
path: root/dec_stream.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dec_stream.cc')
-rw-r--r--dec_stream.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/dec_stream.cc b/dec_stream.cc
index b75e49d..6ea4ed7 100644
--- a/dec_stream.cc
+++ b/dec_stream.cc
@@ -1,6 +1,6 @@
/* Plzip - Massively parallel implementation of lzip
Copyright (C) 2009 Laszlo Ersek.
- Copyright (C) 2009-2022 Antonio Diaz Diaz.
+ Copyright (C) 2009-2024 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
@@ -443,10 +443,10 @@ fail:
( size <= 0 ) ? "File ends unexpectedly at member header." :
"Input file is too short." ); goto fail; }
const Lzip_header & header = *(const Lzip_header *)buffer;
- if( !header.verify_magic() )
+ if( !header.check_magic() )
{ if( shared_retval.set_value( 2 ) )
{ show_file_error( pp.name(), bad_magic_msg ); } goto fail; }
- if( !header.verify_version() )
+ if( !header.check_version() )
{ if( shared_retval.set_value( 2 ) )
{ pp( bad_version( header.version() ) ); } goto fail; }
tmp.dictionary_size = header.dictionary_size();
@@ -474,10 +474,10 @@ fail:
*(const Lzip_trailer *)(buffer + newpos - tsize);
const unsigned long long member_size = trailer.member_size();
if( partial_member_size + newpos - pos == member_size &&
- trailer.verify_consistency() )
+ trailer.check_consistency() )
{ // header found
const Lzip_header & header = *(const Lzip_header *)(buffer + newpos);
- if( !header.verify_version() )
+ if( !header.check_version() )
{ if( shared_retval.set_value( 2 ) )
{ pp( bad_version( header.version() ) ); } goto fail; }
const unsigned dictionary_size = header.dictionary_size();
@@ -565,11 +565,10 @@ void muxer( Packet_courier & courier, const Pretty_print & pp,
/* Init the courier, then start the splitter and the workers and, if not
testing, call the muxer.
*/
-int dec_stream( const unsigned long long cfile_size,
- const int num_workers, const int infd, const int outfd,
+int dec_stream( const unsigned long long cfile_size, const int num_workers,
+ const int infd, const int outfd, const Cl_options & cl_opts,
const Pretty_print & pp, const int debug_level,
- const int in_slots, const int out_slots,
- const bool ignore_trailing, const bool loose_trailing )
+ const int in_slots, const int out_slots )
{
const int total_in_slots = ( INT_MAX / num_workers >= in_slots ) ?
num_workers * in_slots : INT_MAX;
@@ -596,8 +595,8 @@ int dec_stream( const unsigned long long cfile_size,
splitter_arg.worker_arg.pp = &pp;
splitter_arg.worker_arg.shared_retval = &shared_retval;
splitter_arg.worker_arg.worker_id = 0;
- splitter_arg.worker_arg.ignore_trailing = ignore_trailing;
- splitter_arg.worker_arg.loose_trailing = loose_trailing;
+ splitter_arg.worker_arg.ignore_trailing = cl_opts.ignore_trailing;
+ splitter_arg.worker_arg.loose_trailing = cl_opts.loose_trailing;
splitter_arg.worker_arg.testing = ( outfd < 0 );
splitter_arg.worker_arg.nocopy = nocopy;
splitter_arg.worker_args = worker_args;