summaryrefslogtreecommitdiff
path: root/ext/dl/doc/dl.txt
diff options
context:
space:
mode:
authorttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-10 18:23:39 +0000
committerttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-10 18:23:39 +0000
commitceade7b9268e9620b123843afeb25a7136f8a576 (patch)
tree5934090e772e41a4b3f75a7744a031f4576d60b1 /ext/dl/doc/dl.txt
parent5c1bdda10cc0febcac126532cf6f3aac51c08271 (diff)
bugfix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/doc/dl.txt')
-rw-r--r--ext/dl/doc/dl.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/dl/doc/dl.txt b/ext/dl/doc/dl.txt
index 114baafcb7..9964c4e12f 100644
--- a/ext/dl/doc/dl.txt
+++ b/ext/dl/doc/dl.txt
@@ -59,6 +59,18 @@ to wrap the given PtrData object which is, for example, created by DL::malloc().
DL::malloc() is a function to allocate a memory by using the C library function
malloc().
+We can define a callback using the module function "callback" as follows:
+
+ module Foo
+ extend DL::Importable
+ def my_comp(str1,str2)
+ str1 <=> str2
+ end
+ COMPARE = callback "int my_comp(char*,char*)"
+ end
+
+where Foo::COMPARE is a Symbol object which invokes the method "my_comp".
+
DL::Importable module is very useful. However, we sometimes encounter a case
that we must directly use low-level functions such as dlsym(). In such case,
we would use DL module functions. They are described in next section.