 -- Portability : not portable
 --
 -- A simple binding to xine-lib. Low-level bindings.
+-- Made for xine-lib version 1.1.18.1
 
 module Xine.Foreign (
     -- * Version information


peekStream = maybeForeignPtr_ Stream

withData f = f nullPtr

withMaybeString :: Maybe String -> (CString -> IO a) -> IO a
withMaybeString Nothing f  = f nullPtr
withMaybeString (Just s) f = withCString s f

peekInt :: Ptr CInt -> IO Int
peekInt = liftM cint2int . peek

-- For pointers which may be NULL.
maybeForeignPtr_ c x | x == nullPtr = return Nothing
                     | otherwise    = (Just . c) `liftM` newForeignPtr_ x

