Граф коммитов

221 Коммитов

Автор SHA1 Сообщение Дата
nobu 97a016ac8a install extra libraries
* ext/extmk.rb (extract_makefile, extmake, configuration): store
  extra libraries to be installed.
* tool/rbinstall.rb (ext-arch): install extra libraries.
* ext/zlib/extconf.rb: install zlib if built.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-24 13:26:21 +00:00
nobu b212dd6674 zlib: no checks [ci skip]
* ext/zlib/extconf.rb: no feature checks when building zlib from
  the source, assume it is recent.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-23 14:18:41 +00:00
nobu f5f8f3ce37 zlib: fix directory [ci skip]
* ext/zlib/extconf.rb: fix directory to install zlib library.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-23 14:18:39 +00:00
nobu 21255071d8 zlib: try zlib source
* ext/zlib/extconf.rb: try building zlib from the source if
  exists.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-22 06:35:28 +00:00
nobu 64fea27496 Update dependencies
* common.mk (compile.o, loadpath.o): update dependencies.

* common.mk (vm_call.o): remove stale object dependencies.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-06 05:48:13 +00:00
nobu 871472c72b Unnecessary checks
* ext/bigdecimal/bigdecimal.c: FIX2INT and FIX2UINT imply the
  check for Fixnum.

* ext/zlib/zlib.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-17 08:45:05 +00:00
naruse fd307c3b60 * ext/zlib/zlib.c: remove hacky macro introduced at r30437.
* ext/zlib/zlib.c (gzfile_make_header): cast as long (instead of int).

* ext/zlib/zlib.c (gzfile_make_footer): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21 17:47:52 +00:00
zzak 70d040ddbd * ext/zlib/zlib.c: Document mtime header behavior with patch by @schneems
Fixes [GH-1129]: https://github.com/ruby/ruby/pull/1129


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-09 05:33:35 +00:00
nobu 26bc97bda4 zlib.c: Fix typo [ci skip]
* ext/zlib/zlib.c (Init_zlib): [DOC] Fix double-word typo and
  grammatical error.  [Fix GH-1162]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-19 05:27:52 +00:00
naruse c4fdfabcc8 handle ext/ as r53141
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts
fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&#
frozen_string_literal: false\n");f.rewind;f.write s}}'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:31:54 +00:00
hsbt 79a6daa394 * ext/zlib/zlib.c: fix a typo.
[ci skip][fix GH-1149] Patch by @crismali

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-15 02:55:13 +00:00
nobu 898fd2ed2a use rb_check_arity [ci skip]
* ext: use rb_check_arity and rb_error_arity to raise
  ArgumentError.  [Feature #9025]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-25 00:43:06 +00:00
kosaki 4ad2057f27 * ChangeLog: Good-bye OS/2.
* common.mk: ditto.
* configure.in: ditto.
* dln_find.c: ditto.
* ext/Setup.emx: ditto.
* ext/extmk.rb: ditto.
* ext/socket/extconf.rb: ditto.
* ext/zlib/extconf.rb: ditto.
* file.c: ditto.
* include/ruby/defines.h: ditto.
* io.c: ditto.
* lib/mkmf.rb: ditto.
* missing/os2.c: ditto.
* process.c: ditto.
* ruby.c: ditto.
* NEWS: announce OS/2 is no longer supported.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-18 01:18:34 +00:00
nobu 498b6f4776 zlib.c: GC guards
* ext/zlib/zlib.c: prevent from GC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-10 12:50:26 +00:00
nobu 41bd073de2 zlib.c: protoize
* ext/zlib/zlib.c (do_checksum): protoize the definition.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-10 12:49:58 +00:00
hsbt 4162f90e03 * ext/zlib/zlib.c: Fix indentation for rdoc.
[Bug #11221][ruby-core:69465]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-11 10:11:30 +00:00
glass d88957abad * ext/zlib/zlib.c (rb_gzreader_external_encoding):
define GzipReader#external_encoding.
  [Bug #10900]

* test/zlib/test_zlib.rb: test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-10 03:43:22 +00:00
akr b6d5ce7975 * ext/zlib/zlib.c (rb_gzfile_close): Don't raise on double
close for consistent to IO#close.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-08 13:52:51 +00:00
hsbt 6d92166c97 * ext/zlib/zlib.c: fix document of method signatures.
[Bug #10668][ruby-core:67186][ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-10 03:57:17 +00:00
normal 02be147c8a ext/zlib/zlib.c: TypedData conversion
* ext/zlib/zlib.c (zstream_mark, zstream_free): update signature
  (gzfile_mark, gzfile_free): ditto
  (zstream_memsize): new function for rb_data_type->dsize
  (gzfile_memsize): ditto
  (zstream_data_type, gzfile_data_type): new data types
  (zstream_new): Data_Make_Struct => TypedData_Make_Struct
  (gzfile_new): ditto
  (get_zstream, get_gzfile): Data_Get_Struct => TypedData_Get_Struct
  (rb_zstream_flush_next_in): ditto
  (rb_zstream_flush_next_out): ditto
  (rb_zstream_avail_out): ditto
  (rb_zstream_avail_in): ditto
  (rb_zstream_closed_p): ditto
  (rb_deflate_initialize): ditto
  (rb_deflate_init_copy): ditto
  (rb_inflate_initialize): ditto
  (gzfile_ensure_close): ditto
  (rb_gzfile_closed_p): ditto
  (rb_gzfile_path): ditto
  (rb_gzwriter_initialize): ditto
  (rb_gzreader_initialize): ditto
  (rb_gzreader_unused): ditto
  [ruby-core:65377] [Feature #10319]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-04 20:56:10 +00:00
nobu 28b9f11d5a protoize no-arguments functions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-30 05:25:32 +00:00
normal 338cea741d ext/zlib/zlib.c (struct gzfile): pack (288 => 272 bytes) on 64-bit
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-17 22:01:31 +00:00
normal f5e06db39c ext/zlib/zlib.c (zlib_mem_alloc): check overflow
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-17 07:26:12 +00:00
normal 3cee6a22c0 zlib: GzipReader#rewind preserves ZSTREAM_FLAG_GZFILE
* ext/zlib/zlib.c (gzfile_reset): preserve ZSTREAM_FLAG_GZFILE
  [Bug #10101]

* test/zlib/test_zlib.rb (test_rewind): test each_byte

We must preserve the ZSTREAM_FLAG_GZFILE flag to prevent
zstream_detach_buffer from:

a) returning Qnil and breaking out of the `each_byte' loop
b) yielding a large string to each_byte

Note: the test case in bug report takes a long time.  I found this
bug because I noticed the massive time descrepancy between
`each_byte' and `readbyte' loop before this patch.  With this patch,
`each_byte' and `readbyte' both take very long.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-30 23:53:28 +00:00
zzak e0270975d8 * ext/zlib/zlib.c: [DOC] Remove default value of Zlib constants, as
they may change in the implementation without notice. Patched by
  @robin850 [Fixes GH-682] https://github.com/ruby/ruby/pull/682


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-27 19:41:22 +00:00
akr 543b402f38 * ext/socket/ifaddr.c (IS_IFADDRS): Unused macro removed.
* ext/strscan/strscan.c (BUFSIZE): Ditto.

* ext/zlib/zlib.c (OBJ_IS_FREED): Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-11 16:31:51 +00:00
nobu 549e0e488e zlib.c: return unshared string
* ext/zlib/zlib.c (zstream_shift_buffer): create new copied string
  since it cannot be shared ever.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-18 11:46:02 +00:00
nobu 1f29e8e2ba class.c: do nothing if copying self
* class.c (rb_mod_init_copy): do nothing if copying self.
  [ruby-dev:47989] [Bug #9535]
* hash.c (rb_hash_initialize_copy): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21 11:42:03 +00:00
zzak 5d83f5554f * ext/zlib/zlib.c (rb_zlib_adler32): [DOC] Add example for adler32
Patch by Vajrasky Kok [Bug #9307] [ci skip]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-28 06:13:50 +00:00
nobu 9bd672f668 ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-12 08:11:36 +00:00
drbrain 9f2f1fcbc8 * ext/zlib/zlib.c (zstream_run): Fix handling of deflate streams that
need a dictionary but are being decompressed by Zlib::Inflate.inflate
  (which has no option to set a dictionary).  Now Zlib::NeedDict is
  raised instead of crashing.  [ruby-trunk - Bug #8829]
* test/zlib/test_zlib.rb (TestZlibInflate):  Test for the above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-28 20:36:21 +00:00
nobu aa8cc01aa3 zlib.c: check EOF
* ext/zlib/zlib.c (gzfile_read, gzfile_read_all, gzfile_getc),
  (gzreader_gets): check EOF.  [ruby-core:55220] [Bug #8467]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31 23:00:48 +00:00
ko1 83aba04862 * include/ruby/ruby.h: constify RBasic::klass and add
RBASIC_CLASS(obj) macro which returns a class of `obj'.
  This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
* object.c: add new function rb_obj_reveal().
  This function reveal interal (hidden) object by rb_obj_hide().
  Note that do not change class before and after hiding.
  Only permitted example is:
  klass = RBASIC_CLASS(obj);
  rb_obj_hide(obj);
  ....
  rb_obj_reveal(obj, klass);
  TODO: API design. rb_obj_reveal() should be replaced with others.
  TODO: modify constified variables using cast may be harmful for
  compiler's analysis and optimizaton.
  Any idea to prohibt inserting RBasic::klass directly?
  If rename RBasic::klass and force to use RBASIC_CLASS(obj),
  then all codes such as `RBASIC(obj)->klass' will be
  compilation error. Is it acceptable? (We have similar
  experience at Ruby 1.9,
  for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
* internal.h: add some macros.
* RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
  object.
* RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
* RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
  without write barrier (planned).
* RCLASS_SET_SUPER(a, b) set super class of a.
* array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
  file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
  parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
  string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
  Use above macros and functions to access RBasic::klass.
* ext/coverage/coverage.c, ext/readline/readline.c,
  ext/socket/ancdata.c, ext/socket/init.c,
* ext/zlib/zlib.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 10:49:11 +00:00
zzak 3a7a773aeb * ext/socket/option.c: Document synonymous methods, by windwiny [GH-277]
* ext/stringio/stringio.c: ditto
* ext/io/wait/wait.c: ditto
* ext/gdbm/gdbm.c: ditto
* ext/dl/cfunc.c: ditto
* ext/zlib/zlib.c: ditto
* ext/win32ole/win32ole.c: ditto
* ext/dbm/dbm.c: ditto
* ext/json/generator/generator.c: ditto
* ext/date/date_core.c: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-16 03:25:50 +00:00
akr 788b45da3e * ext/-test-/debug/depend: New file.
* ext/-test-/exception/depend: Ditto.

* ext/-test-/printf/depend: Ditto.

* ext/-test-/string/depend: Ditto.

* ext/coverage/depend: Ditto.

* ext/io/console/depend: Ditto.

* ext/io/nonblock/depend: Ditto.

* ext/io/wait/depend: Ditto.

* ext/openssl/depend: Ditto.

* ext/pathname/depend: Ditto.

* ext/psych/depend: Ditto.

* ext/zlib/depend: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-14 10:48:08 +00:00
akr 87877eb04f * ext/zlib/zlib.c (rb_gzfile_set_mtime): Use NUM2UINT.
The old logic doesn't work well on LP64 platforms as:
  .. -2**63-1 => error,
  -2**63 .. -2**62-1 => success,
  -2**62 .. -2**31-1 => error,
  -2**31 .. 2**31-1 => success,
  2**31 .. 2**62-1 => error,
  2**62 .. 2**64-1 => success,
  2**64 ..  => error.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-01 13:34:52 +00:00
eregon f4eeca1d16 * ext/zlib/zlib.c (Zlib::Inflate.new):
Fix documentation syntax and naming errors.
  Based on patch by Robin Dupret. Fix GH-271.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-01 13:08:28 +00:00
zzak 762aa293ca * ext/zlib/zlib.c (Zlib::GzipFile): Fix typo by zed_0xff
[Fixes Github #229]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-01 18:10:34 +00:00
nobu 20a5505349 zlib.c: function name
* ext/zlib/zlib.c (rb_gzreader_lines): fix function name.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-23 06:21:49 +00:00
knu c47c095b97 Deprecate #{lines,bytes,chars,codepoints} of IO-likes.
* io.c (rb_io_lines, rb_io_bytes, rb_io_chars, rb_io_codepoints):
  Deprecate IO#{lines,bytes,chars,codepoints} and those of ARGF.
  [Feature #6670]

* ext/stringio/stringio.c (strio_lines, strio_bytes, strio_chars)
  (strio_codepoints): Deprecate
  StringIO#{lines,bytes,chars,codepoints}. [Feature #6670]

* ext/zlib/zlib.c (rb_gzreader_lines, rb_gzreader_bytes):
  Deprecate Zlib::GzipReader#{lines,bytes}. [Feature #6670]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-22 17:22:04 +00:00
nobu ed0aa14fcc zlib.c: suppress warning
* ext/zlib/zlib.c (zstream_run): suppress unused-but-set-variable
  warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30 09:50:32 +00:00
nobu 578deb65b0 zlib.c: suppress warning
* ext/zlib/zlib.c (zlib_mem_alloc): suppress unused-value warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30 09:50:30 +00:00
luislavena 95cd5aaa48 Recognize zlibwapi as linking library
* ext/zlib/extconf.rb: Recognize zlibwapi as linking library.
  Patch by Daniel Berger.

  [ruby-core:44979] [Feature #6421]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 18:50:53 +00:00
nagachika f21ac99ef9 * ext/zlib/zlib.c (zstream_run_func): don't call inflate() when
z->stream.avail_in == 0. it return Z_BUF_ERROR.
  but deflate() could be called with z->stream->avail_in == 0 because
  it has hidden buffer in z->stream->state (opaque structure).
  fix for gem install error. [ruby-dev:46149] [Bug #7040]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-08 16:40:19 +00:00
nobu af6c038b23 remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-04 00:57:31 +00:00
nobu 7bca2f031a get rid of warnings
* io.c (sysopen_func, rb_sysopen_internal): cast through VALUE to get
  rid of warnings.  fixup of r36355.
* process.c (rb_waitpid_blocking, rb_waitpid): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-11 03:17:35 +00:00
drbrain 3cf7d1b57e * ext/zlib/zlib.c: Added streaming support to inflate processing.
This allows zlib streams to be processed without huge memory growth.
  [Feature #6612]
* NEWS:  ditto
* ext/zlib/zlib.c (zstream_expand_buffer):  Uses rb_yield when a block
  is given for streaming support.  Refactored to use
  zstream_expand_buffer_into to remove duplicate code.
* ext/zlib/zlib.c (zstream_expand_buffer_protect):  Added wrapper
  function to pass jump state back through GVL-free section to allow
  zstream clean-up before terminating the ruby call.
* ext/zlib/zlib.c (zstream_expand_buffer_without_gvl):  Acquire GVL to
  yield processed chunk of output stream.
* ext/zlib/zlib.c (zstream_detach_buffer):  When a block is given,
  returns Qnil mid-stream and yields the output buffer at the end of
  the stream.
* test/zlib/test_zlib.rb:  Updated tests


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-10 18:28:40 +00:00
nobu c51a826764 rb_thread_call_without_gvl
* include/ruby/thread.h: new header file for thread stuff.
* thread.c (rb_thread_call_without_gvl): export.  [Feature#4328]
  returns void* instead of VALUE.  [Feature #5543]
* thread.c (rb_thread_blocking_region): deprecate.  [ruby-core:46295]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-10 13:57:11 +00:00
drbrain 1a853390ee * ext/zlib/zlib.c: Revert r36349. Added streaming support to inflate
processing.  rb_block_given_p() is not callable without the GVL.
* ext/zlib/extconf.rb:  ditto
* NEWS:  ditto
* test/zlib/test_zlib.rb:  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-10 03:51:25 +00:00
drbrain 3e419e6c4a * ext/zlib/zlib.c: Added streaming support to inflate processing.
This allows zlib streams to be processed without huge memory growth.
  [Feature #6612]
* NEWS:  ditto
* ext/zlib/zlib.c (zstream_expand_buffer):  Uses rb_yield when a block
  is given for streaming support.  Refactored to use
  zstream_expand_buffer_into to remove duplicate code.
* ext/zlib/zlib.c (zstream_expand_buffer_protect):  Added wrapper
  function to pass jump state back through GVL-free section to allow
  zstream clean-up before terminating the ruby call.
* ext/zlib/zlib.c (zstream_expand_buffer_without_gvl):  Acquire GVL to
  yield processed chunk of output stream.
* ext/zlib/zlib.c (zstream_detach_buffer):  When a block is given,
  returns Qnil mid-stream and yields the output buffer at the end of
  the stream.
* ext/zlib/extconf.rb:  Update INCFLAGS to find internal.h for
  rb_thread_call_with_gvl
* test/zlib/test_zlib.rb:  Updated tests


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-10 00:04:47 +00:00
nobu 9a8a2fd294 ext/zlib/zlib.c: initialize return value
* ext/zlib/zlib.c (zstream_run_func): initialize the return value,
  interrupt flag may set before starting loop.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-09 04:35:53 +00:00
drbrain 7182c0005c * ext/zlib/zlib.c (zstream_expand_buffer_without_gvl): Use
ruby_xrealloc() to avoid crash with CALC_EXACT_MALLOC_SIZE.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-05 19:06:18 +00:00
drbrain 1884f1c0ab * ext/zlib/zlib.c (zstream_run_func): Fix bug that caused early exit
of GVL-free loop.  [Feature #6615]
* ext/zlib/zlib.c:  Fix style to match existing functions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-03 05:52:22 +00:00
drbrain 1138756967 * ext/zlib/zlib.c (zstream_detach_buffer): Refactored tainting of
output string, moving it from the callee to zstream_detach_buffer.
* ext/zlib/zlib.c (rb_zstream_finish):  ditto
* ext/zlib/zlib.c (rb_zstream_flush_next_out):  ditto
* ext/zlib/zlib.c (rb_deflate_deflate):  ditto
* ext/zlib/zlib.c (rb_deflate_flush):  ditto
* ext/zlib/zlib.c (rb_inflate_inflate):  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-03 03:09:30 +00:00
drbrain cda2bf5568 * ext/zlib/zlib.c: Restored the comment explaining the choice of
buffer expansion size.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-02 21:15:47 +00:00
drbrain 802c468fc6 * ext/zlib/zlib.c (zstream_run): Process zlib streams without GVL.
[Feature #6615]
* NEWS:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-02 21:03:15 +00:00
ktsj fb3c4a2d18 * ext/zlib/zlib.c: cosmetic changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-01 13:32:32 +00:00
nobu b0dd250dc9 use RB_TYPE_P() instead of comparison of TYPE()
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23 07:13:21 +00:00
kosaki 54872dd7b3 * ext/openssl/extconf.rb: Use Logging::message instead of message.
* ext/zlib/extconf.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-18 19:51:58 +00:00
kosaki 69305da74d * ext/zlib/extconf.rb: Use an exception instaed of bare puts.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-18 07:02:56 +00:00
akr ce007c7c86 * ext/zlib/extconf.rb: detect z_crc_t type which will be defined
since zlib-1.2.7.

* ext/zlib/zlib.c (rb_zlib_crc_table): use z_crc_t if available.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-30 11:11:21 +00:00
drbrain 718ab93d4d * ext/zlib/zlib.c (rb_deflate_s_deflate): Fixed ruby example replacing
NO_FLUSH with FINISH.  [ruby-trunk - Bug #6273]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10 00:48:49 +00:00
naruse f35fa23852 Comment out unused lines.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06 09:44:27 +00:00
drbrain b6c604d757 * ext/zlib/zlib.c (Init_zlib): Added Zlib::TEXT and note that
Zlib::ASCII is deprecated in zlib 1.2.3 and newer.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 04:30:37 +00:00
drbrain 72282ab1e2 * ext/zlib/zlib.c: Move constant descriptions to constants. Remove
extra comment block at the top of Init_zlib().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 04:25:11 +00:00
drbrain 623169a5c6 * ext/zlib/zlib.c (Init_zlib): Added Zlib::FIXED and Zlib::RLE
strategies.
* NEWS:  Add note about the new Zlib constants.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 01:28:05 +00:00
drbrain b52693b5a8 * ext/zlib/zlib.c: Improve documentation. [ruby-trunk - Bug #5948]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15 01:12:08 +00:00
drbrain 1516f8eb9f * ext/zlib/zlib.c (rb_inflate_add_dictionary): Added
Zlib::Inflate#add_dictionary to allow users to pre-specify
  for using during #inflate.  [ruby-trunk - Feature #5937]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-11 00:37:44 +00:00
drbrain 403dc5357d * ext/zlib/zlib.c (do_inflate): Inflate more data if buffered data
exists.  Allows Zlib::Inflate#set_dictionary to work.
  [ruby-trunk - Bug #5929]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-11 00:29:52 +00:00
usa 8229b9dd3f * ext/zlib/zlib.c (rb_gzreader_initialize): revert a part of r33937.
1st, to change the mode of an IO is very sensitive problem, so
  the maintainer of this library should judge it.
  2nd, usually Zlib::GzReader.new is not called directly.  #initialize
  is called via .open, and in the method the I/O is opened in binary
  mode, so there is no problem without changing the mode in #initialize.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-05 01:25:47 +00:00
luislavena f9a6a1dd0c Introduce NEED_READCONV and NEED_WRITECONV to replace universal newline decorator
Use CRLF only when required to improve file reading and writing under Windows.
Patch by Hiroshi Shirosaki. [ruby-core:40706] [Feature #5562]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-04 01:10:06 +00:00
nahi e3e985064a * ext/zlib/zlib.c (gzfile_read_header): Ensure that each section of
gzip header is readable to avoid SEGV.

* test/zlib/test_zlib.rb (test_corrupted_header): Test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-23 02:36:13 +00:00
drbrain 88cff367f4 * ext/zlib/zlib.c (gzfile_wrap): Document encoding options.
* ext/zlib/zlib.c (rb_gzwriter_s_open): ditto
	* ext/zlib/zlib.c (rb_gzreader_s_open): ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-09 00:18:18 +00:00
drbrain 290c4db6e6 * ext/zlib/zlib.c: Fix document-method declarations for set_sync and
set_comment.  [Ruby 1.9 - Bug #4695]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-31 22:25:32 +00:00
drbrain 9af99106c1 * ext/zlib/zlib.c: Fix Document-method declarations. Improve
Zlib::GzipFile's method catalog.  [Ruby 1.9 - Bug #4695]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-25 00:19:37 +00:00
nobu 3a47cf3395 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 11:55:52 +00:00
drbrain 39da1b6369 * ext/zlib/zlib.c: Improve documentation. Patch by Vincent Batts.
[Ruby 1.9 - Bug #4695]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-14 18:39:53 +00:00
akr 11b1f4ff92 * ext/zlib/zlib.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-03 13:10:29 +00:00
nobu b6371b55de * ext/zlib/zlib.c (gzfile_reader_get_unused): no need to dup
before rb_str_resurrect.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-03 15:15:04 +00:00
naruse b4940b61e3 e ext/zlib/zlib.c (gzfile_reader_get_unused): use rb_str_resurrect
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-03 09:56:52 +00:00
naruse d6d24991bd * ext/zlib/zlib.c (gzfile_reader_get_unused): use rb_str_new_shared
because gz->z.input is hidden string. [ruby-core:35057]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-03 09:35:55 +00:00
akr f6de1a3f00 * ext/zlib/zlib.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-28 12:49:53 +00:00
naruse a2e9ec244e The cast must use uint32_t. [ruby-core:34481]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-14 04:54:51 +00:00
naruse ec9a859c76 * ext/zlib/zlib.c (gzfile_check_footer): ISIZE (Input SIZE) in
gzip's header is the size of uncompressed input data modulo 2^32.
  [ruby-core:34481] http://www.ietf.org/rfc/rfc1952.txt

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-14 04:51:34 +00:00
nobu 778796b008 * ext/zlib/zlib.c: take care of platforms where long is bigger
than int.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-01 02:10:30 +00:00
nobu cf1cc4bd8b * ext/zlib/zlib.c (sizeof): zlib.h mistakenly assumes the result
of sizeof to be int, not size_t.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-31 02:16:00 +00:00
naruse ca96e8da24 * ext/zlib/zlib.c (Init_zlib): Add Zlib.defale and Zlib.inflate.
[ruby-dev:42833]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-27 01:36:19 +00:00
naruse e755ecacf9 Update rdoc of zlib.
Add description about gzip(1) compatible output.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-27 01:36:16 +00:00
nobu 91c6ba2333 * ext/zlib/zlib.c (gzreader_gets): support optional length
parameter.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 02:02:55 +00:00
nobu aeb8d7f5e5 * ext/zlib/zlib.c (gzfile_read, gzfile_readpartial): length should
be long.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 01:59:15 +00:00
usa dcca25f003 * ext/zlib/zlib.c (gzfile_s_open): should close the IO if some error
occurs in initilizing.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-14 04:36:14 +00:00
knu 82abe79b9f * class.c (rb_scan_args): Add support for optional keyword
argument hash.

* README.EXT, README.EXT.ja: Update documentation accordingly.

* dir.c (dir_initialize): Make use of the new rb_scan_args()
  feature.

* io.c (rb_io_s_popen, rb_scan_open_args, rb_io_initialize)
  (rb_io_s_pipe, open_key_args, io_s_foreach, io_s_readlines)
  (rb_io_s_read, rb_io_set_encoding): Ditto.

* transcode.c (str_transcode, econv_args)
  (econv_primitive_convert): Ditto.

* ext/zlib/zlib.c (rb_gzreader_initialize): Ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-10 07:51:58 +00:00
nobu c53664c84d .cvsignore: have not been used already. [Bug #3468]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-07 05:43:21 +00:00
nobu 062b4d6752 * include/ruby/{intern,io}.h: add missing prototypes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-22 03:02:40 +00:00
nobu 01e1a0ac78 * ext/zlib/zlib.c (gzfile_raise): add invalid header to
exceptions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-07 02:44:04 +00:00
mame 1887f60a85 * ext/zlib/zlib.c (zstream_append_input2): add RB_GC_GUARD.
This caused failure when test/csv is executed with GC.stress = true.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29 17:22:46 +00:00
nobu 977267c2e0 * ext/**/*.[ch]: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-22 08:04:13 +00:00
mame 7c7a7c1205 * ext/zlib/zlib.c (rb_deflate_params): update buf_filled count because
deflateParams writes to out buffer.  And, revert r18029 because the
  flush was not needed now and emits garbage.  [ruby-dev:40802]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-20 15:23:23 +00:00
takano32 f14133782b * ext/zlib/zlib.c (zstream_expand_buffer_into): remove compare different type values warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-01 11:11:08 +00:00
akr 8d532a8689 * ext/zlib/zlib.c (zlib_mem_alloc): suppress valgrind warnings.
http://www.zlib.net/zlib_faq.html#faq36


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-15 13:26:51 +00:00