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

228 Коммитов

Автор SHA1 Сообщение Дата
tenderlove 6a1aebaabf * ext/dl/cptr.c (to_int): DL::CPtr supports to_int
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-04 23:21:01 +00:00
tenderlove 17ccd5d013 * ext/dl/cptr.c (rb_dlptr_s_to_ptr): when wrapping a pointer it should
keep a reference to the object it's wrapping
* test/dl/test_func.rb use standard test methods

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-12 22:41:07 +00:00
tenderlove 5de564634d * ext/dl/cfunc.c (**) updating documentation
* test/dl/test_cfunc.rb (test_ptr=, test_ptr) testing the pointer
  accessor methods on CFunc

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-08 00:21:41 +00:00
tenderlove a56bd8c31a * ext/dl/cptr.c (rb_dlptr_inspect): making inspect consistent across
platforms
* test/dl/test_cptr.rb (test_inspect): testing inspect

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-07 21:37:27 +00:00
tenderlove 35da6fdcf1 * ext/dl/cfunc.c (rb_dlcfunc_initialize): cleaning up C macros
* ext/dl/cfunc.c (**): adding documentation
* test/dl/test_cfunc.rb (test_set_calltype) testing calltype

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-06 22:50:40 +00:00
tenderlove bc52ea0fde * ext/dl/cptr.c (rb_dlptr_s_malloc, rb_dlptr_initialize): adding
documentation
* test/dl/test_cptr.rb (**): testing that malloc works when passed free
  functions

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-06 22:50:05 +00:00
tenderlove 5296367cf4 * ext/dl/cptr.c (rb_dlptr_to_str, rb_dlptr_to_s) adding documentation
* test/dl/test_cptr.rb (test_to_str, test_to_s) testing the
  stringification of DL::Ptr

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-06 18:29:31 +00:00
tenderlove c2d7621d8d * ext/dl/cptr.c (rb_dlptr_inspect, rb_dlptr_plus, rb_dlptr_minus)
documenting +, -, inspect
* text/dl/test_cptr.rb (test_minus, test_plus, test_inspect) testing
  minus, plus, and inspect

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-06 18:02:30 +00:00
tenderlove 02d55ac989 * test/dl/test_cptr.rb (test_to_ptr*): testing DL::CPtr#to_ptr
* ext/dl/cptr.c (rb_dlptr_free_set, rb_dlptr_free_get,
  rb_dlptr_s_to_ptr): adding documentation, fixing indentation

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03 20:28:20 +00:00
tenderlove c30e32d075 * ext/dl/cptr.c (rb_dlptr_eql, rb_dlptr_cmp): DL::CPtr#== and DL::CPtr#<=>
should not raise an exception when compared to a different object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03 17:12:46 +00:00
naruse 7539e11a7f * ext/dl/win32/lib/win32/registry.rb: update rdoc. [ruby-core:26022]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-02 02:24:11 +00:00
tenderlove a9e662ac7a * ext/dl/cptr.c (rb_dlptr_ptr, rb_dlptr_ref) adding documentation
* test/dl/test_cptr.rb (test_ref_ptr) testing CPtr#ref and CPtr#ptr

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-01 01:47:08 +00:00
tenderlove 4b76900a55 * ext/dl/cptr.c (rb_dlptr_to_value) added documentation
* test/dl/test_cptr.rb (test_to_value) testing DL::CPtr#to_value

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-01 01:46:56 +00:00
tenderlove 6cf6d8556c * ext/dl/cptr.c (rb_dlptr_size) splitting function to reduce complexity
* ext/dl/cptr.c (rb_dlptr_null_p, rb_dlptr_aref, rb_dlptr_aset) adding
  documentation
* ext/dl/dl.c (rb_dl_free) adding documentation
* test/dl/test_cptr.rb (test_null?, test_size, test_size=,
  test_aref_aset) Improving test coverage
* test/dl/test_dl2.rb (test_free_secure) improving test coverage

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-01 01:46:44 +00:00
tenderlove 5f3d0f5233 * test/dl/test_dl2.rb (**) testing malloc and realloc
* ext/dl/dl.c (**) adding documentation

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-01 01:46:27 +00:00
nobu 475e705b2f * ext/dl/handle.c (dlhandle_sym): fixed an invalid local variable
declaration.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-25 06:44:26 +00:00
nobu b6c007ac85 * ext/dl/handle.c (rb_dlhandle_close): fixed an invalid local
variable declaration.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-25 01:19:11 +00:00
tenderlove 3f6f9f87ca * ext/dl/handle.c (**) adding documentation
* test/dl/test_handle.rb (test_NEXT) testing the NEXT handle

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-25 00:11:56 +00:00
tenderlove 1578edbafc * ext/dl/handle.c (rb_dlhandle_close_enabled_p) testing that handles can
be enabled and disabled for closure on GC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-25 00:11:41 +00:00
tenderlove 159e6439c0 * ext/dl/handle.c (**) adding documentation
* test/dl/test_handle.rb (**) testing to_i and initialize

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-25 00:11:29 +00:00
tenderlove 60f86b2edb * ext/dl/handle.c (rb_dlhandle_sym) refactoring rb_secure(2)
* test/dl/test_handle.rb (**) testing sym behavior

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-25 00:11:15 +00:00
tenderlove c30de1e38e * ext/dl/handle.c (rb_dlhandle_sym) removing unnecessary code. Adding
documentation and tests for current functionality.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-25 00:11:02 +00:00
tenderlove a631b5df36 * ext/dl/handle.c (rb_dlhandle_close) check return value of dlclose()
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-24 21:56:50 +00:00
tenderlove 5ee251bdad * ext/ext/dl/handle.c (rb_dlhandle_initialize) added rb_secure(2)
[ruby-core:25762]
* ext/dl/dl.c (rb_dl_dlopen) removed rb_secure(2)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-23 16:44:41 +00:00
nobu a4fbd748e2 * configure.in (GCC): subst for GCC depending extension libraries.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-12 08:31:44 +00:00
nobu c754c0b237 * ext/dl/cfunc.c (dlcfunc_data_type): typed.
* ext/dl/cptr.c (dlptr_data_type): ditto.

* ext/dl/handle.c (dlhandle_data_type): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-09 12:19:28 +00:00
nobu 34cf45ab19 * ext/dl/handle.c (rb_dlhandle_s_sym): added a method to access
using RTLD_NEXT.  [ruby-dev:38152]

* ext/dl/handle.c (Init_dlhandle): added constants DEFAULT and
  NEXT which correspond to RTLD_DEFAULT and RTLD_NEXT.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-23 12:49:00 +00:00
nobu 96e6cfb835 * ext/dl/lib/dl/cparser.rb (DL::CParser#parse_struct_signature):
splitting with regexp source string is obsolete.  a patch from
  Minwoo Lee at [ruby-core:23494].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-23 09:53:15 +00:00
nobu fb3fa6aa4e * ext/dl/cptr.c (rb_dlptr_cmp): return signed value, and restrict
to Fixnum.  [ruby-dev:38533]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-23 09:48:54 +00:00
nobu 28e7beb54c * ext/dl/lib/dl/callback.rb (DL#remove_callback_internal): ignore
unbound function.  [ruby-dev:38474]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-16 08:57:41 +00:00
nobu ab142b7274 * ext/dl/lib/dl/func.rb (DL::Function#bound?): returns if already
bound to a block.

* ext/dl/lib/dl/value.rb (DL::ValueUtil#wrap_arg): block must be
  given if arg is not bound.  [ruby-dev:38404]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-10 02:36:13 +00:00
nobu 8812fe1a97 * ext/dl/cfunc.c (rb_dlcfunc_instance_p): new function to check if
the argument is an instance of DL::CFunc.

* ext/dl/cptr.c (rb_dlptr_initialize, rb_dlptr_s_malloc): checks
  if DL::CFunc.  [ruby-dev:38403].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-10 02:13:20 +00:00
nobu 07b5520752 * ext/dl/cptr.c: consistent indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-10 01:47:10 +00:00
nobu e102f89472 * ext/dl/lib/dl/cparser.rb (DL::CParser#parse_signature): strips
spaces.  based on a patch from Takashi Tamura in [ruby-dev:38398].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-10 01:40:04 +00:00
nobu f65d706529 * ext/dl: updated svn:ignore.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-21 00:51:51 +00:00
nobu 27a39b8ffe * win32/Makefile.sub (config.h): added RUBY_COREDLL.
* ext/dl/handle.c (rb_dlhandle_initialize): returns msvcrt if libc
  or RUBY_COREDLL is given.  [ruby-core:22828]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-17 04:48:03 +00:00
nobu f797bdae70 * ext/dl: made indent style insistent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-17 01:15:35 +00:00
nobu 02136ebbb5 * common.mk (srcs-ext): creates ext/dl/callback/callback.c also.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-14 23:26:11 +00:00
nobu 976c01b404 * ext/dl/handle.c (rb_dlhandle_sym): RTLD_NEXT is not for symbol
name.   [ruby-dev:38150]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-11 11:13:40 +00:00
usa df63af6be2 * ext/dl/win32/lib/Win32API.rb: call by :stdcall as default.
[ruby-core:22826]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-11 08:27:21 +00:00
nobu f5315680aa * ext/dl/handle.c (rb_dlhandle_sym): moved conditinally used variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-11 04:06:57 +00:00
nobu 7e59a8c5e4 * ext/dl/handle.c (rb_dlhandle_sym): fixed heap corruption.
[ruby-core:22822]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-11 04:03:14 +00:00
nobu 5bfb9a63b7 * ext/dl/callback/mkcallback.rb (DLTYPE[FLOAT]): cast to suppress
warnings.  [ruby-core:22792]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-10 10:40:07 +00:00
nobu 53f011e662 * ext/dl/callback/depend: fix for parallel build.
* ext/dl/callback/extconf.rb: callback.h is no longer created.

* ext/dl/callback/mkcallback.rb: creates main source first.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-09 18:48:34 +00:00
nobu d3c4a4686a * ext/dl/callback/extconf.rb ($distcleanfiles): added callback.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-09 16:57:17 +00:00
nobu 3b759e62ac * ext/dl/dl.c (Init_dl): protoized.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-09 06:25:14 +00:00
nobu 287a34ae0d * {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06 03:56:38 +00:00
usa dba06de110 * ext/dl/win32/lib/win32/resolv.rb: get rid of warning.
* ext/dl/lib/dl/func.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-03 07:52:42 +00:00
usa 2a89c088a2 * ext/dl/win32/lib/win32/{registry,resolv}.rb: use dl/import instead
of Win32API.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-03 06:55:26 +00:00
usa 95189045d0 * ext/dl/lib/dl/func.rb (DL::Function.name): delegate to @cfunc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-03 06:54:00 +00:00