X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=generator%2Fgenerator_haskell.ml;h=29b260f2f23c84d4916b6dbc5e7df8acc990bc9b;hb=319e946b92e175c05cdd1fdcb85c9b86f5631011;hp=b49e385bc651aaa1c913f6c08fd1448c910611ed;hpb=14490c3e1aac61c6ac90f28828896683f64f0dc9;p=libguestfs.git diff --git a/generator/generator_haskell.ml b/generator/generator_haskell.ml index b49e385..29b260f 100644 --- a/generator/generator_haskell.ml +++ b/generator/generator_haskell.ml @@ -74,7 +74,7 @@ import Prelude hiding (truncate) import Foreign import Foreign.C import Foreign.C.Types -import IO +import System.IO import Control.Exception import Data.Typeable @@ -148,7 +148,7 @@ last_error h = do pr "withCStringLen %s $ \\(%s, %s_size) -> " n n n | OptString n -> pr "maybeWith withCString %s $ \\%s -> " n n | StringList n | DeviceList n -> pr "withMany withCString %s $ \\%s -> withArray0 nullPtr %s $ \\%s -> " n n n n - | Bool _ | Int _ | Int64 _ -> () + | Bool _ | Int _ | Int64 _ | Pointer _ -> () ) args; (* Convert integer arguments. *) let args = @@ -156,7 +156,7 @@ last_error h = do function | Bool n -> sprintf "(fromBool %s)" n | Int n -> sprintf "(fromIntegral %s)" n - | Int64 n -> sprintf "(fromIntegral %s)" n + | Int64 n | Pointer (_, n) -> sprintf "(fromIntegral %s)" n | FileIn n | FileOut n | Pathname n | Device n | Dev_or_Path n | String n | OptString n @@ -222,6 +222,7 @@ and generate_haskell_prototype ~handle ?(hs = false) (ret, args, optargs) = | Bool _ -> pr "%s" bool | Int _ -> pr "%s" int | Int64 _ -> pr "%s" int + | Pointer _ -> pr "%s" int | FileIn _ -> pr "%s" string | FileOut _ -> pr "%s" string );