diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 11:53:09 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 11:53:09 +0000 |
commit | 746479a2d915d02f6f02ec508202afb1face7c2b (patch) | |
tree | 1d26867f949791b0e2ba99246aa252f02e693cef /split.cc | |
parent | Adding debian version 1.18~pre1-1. (diff) | |
download | lziprecover-746479a2d915d02f6f02ec508202afb1face7c2b.tar.xz lziprecover-746479a2d915d02f6f02ec508202afb1face7c2b.zip |
Merging upstream version 1.18~pre2.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'split.cc')
-rw-r--r-- | split.cc | 38 |
1 files changed, 19 insertions, 19 deletions
@@ -62,25 +62,6 @@ bool next_filename( std::string & output_filename, const int max_digits ) } -bool verify_header( const File_header & header, const Pretty_print & pp ) - { - if( !header.verify_magic() ) - { - pp( "Bad magic number (file not in lzip format)." ); - return false; - } - if( !header.verify_version() ) - { - if( pp.verbosity() >= 0 ) - { pp(); - std::fprintf( stderr, "Version %d member format not supported.\n", - header.version() ); } - return false; - } - return true; - } - - // Search forward from 'pos' for "LZIP" (Boyer-Moore algorithm) // Returns pos of found string or 'pos+size' if not found. // @@ -205,6 +186,25 @@ int do_split_file( const std::string & input_filename, uint8_t * & base_buffer, } // end namespace +bool verify_header( const File_header & header, const Pretty_print & pp ) + { + if( !header.verify_magic() ) + { + pp( "Bad magic number (file not in lzip format)." ); + return false; + } + if( !header.verify_version() ) + { + if( pp.verbosity() >= 0 ) + { pp(); + std::fprintf( stderr, "Version %d member format not supported.\n", + header.version() ); } + return false; + } + return true; + } + + int split_file( const std::string & input_filename, const std::string & default_output_filename, const int verbosity, const bool force ) |