voyeur 0.1.0.0 → 0.1.0.1
raw patch · 4 files changed
+35/−24 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- changelog +3/−0
- src/System/Process/Voyeur.hs +26/−18
- src/System/Process/Voyeur/FFI.hs +4/−4
- voyeur.cabal +2/−2
changelog view
@@ -1,3 +1,6 @@+0.1.0.1++ * Documentation tweaks. 0.1.0.0 * Initial release.
src/System/Process/Voyeur.hs view
@@ -16,25 +16,33 @@ -- or 'ProcessID' to 'startObserving', and your handlers will be -- called as events happen. ----- A simple function that prints a message every time a child+-- A simple program that prints a message every time a child -- process opened a file might look like this: ----- > withVoyeur $ \ctx -> do--- > -- Set up a handler.--- > observeOpen ctx defaultOpenFlags $--- > \path _ _ _ _ pid -> putStrLn $ show pid ++ " opened " ++ show path--- >--- > -- Set up the environment.--- > curEnv <- getEnvironment--- > newEnv <- prepareEnvironment ctx--- > --- > when (isJust newEnv) $ do--- > -- Start the child process.--- > handle <- runProcess program args Nothing newEnv Nothing Nothing Nothing--- >--- > -- Observe it! startObserving only returns when the child process--- > -- exits, so we don't need to wait.--- > void $ startObserving ctx handle+-- > import Control.Monad+-- > import Data.Maybe+-- > import System.Environment+-- > import System.Process+-- > import System.Process.Voyeur+-- > +-- > main = do+-- > (program : args) <- getArgs+-- > withVoyeur $ \ctx -> do+-- > -- Set up a handler.+-- > observeOpen ctx defaultOpenFlags $+-- > \path _ _ _ _ pid -> putStrLn $ show pid ++ " opened " ++ show path+-- > +-- > -- Set up the environment.+-- > curEnv <- getEnvironment+-- > newEnv <- prepareEnvironment ctx curEnv+-- > +-- > when (isJust newEnv) $ do+-- > -- Start the child process.+-- > handle <- runProcess program args Nothing newEnv Nothing Nothing Nothing+-- > +-- > -- Observe it! startObserving only returns when the child process+-- > -- exits, so we don't need to wait.+-- > void $ startObserving ctx handle -- -- A larger example program is included with the source code to this package. module System.Process.Voyeur@@ -44,7 +52,7 @@ , FFI.prepareEnvironment , startObserving --- * Observing 'exec*' calls+-- * Observing \'exec\' calls , FFI.ObserveExecFlags(..) , FFI.defaultExecFlags , FFI.ObserveExecHandler
src/System/Process/Voyeur/FFI.hs view
@@ -58,7 +58,7 @@ -- Registering callbacks for particular events. -------------------------------------------------- --- | Flags for observing 'exec*' calls.+-- | Flags for observing 'exec' calls. data ObserveExecFlags = ObserveExecFlags { observeExecCWD :: !Bool -- ^ True if you want the current working directory. , observeExecEnv :: !Bool -- ^ True if you want the environment. (Potentially slow.)@@ -80,7 +80,7 @@ foreign import ccall unsafe "voyeur.h voyeur_observe_exec" voyeur_observe_exec :: Ptr () -> Word8 -> FunPtr ExecCallback -> Ptr () -> IO () --- | A handler for 'exec*' calls.+-- | A handler for 'exec' calls. type ObserveExecHandler = BS.ByteString -- ^ The file being executed. -> [BS.ByteString] -- ^ The arguments. -> [(BS.ByteString, BS.ByteString)] -- ^ The environment (if requested).@@ -91,7 +91,7 @@ -> ProcessID -- ^ The parent process ID. -> IO () --- | Observe calls to the 'exec*' and 'posix_spawn*' families of functions.+-- | Observe calls to the 'exec' and 'posix_spawn' families of functions. observeExec :: VoyeurContext -- ^ The context. -> ObserveExecFlags -- ^ Flags controlling what will be observed. -> ObserveExecHandler -- ^ A handler for observed 'exec*' events.@@ -127,7 +127,7 @@ -> ProcessID -- ^ The parent process ID of the exiting process. -> IO () --- | Observe calls to \'exit\'.+-- | Observe calls to the \'exit\' family of functions. observeExit :: VoyeurContext -- ^ The context. -> ObserveExitHandler -- ^ A handler for observed \'exit\' events. -> IO ()
voyeur.cabal view
@@ -1,5 +1,5 @@ name: voyeur-version: 0.1.0.0+version: 0.1.0.1 synopsis: Haskell bindings for libvoyeur description: Haskell bindings for libvoyeur, a library for observing the private activities of child processes.@@ -38,7 +38,7 @@ source-repository head type: git location: https://github.com/sethfowler/hslibvoyeur.git- tag: 0.1+ tag: 0.1.0.1 library ghc-options: -Wall