diff options
author | ttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-04-14 17:19:44 +0000 |
---|---|---|
committer | ttate <ttate@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-04-14 17:19:44 +0000 |
commit | cb944528b6e73eb220d31f487d350e752aef5027 (patch) | |
tree | 7ca3fa6cb5dcfe83337a5af8014642c6cd659755 /ext/dl/doc/dl.txt | |
parent | 66484faf1b48ac523628597e77a7758382a1764a (diff) | |
download | ruby-cb944528b6e73eb220d31f487d350e752aef5027.tar.gz |
Correct.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/doc/dl.txt')
-rw-r--r-- | ext/dl/doc/dl.txt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/dl/doc/dl.txt b/ext/dl/doc/dl.txt index c71de5179c..c3d06a6efb 100644 --- a/ext/dl/doc/dl.txt +++ b/ext/dl/doc/dl.txt @@ -17,8 +17,8 @@ and LoadLibrary() on Windows. = Using Ruby/DL -We should usually use DL::Importable module provided by dl/import.rb. -It has high-level functions to access to library functions. We use +We should usually use DL::Importable module provided by "dl/import.rb". +It has high-level functions to access library functions. We use DL::Importable module to extend a module as follows: require "dl/import" @@ -26,22 +26,22 @@ DL::Importable module to extend a module as follows: extend DL::Importable end -Now we can use methods dlload() and extern() in this module. We load the -libraries using dlload(), and define wrapper methods to library functions -using extern() respectively as follows: +Now we can use methods dlload and extern in this module. We load the +libraries using dlload, and define wrapper methods to library functions +using extern respectively as follows: module LIBC extend DL::Importable dlload "libc.so.6","libm.so.6" extern "int strlen(char*)" end + # Note that we should not include the module LIBC from some reason. -Note that we should not include the module LIBC from some reason. -We can call the library function strlen() using LIBC.strlen(). If the first +We can call the library function strlen() using LIBC.strlen. If the first character of given function name is an uppercase, the first character of the defined method name becomes lowercase. We can also construct memory images of structures and unions using functions -struct and union which are defined in dl/struct.rb as follows: +struct and union which are defined in "dl/struct.rb" as follows: require "dl/import" require "dl/struct" |