zutils  1.10
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.
  Fossies Dox: zutils-1.10.tar.lz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

zutils.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Children
 

Enumerations

enum  { magic_buf_size = 10 }
 

Functions

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)
 
bool feed_data (const std::string &filename, const int infd, const int outfd, const uint8_t *magic_data, const int magic_size)
 
bool good_status (const Children &children, const bool finished)
 
bool set_data_feeder (const std::string &filename, int *const infdp, Children &children, int format_index)
 
int test_format (const int infd, uint8_t magic_data[], int *const magic_sizep)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
magic_buf_size 

Definition at line 32 of file zutils.h.

Function Documentation

◆ feed_data()

bool feed_data ( const std::string &  filename,
const int  infd,
const int  outfd,
const uint8_t *  magic_data,
const int  magic_size 
)

Definition at line 115 of file zutils.cc.

References readblock(), show_error(), show_file_error(), and writeblock().

Referenced by set_data_feeder().

◆ good_status()

bool good_status ( const Children children,
const bool  finished 
)

Definition at line 136 of file zutils.cc.

References Children::compressor_name, Children::pid, and wait_for_child().

Referenced by main().

◆ readblock()

int readblock ( const int  fd,
uint8_t *const  buf,
const int  size 
)

Definition at line 79 of file zutils.cc.

Referenced by feed_data(), and test_format().

◆ set_data_feeder()

bool set_data_feeder ( const std::string &  filename,
int *const  infdp,
Children children,
int  format_index 
)

◆ test_format()

int test_format ( const int  infd,
uint8_t  magic_data[],
int *const  magic_sizep 
)

Definition at line 251 of file zutils.cc.

References fmt_bz2, fmt_gz, fmt_lz, fmt_xz, magic_buf_size, and readblock().

Referenced by set_data_feeder().

◆ writeblock()

int writeblock ( const int  fd,
const uint8_t *const  buf,
const int  size 
)

Definition at line 98 of file zutils.cc.

Referenced by feed_data().