"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zutils.h" between
zutils-1.8.tar.lz and zutils-1.9.tar.lz

About: Zutils is a collection of utilities able to deal with any combination of compressed and non-compressed files transparently. The utilities zcat, zcmp, zdiff, zgrep and ztest supports the compressors bzip2, gzip, lzip and xz.

zutils.h  (zutils-1.8.tar.lz):zutils.h  (zutils-1.9.tar.lz)
/* Zutils - Utilities dealing with compressed files /* Zutils - Utilities dealing with compressed files
Copyright (C) 2009-2019 Antonio Diaz Diaz. Copyright (C) 2009-2020 Antonio Diaz Diaz.
This program is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
int readblock( const int fd, uint8_t * const buf, const int size ); 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 writeblock( const int fd, const uint8_t * const buf, const int size );
bool feed_data( const std::string & filename, const int infd, const int outfd, bool feed_data( const std::string & filename, const int infd, const int outfd,
const uint8_t * magic_data, const int magic_size ); const uint8_t * magic_data, const int magic_size );
struct Children struct Children
{ {
const char * compressor_name; const char * compressor_name;
pid_t pid[2]; // data feeder, compressor pid_t pid[2]; // data feeder, compressor
}; };
bool good_status( const Children & children, const bool finished ); bool good_status( const Children & children, const bool finished );
bool set_data_feeder( const std::string & filename, int * const infdp, bool set_data_feeder( const std::string & filename, int * const infdp,
Children & children, int format_index ); Children & children, int format_index );
enum { magic_buf_size = 10 }; // >= longest extended magic (bzip2)
// Returns format index or -1 if uncompressed // Returns format index or -1 if uncompressed
// //
int test_format( const int infd, const uint8_t ** const magic_datap, int test_format( const int infd, uint8_t magic_data[],
int * const magic_sizep ); int * const magic_sizep );
 End of changes. 5 change blocks. 
14 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)