summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 00:11:02 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-25 00:11:02 +0000
commitfef55edeecbe78b34f89347016b41ea9f06aad1a (patch)
treed2274f6b55ad860e2ef4690a1ee846c16f5c06b7 /ext
parent886c186d02c12b7a934bd1033d1c96f0accc93a8 (diff)
downloadruby-fef55edeecbe78b34f89347016b41ea9f06aad1a.tar.gz
ruby-fef55edeecbe78b34f89347016b41ea9f06aad1a.tar.xz
ruby-fef55edeecbe78b34f89347016b41ea9f06aad1a.zip
* ext/dl/handle.c (rb_dlhandle_sym) removing unnecessary code. Adding
documentation and tests for current functionality. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/dl/handle.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/dl/handle.c b/ext/dl/handle.c
index eee0cb26b..ad1f2210c 100644
--- a/ext/dl/handle.c
+++ b/ext/dl/handle.c
@@ -205,16 +205,21 @@ rb_dlhandle_to_i(VALUE self)
static VALUE dlhandle_sym(void *handle, const char *symbol);
+/*
+ * Document-method: sym
+ * Document-method: []
+ *
+ * call-seq: sym(name)
+ *
+ * Get the address as an Integer for the function named +name+.
+ */
VALUE
rb_dlhandle_sym(VALUE self, VALUE sym)
{
struct dl_handle *dlhandle;
- const char *name;
rb_secure(2);
- name = StringValuePtr(sym);
-
TypedData_Get_Struct(self, struct dl_handle, &dlhandle_data_type, dlhandle);
if( ! dlhandle->open ){
rb_raise(rb_eDLError, "closed handle");