"Fossies" - the Fresh Open Source Software Archive

Member "zutils-1.10/zutils.h" (5 Jan 2021, 1559 Bytes) of package /linux/privat/zutils-1.10.tar.lz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "zutils.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes reports: 1.10-rc1_vs_1.10 or 1.9_vs_1.10.

    1 /* Zutils - Utilities dealing with compressed files
    2    Copyright (C) 2009-2021 Antonio Diaz Diaz.
    3 
    4    This program is free software: you can redistribute it and/or modify
    5    it under the terms of the GNU General Public License as published by
    6    the Free Software Foundation, either version 2 of the License, or
    7    (at your option) any later version.
    8 
    9    This program is distributed in the hope that it will be useful,
   10    but WITHOUT ANY WARRANTY; without even the implied warranty of
   11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12    GNU General Public License for more details.
   13 
   14    You should have received a copy of the GNU General Public License
   15    along with this program.  If not, see <http://www.gnu.org/licenses/>.
   16 */
   17 
   18 int readblock( const int fd, uint8_t * const buf, const int size );
   19 int writeblock( const int fd, const uint8_t * const buf, const int size );
   20 bool feed_data( const std::string & filename, const int infd, const int outfd,
   21                 const uint8_t * magic_data, const int magic_size );
   22 
   23 struct Children
   24   {
   25   const char * compressor_name;
   26   pid_t pid[2];             // data feeder, compressor
   27   };
   28 bool good_status( const Children & children, const bool finished );
   29 bool set_data_feeder( const std::string & filename, int * const infdp,
   30                       Children & children, int format_index );
   31 
   32 enum { magic_buf_size = 10 };       // >= longest extended magic (bzip2)
   33 
   34 // Returns format index or -1 if uncompressed
   35 //
   36 int test_format( const int infd, uint8_t magic_data[],
   37                  int * const magic_sizep );