diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-23 15:53:44 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-23 15:53:44 +0100 |
commit | bcb3fc0c3336c05e9ecbbfb25c7c31b42bd3e32e (patch) | |
tree | 80042c722c65911c3a3b55a275daefff96220e7f /haskell/Guestfs.hs | |
parent | da7cf3670fe60301beeb175ff6c284b737d5b7f4 (diff) | |
download | libguestfs-bcb3fc0c3336c05e9ecbbfb25c7c31b42bd3e32e.tar.gz libguestfs-bcb3fc0c3336c05e9ecbbfb25c7c31b42bd3e32e.tar.xz libguestfs-bcb3fc0c3336c05e9ecbbfb25c7c31b42bd3e32e.zip |
Generated code for 'scrub-*' commands.
Diffstat (limited to 'haskell/Guestfs.hs')
-rw-r--r-- | haskell/Guestfs.hs | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/haskell/Guestfs.hs b/haskell/Guestfs.hs index 210274ef..ddbad469 100644 --- a/haskell/Guestfs.hs +++ b/haskell/Guestfs.hs @@ -83,7 +83,10 @@ module Guestfs ( zerofree, pvresize, resize2fs, - e2fsck_f + e2fsck_f, + scrub_device, + scrub_file, + scrub_freespace ) where import Foreign import Foreign.C @@ -853,3 +856,39 @@ e2fsck_f h device = do fail err else return () +foreign import ccall unsafe "guestfs_scrub_device" c_scrub_device + :: GuestfsP -> CString -> IO (CInt) + +scrub_device :: GuestfsH -> String -> IO () +scrub_device h device = do + r <- withCString device $ \device -> withForeignPtr h (\p -> c_scrub_device p device) + if (r == -1) + then do + err <- last_error h + fail err + else return () + +foreign import ccall unsafe "guestfs_scrub_file" c_scrub_file + :: GuestfsP -> CString -> IO (CInt) + +scrub_file :: GuestfsH -> String -> IO () +scrub_file h file = do + r <- withCString file $ \file -> withForeignPtr h (\p -> c_scrub_file p file) + if (r == -1) + then do + err <- last_error h + fail err + else return () + +foreign import ccall unsafe "guestfs_scrub_freespace" c_scrub_freespace + :: GuestfsP -> CString -> IO (CInt) + +scrub_freespace :: GuestfsH -> String -> IO () +scrub_freespace h dir = do + r <- withCString dir $ \dir -> withForeignPtr h (\p -> c_scrub_freespace p dir) + if (r == -1) + then do + err <- last_error h + fail err + else return () + |