Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <utime.h>
#include "zlib.h"
Go to the source code of this file.
Data Structures | |
struct | ind |
struct | outd |
Macros | |
#define | local static |
#define | SIZE 32768U /* input and output buffer sizes */ |
#define | PIECE 16384 /* limits i/o chunks for 16-bit int case */ |
#define | NEXT() |
#define | FLUSHCODE() |
Functions | |
unsigned | in (void *in_desc, z_const unsigned char **buf) |
int | out (void *out_desc, unsigned char *buf, unsigned len) |
int | lunpipe (unsigned have, z_const unsigned char *next, struct ind *indp, int outfile, z_stream *strm) |
int | gunpipe (z_stream *strm, int infile, int outfile) |
void | copymeta (char *from, char *to) |
int | gunzip (z_stream *strm, char *inname, char *outname, int test) |
int | main (int argc, char **argv) |
Variables | |
unsigned char | inbuf [SIZE] |
unsigned char | outbuf [SIZE] |
unsigned short | prefix [65536] |
unsigned char | suffix [65536] |
unsigned char | match [65280+2] |
#define FLUSHCODE | ( | ) |
#define NEXT | ( | ) |
#define PIECE 16384 /* limits i/o chunks for 16-bit int case */ |
void copymeta | ( | char * | from, |
char * | to | ||
) |
Definition at line 517 of file gun.c.
References utimbuf::actime, chown(), utimbuf::modtime, and stat.
Referenced by gunzip().
Definition at line 383 of file gun.c.
References z_stream_s::avail_in, outd::check, outd::crc, crc32(), in(), ind::inbuf, inbuf, ind::infile, inflateBack(), int(), L, last, len, lunpipe(), z_stream_s::msg, NEXT, z_stream_s::next_in, NULL, out, outd::outfile, outd::total, Z_BUF_ERROR, z_const, Z_DATA_ERROR, Z_ERRNO, Z_NULL, Z_OK, and Z_STREAM_END.
Referenced by gunzip().
Definition at line 548 of file gun.c.
References copymeta(), gunpipe(), z_stream_s::msg, z_stream_s::next_in, NULL, strerror(), Z_BUF_ERROR, Z_DATA_ERROR, Z_ERRNO, Z_MEM_ERROR, Z_NULL, and Z_OK.
Referenced by main().
unsigned in | ( | void * | in_desc, |
z_const unsigned char ** | buf | ||
) |
Definition at line 89 of file gun.c.
References ind::inbuf, ind::infile, int(), len, PIECE, read(), and SIZE.
Referenced by bclose(), bget4(), blast(), bload(), bopen(), bskip(), def(), deflate_index_build(), deflate_index_extract(), gunpipe(), gzcopy(), gzhead(), gzheader(), gzip_normalize(), gztack(), inet_ntop(), inf(), inflate(), inflate_fast(), inflateSync(), load(), ossl_bin2hex(), partcompress(), rb_ractor_stdin_set(), rb_w32_inet_ntop(), read4(), readin(), readmore(), skip(), tar(), yyparse(), and zpull().
int lunpipe | ( | unsigned | have, |
z_const unsigned char * | next, | ||
struct ind * | indp, | ||
int | outfile, | ||
z_stream * | strm | ||
) |
Definition at line 200 of file gun.c.
References bits(), outd::check, FLUSHCODE, last, mask, match, max, z_stream_s::msg, NEXT, z_stream_s::next_in, out, outbuf, outd::outfile, prefix, SIZE, suffix, Z_BUF_ERROR, Z_DATA_ERROR, and Z_OK.
Referenced by gunpipe().
Definition at line 631 of file gun.c.
References argc, argv, free, gunzip(), inflateBackEnd(), inflateBackInit, int(), len, malloc, match, memcpy, NULL, z_stream_s::opaque, strlen(), Z_NULL, Z_OK, z_stream_s::zalloc, and z_stream_s::zfree.
int out | ( | void * | out_desc, |
unsigned char * | buf, | ||
unsigned | len | ||
) |
Definition at line 131 of file gun.c.
References outd::check, outd::crc, crc32(), int(), len, outd::outfile, PIECE, outd::total, and write().
unsigned char match[65280+2] |
Definition at line 165 of file gun.c.
Referenced by inflate_table(), longest_match(), lunpipe(), main(), onig_search_gpos(), rb_backref_set_string(), rb_match_busy(), rb_match_count(), rb_match_nth_defined(), rb_match_unbusy(), rb_reg_backref_number(), rb_reg_last_match(), rb_reg_match_last(), rb_reg_match_post(), rb_reg_match_pre(), rb_reg_nth_defined(), rb_reg_nth_match(), rb_reg_start_with_p(), and strtod().
unsigned short prefix[65536] |
Definition at line 163 of file gun.c.
Referenced by lunpipe(), rb_str_format(), and rb_w32_pipe().
unsigned char suffix[65536] |
Definition at line 164 of file gun.c.
Referenced by lunpipe(), and ruby_set_inplace_mode().