diff options
Diffstat (limited to 'System/Posix/DynamicLinker.hsc')
-rw-r--r-- | System/Posix/DynamicLinker.hsc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/System/Posix/DynamicLinker.hsc b/System/Posix/DynamicLinker.hsc index 5398f03..b15f507 100644 --- a/System/Posix/DynamicLinker.hsc +++ b/System/Posix/DynamicLinker.hsc @@ -6,7 +6,7 @@ -- Module : System.Posix.DynamicLinker -- Copyright : (c) Volker Stolz <vs@foldr.org> 2003 -- License : BSD-style (see the file libraries/base/LICENSE) --- +-- -- Maintainer : vs@foldr.org -- Stability : provisional -- Portability : non-portable (requires POSIX) @@ -27,16 +27,16 @@ module System.Posix.DynamicLinker ( -- Usage: -- ****** --- +-- -- Let's assume you want to open a local shared library \'foo\' (.\/libfoo.so) -- offering a function -- @char \* mogrify (char\*,int)@ -- and invoke @str = mogrify("test",1)@: --- --- +-- +-- -- type Fun = CString -> Int -> IO CString -- foreign import dynamic unsafe fun__ :: FunPtr Fun -> Fun --- +-- -- withDL "libfoo.so" [RTLD_NOW] \$ \\ mod -> do -- funptr <- dlsym mod "mogrify" -- let fun = fun__ funptr @@ -44,7 +44,7 @@ module System.Posix.DynamicLinker ( -- strptr <- fun str 1 -- strstr <- peekCString strptr -- ... --- +-- where @@ -54,7 +54,7 @@ import System.Posix.DynamicLinker.Prim #include "HsUnix.h" import Control.Exception ( bracket ) -import Control.Monad ( liftM ) +import Control.Monad ( liftM ) import Foreign import System.Posix.Internals ( withFilePath ) |