Bug #4695 ยป ruby_doc_updates-20110513-2043_vbatts.patch
ext/zlib/zlib.c | ||
---|---|---|
static VALUE rb_gzreader_readlines(int, VALUE*, VALUE);
|
||
#endif /* GZIP_SUPPORT */
|
||
/*
|
||
* Document-module: Zlib
|
||
*
|
||
* == Overview
|
||
*
|
||
* Access to the zlib library.
|
||
*
|
||
* == Class tree
|
||
*
|
||
* - Zlib::Deflate
|
||
* - Zlib::Inflate
|
||
* - Zlib::ZStream
|
||
* - Zlib::Error
|
||
* - Zlib::StreamEnd
|
||
* - Zlib::NeedDict
|
||
* - Zlib::DataError
|
||
* - Zlib::StreamError
|
||
* - Zlib::MemError
|
||
* - Zlib::BufError
|
||
* - Zlib::VersionError
|
||
*
|
||
* (if you have GZIP_SUPPORT)
|
||
* - Zlib::GzipReader
|
||
* - Zlib::GzipWriter
|
||
* - Zlib::GzipFile
|
||
* - Zlib::GzipFile::Error
|
||
* - Zlib::GzipFile::LengthError
|
||
* - Zlib::GzipFile::CRCError
|
||
* - Zlib::GzipFile::NoFooter
|
||
*
|
||
* see also zlib.h
|
||
*
|
||
*/
|
||
void Init_zlib(void);
|
||
/*--------- Exceptions --------*/
|
||
... | ... | |
/*-------- module Zlib --------*/
|
||
/*
|
||
* Document-method: Zlib.zlib_version
|
||
*
|
||
* Returns the string which represents the version of zlib library.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib.adler32
|
||
*
|
||
* call-seq: Zlib.adler32(string, adler)
|
||
*
|
||
* Calculates Adler-32 checksum for +string+, and returns updated value of
|
||
... | ... | |
#ifdef HAVE_ADLER32_COMBINE
|
||
/*
|
||
* Document-method: Zlib.adler32_combine
|
||
*
|
||
* call-seq: Zlib.adler32_combine(adler1, adler2, len2)
|
||
*
|
||
* Combine two Adler-32 check values in to one. +alder1+ is the first Adler-32
|
||
... | ... | |
#endif
|
||
/*
|
||
* Document-method: Zlib.crc32
|
||
*
|
||
* call-seq: Zlib.crc32(string, adler)
|
||
*
|
||
* Calculates CRC checksum for +string+, and returns updated value of +crc+. If
|
||
... | ... | |
#ifdef HAVE_CRC32_COMBINE
|
||
/*
|
||
* Document-method: Zlib.crc32_combine
|
||
*
|
||
* call-seq: Zlib.crc32_combine(crc1, crc2, len2)
|
||
*
|
||
* Combine two CRC-32 check values in to one. +crc1+ is the first CRC-32
|
||
... | ... | |
#endif
|
||
/*
|
||
* Document-method: Zlib.crc_table
|
||
*
|
||
* Returns the table for calculating CRC checksum as an array.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
/*
|
||
* Guesses the type of the data which have been inputed into the stream. The
|
||
* returned value is either <tt>Zlib::BINARY</tt>, <tt>Zlib::ASCII</tt>, or
|
||
* <tt>Zlib::UNKNOWN</tt>.
|
||
* returned value is either <tt>BINARY</tt>, <tt>ASCII</tt>, or
|
||
* <tt>UNKNOWN</tt>.
|
||
*/
|
||
static VALUE
|
||
rb_zstream_data_type(VALUE obj)
|
||
... | ... | |
/*
|
||
* Document-class: Zlib::Deflate
|
||
*
|
||
* Zlib::Deflate is the class for compressing data. See Zlib::Stream for more
|
||
* Zlib::Deflate is the class for compressing data. See Zlib::ZStream for more
|
||
* information.
|
||
*/
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::Deflate.new
|
||
*
|
||
* call-seq: Zlib::Deflate.new(level=nil, windowBits=nil, memlevel=nil, strategy=nil)
|
||
*
|
||
* == Arguments
|
||
*
|
||
* +level+::
|
||
* An Integer compression level between
|
||
* BEST_SPEED and BEST_COMPRESSION
|
||
* +windowBits+::
|
||
* An Integer for the windowBits size. Should be
|
||
* in the range 8..15, larger values of this parameter
|
||
* result in better at the expense of memory usage.
|
||
* +memlevel+::
|
||
* Specifies how much memory should be allocated for
|
||
* the internal compression state.
|
||
* Between DEF_MEM_LEVEL and MAX_MEM_LEVEL
|
||
* +strategy+::
|
||
* A parameter to tune the compression algorithm. Use the
|
||
* DEFAULT_STRATEGY for normal data, FILTERED for data produced by a
|
||
* filter (or predictor), HUFFMAN_ONLY to force Huffman encoding only (no
|
||
* string match).
|
||
*
|
||
* == Description
|
||
*
|
||
* Creates a new deflate stream for compression. See zlib.h for details of
|
||
* each argument. If an argument is nil, the default value of that argument is
|
||
* used.
|
||
*
|
||
* TODO: document better!
|
||
*
|
||
* == examples
|
||
*
|
||
* === basic
|
||
*
|
||
* f = File.new("compressed.file","w+")
|
||
* #=> #<File:compressed.file>
|
||
* f << Zlib::Deflate.new().deflate(File.read("big.file"))
|
||
* #=> #<File:compressed.file>
|
||
* f.close
|
||
* #=> nil
|
||
*
|
||
* === a little more robust
|
||
*
|
||
* compressed_file = File.open("compressed.file", "w+")
|
||
* #=> #<File:compressed.file>
|
||
* zd = Zlib::Deflate.new(Zlib::BEST_COMPRESSION, 15, Zlib::MAX_MEM_LEVEL, Zlib::HUFFMAN_ONLY)
|
||
* #=> #<Zlib::Deflate:0x000000008610a0>
|
||
* compressed_file << zd.deflate(File.read("big.file"))
|
||
* #=> "\xD4z\xC6\xDE\b\xA1K\x1Ej\x8A ..."
|
||
* compressed_file.close
|
||
* #=> nil
|
||
* zd.close
|
||
* #=> nil
|
||
*
|
||
* (while this example will work, for best optimization the flags need to be reviewed for your specific function)
|
||
*
|
||
*/
|
||
static VALUE
|
||
rb_deflate_initialize(int argc, VALUE *argv, VALUE obj)
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::Deflate#initialize_copy
|
||
*
|
||
* Duplicates the deflate stream.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::Deflate.deflate
|
||
*
|
||
* call-seq: Zlib.deflate(string[, level])
|
||
* Zlib::Deflate.deflate(string[, level])
|
||
*
|
||
* Compresses the given +string+. Valid values of level are
|
||
* <tt>Zlib::NO_COMPRESSION</tt>, <tt>Zlib::BEST_SPEED</tt>,
|
||
* <tt>Zlib::BEST_COMPRESSION</tt>, <tt>Zlib::DEFAULT_COMPRESSION</tt>, and an
|
||
* <tt>NO_COMPRESSION</tt>, <tt>BEST_SPEED</tt>,
|
||
* <tt>BEST_COMPRESSION</tt>, <tt>DEFAULT_COMPRESSION</tt>, and an
|
||
* integer from 0 to 9 (the default is 6).
|
||
*
|
||
* This method is almost equivalent to the following code:
|
||
*
|
||
* def deflate(string, level)
|
||
* z = Zlib::Deflate.new(level)
|
||
* dst = z.deflate(string, Zlib::FINISH)
|
||
* dst = z.deflate(string, Zlib::NO_FLUSH)
|
||
* z.close
|
||
* dst
|
||
* end
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib.deflate
|
||
*
|
||
* call-seq: deflate(string[, flush])
|
||
*
|
||
* == Arguments
|
||
*
|
||
* +string+::
|
||
* String
|
||
*
|
||
* +flush+::
|
||
* Integer representing a flush code. Either NO_FLUSH,
|
||
* SYNC_FLUSH, FULL_FLUSH, or FINISH. See zlib.h for details.
|
||
* Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
|
||
* decide how much data to accumualte before producing output, in order to
|
||
* maximize compression.
|
||
*
|
||
* == Description
|
||
*
|
||
* Inputs +string+ into the deflate stream and returns the output from the
|
||
* stream. On calling this method, both the input and the output buffers of
|
||
* the stream are flushed. If +string+ is nil, this method finishes the
|
||
* the stream are flushed.
|
||
*
|
||
* If +string+ is nil, this method finishes the
|
||
* stream, just like Zlib::ZStream#finish.
|
||
*
|
||
* The value of +flush+ should be either <tt>Zlib::NO_FLUSH</tt>,
|
||
* <tt>Zlib::SYNC_FLUSH</tt>, <tt>Zlib::FULL_FLUSH</tt>, or
|
||
* <tt>Zlib::FINISH</tt>. See zlib.h for details.
|
||
* == Usage
|
||
*
|
||
* comp = Zlib.deflate(File.read("big.file"))
|
||
* or
|
||
* comp = Zlib.deflate(File.read("big.file"), Zlib::FULL_FLUSH)
|
||
*
|
||
* TODO: document better!
|
||
*/
|
||
static VALUE
|
||
rb_deflate_deflate(int argc, VALUE *argv, VALUE obj)
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::Deflate.<<
|
||
*
|
||
* call-seq: << string
|
||
*
|
||
* Inputs +string+ into the deflate stream just like Zlib::Deflate#deflate, but
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::Deflate#flush
|
||
*
|
||
* call-seq: flush(flush)
|
||
*
|
||
* This method is equivalent to <tt>deflate('', flush)</tt>. If flush is omitted,
|
||
* <tt>Zlib::SYNC_FLUSH</tt> is used as flush. This method is just provided
|
||
* <tt>SYNC_FLUSH</tt> is used as flush. This method is just provided
|
||
* to improve the readability of your Ruby program.
|
||
*
|
||
* TODO: document better!
|
||
* Please visit your zlib.h for a deeper detail on NO_FLUSH, SYNC_FLUSH, FULL_FLUSH, and FINISH
|
||
*
|
||
*/
|
||
static VALUE
|
||
rb_deflate_flush(int argc, VALUE *argv, VALUE obj)
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::Deflate.params
|
||
*
|
||
* call-seq: params(level, strategy)
|
||
*
|
||
* Changes the parameters of the deflate stream. See zlib.h for details. The
|
||
* output from the stream by changing the params is preserved in output
|
||
* buffer.
|
||
*
|
||
* TODO: document better!
|
||
* +level+::
|
||
* An Integer compression level between
|
||
* BEST_SPEED and BEST_COMPRESSION
|
||
* +strategy+::
|
||
* A parameter to tune the compression algorithm. Use the
|
||
* DEFAULT_STRATEGY for normal data, FILTERED for data produced by a
|
||
* filter (or predictor), HUFFMAN_ONLY to force Huffman encoding only (no
|
||
* string match).
|
||
*
|
||
*/
|
||
static VALUE
|
||
rb_deflate_params(VALUE obj, VALUE v_level, VALUE v_strategy)
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::Deflate.set_dictionary
|
||
*
|
||
* call-seq: set_dictionary(string)
|
||
*
|
||
* Sets the preset dictionary and returns +string+. This method is available
|
||
* just only after Zlib::Deflate.new or Zlib::ZStream#reset method was called.
|
||
* See zlib.h for details.
|
||
*
|
||
* TODO: document better!
|
||
* Can raise errors of Z_STREAM_ERROR if a parameter is invalid (such as
|
||
* NULL dictionary) or the stream state is inconsistent, Z_DATA_ERROR if
|
||
* the given dictionary doesn't match the expected one (incorrect adler32 value)
|
||
*
|
||
*/
|
||
static VALUE
|
||
rb_deflate_set_dictionary(VALUE obj, VALUE dic)
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::Inflate.new
|
||
*
|
||
* call-seq: Zlib::Inflate.new(window_bits)
|
||
*
|
||
* == Arguments
|
||
*
|
||
* +windowBits+::
|
||
* An Integer for the windowBits size. Should be
|
||
* in the range 8..15, larger values of this parameter
|
||
* result in better at the expense of memory usage.
|
||
*
|
||
* == Description
|
||
*
|
||
* Creates a new inflate stream for decompression. See zlib.h for details
|
||
* of the argument. If +window_bits+ is +nil+, the default value is used.
|
||
*
|
||
* TODO: document better!
|
||
* == Example
|
||
*
|
||
* cf = File.open("compressed.file")
|
||
* ucf = File.open("uncompressed.file", "w+")
|
||
* zi = Zlib::Inflate.new(Zlib::MAX_WBITS)
|
||
*
|
||
* ucf << zi.inflate(cf.read)
|
||
*
|
||
* ucf.close
|
||
* zi.close
|
||
* cf.close
|
||
*
|
||
* or
|
||
*
|
||
* File.open("compressed.file") {|cf|
|
||
* zi = Zlib::Inflate.new
|
||
* File.open("uncompressed.file", "w+") {|ucf|
|
||
* ucf << zi.inflate(cf.read)
|
||
* }
|
||
* zi.close
|
||
* }
|
||
*
|
||
*/
|
||
static VALUE
|
||
rb_inflate_initialize(int argc, VALUE *argv, VALUE obj)
|
||
... | ... | |
}
|
||
/*
|
||
* call-seq: Zlib.inflate(string)
|
||
* Zlib::Inflate.inflate(string)
|
||
* Document-method: Zlib::Inflate.inflate
|
||
*
|
||
* call-seq: Zlib::Inflate.inflate(string)
|
||
*
|
||
* Decompresses +string+. Raises a Zlib::NeedDict exception if a preset
|
||
* dictionary is needed for decompression.
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::Inflate#inflate
|
||
*
|
||
* call-seq: inflate(string)
|
||
*
|
||
* Inputs +string+ into the inflate stream and returns the output from the
|
||
... | ... | |
* decompress. Set the dictionary by Zlib::Inflate#set_dictionary and then
|
||
* call this method again with an empty string. (<i>???</i>)
|
||
*
|
||
* TODO: document better!
|
||
* See also Zlib::Inflate.new
|
||
*/
|
||
static VALUE
|
||
rb_inflate_inflate(VALUE obj, VALUE src)
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::Inflate#set_dictionary
|
||
*
|
||
* Sets the preset dictionary and returns +string+. This method is available just
|
||
* only after a Zlib::NeedDict exception was raised. See zlib.h for details.
|
||
*
|
||
* TODO: document better!
|
||
*/
|
||
static VALUE
|
||
rb_inflate_set_dictionary(VALUE obj, VALUE dic)
|
||
... | ... | |
rb_exc_raise(exc);
|
||
}
|
||
/*
|
||
* Document-method: Zlib::GzipFile::Error#inspect
|
||
*
|
||
* Constructs a String of the GzipFile Error
|
||
*/
|
||
static VALUE
|
||
gzfile_error_inspect(VALUE error)
|
||
{
|
||
... | ... | |
* Zlib::GzipReader for reading, and Zlib::GzipWriter for writing.
|
||
*
|
||
* GzipReader should be used by associating an IO, or IO-like, object.
|
||
*
|
||
* == Method Catalogue
|
||
*
|
||
* - wrap
|
||
* - open
|
||
* - #close
|
||
* - #closed?
|
||
* - #comment
|
||
* - #comment=
|
||
* - #crc
|
||
* - #eof?
|
||
* - #finish
|
||
* - #level
|
||
* - #lineno
|
||
* - #lineno=
|
||
* - #mtime
|
||
* - #mtime=
|
||
* - #orig_name
|
||
* - #orig_name=
|
||
* - #os_code
|
||
* - #path
|
||
* - #sync
|
||
* - #sync=
|
||
* - #to_io
|
||
* - #total_in
|
||
* - #total_out
|
||
*
|
||
* (due to internal sturcture, documentation may appear under
|
||
* Zlib::GzipReader or Zlib::GzipWriter )
|
||
*/
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipFile.wrap
|
||
*
|
||
* call-seq: Zlib::GzipFile.wrap(io) { |gz| ... }
|
||
*
|
||
* Creates a GzipFile object associated with +io+, and
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipFile.open
|
||
*
|
||
* See Zlib::GzipReader#open and Zlib::GzipWriter#open.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipFile#to_io
|
||
*
|
||
* Same as IO.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipFile#crc
|
||
*
|
||
* Returns CRC value of the uncompressed data.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipFile#mtime
|
||
*
|
||
* Returns last modification time recorded in the gzip file header.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipFile#level
|
||
*
|
||
* Returns compression level.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipFile#os_code
|
||
*
|
||
* Returns OS code number recorded in the gzip file header.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipFile#orig_name
|
||
*
|
||
* Returns original filename recorded in the gzip file header, or +nil+ if
|
||
* original filename is not present.
|
||
*/
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipFile#comment
|
||
*
|
||
* Returns comments recorded in the gzip file header, or nil if the comments
|
||
* is not present.
|
||
*/
|
||
... | ... | |
}
|
||
/*
|
||
* ???
|
||
* Document-method: Zlib::GzipFile#lineno
|
||
*
|
||
* The line number of the last row read from this file.
|
||
*/
|
||
static VALUE
|
||
rb_gzfile_lineno(VALUE obj)
|
||
... | ... | |
}
|
||
/*
|
||
* ???
|
||
* Document-method: Zlib::GzipFile#set_lineno
|
||
*
|
||
* Specify line number of the last row read from this file.
|
||
*/
|
||
static VALUE
|
||
rb_gzfile_set_lineno(VALUE obj, VALUE lineno)
|
||
... | ... | |
}
|
||
/*
|
||
* ???
|
||
* Document-method: Zlib::GzipFile#set_mtime
|
||
*
|
||
* Specify the modification time (+mtime+) in the gzip header.
|
||
* Using a Fixnum or Integer
|
||
*/
|
||
static VALUE
|
||
rb_gzfile_set_mtime(VALUE obj, VALUE mtime)
|
||
... | ... | |
}
|
||
/*
|
||
* ???
|
||
* Document-method: Zlib::GzipFile#set_orig_name
|
||
*
|
||
* Specify the original name (+str+) in the gzip header.
|
||
*/
|
||
static VALUE
|
||
rb_gzfile_set_orig_name(VALUE obj, VALUE str)
|
||
... | ... | |
}
|
||
/*
|
||
* ???
|
||
* Document-method: Zlib::GzipFile#set_comment
|
||
*
|
||
* Specify the comment (+str+) in the gzip header.
|
||
*/
|
||
static VALUE
|
||
rb_gzfile_set_comment(VALUE obj, VALUE str)
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipFile#close
|
||
*
|
||
* Closes the GzipFile object. This method calls close method of the
|
||
* associated IO object. Returns the associated IO object.
|
||
*/
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipFile#finish
|
||
*
|
||
* Closes the GzipFile object. Unlike Zlib::GzipFile#close, this method never
|
||
* calls the close method of the associated IO object. Returns the associated IO
|
||
* object.
|
||
... | ... | |
}
|
||
/*
|
||
* Same as IO.
|
||
* Document-method: Zlib::GzipFile#closed?
|
||
*
|
||
* Same as IO#closed?
|
||
*
|
||
*/
|
||
static VALUE
|
||
rb_gzfile_closed_p(VALUE obj)
|
||
... | ... | |
}
|
||
/*
|
||
* ???
|
||
* Document-method: Zlib::GzipFile#eof?
|
||
*
|
||
* Returns +true+ or +false+ whether the stream has reached the end.
|
||
*/
|
||
static VALUE
|
||
rb_gzfile_eof_p(VALUE obj)
|
||
... | ... | |
}
|
||
/*
|
||
* Same as IO.
|
||
* Document-method: Zlib::GzipFile#sync
|
||
*
|
||
* Same as IO#sync
|
||
*
|
||
*/
|
||
static VALUE
|
||
rb_gzfile_sync(VALUE obj)
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipFile#set_sync
|
||
*
|
||
* call-seq: sync = flag
|
||
*
|
||
* Same as IO. If flag is +true+, the associated IO object must respond to the
|
||
... | ... | |
}
|
||
/*
|
||
* ???
|
||
* Document-method: Zlib::GzipFile#total_in
|
||
*
|
||
* Total number of input bytes read so far.
|
||
*/
|
||
static VALUE
|
||
rb_gzfile_total_in(VALUE obj)
|
||
... | ... | |
}
|
||
/*
|
||
* ???
|
||
* Document-method: Zlib::GzipFile#total_out
|
||
*
|
||
* Total number of output bytes output so far.
|
||
*/
|
||
static VALUE
|
||
rb_gzfile_total_out(VALUE obj)
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: path
|
||
* Document-method: Zlib::GzipFile#path
|
||
*
|
||
* call-seq: path
|
||
*
|
||
... | ... | |
* gz.close
|
||
* end
|
||
*
|
||
* # TODO: test these. Are they equivalent? Can GzipReader.new take a
|
||
* # block?
|
||
*
|
||
* == Method Catalogue
|
||
*
|
||
* The following methods in Zlib::GzipReader are just like their counterparts
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader.open
|
||
*
|
||
* call-seq: Zlib::GzipReader.open(filename) {|gz| ... }
|
||
*
|
||
* Opens a file specified by +filename+ as a gzipped file, and returns a
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader.new
|
||
*
|
||
* call-seq: Zlib::GzipReader.new(io)
|
||
*
|
||
* Creates a GzipReader object associated with +io+. The GzipReader object reads
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#rewind
|
||
*
|
||
* Resets the position of the file pointer to the point created the GzipReader
|
||
* object. The associated IO object needs to respond to the +seek+ method.
|
||
*/
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#unused
|
||
*
|
||
* Returns the rest of the data which had read for parsing gzip format, or
|
||
* +nil+ if the whole gzip file is not parsed yet.
|
||
*/
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#read
|
||
*
|
||
* See Zlib::GzipReader documentation for a description.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#readpartial
|
||
*
|
||
* call-seq:
|
||
* gzipreader.readpartial(maxlen [, outbuf]) => string, outbuf
|
||
*
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#getc
|
||
*
|
||
* See Zlib::GzipReader documentation for a description.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#readchar
|
||
*
|
||
* See Zlib::GzipReader documentation for a description.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#getbyte
|
||
*
|
||
* See Zlib::GzipReader documentation for a description.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#readbyte
|
||
*
|
||
* See Zlib::GzipReader documentation for a description.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#each_char
|
||
*
|
||
* See Zlib::GzipReader documentation for a description.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#each_byte
|
||
*
|
||
* See Zlib::GzipReader documentation for a description.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#ungetc
|
||
*
|
||
* See Zlib::GzipReader documentation for a description.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#ungetbyte
|
||
*
|
||
* See Zlib::GzipReader documentation for a description.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#gets
|
||
*
|
||
* See Zlib::GzipReader documentation for a description.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#readline
|
||
*
|
||
* See Zlib::GzipReader documentation for a description.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#each
|
||
*
|
||
* See Zlib::GzipReader documentation for a description.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
}
|
||
/*
|
||
* Document-method: Zlib::GzipReader#readlines
|
||
*
|
||
* See Zlib::GzipReader documentation for a description.
|
||
*/
|
||
static VALUE
|
||
... | ... | |
/*
|
||
* Document-module: Zlib
|
||
*
|
||
* The Zlib module contains several classes for compressing and decompressing
|
||
* streams, and for working with "gzip" files.
|
||
*
|
||
... | ... | |
rb_define_module_function(mZlib, "crc32_combine", rb_zlib_crc32_combine, 3);
|
||
rb_define_module_function(mZlib, "crc_table", rb_zlib_crc_table, 0);
|
||
/* The Ruby/zlib version string. */
|
||
rb_define_const(mZlib, "VERSION", rb_str_new2(RUBY_ZLIB_VERSION));
|
||
/* The string which represents the version of zlib.h */
|
||
rb_define_const(mZlib, "ZLIB_VERSION", rb_str_new2(ZLIB_VERSION));
|
||
cZStream = rb_define_class_under(mZlib, "ZStream", rb_cObject);
|
||
... | ... | |
rb_define_method(cZStream, "flush_next_in", rb_zstream_flush_next_in, 0);
|
||
rb_define_method(cZStream, "flush_next_out", rb_zstream_flush_next_out, 0);
|
||
/* Integer representing date types which
|
||
* ZStream#data_type method returns */
|
||
rb_define_const(mZlib, "BINARY", INT2FIX(Z_BINARY));
|
||
/* Integer representing date types which
|
||
* ZStream#data_type method returns */
|
||
rb_define_const(mZlib, "ASCII", INT2FIX(Z_ASCII));
|
||
/* Integer representing date types which
|
||
* ZStream#data_type method returns */
|
||
rb_define_const(mZlib, "UNKNOWN", INT2FIX(Z_UNKNOWN));
|
||
cDeflate = rb_define_class_under(mZlib, "Deflate", cZStream);
|
||
... | ... | |
rb_define_method(cInflate, "sync_point?", rb_inflate_sync_point_p, 0);
|
||
rb_define_method(cInflate, "set_dictionary", rb_inflate_set_dictionary, 1);
|
||
/* compression level 0
|
||
*
|
||
* Which is an argument for Deflate.new, Deflate#deflate, and so on. */
|
||
rb_define_const(mZlib, "NO_COMPRESSION", INT2FIX(Z_NO_COMPRESSION));
|
||
/* compression level 1
|
||
*
|
||
* Which is an argument for Deflate.new, Deflate#deflate, and so on. */
|
||
rb_define_const(mZlib, "BEST_SPEED", INT2FIX(Z_BEST_SPEED));
|
||
/* compression level 9
|
||
*
|
||
* Which is an argument for Deflate.new, Deflate#deflate, and so on. */
|
||
rb_define_const(mZlib, "BEST_COMPRESSION", INT2FIX(Z_BEST_COMPRESSION));
|
||
/* compression level -1
|
||
*
|
||
* Which is an argument for Deflate.new, Deflate#deflate, and so on. */
|
||
rb_define_const(mZlib, "DEFAULT_COMPRESSION",
|
||
INT2FIX(Z_DEFAULT_COMPRESSION));
|
||
/* compression method 1
|
||
*
|
||
* Which is an argument for Deflate.new and Deflate#params. */
|
||
rb_define_const(mZlib, "FILTERED", INT2FIX(Z_FILTERED));
|
||
/* compression method 2
|
||
*
|
||
* Which is an argument for Deflate.new and Deflate#params. */
|
||
rb_define_const(mZlib, "HUFFMAN_ONLY", INT2FIX(Z_HUFFMAN_ONLY));
|
||
/* compression method 0
|
||
*
|
||
* Which is an argument for Deflate.new and Deflate#params. */
|
||
rb_define_const(mZlib, "DEFAULT_STRATEGY", INT2FIX(Z_DEFAULT_STRATEGY));
|
||
/* The default value of windowBits which is an argument for
|
||
* Deflate.new and Inflate.new.
|
||
*/
|
||
rb_define_const(mZlib, "MAX_WBITS", INT2FIX(MAX_WBITS));
|
||
/* Default value is 8
|
||
*
|
||
* The integer representing memory levels.
|
||
* Which are an argument for Deflate.new, Deflate#params, and so on. */
|
||
rb_define_const(mZlib, "DEF_MEM_LEVEL", INT2FIX(DEF_MEM_LEVEL));
|
||
/* Maximum level is 9
|
||
*
|
||
* The integers representing memory levels which are an argument for
|
||
* Deflate.new, Deflate#params, and so on. */
|
||
rb_define_const(mZlib, "MAX_MEM_LEVEL", INT2FIX(MAX_MEM_LEVEL));
|
||
/* Output control - 0
|
||
*
|
||
* The integers to control the output of the deflate stream, which are
|
||
* an argument for Deflate#deflate and so on. */
|
||
rb_define_const(mZlib, "NO_FLUSH", INT2FIX(Z_NO_FLUSH));
|
||
/* Output control - 2
|
||
*
|
||
* The integers to control the output of the deflate stream, which are
|
||
* an argument for Deflate#deflate and so on. */
|
||
rb_define_const(mZlib, "SYNC_FLUSH", INT2FIX(Z_SYNC_FLUSH));
|
||
/* Output control - 3
|
||
*
|
||
* The integers to control the output of the deflate stream, which are
|
||
* an argument for Deflate#deflate and so on. */
|
||
rb_define_const(mZlib, "FULL_FLUSH", INT2FIX(Z_FULL_FLUSH));
|
||
/* Oputput control - 4
|
||
*
|
||
* The integers to control the output of the deflate stream, which are
|
||
* an argument for Deflate#deflate and so on. */
|
||
rb_define_const(mZlib, "FINISH", INT2FIX(Z_FINISH));
|
||
#if GZIP_SUPPORT
|
||
... | ... | |
cGzipFile = rb_define_class_under(mZlib, "GzipFile", rb_cObject);
|
||
cGzError = rb_define_class_under(cGzipFile, "Error", cZError);
|
||
/* ??? */
|
||
rb_define_attr(cGzError, "input", 1, 0);
|
||
rb_define_method(cGzError, "inspect", gzfile_error_inspect, 0);
|
||
... | ... | |
rb_define_method(cGzipReader, "lines", rb_gzreader_each, -1);
|
||
rb_define_method(cGzipReader, "readlines", rb_gzreader_readlines, -1);
|
||
/* From GzipFile#os_code - code of current host */
|
||
rb_define_const(mZlib, "OS_CODE", INT2FIX(OS_CODE));
|
||
/* From GzipFile#os_code - 0x00 */
|
||
rb_define_const(mZlib, "OS_MSDOS", INT2FIX(OS_MSDOS));
|
||
/* From GzipFile#os_code - 0x01 */
|
||
rb_define_const(mZlib, "OS_AMIGA", INT2FIX(OS_AMIGA));
|
||
/* From GzipFile#os_code - 0x02 */
|
||
rb_define_const(mZlib, "OS_VMS", INT2FIX(OS_VMS));
|
||
/* From GzipFile#os_code - 0x03 */
|
||
rb_define_const(mZlib, "OS_UNIX", INT2FIX(OS_UNIX));
|
||
/* From GzipFile#os_code - 0x05 */
|
||
rb_define_const(mZlib, "OS_ATARI", INT2FIX(OS_ATARI));
|
||
/* From GzipFile#os_code - 0x06 */
|
||
rb_define_const(mZlib, "OS_OS2", INT2FIX(OS_OS2));
|
||
/* From GzipFile#os_code - 0x07 */
|
||
rb_define_const(mZlib, "OS_MACOS", INT2FIX(OS_MACOS));
|
||
/* From GzipFile#os_code - 0x0a */
|
||
rb_define_const(mZlib, "OS_TOPS20", INT2FIX(OS_TOPS20));
|
||
/* From GzipFile#os_code - 0x0b */
|
||
rb_define_const(mZlib, "OS_WIN32", INT2FIX(OS_WIN32));
|
||
/* From GzipFile#os_code - 0x04 */
|
||
rb_define_const(mZlib, "OS_VMCMS", INT2FIX(OS_VMCMS));
|
||
/* From GzipFile#os_code - 0x08 */
|
||
rb_define_const(mZlib, "OS_ZSYSTEM", INT2FIX(OS_ZSYSTEM));
|
||
/* From GzipFile#os_code - 0x09 */
|
||
rb_define_const(mZlib, "OS_CPM", INT2FIX(OS_CPM));
|
||
/* From GzipFile#os_code - 0x0c */
|
||
rb_define_const(mZlib, "OS_QDOS", INT2FIX(OS_QDOS));
|
||
/* From GzipFile#os_code - 0x0d */
|
||
rb_define_const(mZlib, "OS_RISCOS", INT2FIX(OS_RISCOS));
|
||
/* From GzipFile#os_code - 0xff */
|
||
rb_define_const(mZlib, "OS_UNKNOWN", INT2FIX(OS_UNKNOWN));
|
||
#endif /* GZIP_SUPPORT */
|
||
... | ... | |
*/
|
||
/*
|
||
* Document-class: Zlib::StreamEnd
|
||
*
|
||
* Subclass of Zlib::Error
|
||
*
|
||
* When zlib returns a Z_STREAM_END
|
||
* is return if the end of the compressed data has been reached
|
||
* and all uncompressed out put has been produced.
|
||
*
|
||
*/
|
||
/*
|
||
* Document-class: Zlib::NeedDict
|
||
*
|
||
* Subclass of Zlib::Error
|
||
*
|
||
* When zlib returns a Z_NEED_DICT
|
||
* if a preset dictionary is needed at this point.
|
||
*
|
||
* Used by Zlib::Inflate.inflate and <tt>Zlib.inflate</tt>
|
||
*/
|
||
/*
|
||
* Document-class: Zlib::VersionError
|
||
*
|
||
* Subclass of Zlib::Error
|
||
*
|
||
* When zlib returns a Z_VERSION_ERROR,
|
||
* usually if the zlib library version is incompatible with the
|
||
* version assumed by the caller.
|
||
*
|
||
*/
|
||
/*
|
||
* Document-class: Zlib::MemError
|
||
*
|
||
* Subclass of Zlib::Error
|
||
*
|
||
* When zlib returns a Z_MEM_ERROR,
|
||
* usually if there was not enough memory.
|
||
*
|
||
*/
|
||
/*
|
||
* Document-class: Zlib::StreamError
|
||
*
|
||
* Subclass of Zlib::Error
|
||
*
|
||
* When zlib returns a Z_STREAM_ERROR,
|
||
* usually if the stream state was inconsistent.
|
||
*
|
||
*/
|
||
/*
|
||
* Document-class: Zlib::BufError
|
||
*
|
||
* Subclass of Zlib::Error when zlib returns a Z_BUF_ERROR.
|
||
*
|
||
* Usually if no progress is possible.
|
||
*
|
||
*/
|
||
/*
|
||
* Document-class: Zlib::DataError
|
||
*
|
||
* Subclass of Zlib::Error when zlib returns a Z_DATA_ERROR.
|
||
*
|
||
* Usually if a stream was prematurely freed.
|
||
*
|
||
*/
|
||
/*
|
||
* Document-class: Zlib::GzipFile::Error
|
||
*
|
||
* Base class of errors that occur when processing GZIP files.
|