xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

gzip.c File Reference
#include "../libisofs.h"
#include "../filter.h"
#include "../fsource.h"
#include "../util.h"
#include "../stream.h"
#include <sys/types.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
Include dependency graph for gzip.c:

Go to the source code of this file.

Data Structures

struct  GzipFilterRuntime
 
struct  GzipFilterStreamData
 

Functions

static int gzip_stream_uncompress (IsoStream *stream, void *buf, size_t desired)
 
static int gzip_stream_close_flag (IsoStream *stream, int flag)
 
static int gzip_stream_close (IsoStream *stream)
 
static int gzip_stream_open_flag (IsoStream *stream, int flag)
 
static int gzip_stream_open (IsoStream *stream)
 
static int gzip_stream_convert (IsoStream *stream, void *buf, size_t desired, int flag)
 
static int gzip_stream_compress (IsoStream *stream, void *buf, size_t desired)
 
static off_t gzip_stream_get_size (IsoStream *stream)
 
static int gzip_stream_is_repeatable (IsoStream *stream)
 
static void gzip_stream_get_id (IsoStream *stream, unsigned int *fs_id, dev_t *dev_id, ino_t *ino_id)
 
static void gzip_stream_free (IsoStream *stream)
 
static int gzip_update_size (IsoStream *stream)
 
static IsoStreamgzip_get_input_stream (IsoStream *stream, int flag)
 
static int gzip_clone_stream (IsoStream *old_stream, IsoStream **new_stream, int flag)
 
static int gzip_cmp_ino (IsoStream *s1, IsoStream *s2)
 
static int gzip_uncompress_cmp_ino (IsoStream *s1, IsoStream *s2)
 
int gzip_add_filter (IsoFile *file, int flag)
 
int iso_file_add_gzip_filter (IsoFile *file, int flag)
 
int iso_gzip_get_refcounts (off_t *gzip_count, off_t *gunzip_count, int flag)
 

Variables

static off_t gzip_ref_count = 0
 
static off_t gunzip_ref_count = 0
 
IsoStreamIface gzip_stream_compress_class
 
IsoStreamIface gzip_stream_uncompress_class
 

Function Documentation

◆ gzip_add_filter()

int gzip_add_filter ( IsoFile file,
int  flag 
)

◆ gzip_clone_stream()

static int gzip_clone_stream ( IsoStream old_stream,
IsoStream **  new_stream,
int  flag 
)
static

◆ gzip_cmp_ino()

static int gzip_cmp_ino ( IsoStream s1,
IsoStream s2 
)
static

◆ gzip_get_input_stream()

static IsoStream* gzip_get_input_stream ( IsoStream stream,
int  flag 
)
static

Definition at line 522 of file gzip.c.

References iso_stream::data, and GzipFilterStreamData::orig.

◆ gzip_stream_close()

static int gzip_stream_close ( IsoStream stream)
static

Definition at line 231 of file gzip.c.

References gzip_stream_close_flag().

Referenced by gzip_stream_free(), and gzip_stream_get_size().

◆ gzip_stream_close_flag()

static int gzip_stream_close_flag ( IsoStream stream,
int  flag 
)
static

◆ gzip_stream_compress()

static int gzip_stream_compress ( IsoStream stream,
void *  buf,
size_t  desired 
)
static

Definition at line 416 of file gzip.c.

References gzip_stream_convert().

◆ gzip_stream_convert()

◆ gzip_stream_free()

◆ gzip_stream_get_id()

static void gzip_stream_get_id ( IsoStream stream,
unsigned int *  fs_id,
dev_t *  dev_id,
ino_t *  ino_id 
)
static

◆ gzip_stream_get_size()

static off_t gzip_stream_get_size ( IsoStream stream)
static

◆ gzip_stream_is_repeatable()

static int gzip_stream_is_repeatable ( IsoStream stream)
static

Definition at line 469 of file gzip.c.

◆ gzip_stream_open()

static int gzip_stream_open ( IsoStream stream)
static

Definition at line 306 of file gzip.c.

References gzip_stream_open_flag().

◆ gzip_stream_open_flag()

◆ gzip_stream_uncompress()

static int gzip_stream_uncompress ( IsoStream stream,
void *  buf,
size_t  desired 
)
static

Definition at line 422 of file gzip.c.

References gzip_stream_convert().

Referenced by gzip_stream_close_flag(), gzip_stream_free(), and gzip_stream_open_flag().

◆ gzip_uncompress_cmp_ino()

static int gzip_uncompress_cmp_ino ( IsoStream s1,
IsoStream s2 
)
static

◆ gzip_update_size()

static int gzip_update_size ( IsoStream stream)
static

Definition at line 514 of file gzip.c.

◆ iso_file_add_gzip_filter()

int iso_file_add_gzip_filter ( IsoFile file,
int  flag 
)

Install a gzip or gunzip filter on top of the content stream of a data file. gzip is a compression format which is used by programs gzip and gunzip. The filter will not be installed if its output size is not smaller than the size of the input stream. This is only enabled if the use of libz was enabled at compile time.

Parameters
fileThe data file node which shall show filtered content.
flagBitfield for control purposes bit0= Do not install filter if the number of output blocks is not smaller than the number of input blocks. Block size is 2048. bit1= Install a decompression filter rather than one for compression. bit2= Only inquire availability of gzip filtering. file may be NULL. If available return 2, else return error. bit3= is reserved for internal use and will be forced to 0
Returns
1 on success, 2 if filter available but installation revoked <0 on error, e.g. ISO_ZLIB_NOT_ENABLED
Since
0.6.18

Definition at line 819 of file gzip.c.

References gzip_add_filter().

Referenced by Xorriso_set_filter().

◆ iso_gzip_get_refcounts()

int iso_gzip_get_refcounts ( off_t *  gzip_count,
off_t *  gunzip_count,
int  flag 
)

Inquire the number of gzip compression and uncompression filters which are in use.

Parameters
gzip_countWill return the number of currently installed compression filters.
gunzip_countWill return the number of currently installed uncompression filters.
flagBitfield for control purposes, unused yet, submit 0
Returns
1 on success, <0 on error
Since
0.6.18

Definition at line 826 of file gzip.c.

References gunzip_ref_count, gzip_ref_count, and ISO_SUCCESS.

Referenced by Xorriso_status_zisofs().

Variable Documentation

◆ gunzip_ref_count

off_t gunzip_ref_count = 0
static

Definition at line 139 of file gzip.c.

Referenced by gzip_stream_free(), and iso_gzip_get_refcounts().

◆ gzip_ref_count

off_t gzip_ref_count = 0
static

Definition at line 136 of file gzip.c.

Referenced by gzip_stream_free(), and iso_gzip_get_refcounts().

◆ gzip_stream_compress_class

IsoStreamIface gzip_stream_compress_class
Initial value:
= {
4,
"gzip",
}
static int gzip_clone_stream(IsoStream *old_stream, IsoStream **new_stream, int flag)
Definition: gzip.c:535
static void gzip_stream_get_id(IsoStream *stream, unsigned int *fs_id, dev_t *dev_id, ino_t *ino_id)
Definition: gzip.c:477
static int gzip_stream_close(IsoStream *stream)
Definition: gzip.c:231
static int gzip_stream_compress(IsoStream *stream, void *buf, size_t desired)
Definition: gzip.c:416
static int gzip_stream_is_repeatable(IsoStream *stream)
Definition: gzip.c:469
static IsoStream * gzip_get_input_stream(IsoStream *stream, int flag)
Definition: gzip.c:522
static int gzip_update_size(IsoStream *stream)
Definition: gzip.c:514
static int gzip_stream_open(IsoStream *stream)
Definition: gzip.c:306
static void gzip_stream_free(IsoStream *stream)
Definition: gzip.c:490
static int gzip_cmp_ino(IsoStream *s1, IsoStream *s2)
Definition: gzip.c:615
static off_t gzip_stream_get_size(IsoStream *stream)
Definition: gzip.c:429

Definition at line 580 of file gzip.c.

Referenced by gzip_cmp_ino().

◆ gzip_stream_uncompress_class

IsoStreamIface gzip_stream_uncompress_class
Initial value:
= {
4,
"pizg",
}
static int gzip_stream_uncompress(IsoStream *stream, void *buf, size_t desired)
Definition: gzip.c:422
static int gzip_uncompress_cmp_ino(IsoStream *s1, IsoStream *s2)
Definition: gzip.c:634

Definition at line 597 of file gzip.c.

Referenced by gzip_uncompress_cmp_ino().