HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulevulkan-3.27GHC2021

Vulkan.CStruct

  • 2 classes
  • Packagevulkan-3.27
  • Exports2
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceCStruct.hs
classclass ToCStruct a where
#

A class for types which can be marshalled into a C style structure.

Methods

  • withCStruct :: a -> (Ptr a -> IO b) -> IO b

    Allocates a C type structure and all dependencies and passes it to a continuation. The space is deallocated when this continuation returns and the C type structure must not be returned out of it.

  • pokeCStruct :: Ptr a -> a -> IO b -> IO b

    Write a C type struct into some existing memory and run a continuation. The pointed to structure is not necessarily valid outside the continuation as additional allocations may have been made.

  • withZeroCStruct :: (Ptr a -> IO b) -> IO b

    Allocate space for an "empty" a and populate any univalued members with their value.

  • pokeZeroCStruct :: Ptr a -> IO b -> IO b

    And populate any univalued members with their value, run a function and then clean up any allocated resources.

  • cStructSize :: Int

    The size of this struct, note that this doesn't account for any extra pointed-to data

  • cStructAlignment :: Int

    The required memory alignment for this type

Instances1267ToCStruct, …
classclass FromCStruct a where
#

A class for types which can be marshalled from a C style structure.

Methods

Instances1221FromCStruct, …