Data Structures | Defines | Functions | Variables

ext/zlib/zlib.c File Reference

#include <ruby.h>
#include <zlib.h>
#include <time.h>
#include <ruby/encoding.h>
Include dependency graph for zlib.c:

Go to the source code of this file.

Data Structures

struct  zstream
struct  zstream::zstream_funcs

Defines

#define VALGRIND_MAKE_MEM_DEFINED(p, n)
#define VALGRIND_MAKE_MEM_UNDEFINED(p, n)
#define RUBY_ZLIB_VERSION   "0.6.0"
#define OBJ_IS_FREED(val)   (RBASIC(val)->flags == 0)
#define DEF_MEM_LEVEL   MAX_MEM_LEVEL
#define rb_zlib_adler32_combine   rb_f_notimplement
#define rb_zlib_crc32_combine   rb_f_notimplement
#define ZSTREAM_FLAG_READY   0x1
#define ZSTREAM_FLAG_IN_STREAM   0x2
#define ZSTREAM_FLAG_FINISHED   0x4
#define ZSTREAM_FLAG_CLOSING   0x8
#define ZSTREAM_FLAG_UNUSED   0x10
#define ZSTREAM_READY(z)   ((z)->flags |= ZSTREAM_FLAG_READY)
#define ZSTREAM_IS_READY(z)   ((z)->flags & ZSTREAM_FLAG_READY)
#define ZSTREAM_IS_FINISHED(z)   ((z)->flags & ZSTREAM_FLAG_FINISHED)
#define ZSTREAM_IS_CLOSING(z)   ((z)->flags & ZSTREAM_FLAG_CLOSING)
#define ZSTREAM_INITIAL_BUFSIZE   1024
#define ZSTREAM_AVAIL_OUT_STEP_MAX   16384
#define ZSTREAM_AVAIL_OUT_STEP_MIN   2048
#define zstream_init_deflate(z)   zstream_init((z), &deflate_funcs)
#define zstream_init_inflate(z)   zstream_init((z), &inflate_funcs)
#define zstream_append_buffer2(z, v)   zstream_append_buffer((z),(Bytef*)RSTRING_PTR(v),RSTRING_LEN(v))
#define zstream_append_input2(z, v)
#define zstream_deflate_new(klass)   zstream_new((klass), &deflate_funcs)
#define zstream_inflate_new(klass)   zstream_new((klass), &inflate_funcs)
#define FIXNUMARG(val, ifnil)
#define ARG_LEVEL(val)   FIXNUMARG((val), Z_DEFAULT_COMPRESSION)
#define ARG_WBITS(val)   FIXNUMARG((val), MAX_WBITS)
#define ARG_MEMLEVEL(val)   FIXNUMARG((val), DEF_MEM_LEVEL)
#define ARG_STRATEGY(val)   FIXNUMARG((val), Z_DEFAULT_STRATEGY)
#define ARG_FLUSH(val)   FIXNUMARG((val), Z_NO_FLUSH)

Functions

static NORETURN (void raise_zlib_error(int, const char *))
static VALUE rb_zlib_version (VALUE)
static VALUE do_checksum (int, VALUE *, uLong(*)(uLong, const Bytef *, uInt))
static VALUE rb_zlib_adler32 (int, VALUE *, VALUE)
static VALUE rb_zlib_crc32 (int, VALUE *, VALUE)
static VALUE rb_zlib_crc_table (VALUE)
static voidpf zlib_mem_alloc (voidpf, uInt, uInt)
static void zlib_mem_free (voidpf, voidpf)
static void finalizer_warn (const char *)
static void zstream_init (struct zstream *, const struct zstream_funcs *)
static void zstream_expand_buffer (struct zstream *)
static void zstream_expand_buffer_into (struct zstream *, unsigned int)
static void zstream_append_buffer (struct zstream *, const Bytef *, int)
static VALUE zstream_detach_buffer (struct zstream *)
static VALUE zstream_shift_buffer (struct zstream *, int)
static void zstream_buffer_ungets (struct zstream *, const Bytef *, int)
static void zstream_buffer_ungetbyte (struct zstream *, int)
static void zstream_append_input (struct zstream *, const Bytef *, unsigned int)
static void zstream_discard_input (struct zstream *, unsigned int)
static void zstream_reset_input (struct zstream *)
static void zstream_passthrough_input (struct zstream *)
static VALUE zstream_detach_input (struct zstream *)
static void zstream_reset (struct zstream *)
static VALUE zstream_end (struct zstream *)
static void zstream_run (struct zstream *, Bytef *, uInt, int)
static VALUE zstream_sync (struct zstream *, Bytef *, uInt)
static void zstream_mark (struct zstream *)
static void zstream_free (struct zstream *)
static VALUE zstream_new (VALUE, const struct zstream_funcs *)
static struct zstreamget_zstream (VALUE)
static void zstream_finalize (struct zstream *)
static VALUE rb_zstream_end (VALUE)
static VALUE rb_zstream_reset (VALUE)
static VALUE rb_zstream_finish (VALUE)
static VALUE rb_zstream_flush_next_in (VALUE)
static VALUE rb_zstream_flush_next_out (VALUE)
static VALUE rb_zstream_avail_out (VALUE)
static VALUE rb_zstream_set_avail_out (VALUE, VALUE)
static VALUE rb_zstream_avail_in (VALUE)
static VALUE rb_zstream_total_in (VALUE)
static VALUE rb_zstream_total_out (VALUE)
static VALUE rb_zstream_data_type (VALUE)
static VALUE rb_zstream_adler (VALUE)
static VALUE rb_zstream_finished_p (VALUE)
static VALUE rb_zstream_closed_p (VALUE)
static VALUE rb_deflate_s_allocate (VALUE)
static VALUE rb_deflate_initialize (int, VALUE *, VALUE)
static VALUE rb_deflate_init_copy (VALUE, VALUE)
static VALUE deflate_run (VALUE)
static VALUE rb_deflate_s_deflate (int, VALUE *, VALUE)
static void do_deflate (struct zstream *, VALUE, int)
static VALUE rb_deflate_deflate (int, VALUE *, VALUE)
static VALUE rb_deflate_addstr (VALUE, VALUE)
static VALUE rb_deflate_flush (int, VALUE *, VALUE)
static VALUE rb_deflate_params (VALUE, VALUE, VALUE)
static VALUE rb_deflate_set_dictionary (VALUE, VALUE)
static VALUE inflate_run (VALUE)
static VALUE rb_inflate_s_allocate (VALUE)
static VALUE rb_inflate_initialize (int, VALUE *, VALUE)
static VALUE rb_inflate_s_inflate (VALUE, VALUE)
static void do_inflate (struct zstream *, VALUE)
static VALUE rb_inflate_inflate (VALUE, VALUE)
static VALUE rb_inflate_addstr (VALUE, VALUE)
static VALUE rb_inflate_sync (VALUE, VALUE)
static VALUE rb_inflate_sync_point_p (VALUE)
static VALUE rb_inflate_set_dictionary (VALUE, VALUE)
void Init_zlib (void)
int rb_io_extract_encoding_option (VALUE opt, rb_encoding **enc_p, rb_encoding **enc2_p)
VALUE rb_str_conv_enc_opts (VALUE, rb_encoding *, rb_encoding *, int, VALUE)
static void raise_zlib_error (int err, const char *msg)
static VALUE do_checksum (int argc, VALUE *argv, uLong *func)

Variables

static VALUE cZError
static VALUE cStreamEnd
static VALUE cNeedDict
static VALUE cStreamError
static VALUE cDataError
static VALUE cMemError
static VALUE cBufError
static VALUE cVersionError
static struct zstream_funcs deflate_funcs
static struct zstream_funcs inflate_funcs

Define Documentation

#define ARG_FLUSH (   val  )     FIXNUMARG((val), Z_NO_FLUSH)

Definition at line 1157 of file zlib.c.

Referenced by rb_deflate_deflate().

#define ARG_LEVEL (   val  )     FIXNUMARG((val), Z_DEFAULT_COMPRESSION)

Definition at line 1153 of file zlib.c.

Referenced by rb_deflate_initialize(), rb_deflate_params(), and rb_deflate_s_deflate().

#define ARG_MEMLEVEL (   val  )     FIXNUMARG((val), DEF_MEM_LEVEL)

Definition at line 1155 of file zlib.c.

Referenced by rb_deflate_initialize().

#define ARG_STRATEGY (   val  )     FIXNUMARG((val), Z_DEFAULT_STRATEGY)

Definition at line 1156 of file zlib.c.

Referenced by rb_deflate_initialize(), and rb_deflate_params().

#define ARG_WBITS (   val  )     FIXNUMARG((val), MAX_WBITS)

Definition at line 1154 of file zlib.c.

Referenced by rb_deflate_initialize(), and rb_inflate_initialize().

#define DEF_MEM_LEVEL   MAX_MEM_LEVEL

Definition at line 41 of file zlib.c.

Referenced by Init_zlib().

#define FIXNUMARG (   val,
  ifnil 
)
Value:
(NIL_P((val)) ? (ifnil) \
    : ((void)Check_Type((val), T_FIXNUM), FIX2INT((val))))

Definition at line 1149 of file zlib.c.

Referenced by rb_deflate_flush().

#define OBJ_IS_FREED (   val  )     (RBASIC(val)->flags == 0)

Definition at line 30 of file zlib.c.

#define rb_zlib_adler32_combine   rb_f_notimplement

Definition at line 350 of file zlib.c.

Referenced by Init_zlib().

#define rb_zlib_crc32_combine   rb_f_notimplement

Definition at line 384 of file zlib.c.

Referenced by Init_zlib().

#define RUBY_ZLIB_VERSION   "0.6.0"

Definition at line 27 of file zlib.c.

Referenced by Init_zlib().

#define VALGRIND_MAKE_MEM_DEFINED (   p,
  n 
)

Definition at line 23 of file zlib.c.

Referenced by zlib_mem_alloc().

#define VALGRIND_MAKE_MEM_UNDEFINED (   p,
  n 
)

Definition at line 24 of file zlib.c.

#define zstream_append_buffer2 (   z,
  v 
)    zstream_append_buffer((z),(Bytef*)RSTRING_PTR(v),RSTRING_LEN(v))

Definition at line 569 of file zlib.c.

Referenced by rb_inflate_addstr(), rb_inflate_inflate(), and zstream_passthrough_input().

#define zstream_append_input2 (   z,
  v 
)
Value:

Definition at line 663 of file zlib.c.

#define ZSTREAM_AVAIL_OUT_STEP_MAX   16384

Definition at line 437 of file zlib.c.

Referenced by zstream_expand_buffer(), and zstream_shift_buffer().

#define ZSTREAM_AVAIL_OUT_STEP_MIN   2048

Definition at line 438 of file zlib.c.

Referenced by zstream_expand_buffer().

#define zstream_deflate_new (   klass  )     zstream_new((klass), &deflate_funcs)

Definition at line 894 of file zlib.c.

Referenced by rb_deflate_s_allocate().

#define ZSTREAM_FLAG_CLOSING   0x8

Definition at line 426 of file zlib.c.

#define ZSTREAM_FLAG_FINISHED   0x4

Definition at line 425 of file zlib.c.

#define ZSTREAM_FLAG_IN_STREAM   0x2

Definition at line 424 of file zlib.c.

Referenced by zstream_end().

#define ZSTREAM_FLAG_READY   0x1

Definition at line 423 of file zlib.c.

#define ZSTREAM_FLAG_UNUSED   0x10

Definition at line 427 of file zlib.c.

#define zstream_inflate_new (   klass  )     zstream_new((klass), &inflate_funcs)

Definition at line 895 of file zlib.c.

Referenced by rb_inflate_s_allocate().

#define zstream_init_deflate (   z  )     zstream_init((z), &deflate_funcs)

Definition at line 485 of file zlib.c.

Referenced by rb_deflate_s_deflate().

#define zstream_init_inflate (   z  )     zstream_init((z), &inflate_funcs)

Definition at line 486 of file zlib.c.

Referenced by rb_inflate_s_inflate().

#define ZSTREAM_INITIAL_BUFSIZE   1024

Definition at line 436 of file zlib.c.

Referenced by zstream_expand_buffer().

#define ZSTREAM_IS_CLOSING (   z  )     ((z)->flags & ZSTREAM_FLAG_CLOSING)

Definition at line 432 of file zlib.c.

#define ZSTREAM_IS_FINISHED (   z  )     ((z)->flags & ZSTREAM_FLAG_FINISHED)

Definition at line 431 of file zlib.c.

Referenced by rb_inflate_addstr(), rb_inflate_inflate(), and rb_zstream_finished_p().

#define ZSTREAM_IS_READY (   z  )     ((z)->flags & ZSTREAM_FLAG_READY)

Definition at line 430 of file zlib.c.

Referenced by get_zstream(), rb_zstream_closed_p(), zstream_end(), and zstream_free().

#define ZSTREAM_READY (   z  )     ((z)->flags |= ZSTREAM_FLAG_READY)

Function Documentation

static VALUE deflate_run ( VALUE  args  )  [static]

Definition at line 1221 of file zlib.c.

References RSTRING_LEN, RSTRING_PTR, zstream_detach_buffer(), and zstream_run().

Referenced by rb_deflate_s_deflate().

static VALUE do_checksum ( int  argc,
VALUE argv,
uLong *  func 
) [static]

Definition at line 289 of file zlib.c.

References func, NIL_P, NUM2ULONG, rb_scan_args(), rb_uint2inum(), RSTRING_LEN, RSTRING_PTR, and StringValue.

static VALUE do_checksum ( int  ,
VALUE ,
uLong(*)(uLong, const Bytef *, uInt)   
) [static]

Referenced by rb_zlib_adler32(), and rb_zlib_crc32().

static void do_deflate ( struct zstream z,
VALUE  src,
int  flush 
) [static]

Definition at line 1277 of file zlib.c.

References NIL_P, RSTRING_LEN, RSTRING_PTR, StringValue, and zstream_run().

Referenced by rb_deflate_addstr(), and rb_deflate_deflate().

static void do_inflate ( struct zstream z,
VALUE  src 
) [static]

Definition at line 1522 of file zlib.c.

References NIL_P, RSTRING_LEN, RSTRING_PTR, StringValue, and zstream_run().

Referenced by rb_inflate_addstr(), and rb_inflate_inflate().

static void finalizer_warn ( const char *  msg  )  [static]

Definition at line 267 of file zlib.c.

Referenced by zstream_finalize().

static struct zstream * get_zstream ( VALUE  obj  )  [static, read]
static VALUE inflate_run ( VALUE  args  )  [static]

Definition at line 1471 of file zlib.c.

References RSTRING_LEN, RSTRING_PTR, zstream_detach_buffer(), and zstream_run().

Referenced by rb_inflate_s_inflate().

void Init_zlib ( void   ) 
static NORETURN ( void   raise_zlib_errorint, const char *  )  [static]
static void raise_zlib_error ( int  err,
const char *  msg 
) [static]
static VALUE rb_deflate_addstr ( VALUE  obj,
VALUE  src 
) [static]

Definition at line 1326 of file zlib.c.

References do_deflate(), get_zstream(), and OBJ_INFECT.

Referenced by Init_zlib().

static VALUE rb_deflate_deflate ( int  argc,
VALUE argv,
VALUE  obj 
) [static]

Definition at line 1304 of file zlib.c.

References ARG_FLUSH, do_deflate(), get_zstream(), OBJ_INFECT, rb_scan_args(), and zstream_detach_buffer().

Referenced by Init_zlib().

static VALUE rb_deflate_flush ( int  argc,
VALUE argv,
VALUE  obj 
) [static]

Definition at line 1343 of file zlib.c.

References FIXNUMARG, get_zstream(), OBJ_INFECT, rb_scan_args(), zstream_detach_buffer(), and zstream_run().

Referenced by Init_zlib().

static VALUE rb_deflate_init_copy ( VALUE  self,
VALUE  orig 
) [static]
static VALUE rb_deflate_initialize ( int  argc,
VALUE argv,
VALUE  obj 
) [static]
static VALUE rb_deflate_params ( VALUE  obj,
VALUE  v_level,
VALUE  v_strategy 
) [static]
static VALUE rb_deflate_s_allocate ( VALUE  klass  )  [static]

Definition at line 1161 of file zlib.c.

References zstream_deflate_new.

Referenced by Init_zlib().

static VALUE rb_deflate_s_deflate ( int  argc,
VALUE argv,
VALUE  klass 
) [static]
static VALUE rb_deflate_set_dictionary ( VALUE  obj,
VALUE  dic 
) [static]

Definition at line 1407 of file zlib.c.

References err, get_zstream(), OBJ_INFECT, raise_zlib_error(), RSTRING_LEN, RSTRING_PTR, zstream::stream, and StringValue.

Referenced by Init_zlib().

static VALUE rb_inflate_addstr ( VALUE  obj,
VALUE  src 
) [static]
static VALUE rb_inflate_inflate ( VALUE  obj,
VALUE  src 
) [static]
static VALUE rb_inflate_initialize ( int  argc,
VALUE argv,
VALUE  obj 
) [static]

Definition at line 1452 of file zlib.c.

References ARG_WBITS, Data_Get_Struct, err, raise_zlib_error(), rb_scan_args(), zstream::stream, and ZSTREAM_READY.

Referenced by Init_zlib().

static VALUE rb_inflate_s_allocate ( VALUE  klass  )  [static]

Definition at line 1438 of file zlib.c.

References zstream_inflate_new.

Referenced by Init_zlib().

static VALUE rb_inflate_s_inflate ( VALUE  obj,
VALUE  src 
) [static]
static VALUE rb_inflate_set_dictionary ( VALUE  obj,
VALUE  dic 
) [static]

Definition at line 1656 of file zlib.c.

References err, get_zstream(), OBJ_INFECT, raise_zlib_error(), RSTRING_LEN, RSTRING_PTR, zstream::stream, and StringValue.

Referenced by Init_zlib().

static VALUE rb_inflate_sync ( VALUE  obj,
VALUE  src 
) [static]

Definition at line 1617 of file zlib.c.

References get_zstream(), OBJ_INFECT, RSTRING_LEN, RSTRING_PTR, StringValue, and zstream_sync().

Referenced by Init_zlib().

static VALUE rb_inflate_sync_point_p ( VALUE  obj  )  [static]

Definition at line 1634 of file zlib.c.

References err, get_zstream(), raise_zlib_error(), and zstream::stream.

Referenced by Init_zlib().

int rb_io_extract_encoding_option ( VALUE  opt,
rb_encoding **  enc_p,
rb_encoding **  enc2_p 
)

Referenced by rb_io_extract_modeenc().

VALUE rb_str_conv_enc_opts ( VALUE  ,
rb_encoding ,
rb_encoding ,
int  ,
VALUE   
)

Referenced by rb_str_conv_enc().

static VALUE rb_zlib_adler32 ( int  argc,
VALUE argv,
VALUE  klass 
) [static]

Definition at line 329 of file zlib.c.

References do_checksum().

Referenced by Init_zlib().

static VALUE rb_zlib_crc32 ( int  argc,
VALUE argv,
VALUE  klass 
) [static]

Definition at line 363 of file zlib.c.

References do_checksum().

Referenced by Init_zlib().

static VALUE rb_zlib_crc_table ( VALUE  obj  )  [static]

Definition at line 391 of file zlib.c.

References rb_ary_new2(), rb_ary_push(), and rb_uint2inum().

Referenced by Init_zlib().

static VALUE rb_zlib_version ( VALUE  klass  )  [static]

Definition at line 279 of file zlib.c.

References OBJ_TAINT, and rb_str_new2().

Referenced by Init_zlib().

static VALUE rb_zstream_adler ( VALUE  obj  )  [static]

Definition at line 1114 of file zlib.c.

References get_zstream(), rb_uint2inum(), and zstream::stream.

Referenced by Init_zlib().

static VALUE rb_zstream_avail_in ( VALUE  obj  )  [static]

Definition at line 1074 of file zlib.c.

References Data_Get_Struct, zstream::input, INT2FIX, NIL_P, and RSTRING_LEN.

Referenced by Init_zlib().

static VALUE rb_zstream_avail_out ( VALUE  obj  )  [static]

Definition at line 1047 of file zlib.c.

References Data_Get_Struct, rb_uint2inum(), and zstream::stream.

Referenced by Init_zlib().

static VALUE rb_zstream_closed_p ( VALUE  obj  )  [static]

Definition at line 1132 of file zlib.c.

References Data_Get_Struct, Qfalse, and ZSTREAM_IS_READY.

Referenced by Init_zlib().

static VALUE rb_zstream_data_type ( VALUE  obj  )  [static]

Definition at line 1105 of file zlib.c.

References get_zstream(), INT2FIX, and zstream::stream.

Referenced by Init_zlib().

static VALUE rb_zstream_end ( VALUE  obj  )  [static]

Definition at line 978 of file zlib.c.

References get_zstream(), and zstream_end().

Referenced by Init_zlib().

static VALUE rb_zstream_finish ( VALUE  obj  )  [static]

Definition at line 1000 of file zlib.c.

References get_zstream(), OBJ_INFECT, zstream_detach_buffer(), and zstream_run().

Referenced by Init_zlib().

static VALUE rb_zstream_finished_p ( VALUE  obj  )  [static]

Definition at line 1123 of file zlib.c.

References get_zstream(), Qtrue, and ZSTREAM_IS_FINISHED.

Referenced by Init_zlib().

static VALUE rb_zstream_flush_next_in ( VALUE  obj  )  [static]

Definition at line 1016 of file zlib.c.

References Data_Get_Struct, OBJ_INFECT, and zstream_detach_input().

Referenced by Init_zlib().

static VALUE rb_zstream_flush_next_out ( VALUE  obj  )  [static]

Definition at line 1031 of file zlib.c.

References Data_Get_Struct, OBJ_INFECT, and zstream_detach_buffer().

Referenced by Init_zlib().

static VALUE rb_zstream_reset ( VALUE  obj  )  [static]

Definition at line 989 of file zlib.c.

References get_zstream(), and zstream_reset().

Referenced by Init_zlib().

static VALUE rb_zstream_set_avail_out ( VALUE  obj,
VALUE  size 
) [static]

Definition at line 1061 of file zlib.c.

References Check_Type, FIX2INT, get_zstream(), T_FIXNUM, and zstream_expand_buffer_into().

Referenced by Init_zlib().

static VALUE rb_zstream_total_in ( VALUE  obj  )  [static]

Definition at line 1085 of file zlib.c.

References get_zstream(), rb_uint2inum(), and zstream::stream.

Referenced by Init_zlib().

static VALUE rb_zstream_total_out ( VALUE  obj  )  [static]

Definition at line 1094 of file zlib.c.

References get_zstream(), rb_uint2inum(), and zstream::stream.

Referenced by Init_zlib().

static voidpf zlib_mem_alloc ( voidpf  opaque,
uInt  items,
uInt  size 
) [static]

Definition at line 450 of file zlib.c.

References VALGRIND_MAKE_MEM_DEFINED, and xmalloc.

static void zlib_mem_free ( voidpf  opaque,
voidpf  address 
) [static]

Definition at line 462 of file zlib.c.

References xfree().

static void zstream_append_buffer ( struct zstream z,
const Bytef *  src,
int  len 
) [static]
static void zstream_append_input ( struct zstream z,
const Bytef *  src,
unsigned int  len 
) [static]

Definition at line 649 of file zlib.c.

References zstream::input, NIL_P, rb_str_buf_cat(), rb_str_buf_new(), and RBASIC.

Referenced by zstream_run(), and zstream_sync().

static void zstream_buffer_ungetbyte ( struct zstream z,
int  c 
) [static]
static void zstream_buffer_ungets ( struct zstream z,
const Bytef *  b,
int  len 
) [static]
static VALUE zstream_detach_buffer ( struct zstream z  )  [static]
static VALUE zstream_detach_input ( struct zstream z  )  [static]

Definition at line 696 of file zlib.c.

References zstream::input, NIL_P, rb_cString, rb_str_new(), and RBASIC.

Referenced by rb_zstream_flush_next_in().

static void zstream_discard_input ( struct zstream z,
unsigned int  len 
) [static]

Definition at line 668 of file zlib.c.

References zstream::input, memmove(), NIL_P, rb_str_resize(), RSTRING_LEN, and RSTRING_PTR.

Referenced by zstream_sync().

static VALUE zstream_end ( struct zstream z  )  [static]
static void zstream_expand_buffer ( struct zstream z  )  [static]
static void zstream_expand_buffer_into ( struct zstream z,
unsigned int  size 
) [static]
static void zstream_finalize ( struct zstream z  )  [static]

Definition at line 864 of file zlib.c.

References zstream::zstream_funcs::end, err, finalizer_warn(), zstream::func, and zstream::stream.

Referenced by zstream_free().

static void zstream_free ( struct zstream z  )  [static]

Definition at line 874 of file zlib.c.

References xfree(), zstream_finalize(), and ZSTREAM_IS_READY.

Referenced by zstream_new().

static void zstream_init ( struct zstream z,
const struct zstream_funcs *  func 
) [static]

Definition at line 468 of file zlib.c.

References zstream::buf, zstream::buf_filled, zstream::flags, zstream::func, zstream::input, and zstream::stream.

Referenced by zstream_new().

static void zstream_mark ( struct zstream z  )  [static]

Definition at line 857 of file zlib.c.

References zstream::buf, zstream::input, and rb_gc_mark().

Referenced by zstream_new().

static VALUE zstream_new ( VALUE  klass,
const struct zstream_funcs *  funcs 
) [static]

Definition at line 883 of file zlib.c.

References Data_Make_Struct, zstream_free(), zstream_init(), and zstream_mark().

static void zstream_passthrough_input ( struct zstream z  )  [static]

Definition at line 687 of file zlib.c.

References zstream::input, NIL_P, and zstream_append_buffer2.

Referenced by rb_inflate_addstr(), and rb_inflate_inflate().

static void zstream_reset ( struct zstream z  )  [static]
static void zstream_reset_input ( struct zstream z  )  [static]

Definition at line 681 of file zlib.c.

References zstream::input.

Referenced by zstream_end(), zstream_reset(), zstream_run(), and zstream_sync().

static void zstream_run ( struct zstream z,
Bytef *  src,
uInt  len,
int  flush 
) [static]
static VALUE zstream_shift_buffer ( struct zstream z,
int  len 
) [static]
static VALUE zstream_sync ( struct zstream z,
Bytef *  src,
uInt  len 
) [static]

Variable Documentation

VALUE cBufError [static]

Definition at line 216 of file zlib.c.

VALUE cDataError [static]

Definition at line 216 of file zlib.c.

VALUE cMemError [static]

Definition at line 216 of file zlib.c.

VALUE cNeedDict [static]

Definition at line 215 of file zlib.c.

VALUE cStreamEnd [static]

Definition at line 215 of file zlib.c.

VALUE cStreamError [static]

Definition at line 216 of file zlib.c.

VALUE cVersionError [static]

Definition at line 216 of file zlib.c.

VALUE cZError [static]

Definition at line 215 of file zlib.c.

struct zstream_funcs deflate_funcs [static]
Initial value:
 {
    deflateReset, deflateEnd, deflate,
}

Definition at line 440 of file zlib.c.

struct zstream_funcs inflate_funcs [static]
Initial value:
 {
    inflateReset, inflateEnd, inflate,
}

Definition at line 444 of file zlib.c.