vt-utils-1.3.0.0: Vector and Text utilities

Safe HaskellNone
LanguageHaskell2010

VtUtils.FFI

Description

Foreign Function Interface utilities

Synopsis

Documentation

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

Passes specified Storable value as a pointer (to that value) to the specified IO action

Arguments:

  • val :: Storable a: Input value
  • fun :: Ptr a -> IO b: IO action to run

Return value: Value returned from IO action

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

Passes a pointer to a NULL pointer of a Storable type to the specified IO action

Arguments:

  • fun :: Ptr (Ptr a) -> IO b: IO action to run

Return value: Value returned from IO action

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

Passes specified Text string as a NUL-terminated UTF-8 string to the specified IO action

Arguments:

  • text :: Text: Input string
  • fun :: CString -> IO a: IO action to run

Return value: Value returned from IO action

ffiWithUTF16 :: Text -> (Ptr Word16 -> IO a) -> IO a Source #

Passes specified Text string as a NUL-terminated UTF-16 string to the specified IO action

Arguments:

  • text :: Text: Input string
  • fun :: Ptr Word16 -> IO a: IO action to run

Return value: Value returned from IO action