summaryrefslogtreecommitdiff
path: root/ext/dl/cfunc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-10 02:13:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-10 02:13:20 +0000
commit8812fe1a973e66130a560708b15a76bd2e08e5a7 (patch)
treeabc1774c2925fdb60c35b2f86c613c949d652120 /ext/dl/cfunc.c
parent07b5520752bfe9217ff906189a32c878717a3917 (diff)
* 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
Diffstat (limited to 'ext/dl/cfunc.c')
-rw-r--r--ext/dl/cfunc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/dl/cfunc.c b/ext/dl/cfunc.c
index 20d3f537669..6110e14f557 100644
--- a/ext/dl/cfunc.c
+++ b/ext/dl/cfunc.c
@@ -43,8 +43,9 @@ rb_dl_set_win32_last_error(VALUE self, VALUE val)
void
-dlcfunc_free(struct cfunc_data *data)
+dlcfunc_free(void *ptr)
{
+ struct cfunc_data *data = ptr;
if( data->name ){
xfree(data->name);
}
@@ -107,6 +108,13 @@ rb_dlcfunc_s_allocate(VALUE klass)
return obj;
}
+int
+rb_dlcfunc_kind_p(VALUE func)
+{
+ if (TYPE(func) == T_DATA) return 0;
+ return RDATA(func)->dfree == dlcfunc_free;
+}
+
VALUE
rb_dlcfunc_initialize(int argc, VALUE argv[], VALUE self)
{