From cb944528b6e73eb220d31f487d350e752aef5027 Mon Sep 17 00:00:00 2001 From: ttate Date: Sun, 14 Apr 2002 17:19:44 +0000 Subject: Correct. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/dl/doc/dl.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'ext/dl') 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" -- cgit v1.2.3