Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
Data Structures | Macros | Functions
gzappend.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include "zlib.h"

Go to the source code of this file.

Data Structures

struct  file
 

Macros

#define local   static
 
#define LGCHUNK   14
 
#define CHUNK   (1U << LGCHUNK)
 
#define DSIZE   32768U
 
#define read1(in)
 

Functions

void bye (char *msg1, char *msg2)
 
unsigned gcd (unsigned a, unsigned b)
 
void rotate (unsigned char *list, unsigned len, unsigned rot)
 
int readin (file *in)
 
int readmore (file *in)
 
void skip (file *in, unsigned n)
 
unsigned long read4 (file *in)
 
void gzheader (file *in)
 
int gzscan (char *name, z_stream *strm, int level)
 
void gztack (char *name, int gd, z_stream *strm, int last)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ CHUNK

#define CHUNK   (1U << LGCHUNK)

Definition at line 89 of file gzappend.c.

◆ DSIZE

#define DSIZE   32768U

Definition at line 90 of file gzappend.c.

◆ LGCHUNK

#define LGCHUNK   14

Definition at line 88 of file gzappend.c.

◆ local

#define local   static

Definition at line 87 of file gzappend.c.

◆ read1

#define read1 (   in)
Value:
(in->left == 0 ? readmore(in) : 0, \
in->left--, *(in->next)++)
unsigned in(void *in_desc, z_const unsigned char **buf)
Definition: gun.c:89
int readmore(file *in)
Definition: gzappend.c:192

Definition at line 198 of file gzappend.c.

Function Documentation

◆ bye()

void bye ( char *  msg1,
char *  msg2 
)

Definition at line 93 of file gzappend.c.

Referenced by gzheader(), gzscan(), gztack(), main(), readin(), readmore(), and skip().

◆ gcd()

unsigned gcd ( unsigned  a,
unsigned  b 
)

Definition at line 102 of file gzappend.c.

Referenced by rb_int_fdiv_double(), and rotate().

◆ gzheader()

void gzheader ( file in)

Definition at line 235 of file gzappend.c.

References bye(), in(), read1, and skip().

Referenced by gzscan().

◆ gzscan()

int gzscan ( char *  name,
z_stream strm,
int  level 
)

◆ gztack()

void gztack ( char *  name,
int  gd,
z_stream strm,
int  last 
)

◆ main()

int main ( int argc  ,
char **  argv 
)

Definition at line 466 of file gzappend.c.

References argc, argv, bye(), gzscan(), gztack(), NULL, and Z_DEFAULT_COMPRESSION.

◆ read4()

unsigned long read4 ( file in)

Definition at line 223 of file gzappend.c.

References in(), long(), and read1.

Referenced by gzscan().

◆ readin()

int readin ( file in)

Definition at line 180 of file gzappend.c.

References bye(), in(), len, and read().

Referenced by gzscan(), and readmore().

◆ readmore()

int readmore ( file in)

Definition at line 192 of file gzappend.c.

References bye(), in(), and readin().

Referenced by gzscan(), and skip().

◆ rotate()

void rotate ( unsigned char *  list,
unsigned  len,
unsigned  rot 
)

Definition at line 123 of file gzappend.c.

References gcd(), last, len, and memmove().

Referenced by gzscan().

◆ skip()

void skip ( file in,
unsigned  n 
)

Definition at line 202 of file gzappend.c.

References bye(), in(), off_t, readmore(), and SEEK_CUR.

Referenced by bskip(), deflate_index_extract(), gzheader(), and main().