Hoogle Search
Within LTS Haskell 24.51 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
fixupCallerAllocates :: Callable -> Callablehaskell-gi Data.GI.CodeGen.Callable caller-allocates arguments are arguments that the caller allocates, and the called function modifies. They are marked as out argumens in the introspection data, we sometimes treat them as inout arguments instead. The semantics are somewhat tricky: for memory management purposes they should be treated as "in" arguments, but from the point of view of the exposed API they should be treated as "out" or "inout". Unfortunately we cannot always just assume that they are purely "out", so in many cases the generated API is somewhat suboptimal (since the initial values are not important): for example for g_io_channel_read_chars the size of the buffer to read is determined by the caller-allocates argument. As a compromise, we assume that we can allocate anything that is not a TCArray of length determined by an argument.
genCCallableWrapper :: Name -> Text -> Callable -> ExcCodeGen ()haskell-gi Data.GI.CodeGen.Callable Generate a wrapper for a known C symbol.
genDynamicCallableWrapper :: Name -> Text -> Callable -> ExcCodeGen Texthaskell-gi Data.GI.CodeGen.Callable Generate a wrapper for a dynamic C symbol (i.e. a Haskell function that will invoke its first argument, which should be a FunPtr of the appropriate type). The caller should have created a type synonym with the right type for the foreign symbol.
signatureCallable :: Signature -> Callablehaskell-gi Data.GI.CodeGen.Callable No documentation available.
TypeAlloc :: Text -> Int -> TypeAllocInfohaskell-gi Data.GI.CodeGen.Conversions No documentation available.
-
haskell-gi Data.GI.CodeGen.Conversions Information on how to allocate a type: allocator function and size of the struct.
callableHasClosures :: Callable -> Boolhaskell-gi Data.GI.CodeGen.Conversions Whether the callable has closure arguments (i.e. "user_data" style arguments).
typeAllocInfo :: Type -> CodeGen e (Maybe TypeAllocInfo)haskell-gi Data.GI.CodeGen.Conversions Information on how to allocate the given type, if known.
typeIsCallback :: Type -> CodeGen e Boolhaskell-gi Data.GI.CodeGen.Conversions Check whether the given type corresponds to a callback.
fixCallbackUserData :: (Name, API) -> (Name, API)haskell-gi Data.GI.CodeGen.Fixups The last argument of callbacks is often a user_data argument, but currently gobject-introspection does not have an annotation representing this. This is generally OK, since the gir generator will mark these arguments as (closure) if they are named user_data, and we do the right things in this case, but recently there has been a push to "fix" these annotations by removing them without providing any replacement, which breaks the bindings. See https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/450 Here we try to guess which arguments in callbacks are user_data arguments.