haskell-gi-base-0.26.9: Foundation for libraries generated by haskell-gi

Safe Haskell | None
Language | Haskell2010

Data.GI.Base.BasicConversions

Synopsis

- gflagsToWord :: (Num b, IsGFlag a) => [a] -> b
- wordToGFlags :: (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
- packGList :: [Ptr a] -> IO (Ptr (GList (Ptr a)))
- unpackGList :: Ptr (GList (Ptr a)) -> IO [Ptr a]
- packGSList :: [Ptr a] -> IO (Ptr (GSList (Ptr a)))
- unpackGSList :: Ptr (GSList (Ptr a)) -> IO [Ptr a]
- packGArray :: Storable a => [a] -> IO (Ptr (GArray a))
- unpackGArray :: Storable a => Ptr (GArray a) -> IO [a]
- unrefGArray :: Ptr (GArray a) -> IO ()
- packGPtrArray :: [Ptr a] -> IO (Ptr (GPtrArray (Ptr a)))
- unpackGPtrArray :: Ptr (GPtrArray (Ptr a)) -> IO [Ptr a]
- unrefPtrArray :: Ptr (GPtrArray a) -> IO ()
- packGByteArray :: ByteString -> IO (Ptr GByteArray)
- unpackGByteArray :: Ptr GByteArray -> IO ByteString
- unrefGByteArray :: Ptr GByteArray -> IO ()
- packGHashTable :: GHashFunc a -> GEqualFunc a -> Maybe (GDestroyNotify a) -> Maybe (GDestroyNotify b) -> [(PtrWrapped a, PtrWrapped b)] -> IO (Ptr (GHashTable a b))
- unpackGHashTable :: Ptr (GHashTable a b) -> IO [(PtrWrapped a, PtrWrapped b)]
- unrefGHashTable :: Ptr (GHashTable a b) -> IO ()
- packByteString :: ByteString -> IO (Ptr Word8)
- packZeroTerminatedByteString :: ByteString -> IO (Ptr Word8)
- unpackByteStringWithLength :: Integral a => a -> Ptr Word8 -> IO ByteString
- unpackZeroTerminatedByteString :: Ptr Word8 -> IO ByteString
- packFileNameArray :: [String] -> IO (Ptr CString)
- packZeroTerminatedFileNameArray :: [String] -> IO (Ptr CString)
- unpackZeroTerminatedFileNameArray :: HasCallStack => Ptr CString -> IO [String]
- unpackFileNameArrayWithLength :: (HasCallStack, Integral a) => a -> Ptr CString -> IO [String]
- packUTF8CArray :: [Text] -> IO (Ptr CString)
- packZeroTerminatedUTF8CArray :: [Text] -> IO (Ptr CString)
- unpackUTF8CArrayWithLength :: (HasCallStack, Integral a) => a -> Ptr CString -> IO [Text]
- unpackZeroTerminatedUTF8CArray :: HasCallStack => Ptr CString -> IO [Text]
- packStorableArray :: Storable a => [a] -> IO (Ptr a)
- packZeroTerminatedStorableArray :: (Num a, Storable a) => [a] -> IO (Ptr a)
- unpackStorableArrayWithLength :: (Integral a, Storable b) => a -> Ptr b -> IO [b]
- unpackZeroTerminatedStorableArray :: (Eq a, Num a, Storable a) => Ptr a -> IO [a]
- packMapStorableArray :: forall a b. Storable b => (a -> b) -> [a] -> IO (Ptr b)
- packMapZeroTerminatedStorableArray :: forall a b. (Num b, Storable b) => (a -> b) -> [a] -> IO (Ptr b)
- unpackMapStorableArrayWithLength :: (Integral a, Storable b) => (b -> c) -> a -> Ptr b -> IO [c]
- unpackMapZeroTerminatedStorableArray :: (Eq a, Num a, Storable a) => (a -> b) -> Ptr a -> IO [b]
- packPtrArray :: [Ptr a] -> IO (Ptr (Ptr a))
- packZeroTerminatedPtrArray :: [Ptr a] -> IO (Ptr (Ptr a))
- unpackPtrArrayWithLength :: Integral a => a -> Ptr (Ptr b) -> IO [Ptr b]
- unpackZeroTerminatedPtrArray :: Ptr (Ptr a) -> IO [Ptr a]
- packBlockArray :: Int -> [Ptr a] -> IO (Ptr a)
- unpackBlockArrayWithLength :: Integral a => Int -> a -> Ptr b -> IO [Ptr b]
- unpackBoxedArrayWithLength :: (Integral a, GBoxed b) => Int -> a -> Ptr b -> IO [Ptr b]
- stringToCString :: String -> IO CString
- cstringToString :: HasCallStack => CString -> IO String
- textToCString :: Text -> IO CString
- withTextCString :: Text -> (CString -> IO a) -> IO a
- cstringToText :: HasCallStack => CString -> IO Text
- byteStringToCString :: ByteString -> IO CString
- cstringToByteString :: HasCallStack => CString -> IO ByteString
- mapZeroTerminatedCArray :: (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
- mapCArrayWithLength :: (Storable a, Integral b) => b -> (a -> IO c) -> Ptr a -> IO ()
- mapGArray :: Storable a => (a -> IO b) -> Ptr (GArray a) -> IO ()
- mapPtrArray :: (Ptr a -> IO b) -> Ptr (GPtrArray (Ptr a)) -> IO ()
- mapGList :: (Ptr a -> IO b) -> Ptr (GList (Ptr a)) -> IO ()
- mapGSList :: (Ptr a -> IO b) -> Ptr (GSList (Ptr a)) -> IO ()

# Documentation

gflagsToWord :: (Num b, IsGFlag a) => [a] -> b Source #

wordToGFlags :: (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b] Source #

packGList :: [Ptr a] -> IO (Ptr (GList (Ptr a))) Source #

Given a Haskell list of items, construct a GList with those values.

unpackGList :: Ptr (GList (Ptr a)) -> IO [Ptr a] Source #

Given a GSList construct the corresponding Haskell list.

packGSList :: [Ptr a] -> IO (Ptr (GSList (Ptr a))) Source #

Given a Haskell list of items, construct a GSList with those values.

unpackGSList :: Ptr (GSList (Ptr a)) -> IO [Ptr a] Source #

Given a GSList construct the corresponding Haskell list.

packGArray :: Storable a => [a] -> IO (Ptr (GArray a)) Source #

unpackGArray :: Storable a => Ptr (GArray a) -> IO [a] Source #

unrefGArray :: Ptr (GArray a) -> IO () Source #

packGPtrArray :: [Ptr a] -> IO (Ptr (GPtrArray (Ptr a))) Source #

unpackGPtrArray :: Ptr (GPtrArray (Ptr a)) -> IO [Ptr a] Source #

unrefPtrArray :: Ptr (GPtrArray a) -> IO () Source #

packGByteArray :: ByteString -> IO (Ptr GByteArray) Source #

unpackGByteArray :: Ptr GByteArray -> IO ByteString Source #

unrefGByteArray :: Ptr GByteArray -> IO () Source #

packGHashTable :: GHashFunc a -> GEqualFunc a -> Maybe (GDestroyNotify a) -> Maybe (GDestroyNotify b) -> [(PtrWrapped a, PtrWrapped b)] -> IO (Ptr (GHashTable a b)) Source #

unpackGHashTable :: Ptr (GHashTable a b) -> IO [(PtrWrapped a, PtrWrapped b)] Source #

unrefGHashTable :: Ptr (GHashTable a b) -> IO () Source #

packByteString :: ByteString -> IO (Ptr Word8) Source #

packZeroTerminatedByteString :: ByteString -> IO (Ptr Word8) Source #

unpackByteStringWithLength :: Integral a => a -> Ptr Word8 -> IO ByteString Source #

unpackZeroTerminatedByteString :: Ptr Word8 -> IO ByteString Source #

packFileNameArray :: [String] -> IO (Ptr CString) Source #

packZeroTerminatedFileNameArray :: [String] -> IO (Ptr CString) Source #

unpackZeroTerminatedFileNameArray :: HasCallStack => Ptr CString -> IO [String] Source #

unpackFileNameArrayWithLength :: (HasCallStack, Integral a) => a -> Ptr CString -> IO [String] Source #

packUTF8CArray :: [Text] -> IO (Ptr CString) Source #

packZeroTerminatedUTF8CArray :: [Text] -> IO (Ptr CString) Source #

unpackUTF8CArrayWithLength :: (HasCallStack, Integral a) => a -> Ptr CString -> IO [Text] Source #

unpackZeroTerminatedUTF8CArray :: HasCallStack => Ptr CString -> IO [Text] Source #

packStorableArray :: Storable a => [a] -> IO (Ptr a) Source #

packZeroTerminatedStorableArray :: (Num a, Storable a) => [a] -> IO (Ptr a) Source #

unpackStorableArrayWithLength :: (Integral a, Storable b) => a -> Ptr b -> IO [b] Source #

unpackZeroTerminatedStorableArray :: (Eq a, Num a, Storable a) => Ptr a -> IO [a] Source #

packMapStorableArray :: forall a b. Storable b => (a -> b) -> [a] -> IO (Ptr b) Source #

packMapZeroTerminatedStorableArray :: forall a b. (Num b, Storable b) => (a -> b) -> [a] -> IO (Ptr b) Source #

unpackMapStorableArrayWithLength :: (Integral a, Storable b) => (b -> c) -> a -> Ptr b -> IO [c] Source #

unpackMapZeroTerminatedStorableArray :: (Eq a, Num a, Storable a) => (a -> b) -> Ptr a -> IO [b] Source #

packPtrArray :: [Ptr a] -> IO (Ptr (Ptr a)) Source #

packZeroTerminatedPtrArray :: [Ptr a] -> IO (Ptr (Ptr a)) Source #

unpackPtrArrayWithLength :: Integral a => a -> Ptr (Ptr b) -> IO [Ptr b] Source #

unpackZeroTerminatedPtrArray :: Ptr (Ptr a) -> IO [Ptr a] Source #

packBlockArray :: Int -> [Ptr a] -> IO (Ptr a) Source #

Given a set of pointers to blocks of memory of the specified size, copy the contents of these blocks to a freshly-allocated (with `allocBytes`) continuous area of memory.

unpackBlockArrayWithLength :: Integral a => Int -> a -> Ptr b -> IO [Ptr b] Source #

unpackBoxedArrayWithLength :: (Integral a, GBoxed b) => Int -> a -> Ptr b -> IO [Ptr b] Source #

stringToCString :: String -> IO CString Source #

cstringToString :: HasCallStack => CString -> IO String Source #

textToCString :: Text -> IO CString Source #

Convert `Text` into a `CString`, using the GLib allocator.

withTextCString :: Text -> (CString -> IO a) -> IO a Source #

cstringToText :: HasCallStack => CString -> IO Text Source #

byteStringToCString :: ByteString -> IO CString Source #

cstringToByteString :: HasCallStack => CString -> IO ByteString Source #

mapZeroTerminatedCArray :: (Ptr a -> IO b) -> Ptr (Ptr a) -> IO () Source #

mapCArrayWithLength :: (Storable a, Integral b) => b -> (a -> IO c) -> Ptr a -> IO () Source #

mapGArray :: Storable a => (a -> IO b) -> Ptr (GArray a) -> IO () Source #

mapPtrArray :: (Ptr a -> IO b) -> Ptr (GPtrArray (Ptr a)) -> IO () Source #

mapGList :: (Ptr a -> IO b) -> Ptr (GList (Ptr a)) -> IO () Source #

mapGSList :: (Ptr a -> IO b) -> Ptr (GSList (Ptr a)) -> IO () Source #