summaryrefslogtreecommitdiff
path: root/ext/dl/handle.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dl/handle.c')
-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 eee0cb26b0..ad1f2210cf 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");