14 #ifdef HAVE_VALGRIND_MEMCHECK_H 15 # include <valgrind/memcheck.h> 16 # ifndef VALGRIND_MAKE_MEM_DEFINED 17 # define VALGRIND_MAKE_MEM_DEFINED(p, n) VALGRIND_MAKE_READABLE((p), (n)) 19 # ifndef VALGRIND_MAKE_MEM_UNDEFINED 20 # define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE((p), (n)) 23 # define VALGRIND_MAKE_MEM_DEFINED(p, n) 24 # define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 27 #define RUBY_ZLIB_VERSION "0.6.0" 30 #define OBJ_IS_FREED(val) (RBASIC(val)->flags == 0) 33 #define GZIP_SUPPORT 1 38 #if MAX_MEM_LEVEL >= 8 39 #define DEF_MEM_LEVEL 8 41 #define DEF_MEM_LEVEL MAX_MEM_LEVEL 45 #if SIZEOF_LONG > SIZEOF_INT 49 if (n > UINT_MAX) n = UINT_MAX;
52 #define MAX_UINT(n) max_uint(n) 54 #define MAX_UINT(n) (uInt)(n) 57 #define sizeof(x) ((int)sizeof(x)) 148 static unsigned long gzfile_get32(
const unsigned char*);
149 static void gzfile_set32(
unsigned long n,
unsigned char*);
287 case Z_VERSION_ERROR:
310 fprintf(stderr,
"zlib(finalizer): %s\n",
msg);
331 #if SIZEOF_LONG > SIZEOF_INT 335 if (
len > UINT_MAX) {
337 sum =
func(sum, ptr, UINT_MAX);
340 }
while (
len >= UINT_MAX);
346 #define checksum_long(func, sum, ptr, len) (func)((sum), (ptr), (len)) 353 uLong (*
func)(uLong,
const Bytef*, uInt);
363 else if (
NIL_P(str)) {
367 sum =
func(0, Z_NULL, 0);
371 sum =
func(sum, Z_NULL, 0);
397 #ifdef HAVE_ADLER32_COMBINE 415 #define rb_zlib_adler32_combine rb_f_notimplement 435 #ifdef HAVE_CRC32_COMBINE 453 #define rb_zlib_crc32_combine rb_f_notimplement 464 #if !defined(HAVE_TYPE_Z_CRC_T) 466 typedef unsigned long z_crc_t;
468 const z_crc_t *crctbl;
472 crctbl = get_crc_table();
475 for (
i = 0;
i < 256;
i++) {
494 int (*
run)(z_streamp, int);
498 #define ZSTREAM_FLAG_READY 0x1 499 #define ZSTREAM_FLAG_IN_STREAM 0x2 500 #define ZSTREAM_FLAG_FINISHED 0x4 501 #define ZSTREAM_FLAG_CLOSING 0x8 502 #define ZSTREAM_FLAG_UNUSED 0x10 504 #define ZSTREAM_READY(z) ((z)->flags |= ZSTREAM_FLAG_READY) 505 #define ZSTREAM_IS_READY(z) ((z)->flags & ZSTREAM_FLAG_READY) 506 #define ZSTREAM_IS_FINISHED(z) ((z)->flags & ZSTREAM_FLAG_FINISHED) 507 #define ZSTREAM_IS_CLOSING(z) ((z)->flags & ZSTREAM_FLAG_CLOSING) 511 #define ZSTREAM_INITIAL_BUFSIZE 1024 512 #define ZSTREAM_AVAIL_OUT_STEP_MAX 16384 513 #define ZSTREAM_AVAIL_OUT_STEP_MIN 2048 516 deflateReset, deflateEnd, deflate,
520 inflateReset, inflateEnd, inflate,
551 z->
stream.opaque = Z_NULL;
553 z->
stream.next_in = Z_NULL;
555 z->
stream.next_out = Z_NULL;
560 #define zstream_init_deflate(z) zstream_init((z), &deflate_funcs) 561 #define zstream_init_inflate(z) zstream_init((z), &inflate_funcs) 644 #define zstream_append_buffer2(z,v) \ 645 zstream_append_buffer((z),(Bytef*)RSTRING_PTR(v),RSTRING_LEN(v)) 688 z->
stream.avail_out = (uInt)buflen;
703 if (z->
stream.avail_out > 0) {
720 if (z->
stream.avail_out > 0) {
729 if (
len <= 0)
return;
741 #define zstream_append_input2(z,v)\ 743 zstream_append_input((z), (Bytef*)RSTRING_PTR(v), RSTRING_LEN(v)) 813 rb_warning(
"attempt to close uninitialized zstream; ignored.");
817 rb_warning(
"attempt to close unfinished zstream; reset forced.");
838 z->
stream.next_in = (Bytef*)
"";
851 if (z->
stream.avail_out == 0) {
864 if (
err == Z_STREAM_END) {
870 if (flush != Z_FINISH &&
err == Z_BUF_ERROR
871 && z->
stream.avail_out > 0) {
876 if (z->
stream.avail_in > 0) {
881 if (z->
stream.avail_out > 0) {
889 if (z->
stream.avail_in > 0) {
912 if (
err != Z_DATA_ERROR) {
927 if (
err != Z_DATA_ERROR) {
945 if (
err == Z_STREAM_ERROR)
947 if (
err == Z_DATA_ERROR)
972 #define zstream_deflate_new(klass) zstream_new((klass), &deflate_funcs) 973 #define zstream_inflate_new(klass) zstream_new((klass), &inflate_funcs) 1227 #define FIXNUMARG(val, ifnil) \ 1228 (NIL_P((val)) ? (ifnil) \ 1229 : ((void)Check_Type((val), T_FIXNUM), FIX2INT((val)))) 1231 #define ARG_LEVEL(val) FIXNUMARG((val), Z_DEFAULT_COMPRESSION) 1232 #define ARG_WBITS(val) FIXNUMARG((val), MAX_WBITS) 1233 #define ARG_MEMLEVEL(val) FIXNUMARG((val), DEF_MEM_LEVEL) 1234 #define ARG_STRATEGY(val) FIXNUMARG((val), Z_DEFAULT_STRATEGY) 1235 #define ARG_FLUSH(val) FIXNUMARG((val), Z_NO_FLUSH) 1306 VALUE level, wbits, memlevel, strategy;
1337 if (z1 == z2)
return self;
1417 if (flush != Z_NO_FLUSH ||
RSTRING_LEN(src) > 0) {
1459 VALUE src, flush, dst;
1507 flush =
FIXNUMARG(v_flush, Z_SYNC_FLUSH);
1508 if (flush != Z_NO_FLUSH) {
1540 int level, strategy;
1548 err = deflateParams(&z->
stream, level, strategy);
1550 while (
err == Z_BUF_ERROR) {
1551 rb_warning(
"deflateParams() returned Z_BUF_ERROR");
1554 err = deflateParams(&z->
stream, level, strategy);
1911 #define GZ_MAGIC1 0x1f 1912 #define GZ_MAGIC2 0x8b 1913 #define GZ_METHOD_DEFLATE 8 1914 #define GZ_FLAG_MULTIPART 0x2 1915 #define GZ_FLAG_EXTRA 0x4 1916 #define GZ_FLAG_ORIG_NAME 0x8 1917 #define GZ_FLAG_COMMENT 0x10 1918 #define GZ_FLAG_ENCRYPT 0x20 1919 #define GZ_FLAG_UNKNOWN_MASK 0xc0 1921 #define GZ_EXTRAFLAG_FAST 0x4 1922 #define GZ_EXTRAFLAG_SLOW 0x2 1925 #define OS_MSDOS 0x00 1926 #define OS_AMIGA 0x01 1928 #define OS_UNIX 0x03 1929 #define OS_ATARI 0x05 1931 #define OS_MACOS 0x07 1932 #define OS_TOPS20 0x0a 1933 #define OS_WIN32 0x0b 1935 #define OS_VMCMS 0x04 1936 #define OS_ZSYSTEM 0x08 1938 #define OS_QDOS 0x0c 1939 #define OS_RISCOS 0x0d 1940 #define OS_UNKNOWN 0xff 1943 #define OS_CODE OS_UNIX 1973 #define GZFILE_CBUF_CAPA 10 1975 #define GZFILE_FLAG_SYNC ZSTREAM_FLAG_UNUSED 1976 #define GZFILE_FLAG_HEADER_FINISHED (ZSTREAM_FLAG_UNUSED << 1) 1977 #define GZFILE_FLAG_FOOTER_FINISHED (ZSTREAM_FLAG_UNUSED << 2) 1979 #define GZFILE_IS_FINISHED(gz) \ 1980 (ZSTREAM_IS_FINISHED(&(gz)->z) && (gz)->z.buf_filled == 0) 1982 #define GZFILE_READ_SIZE 2048 2003 finalizer_warn(
"Zlib::GzipWriter object must be closed explicitly.");
2016 const struct zstream_funcs *funcs;
2017 void (*endfunc)(
struct gzfile *);
2030 gz->
crc = crc32(0, Z_NULL, 0);
2045 #define gzfile_writer_new(gz) gzfile_new((gz),&deflate_funcs,gzfile_writer_end) 2046 #define gzfile_reader_new(gz) gzfile_new((gz),&inflate_funcs,gzfile_reader_end) 2052 gz->
crc = crc32(0, Z_NULL, 0);
2131 if (
NIL_P(str))
return 0;
2161 n = *(src++) & 0xff;
2162 n |= (*(src++) & 0xff) << 8;
2166 static unsigned long 2170 n = *(src++) & 0xff;
2171 n |= (*(src++) & 0xff) << 8;
2172 n |= (*(src++) & 0xff) << 16;
2173 n |= (*(src++) & 0xffU) << 24;
2180 *(dst++) = n & 0xff;
2181 *(dst++) = (n >> 8) & 0xff;
2182 *(dst++) = (n >> 16) & 0xff;
2183 *dst = (n >> 24) & 0xff;
2220 unsigned char flags = 0, extraflags = 0;
2228 if (gz->
mtime == 0) {
2229 gz->
mtime = time(0);
2232 if (gz->
level == Z_BEST_SPEED) {
2235 else if (gz->
level == Z_BEST_COMPRESSION) {
2244 buf[8] = extraflags;
2274 const unsigned char *head;
2303 gz->
level = Z_BEST_SPEED;
2306 gz->
level = Z_BEST_COMPRESSION;
2309 gz->
level = Z_DEFAULT_COMPRESSION;
2355 unsigned long crc, length;
2387 ? Z_SYNC_FLUSH : Z_NO_FLUSH);
2511 if (!
NIL_P(outbuf)) {
2559 const unsigned char *ss, *sp, *se;
2560 unsigned char *ds, *
dp, *de;
2568 ds =
dp = (
unsigned char *)gz->
cbuf;
2762 if (close_io_on_error) {
3271 flush =
FIXNUMARG(v_flush, Z_SYNC_FLUSH);
3272 if (flush != Z_NO_FLUSH) {
3319 #define rb_gzwriter_addstr rb_io_addstr 3324 #define rb_gzwriter_printf rb_io_printf 3329 #define rb_gzwriter_print rb_io_print 3334 #define rb_gzwriter_puts rb_io_puts 3435 err = inflateInit2(&gz->
z.
stream, -MAX_WBITS);
3681 while (n++, *(
p++) ==
'\n') {
3734 long rslen, n, limit = -1;
3749 else if (!
NIL_P(rs)) {
3819 if (!rspara)
rscheck(rsptr, rslen, rs);
3821 if (limit > 0 && filled >= limit) {
3824 res = memchr(
p, rsptr[0], (filled - n + 1));
3827 if (limit > 0 && filled >= limit)
break;
3830 n += (
long)(res -
p);
3832 if (rslen == 1 ||
memcmp(
p, rsptr, rslen) == 0)
break;
4003 VALUE mZlib, cZStream, cDeflate, cInflate;
4005 VALUE cGzipFile, cGzipWriter, cGzipReader;
4100 INT2FIX(Z_DEFAULT_COMPRESSION));
RUBY_EXTERN VALUE rb_cString
static VALUE rb_gzreader_ungetbyte(VALUE, VALUE)
#define RSTRING_LEN(string)
static long NUM2LONG(VALUE x)
static VALUE rb_zstream_closed_p(VALUE)
#define ZSTREAM_IS_CLOSING(z)
static VALUE rb_zstream_avail_out(VALUE)
static VALUE rb_inflate_s_allocate(VALUE)
static VALUE rb_gzreader_unused(VALUE)
void rb_thread_schedule(void)
static VALUE rb_gzfile_os_code(VALUE)
static VALUE rb_gzfile_set_comment(VALUE, VALUE)
static void gzfile_set32(unsigned long n, unsigned char *)
static VALUE rb_deflate_params(VALUE, VALUE, VALUE)
#define MBCLEN_CHARFOUND_P(ret)
static VALUE rb_gzfile_comment(VALUE)
static VALUE rb_gzfile_to_io(VALUE)
static VALUE new_wrap(VALUE tmp)
#define MBCLEN_CHARFOUND_LEN(ret)
static VALUE rb_gzfile_level(VALUE)
static void finalizer_warn(const char *)
static void zstream_mark(struct zstream *)
static VALUE rb_zstream_set_avail_out(VALUE, VALUE)
static VALUE rb_gzwriter_putc(VALUE, VALUE)
static VALUE rb_zstream_end(VALUE)
static void gzfile_check_footer(struct gzfile *)
VALUE rb_big2ulong(VALUE x)
void rb_undef_alloc_func(VALUE)
#define Data_Get_Struct(obj, type, sval)
void rb_define_singleton_method(VALUE obj, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a singleton method for obj.
static VALUE rb_gzreader_readbyte(VALUE obj)
#define zstream_init_inflate(z)
#define ZSTREAM_AVAIL_OUT_STEP_MAX
static void zstream_expand_buffer_into(struct zstream *, unsigned long)
static VALUE rb_gzfile_mtime(VALUE)
#define rb_zlib_adler32_combine
static VALUE rb_gzfile_set_mtime(VALUE, VALUE)
static VALUE rb_gzwriter_initialize(int, VALUE *, VALUE)
static NORETURN(void raise_zlib_error(int, const char *))
#define GZ_FLAG_ORIG_NAME
static void gzfile_read_header(struct gzfile *)
static void zstream_buffer_ungetbyte(struct zstream *, int)
static void gzfile_ungets(struct gzfile *, const Bytef *, long)
static void do_inflate(struct zstream *, VALUE)
static void do_deflate(struct zstream *, VALUE, int)
static VALUE gzfile_reader_get_unused(struct gzfile *)
void(* end)(struct gzfile *)
int rb_econv_prepare_opts(VALUE opthash, VALUE *ecopts)
void rb_econv_close(rb_econv_t *ec)
static void zstream_reset_input(struct zstream *)
static char * gzfile_read_raw_until_zero(struct gzfile *, long)
static VALUE rb_gzreader_getc(VALUE)
VALUE rb_ary_push(VALUE ary, VALUE item)
SSL_METHOD *(* func)(void)
static VALUE rb_zstream_finished_p(VALUE)
static VALUE INT2NUM(int v)
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
VALUE rb_protect(VALUE(*proc)(VALUE), VALUE data, int *state)
#define RSTRING_PTR(string)
static VALUE rb_inflate_set_dictionary(VALUE, VALUE)
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
Defines a class under the namespace of outer.
static VALUE rb_deflate_s_allocate(VALUE)
void rb_raise(VALUE exc, const char *fmt,...)
static VALUE zstream_detach_input(struct zstream *)
static void zstream_append_input(struct zstream *, const Bytef *, long)
VALUE rb_enc_associate(VALUE obj, rb_encoding *enc)
static void gzfile_reader_end(struct gzfile *)
#define GZFILE_FLAG_FOOTER_FINISHED
void rb_define_alloc_func(VALUE, rb_alloc_func_t)
VALUE rb_obj_is_kind_of(VALUE, VALUE)
static void zstream_discard_input(struct zstream *, long)
int rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc)
void rb_include_module(VALUE klass, VALUE module)
void rb_gc_mark(VALUE ptr)
#define GZFILE_IS_FINISHED(gz)
#define GZFILE_FLAG_HEADER_FINISHED
static VALUE rb_zlib_version(VALUE)
static VALUE rb_gzreader_each_char(VALUE obj)
#define ZSTREAM_IS_READY(z)
static VALUE gzfile_read_all(struct gzfile *)
VALUE rb_file_open_str(VALUE, const char *)
static VALUE rb_inflate_s_inflate(VALUE, VALUE)
#define ZSTREAM_FLAG_FINISHED
#define rb_enc_mbmaxlen(enc)
static void gzreader_skip_linebreaks(struct gzfile *)
static VALUE rb_deflate_addstr(VALUE, VALUE)
#define ZSTREAM_FLAG_IN_STREAM
static VALUE gzfile_new(VALUE, const struct zstream_funcs *, void(*) _((struct gzfile *)))
static void zstream_init(struct zstream *, const struct zstream_funcs *)
#define ZSTREAM_FLAG_CLOSING
static void gzfile_mark(struct gzfile *)
static VALUE rb_gzwriter_flush(int, VALUE *, VALUE)
static VALUE rb_gzreader_rewind(VALUE)
VALUE rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts)
static VALUE rb_gzreader_readchar(VALUE)
static VALUE rb_gzfile_finish(VALUE)
static void zstream_buffer_ungets(struct zstream *, const Bytef *, unsigned long)
RUBY_EXTERN void * memmove(void *, const void *, size_t)
static void gzfile_writer_end(struct gzfile *)
#define rb_gzwriter_printf
static VALUE rb_zstream_total_in(VALUE)
VALUE rb_str_buf_cat(VALUE, const char *, long)
void rb_exc_raise(VALUE mesg)
static VALUE cLengthError
#define gzfile_writer_new(gz)
void rb_econv_check_error(rb_econv_t *ec)
rb_encoding * rb_default_external_encoding(void)
static void gzfile_close(struct gzfile *, int)
static VALUE rb_gzfile_path(VALUE)
static long gzfile_fill(struct gzfile *gz, long len)
VALUE rb_class_new_instance(int, VALUE *, VALUE)
static unsigned long gzfile_get32(const unsigned char *)
static void gzfile_calc_crc(struct gzfile *, VALUE)
static VALUE rb_zstream_adler(VALUE)
static VALUE rb_deflate_s_deflate(int, VALUE *, VALUE)
int rb_block_given_p(void)
#define ZSTREAM_FLAG_READY
static VALUE cVersionError
RUBY_EXTERN VALUE rb_cObject
static VALUE rb_gzwriter_s_allocate(VALUE)
static struct gzfile * get_gzfile(VALUE)
#define checksum_long(func, sum, ptr, len)
#define VALGRIND_MAKE_MEM_DEFINED(p, n)
const struct zstream::zstream_funcs * func
#define MBCLEN_NEEDMORE_P(ret)
static VALUE rb_gzreader_gets(int, VALUE *, VALUE)
static void gzfile_free(struct gzfile *)
static VALUE gzfile_getc(struct gzfile *gz)
VALUE rb_str_cat2(VALUE, const char *)
VALUE rb_obj_as_string(VALUE)
static VALUE rb_gzreader_read(int, VALUE *, VALUE)
static void gzfile_make_footer(struct gzfile *)
rb_econv_t * rb_econv_open_opts(const char *source_encoding, const char *destination_encoding, int ecflags, VALUE ecopts)
#define ECONV_PARTIAL_INPUT
static int gzfile_read_raw_ensure(struct gzfile *, long)
#define ECONV_AFTER_OUTPUT
static void zstream_passthrough_input(struct zstream *)
static void raise_zlib_error(int err, const char *msg)
static void zstream_expand_buffer(struct zstream *)
static VALUE rb_inflate_addstr(VALUE, VALUE)
void rb_define_const(VALUE, const char *, VALUE)
#define GZ_EXTRAFLAG_FAST
#define zstream_deflate_new(klass)
void rb_lastline_set(VALUE)
static VALUE gzfile_read_raw(struct gzfile *)
#define MBCLEN_NEEDMORE_LEN(ret)
static VALUE rb_gzfile_crc(VALUE)
static VALUE rb_gzreader_initialize(int, VALUE *, VALUE)
VALUE rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to)
static VALUE rb_zstream_reset(VALUE)
static VALUE gzfile_readpartial(struct gzfile *gz, long len, VALUE outbuf)
int(* run)(z_streamp, int)
static void gzfile_write_raw(struct gzfile *)
static VALUE rb_gzfile_lineno(VALUE)
static VALUE rb_zstream_flush_next_out(VALUE)
VALUE rb_time_new(time_t, long)
static VALUE rb_zlib_crc_table(VALUE)
#define ZSTREAM_IS_FINISHED(z)
#define ARG_STRATEGY(val)
VALUE rb_str_resurrect(VALUE str)
VALUE rb_str_resize(VALUE, long)
#define rb_zlib_crc32_combine
VALUE rb_str_subseq(VALUE, long, long)
static VALUE gzfile_writer_end_run(VALUE)
static VALUE gzfile_error_inspect(VALUE)
void rb_define_module_function(VALUE module, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a module function for module.
static VALUE rb_deflate_deflate(int, VALUE *, VALUE)
int rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p)
VALUE rb_sprintf(const char *format,...)
static VALUE rb_gzfile_sync(VALUE)
static VALUE rb_gzfile_closed_p(VALUE)
int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc)
#define RB_GC_GUARD(object)
static long gzreader_charboundary(struct gzfile *gz, long n)
static VALUE gzreader_gets(int, VALUE *, VALUE)
#define ZSTREAM_INITIAL_BUFSIZE
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
static VALUE gzfile_wrap(int argc, VALUE *argv, VALUE klass, int close_io_on_error)
VALUE rb_ivar_set(VALUE, ID, VALUE)
static VALUE gzfile_newstr(struct gzfile *gz, VALUE str)
unsigned char buf[MIME_BUF_SIZE]
static VALUE rb_zstream_avail_in(VALUE)
static VALUE gzfile_read(struct gzfile *, long)
VALUE rb_exc_new2(VALUE etype, const char *s)
static VALUE rb_gzfile_set_orig_name(VALUE, VALUE)
static void zlib_mem_free(voidpf, voidpf)
#define zstream_append_input2(z, v)
static VALUE rb_gzreader_s_open(int, VALUE *, VALUE)
static VALUE zstream_new(VALUE, const struct zstream_funcs *)
static struct zstream * get_zstream(VALUE)
#define GZ_FLAG_MULTIPART
#define rb_gzwriter_print
static VALUE rb_gzfile_eof_p(VALUE)
static VALUE rb_gzreader_each_byte(VALUE)
VALUE rb_rescue2(VALUE(*b_proc)(ANYARGS), VALUE data1, VALUE(*r_proc)(ANYARGS), VALUE data2,...)
static int rb_enc_dummy_p(rb_encoding *enc)
register unsigned int len
static VALUE zstream_shift_buffer(struct zstream *, long)
VALUE rb_call_super(int, const VALUE *)
#define RUBY_ZLIB_VERSION
VALUE rb_ensure(VALUE(*b_proc)(ANYARGS), VALUE data1, VALUE(*e_proc)(ANYARGS), VALUE data2)
int memcmp(const void *s1, const void *s2, size_t len)
static voidpf zlib_mem_alloc(voidpf, uInt, uInt)
static VALUE rb_gzreader_readlines(int, VALUE *, VALUE)
static VALUE rb_deflate_initialize(int, VALUE *, VALUE)
void rb_sys_fail(const char *mesg)
static VALUE zstream_end(struct zstream *)
void rb_jump_tag(int tag)
#define FIXNUMARG(val, ifnil)
static void gzfile_reset(struct gzfile *)
static VALUE rb_gzfile_total_in(VALUE)
static VALUE rb_deflate_flush(int, VALUE *, VALUE)
#define Data_Make_Struct(klass, type, mark, free, sval)
int rb_respond_to(VALUE, ID)
static VALUE rb_gzwriter_write(VALUE, VALUE)
static unsigned int gzfile_get16(const unsigned char *)
static VALUE rb_zlib_crc32(int, VALUE *, VALUE)
rb_encoding * rb_enc_get(VALUE obj)
static VALUE inflate_run(VALUE)
static const struct zstream_funcs deflate_funcs
static VALUE rb_gzfile_total_out(VALUE)
static VALUE do_checksum(int, VALUE *, uLong(*)(uLong, const Bytef *, uInt))
static void gzfile_make_header(struct gzfile *)
static void gzfile_ungetbyte(struct gzfile *, int)
#define ZSTREAM_AVAIL_OUT_STEP_MIN
static const struct zstream_funcs inflate_funcs
static VALUE rb_inflate_initialize(int, VALUE *, VALUE)
VALUE rb_exc_new3(VALUE etype, VALUE str)
rb_econv_result_t rb_econv_convert(rb_econv_t *ec, const unsigned char **source_buffer_ptr, const unsigned char *source_buffer_end, unsigned char **destination_buffer_ptr, unsigned char *destination_buffer_end, int flags)
VALUE rb_check_convert_type(VALUE, int, const char *, const char *)
static VALUE ULONG2NUM(unsigned long v)
static VALUE gzfile_ensure_close(VALUE)
void rb_define_attr(VALUE klass, const char *name, int read, int write)
Defines (a) public accessor method(s) for an attribute.
static VALUE rb_gzfile_set_lineno(VALUE, VALUE)
static VALUE rb_zstream_flush_next_in(VALUE)
static VALUE zstream_detach_buffer(struct zstream *)
static VALUE rb_gzreader_ungetc(VALUE, VALUE)
static VALUE cStreamError
static VALUE rb_inflate_sync_point_p(VALUE)
static void gzfile_raise(struct gzfile *gz, VALUE klass, const char *message)
#define ARG_MEMLEVEL(val)
VALUE rb_check_string_type(VALUE)
static VALUE zstream_sync(struct zstream *, Bytef *, long)
static VALUE gzfile_read_raw_rescue(VALUE)
static void zstream_run(struct zstream *, Bytef *, long, int)
static VALUE rb_gzwriter_s_open(int, VALUE *, VALUE)
static void zstream_append_buffer(struct zstream *, const Bytef *, long)
#define gzfile_reader_new(gz)
static void zstream_free(struct zstream *)
VALUE rb_uint2inum(VALUE n)
static VALUE rb_gzfile_orig_name(VALUE)
static void zstream_finalize(struct zstream *)
#define rb_enc_left_char_head(s, p, e, enc)
static VALUE rb_inflate_inflate(VALUE, VALUE)
VALUE rb_str_inspect(VALUE)
static VALUE rb_gzreader_s_allocate(VALUE)
static VALUE rb_gzfile_set_sync(VALUE, VALUE)
#define RETURN_ENUMERATOR(obj, argc, argv)
VALUE rb_ary_new2(long capa)
#define rb_gzwriter_addstr
static VALUE rb_gzreader_readpartial(int argc, VALUE *argv, VALUE obj)
static VALUE rb_gzreader_readline(int, VALUE *, VALUE)
#define GZ_EXTRAFLAG_SLOW
static VALUE rb_gzfile_close(VALUE)
static char NUM2CHR(VALUE x)
static VALUE gzfile_s_open(int, VALUE *, VALUE, const char *)
static VALUE rb_gzreader_each(int, VALUE *, VALUE)
static VALUE rb_zstream_data_type(VALUE)
static VALUE rb_deflate_init_copy(VALUE, VALUE)
VALUE rb_int2inum(SIGNED_VALUE n)
static void gzfile_write(struct gzfile *, Bytef *, long)
static VALUE rb_zstream_total_out(VALUE)
rb_encoding * rb_ascii8bit_encoding(void)
void rb_warning(const char *fmt,...)
#define GZ_METHOD_DEFLATE
#define RSTRING_LENINT(str)
RUBY_EXTERN VALUE rb_eEOFError
#define zstream_init_deflate(z)
VALUE rb_define_module(const char *name)
static void zstream_reset(struct zstream *)
static long gzfile_read_more(struct gzfile *)
static VALUE rb_inflate_sync(VALUE, VALUE)
#define GZ_FLAG_UNKNOWN_MASK
static void rb_gzfile_ecopts(struct gzfile *gz, VALUE opts)
VALUE rb_str_buf_new(long)
static void gzfile_reader_rewind(struct gzfile *)
static VALUE rb_zstream_finish(VALUE)
#define zstream_append_buffer2(z, v)
static void rscheck(const char *rsptr, long rslen, VALUE rs)
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
VALUE rb_str_append(VALUE, VALUE)
static VALUE gzfile_reader_end_run(VALUE)
VALUE rb_str_new2(const char *)
static VALUE rb_gzfile_s_wrap(int, VALUE *, VALUE)
VALUE rb_str_to_str(VALUE)
static VALUE deflate_run(VALUE)
static VALUE rb_deflate_set_dictionary(VALUE, VALUE)
#define zstream_inflate_new(klass)
VALUE rb_attr_get(VALUE, ID)
static VALUE rb_gzreader_getbyte(VALUE obj)
static VALUE gzfile_read_raw_partial(VALUE)
VALUE rb_econv_str_convert(rb_econv_t *ec, VALUE src, int flags)
static VALUE rb_zlib_adler32(int, VALUE *, VALUE)
VALUE rb_str_new(const char *, long)