gi-glib-2.0.23: GLib bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.GLib.Callbacks

Description

 
Synopsis

Signals

ChildWatchFunc

type C_ChildWatchFunc = Int32 -> Int32 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type ChildWatchFunc Source #

Arguments

 = Int32

pid: the process id of the child process

-> Int32

status: Status information about the child process, encoded in a platform-specific manner

-> IO () 

Prototype of a GChildWatchSource callback, called when a child process has exited. To interpret status, see the documentation for spawnCheckExitStatus.

type ChildWatchFunc_WithClosures Source #

Arguments

 = Int32

pid: the process id of the child process

-> Int32

status: Status information about the child process, encoded in a platform-specific manner

-> Ptr ()

userData: user data passed to g_child_watch_add()

-> IO () 

Prototype of a GChildWatchSource callback, called when a child process has exited. To interpret status, see the documentation for spawnCheckExitStatus.

drop_closures_ChildWatchFunc :: ChildWatchFunc -> ChildWatchFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_ChildWatchFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_ChildWatchFunc 
-> Int32

pid: the process id of the child process

-> Int32

status: Status information about the child process, encoded in a platform-specific manner

-> Ptr ()

userData: user data passed to g_child_watch_add()

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_ChildWatchFunc :: C_ChildWatchFunc -> IO (FunPtr C_ChildWatchFunc) Source #

Generate a function pointer callable from C code, from a C_ChildWatchFunc.

ClearHandleFunc

type C_ClearHandleFunc = Word32 -> IO () Source #

Type for the callback on the (unwrapped) C side.

type ClearHandleFunc Source #

Arguments

 = Word32

handleId: the handle ID to clear

-> IO () 

Specifies the type of function passed to g_clear_handle_id(). The implementation is expected to free the resource identified by handleId; for instance, if handleId is a Source ID, sourceRemove can be used.

Since: 2.56

dynamic_ClearHandleFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_ClearHandleFunc 
-> Word32

handleId: the handle ID to clear

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_ClearHandleFunc :: C_ClearHandleFunc -> IO (FunPtr C_ClearHandleFunc) Source #

Generate a function pointer callable from C code, from a C_ClearHandleFunc.

CompareDataFunc

type C_CompareDataFunc = Ptr () -> Ptr () -> Ptr () -> IO Int32 Source #

Type for the callback on the (unwrapped) C side.

type CompareDataFunc Source #

Arguments

 = Ptr ()

a: a value

-> Ptr ()

b: a value to compare with

-> IO Int32

Returns: negative value if a < b; zero if a = b; positive value if a > b

Specifies the type of a comparison function used to compare two values. The function should return a negative integer if the first value comes before the second, 0 if they are equal, or a positive integer if the first value comes after the second.

type CompareDataFunc_WithClosures Source #

Arguments

 = Ptr ()

a: a value

-> Ptr ()

b: a value to compare with

-> Ptr ()

userData: user data

-> IO Int32

Returns: negative value if a < b; zero if a = b; positive value if a > b

Specifies the type of a comparison function used to compare two values. The function should return a negative integer if the first value comes before the second, 0 if they are equal, or a positive integer if the first value comes after the second.

drop_closures_CompareDataFunc :: CompareDataFunc -> CompareDataFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_CompareDataFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_CompareDataFunc 
-> Ptr ()

a: a value

-> Ptr ()

b: a value to compare with

-> Ptr ()

userData: user data

-> m Int32

Returns: negative value if a < b; zero if a = b; positive value if a > b

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_CompareDataFunc :: C_CompareDataFunc -> IO (FunPtr C_CompareDataFunc) Source #

Generate a function pointer callable from C code, from a C_CompareDataFunc.

CompareFunc

type C_CompareFunc = Ptr () -> Ptr () -> IO Int32 Source #

Type for the callback on the (unwrapped) C side.

type CompareFunc Source #

Arguments

 = Ptr ()

a: a value

-> Ptr ()

b: a value to compare with

-> IO Int32

Returns: negative value if a < b; zero if a = b; positive value if a > b

Specifies the type of a comparison function used to compare two values. The function should return a negative integer if the first value comes before the second, 0 if they are equal, or a positive integer if the first value comes after the second.

dynamic_CompareFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_CompareFunc 
-> Ptr ()

a: a value

-> Ptr ()

b: a value to compare with

-> m Int32

Returns: negative value if a < b; zero if a = b; positive value if a > b

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_CompareFunc :: C_CompareFunc -> IO (FunPtr C_CompareFunc) Source #

Generate a function pointer callable from C code, from a C_CompareFunc.

CopyFunc

type C_CopyFunc = Ptr () -> Ptr () -> IO (Ptr ()) Source #

Type for the callback on the (unwrapped) C side.

type CopyFunc Source #

Arguments

 = Ptr ()

src: A pointer to the data which should be copied

-> Ptr ()

data: Additional data

-> IO (Ptr ())

Returns: A pointer to the copy

A function of this signature is used to copy the node data when doing a deep-copy of a tree.

Since: 2.4

dynamic_CopyFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_CopyFunc 
-> Ptr ()

src: A pointer to the data which should be copied

-> Ptr ()

data: Additional data

-> m (Ptr ())

Returns: A pointer to the copy

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_CopyFunc :: MonadIO m => CopyFunc -> m (GClosure C_CopyFunc) Source #

Wrap the callback into a GClosure.

mk_CopyFunc :: C_CopyFunc -> IO (FunPtr C_CopyFunc) Source #

Generate a function pointer callable from C code, from a C_CopyFunc.

noCopyFunc :: Maybe CopyFunc Source #

A convenience synonym for Nothing :: Maybe CopyFunc.

DataForeachFunc

type C_DataForeachFunc = Word32 -> Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type DataForeachFunc Source #

Arguments

 = Word32

keyId: the GQuark id to identifying the data element.

-> Ptr ()

data: the data element.

-> IO () 

Specifies the type of function passed to datasetForeach. It is called with each GQuark id and associated data element, together with the userData parameter supplied to datasetForeach.

type DataForeachFunc_WithClosures Source #

Arguments

 = Word32

keyId: the GQuark id to identifying the data element.

-> Ptr ()

data: the data element.

-> Ptr ()

userData: user data passed to datasetForeach.

-> IO () 

Specifies the type of function passed to datasetForeach. It is called with each GQuark id and associated data element, together with the userData parameter supplied to datasetForeach.

drop_closures_DataForeachFunc :: DataForeachFunc -> DataForeachFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_DataForeachFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_DataForeachFunc 
-> Word32

keyId: the GQuark id to identifying the data element.

-> Ptr ()

data: the data element.

-> Ptr ()

userData: user data passed to datasetForeach.

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_DataForeachFunc :: C_DataForeachFunc -> IO (FunPtr C_DataForeachFunc) Source #

Generate a function pointer callable from C code, from a C_DataForeachFunc.

DestroyNotify

type C_DestroyNotify = Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type DestroyNotify Source #

Arguments

 = Ptr ()

data: the data element.

-> IO () 

Specifies the type of function which is called when a data element is destroyed. It is passed the pointer to the data element and should free any memory and resources allocated for it.

dynamic_DestroyNotify Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_DestroyNotify 
-> Ptr ()

data: the data element.

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_DestroyNotify :: C_DestroyNotify -> IO (FunPtr C_DestroyNotify) Source #

Generate a function pointer callable from C code, from a C_DestroyNotify.

DuplicateFunc

type C_DuplicateFunc = Ptr () -> Ptr () -> IO (Ptr ()) Source #

Type for the callback on the (unwrapped) C side.

type DuplicateFunc Source #

Arguments

 = Ptr ()

data: the data to duplicate

-> IO (Ptr ())

Returns: a duplicate of data

The type of functions that are used to 'duplicate' an object. What this means depends on the context, it could just be incrementing the reference count, if data is a ref-counted object.

type DuplicateFunc_WithClosures Source #

Arguments

 = Ptr ()

data: the data to duplicate

-> Ptr ()

userData: user data that was specified in g_datalist_id_dup_data()

-> IO (Ptr ())

Returns: a duplicate of data

The type of functions that are used to 'duplicate' an object. What this means depends on the context, it could just be incrementing the reference count, if data is a ref-counted object.

drop_closures_DuplicateFunc :: DuplicateFunc -> DuplicateFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_DuplicateFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_DuplicateFunc 
-> Ptr ()

data: the data to duplicate

-> Ptr ()

userData: user data that was specified in g_datalist_id_dup_data()

-> m (Ptr ())

Returns: a duplicate of data

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_DuplicateFunc :: C_DuplicateFunc -> IO (FunPtr C_DuplicateFunc) Source #

Generate a function pointer callable from C code, from a C_DuplicateFunc.

EqualFunc

type C_EqualFunc = Ptr () -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type EqualFunc Source #

Arguments

 = Ptr ()

a: a value

-> Ptr ()

b: a value to compare with

-> IO Bool

Returns: True if a = b; False otherwise

Specifies the type of a function used to test two values for equality. The function should return True if both values are equal and False otherwise.

dynamic_EqualFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_EqualFunc 
-> Ptr ()

a: a value

-> Ptr ()

b: a value to compare with

-> m Bool

Returns: True if a = b; False otherwise

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_EqualFunc :: MonadIO m => EqualFunc -> m (GClosure C_EqualFunc) Source #

Wrap the callback into a GClosure.

mk_EqualFunc :: C_EqualFunc -> IO (FunPtr C_EqualFunc) Source #

Generate a function pointer callable from C code, from a C_EqualFunc.

noEqualFunc :: Maybe EqualFunc Source #

A convenience synonym for Nothing :: Maybe EqualFunc.

FreeFunc

type C_FreeFunc = Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type FreeFunc Source #

Arguments

 = Ptr ()

data: a data pointer

-> IO () 

Declares a type of function which takes an arbitrary data pointer argument and has no return value. It is not currently used in GLib or GTK+.

dynamic_FreeFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_FreeFunc 
-> Ptr ()

data: a data pointer

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_FreeFunc :: MonadIO m => FreeFunc -> m (GClosure C_FreeFunc) Source #

Wrap the callback into a GClosure.

mk_FreeFunc :: C_FreeFunc -> IO (FunPtr C_FreeFunc) Source #

Generate a function pointer callable from C code, from a C_FreeFunc.

noFreeFunc :: Maybe FreeFunc Source #

A convenience synonym for Nothing :: Maybe FreeFunc.

Func

type C_Func = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type Func Source #

Arguments

 = Ptr ()

data: the element's data

-> IO () 

Specifies the type of functions passed to g_list_foreach() and g_slist_foreach().

type Func_WithClosures Source #

Arguments

 = Ptr ()

data: the element's data

-> Ptr ()

userData: user data passed to g_list_foreach() or g_slist_foreach()

-> IO () 

Specifies the type of functions passed to g_list_foreach() and g_slist_foreach().

drop_closures_Func :: Func -> Func_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_Func Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_Func 
-> Ptr ()

data: the element's data

-> Ptr ()

userData: user data passed to g_list_foreach() or g_slist_foreach()

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_Func :: MonadIO m => Func -> m (GClosure C_Func) Source #

Wrap the callback into a GClosure.

mk_Func :: C_Func -> IO (FunPtr C_Func) Source #

Generate a function pointer callable from C code, from a C_Func.

noFunc :: Maybe Func Source #

A convenience synonym for Nothing :: Maybe Func.

HFunc

type C_HFunc = Ptr () -> Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type HFunc Source #

Arguments

 = Ptr ()

key: a key

-> Ptr ()

value: the value corresponding to the key

-> IO () 

Specifies the type of the function passed to g_hash_table_foreach(). It is called with each key/value pair, together with the userData parameter which is passed to g_hash_table_foreach().

type HFunc_WithClosures Source #

Arguments

 = Ptr ()

key: a key

-> Ptr ()

value: the value corresponding to the key

-> Ptr ()

userData: user data passed to g_hash_table_foreach()

-> IO () 

Specifies the type of the function passed to g_hash_table_foreach(). It is called with each key/value pair, together with the userData parameter which is passed to g_hash_table_foreach().

drop_closures_HFunc :: HFunc -> HFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_HFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_HFunc 
-> Ptr ()

key: a key

-> Ptr ()

value: the value corresponding to the key

-> Ptr ()

userData: user data passed to g_hash_table_foreach()

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_HFunc :: MonadIO m => HFunc -> m (GClosure C_HFunc) Source #

Wrap the callback into a GClosure.

mk_HFunc :: C_HFunc -> IO (FunPtr C_HFunc) Source #

Generate a function pointer callable from C code, from a C_HFunc.

noHFunc :: Maybe HFunc Source #

A convenience synonym for Nothing :: Maybe HFunc.

HRFunc

type C_HRFunc = Ptr () -> Ptr () -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type HRFunc Source #

Arguments

 = Ptr ()

key: a key

-> Ptr ()

value: the value associated with the key

-> IO Bool

Returns: True if the key/value pair should be removed from the HashTable

Specifies the type of the function passed to g_hash_table_foreach_remove(). It is called with each key/value pair, together with the userData parameter passed to g_hash_table_foreach_remove(). It should return True if the key/value pair should be removed from the HashTable.

type HRFunc_WithClosures Source #

Arguments

 = Ptr ()

key: a key

-> Ptr ()

value: the value associated with the key

-> Ptr ()

userData: user data passed to hashTableRemove

-> IO Bool

Returns: True if the key/value pair should be removed from the HashTable

Specifies the type of the function passed to g_hash_table_foreach_remove(). It is called with each key/value pair, together with the userData parameter passed to g_hash_table_foreach_remove(). It should return True if the key/value pair should be removed from the HashTable.

drop_closures_HRFunc :: HRFunc -> HRFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_HRFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_HRFunc 
-> Ptr ()

key: a key

-> Ptr ()

value: the value associated with the key

-> Ptr ()

userData: user data passed to hashTableRemove

-> m Bool

Returns: True if the key/value pair should be removed from the HashTable

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_HRFunc :: MonadIO m => HRFunc -> m (GClosure C_HRFunc) Source #

Wrap the callback into a GClosure.

mk_HRFunc :: C_HRFunc -> IO (FunPtr C_HRFunc) Source #

Generate a function pointer callable from C code, from a C_HRFunc.

noHRFunc :: Maybe HRFunc Source #

A convenience synonym for Nothing :: Maybe HRFunc.

HashFunc

type C_HashFunc = Ptr () -> IO Word32 Source #

Type for the callback on the (unwrapped) C side.

type HashFunc Source #

Arguments

 = Ptr ()

key: a key

-> IO Word32

Returns: the hash value corresponding to the key

Specifies the type of the hash function which is passed to g_hash_table_new() when a HashTable is created.

The function is passed a key and should return a guint hash value. The functions directHash, intHash and strHash provide hash functions which can be used when the key is a gpointer, gint*, and gchar* respectively.

directHash is also the appropriate hash function for keys of the form GINT_TO_POINTER (n) (or similar macros).

A good hash functions should produce hash values that are evenly distributed over a fairly large range. The modulus is taken with the hash table size (a prime number) to find the 'bucket' to place each key into. The function should also be very fast, since it is called for each key lookup.

Note that the hash functions provided by GLib have these qualities, but are not particularly robust against manufactured keys that cause hash collisions. Therefore, you should consider choosing a more secure hash function when using a GHashTable with keys that originate in untrusted data (such as HTTP requests). Using strHash in that situation might make your application vulerable to Algorithmic Complexity Attacks.

The key to choosing a good hash is unpredictability. Even cryptographic hashes are very easy to find collisions for when the remainder is taken modulo a somewhat predictable prime number. There must be an element of randomness that an attacker is unable to guess.

dynamic_HashFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_HashFunc 
-> Ptr ()

key: a key

-> m Word32

Returns: the hash value corresponding to the key

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_HashFunc :: MonadIO m => HashFunc -> m (GClosure C_HashFunc) Source #

Wrap the callback into a GClosure.

mk_HashFunc :: C_HashFunc -> IO (FunPtr C_HashFunc) Source #

Generate a function pointer callable from C code, from a C_HashFunc.

noHashFunc :: Maybe HashFunc Source #

A convenience synonym for Nothing :: Maybe HashFunc.

HookCheckFunc

type C_HookCheckFunc = Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type HookCheckFunc Source #

Arguments

 = Ptr ()

data: the data field of the Hook is passed to the hook function here

-> IO Bool

Returns: False if the Hook should be destroyed

Defines the type of a hook function that can be invoked by hookListInvokeCheck.

dynamic_HookCheckFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_HookCheckFunc 
-> Ptr ()

data: the data field of the Hook is passed to the hook function here

-> m Bool

Returns: False if the Hook should be destroyed

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_HookCheckFunc :: C_HookCheckFunc -> IO (FunPtr C_HookCheckFunc) Source #

Generate a function pointer callable from C code, from a C_HookCheckFunc.

HookCheckMarshaller

type C_HookCheckMarshaller = Ptr Hook -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type HookCheckMarshaller Source #

Arguments

 = Hook

hook: a Hook

-> Ptr ()

marshalData: user data

-> IO Bool

Returns: False if hook should be destroyed

Defines the type of function used by g_hook_list_marshal_check().

dynamic_HookCheckMarshaller Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_HookCheckMarshaller 
-> Hook

hook: a Hook

-> Ptr ()

marshalData: user data

-> m Bool

Returns: False if hook should be destroyed

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_HookCheckMarshaller :: C_HookCheckMarshaller -> IO (FunPtr C_HookCheckMarshaller) Source #

Generate a function pointer callable from C code, from a C_HookCheckMarshaller.

HookCompareFunc

type C_HookCompareFunc = Ptr Hook -> Ptr Hook -> IO Int32 Source #

Type for the callback on the (unwrapped) C side.

type HookCompareFunc Source #

Arguments

 = Hook

newHook: the Hook being inserted

-> Hook

sibling: the Hook to compare with newHook

-> IO Int32

Returns: a value <= 0 if newHook should be before sibling

Defines the type of function used to compare Hook elements in g_hook_insert_sorted().

dynamic_HookCompareFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_HookCompareFunc 
-> Hook

newHook: the Hook being inserted

-> Hook

sibling: the Hook to compare with newHook

-> m Int32

Returns: a value <= 0 if newHook should be before sibling

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_HookCompareFunc :: C_HookCompareFunc -> IO (FunPtr C_HookCompareFunc) Source #

Generate a function pointer callable from C code, from a C_HookCompareFunc.

HookFinalizeFunc

type C_HookFinalizeFunc = Ptr HookList -> Ptr Hook -> IO () Source #

Type for the callback on the (unwrapped) C side.

type HookFinalizeFunc Source #

Arguments

 = HookList

hookList: a HookList

-> Hook

hook: the hook in hookList that gets finalized

-> IO () 

Defines the type of function to be called when a hook in a list of hooks gets finalized.

dynamic_HookFinalizeFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_HookFinalizeFunc 
-> HookList

hookList: a HookList

-> Hook

hook: the hook in hookList that gets finalized

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_HookFinalizeFunc :: C_HookFinalizeFunc -> IO (FunPtr C_HookFinalizeFunc) Source #

Generate a function pointer callable from C code, from a C_HookFinalizeFunc.

HookFindFunc

type C_HookFindFunc = Ptr Hook -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type HookFindFunc Source #

Arguments

 = Hook

hook: a Hook

-> Ptr ()

data: user data passed to g_hook_find_func()

-> IO Bool

Returns: True if the required Hook has been found

Defines the type of the function passed to g_hook_find().

dynamic_HookFindFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_HookFindFunc 
-> Hook

hook: a Hook

-> Ptr ()

data: user data passed to g_hook_find_func()

-> m Bool

Returns: True if the required Hook has been found

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_HookFindFunc :: C_HookFindFunc -> IO (FunPtr C_HookFindFunc) Source #

Generate a function pointer callable from C code, from a C_HookFindFunc.

HookFunc

type C_HookFunc = Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type HookFunc Source #

Arguments

 = Ptr ()

data: the data field of the Hook is passed to the hook function here

-> IO () 

Defines the type of a hook function that can be invoked by hookListInvoke.

dynamic_HookFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_HookFunc 
-> Ptr ()

data: the data field of the Hook is passed to the hook function here

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_HookFunc :: MonadIO m => HookFunc -> m (GClosure C_HookFunc) Source #

Wrap the callback into a GClosure.

mk_HookFunc :: C_HookFunc -> IO (FunPtr C_HookFunc) Source #

Generate a function pointer callable from C code, from a C_HookFunc.

noHookFunc :: Maybe HookFunc Source #

A convenience synonym for Nothing :: Maybe HookFunc.

HookMarshaller

type C_HookMarshaller = Ptr Hook -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type HookMarshaller Source #

Arguments

 = Hook

hook: a Hook

-> Ptr ()

marshalData: user data

-> IO () 

Defines the type of function used by g_hook_list_marshal().

dynamic_HookMarshaller Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_HookMarshaller 
-> Hook

hook: a Hook

-> Ptr ()

marshalData: user data

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_HookMarshaller :: C_HookMarshaller -> IO (FunPtr C_HookMarshaller) Source #

Generate a function pointer callable from C code, from a C_HookMarshaller.

IOFunc

type C_IOFunc = Ptr IOChannel -> CUInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type IOFunc Source #

Arguments

 = IOChannel

source: the IOChannel event source

-> [IOCondition]

condition: the condition which has been satisfied

-> Ptr ()

data: user data set in g_io_add_watch() or ioAddWatch

-> IO Bool

Returns: the function should return False if the event source should be removed

Specifies the type of function passed to g_io_add_watch() or ioAddWatch, which is called when the requested condition on a IOChannel is satisfied.

dynamic_IOFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_IOFunc 
-> IOChannel

source: the IOChannel event source

-> [IOCondition]

condition: the condition which has been satisfied

-> Ptr ()

data: user data set in g_io_add_watch() or ioAddWatch

-> m Bool

Returns: the function should return False if the event source should be removed

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_IOFunc :: MonadIO m => IOFunc -> m (GClosure C_IOFunc) Source #

Wrap the callback into a GClosure.

mk_IOFunc :: C_IOFunc -> IO (FunPtr C_IOFunc) Source #

Generate a function pointer callable from C code, from a C_IOFunc.

noIOFunc :: Maybe IOFunc Source #

A convenience synonym for Nothing :: Maybe IOFunc.

IOFuncsIoCloseFieldCallback

type C_IOFuncsIoCloseFieldCallback = Ptr IOChannel -> Ptr (Ptr GError) -> IO CUInt Source #

Type for the callback on the (unwrapped) C side.

type IOFuncsIoCloseFieldCallback Source #

Arguments

 = IOChannel 
-> IO IOStatus

(Can throw GError)

No description available in the introspection data.

dynamic_IOFuncsIoCloseFieldCallback Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

IOFuncsIoCreateWatchFieldCallback

type C_IOFuncsIoCreateWatchFieldCallback = Ptr IOChannel -> CUInt -> IO (Ptr Source) Source #

Type for the callback on the (unwrapped) C side.

type IOFuncsIoCreateWatchFieldCallback = IOChannel -> [IOCondition] -> IO Source Source #

No description available in the introspection data.

dynamic_IOFuncsIoCreateWatchFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_IOFuncsIoCreateWatchFieldCallback -> IOChannel -> [IOCondition] -> m Source Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

IOFuncsIoFreeFieldCallback

type C_IOFuncsIoFreeFieldCallback = Ptr IOChannel -> IO () Source #

Type for the callback on the (unwrapped) C side.

type IOFuncsIoFreeFieldCallback = IOChannel -> IO () Source #

No description available in the introspection data.

dynamic_IOFuncsIoFreeFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_IOFuncsIoFreeFieldCallback -> IOChannel -> m () Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

IOFuncsIoGetFlagsFieldCallback

type C_IOFuncsIoGetFlagsFieldCallback = Ptr IOChannel -> IO CUInt Source #

Type for the callback on the (unwrapped) C side.

type IOFuncsIoGetFlagsFieldCallback = IOChannel -> IO [IOFlags] Source #

No description available in the introspection data.

dynamic_IOFuncsIoGetFlagsFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_IOFuncsIoGetFlagsFieldCallback -> IOChannel -> m [IOFlags] Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

IOFuncsIoReadFieldCallback

type C_IOFuncsIoReadFieldCallback = Ptr IOChannel -> CString -> Word64 -> Word64 -> Ptr (Ptr GError) -> IO CUInt Source #

Type for the callback on the (unwrapped) C side.

type IOFuncsIoReadFieldCallback Source #

Arguments

 = IOChannel 
-> Text 
-> Word64 
-> Word64 
-> IO IOStatus

(Can throw GError)

No description available in the introspection data.

dynamic_IOFuncsIoReadFieldCallback Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_IOFuncsIoReadFieldCallback 
-> IOChannel 
-> Text 
-> Word64 
-> Word64 
-> m IOStatus

(Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

IOFuncsIoSeekFieldCallback

type C_IOFuncsIoSeekFieldCallback = Ptr IOChannel -> Int64 -> CUInt -> Ptr (Ptr GError) -> IO CUInt Source #

Type for the callback on the (unwrapped) C side.

type IOFuncsIoSeekFieldCallback Source #

Arguments

 = IOChannel 
-> Int64 
-> SeekType 
-> IO IOStatus

(Can throw GError)

No description available in the introspection data.

dynamic_IOFuncsIoSeekFieldCallback Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

IOFuncsIoSetFlagsFieldCallback

type C_IOFuncsIoSetFlagsFieldCallback = Ptr IOChannel -> CUInt -> Ptr (Ptr GError) -> IO CUInt Source #

Type for the callback on the (unwrapped) C side.

type IOFuncsIoSetFlagsFieldCallback Source #

Arguments

 = IOChannel 
-> [IOFlags] 
-> IO IOStatus

(Can throw GError)

No description available in the introspection data.

dynamic_IOFuncsIoSetFlagsFieldCallback Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

IOFuncsIoWriteFieldCallback

type C_IOFuncsIoWriteFieldCallback = Ptr IOChannel -> CString -> Word64 -> Word64 -> Ptr (Ptr GError) -> IO CUInt Source #

Type for the callback on the (unwrapped) C side.

type IOFuncsIoWriteFieldCallback Source #

Arguments

 = IOChannel 
-> Text 
-> Word64 
-> Word64 
-> IO IOStatus

(Can throw GError)

No description available in the introspection data.

dynamic_IOFuncsIoWriteFieldCallback Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_IOFuncsIoWriteFieldCallback 
-> IOChannel 
-> Text 
-> Word64 
-> Word64 
-> m IOStatus

(Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

LogFunc

type C_LogFunc = CString -> CInt -> CString -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type LogFunc Source #

Arguments

 = Text

logDomain: the log domain of the message

-> [LogLevelFlags]

logLevel: the log level of the message (including the fatal and recursion flags)

-> Text

message: the message to process

-> IO () 

Specifies the prototype of log handler functions.

The default log handler, logDefaultHandler, automatically appends a new-line character to message when printing it. It is advised that any custom log handler functions behave similarly, so that logging calls in user code do not need modifying to add a new-line character to the message if the log handler is changed.

This is not used if structured logging is enabled; see [Using Structured Logging][using-structured-logging].

type LogFunc_WithClosures Source #

Arguments

 = Text

logDomain: the log domain of the message

-> [LogLevelFlags]

logLevel: the log level of the message (including the fatal and recursion flags)

-> Text

message: the message to process

-> Ptr ()

userData: user data, set in g_log_set_handler()

-> IO () 

Specifies the prototype of log handler functions.

The default log handler, logDefaultHandler, automatically appends a new-line character to message when printing it. It is advised that any custom log handler functions behave similarly, so that logging calls in user code do not need modifying to add a new-line character to the message if the log handler is changed.

This is not used if structured logging is enabled; see [Using Structured Logging][using-structured-logging].

drop_closures_LogFunc :: LogFunc -> LogFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_LogFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_LogFunc 
-> Text

logDomain: the log domain of the message

-> [LogLevelFlags]

logLevel: the log level of the message (including the fatal and recursion flags)

-> Text

message: the message to process

-> Ptr ()

userData: user data, set in g_log_set_handler()

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_LogFunc :: MonadIO m => LogFunc -> m (GClosure C_LogFunc) Source #

Wrap the callback into a GClosure.

mk_LogFunc :: C_LogFunc -> IO (FunPtr C_LogFunc) Source #

Generate a function pointer callable from C code, from a C_LogFunc.

noLogFunc :: Maybe LogFunc Source #

A convenience synonym for Nothing :: Maybe LogFunc.

LogWriterFunc

type C_LogWriterFunc = CInt -> Ptr LogField -> Word64 -> Ptr () -> IO CUInt Source #

Type for the callback on the (unwrapped) C side.

type LogWriterFunc Source #

Arguments

 = [LogLevelFlags]

logLevel: log level of the message

-> [LogField]

fields: fields forming the message

-> IO LogWriterOutput

Returns: LogWriterOutputHandled if the log entry was handled successfully; LogWriterOutputUnhandled otherwise

Writer function for log entries. A log entry is a collection of one or more GLogFields, using the standard <https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html field names from journal specification>. See g_log_structured() for more information.

Writer functions must ignore fields which they do not recognise, unless they can write arbitrary binary output, as field values may be arbitrary binary.

logLevel is guaranteed to be included in fields as the PRIORITY field, but is provided separately for convenience of deciding whether or where to output the log entry.

Writer functions should return LogWriterOutputHandled if they handled the log message successfully or if they deliberately ignored it. If there was an error handling the message (for example, if the writer function is meant to send messages to a remote logging server and there is a network error), it should return LogWriterOutputUnhandled. This allows writer functions to be chained and fall back to simpler handlers in case of failure.

Since: 2.50

type LogWriterFunc_WithClosures Source #

Arguments

 = [LogLevelFlags]

logLevel: log level of the message

-> [LogField]

fields: fields forming the message

-> Ptr ()

userData: user data passed to logSetWriterFunc

-> IO LogWriterOutput

Returns: LogWriterOutputHandled if the log entry was handled successfully; LogWriterOutputUnhandled otherwise

Writer function for log entries. A log entry is a collection of one or more GLogFields, using the standard <https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html field names from journal specification>. See g_log_structured() for more information.

Writer functions must ignore fields which they do not recognise, unless they can write arbitrary binary output, as field values may be arbitrary binary.

logLevel is guaranteed to be included in fields as the PRIORITY field, but is provided separately for convenience of deciding whether or where to output the log entry.

Writer functions should return LogWriterOutputHandled if they handled the log message successfully or if they deliberately ignored it. If there was an error handling the message (for example, if the writer function is meant to send messages to a remote logging server and there is a network error), it should return LogWriterOutputUnhandled. This allows writer functions to be chained and fall back to simpler handlers in case of failure.

Since: 2.50

drop_closures_LogWriterFunc :: LogWriterFunc -> LogWriterFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_LogWriterFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_LogWriterFunc 
-> [LogLevelFlags]

logLevel: log level of the message

-> [LogField]

fields: fields forming the message

-> Ptr ()

userData: user data passed to logSetWriterFunc

-> m LogWriterOutput

Returns: LogWriterOutputHandled if the log entry was handled successfully; LogWriterOutputUnhandled otherwise

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_LogWriterFunc :: C_LogWriterFunc -> IO (FunPtr C_LogWriterFunc) Source #

Generate a function pointer callable from C code, from a C_LogWriterFunc.

MarkupParserEndElementFieldCallback

type C_MarkupParserEndElementFieldCallback = Ptr MarkupParseContext -> CString -> Ptr () -> Ptr (Ptr GError) -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MarkupParserEndElementFieldCallback Source #

Arguments

 = MarkupParseContext 
-> Text 
-> IO ()

(Can throw GError)

No description available in the introspection data.

type MarkupParserEndElementFieldCallback_WithClosures Source #

Arguments

 = MarkupParseContext 
-> Text 
-> Ptr () 
-> IO ()

(Can throw GError)

No description available in the introspection data.

dynamic_MarkupParserEndElementFieldCallback Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_MarkupParserEndElementFieldCallback 
-> MarkupParseContext 
-> Text 
-> Ptr () 
-> m ()

(Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

MarkupParserErrorFieldCallback

type C_MarkupParserErrorFieldCallback = Ptr MarkupParseContext -> Ptr GError -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MarkupParserErrorFieldCallback = MarkupParseContext -> GError -> IO () Source #

No description available in the introspection data.

type MarkupParserErrorFieldCallback_WithClosures = MarkupParseContext -> GError -> Ptr () -> IO () Source #

No description available in the introspection data.

dynamic_MarkupParserErrorFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_MarkupParserErrorFieldCallback -> MarkupParseContext -> GError -> Ptr () -> m () Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

MarkupParserPassthroughFieldCallback

type C_MarkupParserPassthroughFieldCallback = Ptr MarkupParseContext -> CString -> Word64 -> Ptr () -> Ptr (Ptr GError) -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MarkupParserPassthroughFieldCallback Source #

Arguments

 = MarkupParseContext 
-> Text 
-> Word64 
-> IO ()

(Can throw GError)

No description available in the introspection data.

type MarkupParserPassthroughFieldCallback_WithClosures Source #

Arguments

 = MarkupParseContext 
-> Text 
-> Word64 
-> Ptr () 
-> IO ()

(Can throw GError)

No description available in the introspection data.

dynamic_MarkupParserPassthroughFieldCallback Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_MarkupParserPassthroughFieldCallback 
-> MarkupParseContext 
-> Text 
-> Word64 
-> Ptr () 
-> m ()

(Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

MarkupParserStartElementFieldCallback

type C_MarkupParserStartElementFieldCallback = Ptr MarkupParseContext -> CString -> CString -> CString -> Ptr () -> Ptr (Ptr GError) -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MarkupParserStartElementFieldCallback Source #

Arguments

 = MarkupParseContext 
-> Text 
-> Text 
-> Text 
-> IO ()

(Can throw GError)

No description available in the introspection data.

type MarkupParserStartElementFieldCallback_WithClosures Source #

Arguments

 = MarkupParseContext 
-> Text 
-> Text 
-> Text 
-> Ptr () 
-> IO ()

(Can throw GError)

No description available in the introspection data.

dynamic_MarkupParserStartElementFieldCallback Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_MarkupParserStartElementFieldCallback 
-> MarkupParseContext 
-> Text 
-> Text 
-> Text 
-> Ptr () 
-> m ()

(Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

MarkupParserTextFieldCallback

type C_MarkupParserTextFieldCallback = Ptr MarkupParseContext -> CString -> Word64 -> Ptr () -> Ptr (Ptr GError) -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MarkupParserTextFieldCallback Source #

Arguments

 = MarkupParseContext 
-> Text 
-> Word64 
-> IO ()

(Can throw GError)

No description available in the introspection data.

type MarkupParserTextFieldCallback_WithClosures Source #

Arguments

 = MarkupParseContext 
-> Text 
-> Word64 
-> Ptr () 
-> IO ()

(Can throw GError)

No description available in the introspection data.

dynamic_MarkupParserTextFieldCallback Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_MarkupParserTextFieldCallback 
-> MarkupParseContext 
-> Text 
-> Word64 
-> Ptr () 
-> m ()

(Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

MemVTableCallocFieldCallback

type C_MemVTableCallocFieldCallback = Word64 -> Word64 -> IO (Ptr ()) Source #

Type for the callback on the (unwrapped) C side.

type MemVTableCallocFieldCallback = Word64 -> Word64 -> IO (Ptr ()) Source #

No description available in the introspection data.

dynamic_MemVTableCallocFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_MemVTableCallocFieldCallback -> Word64 -> Word64 -> m (Ptr ()) Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

MemVTableFreeFieldCallback

type C_MemVTableFreeFieldCallback = Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type MemVTableFreeFieldCallback = Ptr () -> IO () Source #

No description available in the introspection data.

dynamic_MemVTableFreeFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_MemVTableFreeFieldCallback -> Ptr () -> m () Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

MemVTableMallocFieldCallback

type C_MemVTableMallocFieldCallback = Word64 -> IO (Ptr ()) Source #

Type for the callback on the (unwrapped) C side.

type MemVTableMallocFieldCallback = Word64 -> IO (Ptr ()) Source #

No description available in the introspection data.

dynamic_MemVTableMallocFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_MemVTableMallocFieldCallback -> Word64 -> m (Ptr ()) Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

MemVTableReallocFieldCallback

type C_MemVTableReallocFieldCallback = Ptr () -> Word64 -> IO (Ptr ()) Source #

Type for the callback on the (unwrapped) C side.

type MemVTableReallocFieldCallback = Ptr () -> Word64 -> IO (Ptr ()) Source #

No description available in the introspection data.

dynamic_MemVTableReallocFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_MemVTableReallocFieldCallback -> Ptr () -> Word64 -> m (Ptr ()) Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

MemVTableTryMallocFieldCallback

type C_MemVTableTryMallocFieldCallback = Word64 -> IO (Ptr ()) Source #

Type for the callback on the (unwrapped) C side.

type MemVTableTryMallocFieldCallback = Word64 -> IO (Ptr ()) Source #

No description available in the introspection data.

dynamic_MemVTableTryMallocFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_MemVTableTryMallocFieldCallback -> Word64 -> m (Ptr ()) Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

MemVTableTryReallocFieldCallback

type C_MemVTableTryReallocFieldCallback = Ptr () -> Word64 -> IO (Ptr ()) Source #

Type for the callback on the (unwrapped) C side.

type MemVTableTryReallocFieldCallback = Ptr () -> Word64 -> IO (Ptr ()) Source #

No description available in the introspection data.

dynamic_MemVTableTryReallocFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_MemVTableTryReallocFieldCallback -> Ptr () -> Word64 -> m (Ptr ()) Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

NodeForeachFunc

type C_NodeForeachFunc = Ptr Node -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type NodeForeachFunc Source #

Arguments

 = Node

node: a Node.

-> Ptr ()

data: user data passed to g_node_children_foreach().

-> IO () 

Specifies the type of function passed to g_node_children_foreach(). The function is called with each child node, together with the user data passed to g_node_children_foreach().

dynamic_NodeForeachFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_NodeForeachFunc 
-> Node

node: a Node.

-> Ptr ()

data: user data passed to g_node_children_foreach().

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_NodeForeachFunc :: C_NodeForeachFunc -> IO (FunPtr C_NodeForeachFunc) Source #

Generate a function pointer callable from C code, from a C_NodeForeachFunc.

NodeTraverseFunc

type C_NodeTraverseFunc = Ptr Node -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type NodeTraverseFunc Source #

Arguments

 = Node

node: a Node.

-> Ptr ()

data: user data passed to g_node_traverse().

-> IO Bool

Returns: True to stop the traversal.

Specifies the type of function passed to g_node_traverse(). The function is called with each of the nodes visited, together with the user data passed to g_node_traverse(). If the function returns True, then the traversal is stopped.

dynamic_NodeTraverseFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_NodeTraverseFunc 
-> Node

node: a Node.

-> Ptr ()

data: user data passed to g_node_traverse().

-> m Bool

Returns: True to stop the traversal.

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_NodeTraverseFunc :: C_NodeTraverseFunc -> IO (FunPtr C_NodeTraverseFunc) Source #

Generate a function pointer callable from C code, from a C_NodeTraverseFunc.

OptionArgFunc

type C_OptionArgFunc = CString -> CString -> Ptr () -> Ptr (Ptr GError) -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type OptionArgFunc Source #

Arguments

 = Text

optionName: The name of the option being parsed. This will be either a single dash followed by a single letter (for a short name) or two dashes followed by a long option name.

-> Text

value: The value to be parsed.

-> Ptr ()

data: User data added to the OptionGroup containing the option when it was created with optionGroupNew

-> IO ()

Returns: True if the option was successfully parsed, False if an error occurred, in which case error should be set with g_set_error() (Can throw GError)

The type of function to be passed as callback for OptionArgCallback options.

dynamic_OptionArgFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_OptionArgFunc 
-> Text

optionName: The name of the option being parsed. This will be either a single dash followed by a single letter (for a short name) or two dashes followed by a long option name.

-> Text

value: The value to be parsed.

-> Ptr ()

data: User data added to the OptionGroup containing the option when it was created with optionGroupNew

-> m ()

(Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_OptionArgFunc :: C_OptionArgFunc -> IO (FunPtr C_OptionArgFunc) Source #

Generate a function pointer callable from C code, from a C_OptionArgFunc.

OptionErrorFunc

type C_OptionErrorFunc = Ptr OptionContext -> Ptr OptionGroup -> Ptr () -> Ptr (Ptr GError) -> IO () Source #

Type for the callback on the (unwrapped) C side.

type OptionErrorFunc Source #

Arguments

 = OptionContext

context: The active OptionContext

-> OptionGroup

group: The group to which the function belongs

-> Ptr ()

data: User data added to the OptionGroup containing the option when it was created with optionGroupNew

-> IO ()

(Can throw GError)

The type of function to be used as callback when a parse error occurs.

dynamic_OptionErrorFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_OptionErrorFunc 
-> OptionContext

context: The active OptionContext

-> OptionGroup

group: The group to which the function belongs

-> Ptr ()

data: User data added to the OptionGroup containing the option when it was created with optionGroupNew

-> m ()

(Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_OptionErrorFunc :: C_OptionErrorFunc -> IO (FunPtr C_OptionErrorFunc) Source #

Generate a function pointer callable from C code, from a C_OptionErrorFunc.

OptionParseFunc

type C_OptionParseFunc = Ptr OptionContext -> Ptr OptionGroup -> Ptr () -> Ptr (Ptr GError) -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type OptionParseFunc Source #

Arguments

 = OptionContext

context: The active OptionContext

-> OptionGroup

group: The group to which the function belongs

-> Ptr ()

data: User data added to the OptionGroup containing the option when it was created with optionGroupNew

-> IO ()

Returns: True if the function completed successfully, False if an error occurred, in which case error should be set with g_set_error() (Can throw GError)

The type of function that can be called before and after parsing.

dynamic_OptionParseFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_OptionParseFunc 
-> OptionContext

context: The active OptionContext

-> OptionGroup

group: The group to which the function belongs

-> Ptr ()

data: User data added to the OptionGroup containing the option when it was created with optionGroupNew

-> m ()

(Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_OptionParseFunc :: C_OptionParseFunc -> IO (FunPtr C_OptionParseFunc) Source #

Generate a function pointer callable from C code, from a C_OptionParseFunc.

PollFunc

type C_PollFunc = Ptr PollFD -> Word32 -> Int32 -> IO Int32 Source #

Type for the callback on the (unwrapped) C side.

type PollFunc Source #

Arguments

 = PollFD

ufds: an array of PollFD elements

-> Word32

nfsd: the number of elements in ufds

-> Int32

timeout_: the maximum time to wait for an event of the file descriptors. A negative value indicates an infinite timeout.

-> IO Int32

Returns: the number of PollFD elements which have events or errors reported, or -1 if an error occurred.

Specifies the type of function passed to g_main_context_set_poll_func(). The semantics of the function should match those of the poll() system call.

dynamic_PollFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_PollFunc 
-> PollFD

ufds: an array of PollFD elements

-> Word32

nfsd: the number of elements in ufds

-> Int32

timeout_: the maximum time to wait for an event of the file descriptors. A negative value indicates an infinite timeout.

-> m Int32

Returns: the number of PollFD elements which have events or errors reported, or -1 if an error occurred.

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_PollFunc :: MonadIO m => PollFunc -> m (GClosure C_PollFunc) Source #

Wrap the callback into a GClosure.

mk_PollFunc :: C_PollFunc -> IO (FunPtr C_PollFunc) Source #

Generate a function pointer callable from C code, from a C_PollFunc.

noPollFunc :: Maybe PollFunc Source #

A convenience synonym for Nothing :: Maybe PollFunc.

PrintFunc

type C_PrintFunc = CString -> IO () Source #

Type for the callback on the (unwrapped) C side.

type PrintFunc Source #

Arguments

 = Text

string: the message to output

-> IO () 

Specifies the type of the print handler functions. These are called with the complete formatted string to output.

dynamic_PrintFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_PrintFunc 
-> Text

string: the message to output

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_PrintFunc :: MonadIO m => PrintFunc -> m (GClosure C_PrintFunc) Source #

Wrap the callback into a GClosure.

mk_PrintFunc :: C_PrintFunc -> IO (FunPtr C_PrintFunc) Source #

Generate a function pointer callable from C code, from a C_PrintFunc.

noPrintFunc :: Maybe PrintFunc Source #

A convenience synonym for Nothing :: Maybe PrintFunc.

RegexEvalCallback

type C_RegexEvalCallback = Ptr MatchInfo -> Ptr String -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type RegexEvalCallback Source #

Arguments

 = MatchInfo

matchInfo: the MatchInfo generated by the match. Use matchInfoGetRegex and matchInfoGetString if you need the Regex or the matched string.

-> String

result: a String containing the new string

-> IO Bool

Returns: False to continue the replacement process, True to stop it

Specifies the type of the function passed to g_regex_replace_eval(). It is called for each occurrence of the pattern in the string passed to g_regex_replace_eval(), and it should append the replacement to result.

Since: 2.14

type RegexEvalCallback_WithClosures Source #

Arguments

 = MatchInfo

matchInfo: the MatchInfo generated by the match. Use matchInfoGetRegex and matchInfoGetString if you need the Regex or the matched string.

-> String

result: a String containing the new string

-> Ptr ()

userData: user data passed to g_regex_replace_eval()

-> IO Bool

Returns: False to continue the replacement process, True to stop it

Specifies the type of the function passed to g_regex_replace_eval(). It is called for each occurrence of the pattern in the string passed to g_regex_replace_eval(), and it should append the replacement to result.

Since: 2.14

drop_closures_RegexEvalCallback :: RegexEvalCallback -> RegexEvalCallback_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_RegexEvalCallback Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_RegexEvalCallback 
-> MatchInfo

matchInfo: the MatchInfo generated by the match. Use matchInfoGetRegex and matchInfoGetString if you need the Regex or the matched string.

-> String

result: a String containing the new string

-> Ptr ()

userData: user data passed to g_regex_replace_eval()

-> m Bool

Returns: False to continue the replacement process, True to stop it

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_RegexEvalCallback :: C_RegexEvalCallback -> IO (FunPtr C_RegexEvalCallback) Source #

Generate a function pointer callable from C code, from a C_RegexEvalCallback.

ScannerMsgFunc

type C_ScannerMsgFunc = Ptr Scanner -> CString -> CInt -> IO () Source #

Type for the callback on the (unwrapped) C side.

type ScannerMsgFunc Source #

Arguments

 = Scanner

scanner: a Scanner

-> Text

message: the message

-> Bool

error: True if the message signals an error, False if it signals a warning.

-> IO () 

Specifies the type of the message handler function.

dynamic_ScannerMsgFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_ScannerMsgFunc 
-> Scanner

scanner: a Scanner

-> Text

message: the message

-> Bool

error: True if the message signals an error, False if it signals a warning.

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_ScannerMsgFunc :: C_ScannerMsgFunc -> IO (FunPtr C_ScannerMsgFunc) Source #

Generate a function pointer callable from C code, from a C_ScannerMsgFunc.

SequenceIterCompareFunc

type C_SequenceIterCompareFunc = Ptr SequenceIter -> Ptr SequenceIter -> Ptr () -> IO Int32 Source #

Type for the callback on the (unwrapped) C side.

type SequenceIterCompareFunc Source #

Arguments

 = SequenceIter

a: a SequenceIter

-> SequenceIter

b: a SequenceIter

-> Ptr ()

data: user data

-> IO Int32

Returns: zero if the iterators are equal, a negative value if a comes before b, and a positive value if b comes before a.

A SequenceIterCompareFunc is a function used to compare iterators. It must return zero if the iterators compare equal, a negative value if a comes before b, and a positive value if b comes before a.

dynamic_SequenceIterCompareFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_SequenceIterCompareFunc 
-> SequenceIter

a: a SequenceIter

-> SequenceIter

b: a SequenceIter

-> Ptr ()

data: user data

-> m Int32

Returns: zero if the iterators are equal, a negative value if a comes before b, and a positive value if b comes before a.

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

SourceCallbackFuncsRefFieldCallback

type C_SourceCallbackFuncsRefFieldCallback = Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type SourceCallbackFuncsRefFieldCallback = Ptr () -> IO () Source #

No description available in the introspection data.

dynamic_SourceCallbackFuncsRefFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_SourceCallbackFuncsRefFieldCallback -> Ptr () -> m () Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

SourceCallbackFuncsUnrefFieldCallback

type C_SourceCallbackFuncsUnrefFieldCallback = Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type SourceCallbackFuncsUnrefFieldCallback = Ptr () -> IO () Source #

No description available in the introspection data.

dynamic_SourceCallbackFuncsUnrefFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_SourceCallbackFuncsUnrefFieldCallback -> Ptr () -> m () Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

SourceDummyMarshal

type C_SourceDummyMarshal = IO () Source #

Type for the callback on the (unwrapped) C side.

type SourceDummyMarshal = IO () Source #

This is just a placeholder for GClosureMarshal, which cannot be used here for dependency reasons.

dynamic_SourceDummyMarshal :: (HasCallStack, MonadIO m) => FunPtr C_SourceDummyMarshal -> m () Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_SourceDummyMarshal :: C_SourceDummyMarshal -> IO (FunPtr C_SourceDummyMarshal) Source #

Generate a function pointer callable from C code, from a C_SourceDummyMarshal.

SourceFunc

type C_SourceFunc = Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type SourceFunc Source #

Arguments

 = IO Bool

Returns: False if the source should be removed. SOURCE_CONTINUE and SOURCE_REMOVE are more memorable names for the return value.

Specifies the type of function passed to g_timeout_add(), timeoutAdd, g_idle_add(), and idleAdd.

When calling sourceSetCallback, you may need to cast a function of a different type to this type. Use G_SOURCE_FUNC() to avoid warnings about incompatible function types.

type SourceFunc_WithClosures Source #

Arguments

 = Ptr ()

userData: data passed to the function, set when the source was created with one of the above functions

-> IO Bool

Returns: False if the source should be removed. SOURCE_CONTINUE and SOURCE_REMOVE are more memorable names for the return value.

Specifies the type of function passed to g_timeout_add(), timeoutAdd, g_idle_add(), and idleAdd.

When calling sourceSetCallback, you may need to cast a function of a different type to this type. Use G_SOURCE_FUNC() to avoid warnings about incompatible function types.

drop_closures_SourceFunc :: SourceFunc -> SourceFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_SourceFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_SourceFunc 
-> Ptr ()

userData: data passed to the function, set when the source was created with one of the above functions

-> m Bool

Returns: False if the source should be removed. SOURCE_CONTINUE and SOURCE_REMOVE are more memorable names for the return value.

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_SourceFunc :: C_SourceFunc -> IO (FunPtr C_SourceFunc) Source #

Generate a function pointer callable from C code, from a C_SourceFunc.

noSourceFunc :: Maybe SourceFunc Source #

A convenience synonym for Nothing :: Maybe SourceFunc.

SourceFuncsCheckFieldCallback

type C_SourceFuncsCheckFieldCallback = Ptr Source -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type SourceFuncsCheckFieldCallback = Source -> IO Bool Source #

No description available in the introspection data.

dynamic_SourceFuncsCheckFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_SourceFuncsCheckFieldCallback -> Source -> m Bool Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

SourceFuncsFinalizeFieldCallback

type C_SourceFuncsFinalizeFieldCallback = Ptr Source -> IO () Source #

Type for the callback on the (unwrapped) C side.

type SourceFuncsFinalizeFieldCallback = Source -> IO () Source #

No description available in the introspection data.

dynamic_SourceFuncsFinalizeFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_SourceFuncsFinalizeFieldCallback -> Source -> m () Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

SourceFuncsPrepareFieldCallback

type C_SourceFuncsPrepareFieldCallback = Ptr Source -> Int32 -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type SourceFuncsPrepareFieldCallback = Source -> Int32 -> IO Bool Source #

No description available in the introspection data.

dynamic_SourceFuncsPrepareFieldCallback :: (HasCallStack, MonadIO m) => FunPtr C_SourceFuncsPrepareFieldCallback -> Source -> Int32 -> m Bool Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

SpawnChildSetupFunc

type C_SpawnChildSetupFunc = Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type SpawnChildSetupFunc = IO () Source #

Specifies the type of the setup function passed to spawnAsync, spawnSync and spawnAsyncWithPipes, which can, in very limited ways, be used to affect the child's execution.

On POSIX platforms, the function is called in the child after GLib has performed all the setup it plans to perform, but before calling exec(). Actions taken in this function will only affect the child, not the parent.

On Windows, the function is called in the parent. Its usefulness on Windows is thus questionable. In many cases executing the child setup function in the parent can have ill effects, and you should be very careful when porting software to Windows that uses child setup functions.

However, even on POSIX, you are extremely limited in what you can safely do from a SpawnChildSetupFunc, because any mutexes that were held by other threads in the parent process at the time of the fork() will still be locked in the child process, and they will never be unlocked (since the threads that held them don't exist in the child). POSIX allows only async-signal-safe functions (see signal(7)) to be called in the child between fork() and exec(), which drastically limits the usefulness of child setup functions.

In particular, it is not safe to call any function which may call malloc(), which includes POSIX functions such as setenv(). If you need to set up the child environment differently from the parent, you should use getEnviron, environSetenv, and environUnsetenv, and then pass the complete environment list to the g_spawn... function.

type SpawnChildSetupFunc_WithClosures Source #

Arguments

 = Ptr ()

userData: user data to pass to the function.

-> IO () 

Specifies the type of the setup function passed to spawnAsync, spawnSync and spawnAsyncWithPipes, which can, in very limited ways, be used to affect the child's execution.

On POSIX platforms, the function is called in the child after GLib has performed all the setup it plans to perform, but before calling exec(). Actions taken in this function will only affect the child, not the parent.

On Windows, the function is called in the parent. Its usefulness on Windows is thus questionable. In many cases executing the child setup function in the parent can have ill effects, and you should be very careful when porting software to Windows that uses child setup functions.

However, even on POSIX, you are extremely limited in what you can safely do from a SpawnChildSetupFunc, because any mutexes that were held by other threads in the parent process at the time of the fork() will still be locked in the child process, and they will never be unlocked (since the threads that held them don't exist in the child). POSIX allows only async-signal-safe functions (see signal(7)) to be called in the child between fork() and exec(), which drastically limits the usefulness of child setup functions.

In particular, it is not safe to call any function which may call malloc(), which includes POSIX functions such as setenv(). If you need to set up the child environment differently from the parent, you should use getEnviron, environSetenv, and environUnsetenv, and then pass the complete environment list to the g_spawn... function.

drop_closures_SpawnChildSetupFunc :: SpawnChildSetupFunc -> SpawnChildSetupFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_SpawnChildSetupFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_SpawnChildSetupFunc 
-> Ptr ()

userData: user data to pass to the function.

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_SpawnChildSetupFunc :: C_SpawnChildSetupFunc -> IO (FunPtr C_SpawnChildSetupFunc) Source #

Generate a function pointer callable from C code, from a C_SpawnChildSetupFunc.

TestDataFunc

type C_TestDataFunc = Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TestDataFunc = IO () Source #

The type used for test case functions that take an extra pointer argument.

Since: 2.28

type TestDataFunc_WithClosures Source #

Arguments

 = Ptr ()

userData: the data provided when registering the test

-> IO () 

The type used for test case functions that take an extra pointer argument.

Since: 2.28

drop_closures_TestDataFunc :: TestDataFunc -> TestDataFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_TestDataFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_TestDataFunc 
-> Ptr ()

userData: the data provided when registering the test

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_TestDataFunc :: C_TestDataFunc -> IO (FunPtr C_TestDataFunc) Source #

Generate a function pointer callable from C code, from a C_TestDataFunc.

TestFixtureFunc

type C_TestFixtureFunc = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type TestFixtureFunc Source #

Arguments

 = Ptr ()

fixture: the test fixture

-> IO () 

The type used for functions that operate on test fixtures. This is used for the fixture setup and teardown functions as well as for the testcases themselves.

userData is a pointer to the data that was given when registering the test case.

fixture will be a pointer to the area of memory allocated by the test framework, of the size requested. If the requested size was zero then fixture will be equal to userData.

Since: 2.28

type TestFixtureFunc_WithClosures Source #

Arguments

 = Ptr ()

fixture: the test fixture

-> Ptr ()

userData: the data provided when registering the test

-> IO () 

The type used for functions that operate on test fixtures. This is used for the fixture setup and teardown functions as well as for the testcases themselves.

userData is a pointer to the data that was given when registering the test case.

fixture will be a pointer to the area of memory allocated by the test framework, of the size requested. If the requested size was zero then fixture will be equal to userData.

Since: 2.28

drop_closures_TestFixtureFunc :: TestFixtureFunc -> TestFixtureFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_TestFixtureFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_TestFixtureFunc 
-> Ptr ()

fixture: the test fixture

-> Ptr ()

userData: the data provided when registering the test

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_TestFixtureFunc :: C_TestFixtureFunc -> IO (FunPtr C_TestFixtureFunc) Source #

Generate a function pointer callable from C code, from a C_TestFixtureFunc.

TestFunc

type C_TestFunc = IO () Source #

Type for the callback on the (unwrapped) C side.

type TestFunc = IO () Source #

The type used for test case functions.

Since: 2.28

dynamic_TestFunc :: (HasCallStack, MonadIO m) => FunPtr C_TestFunc -> m () Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_TestFunc :: MonadIO m => TestFunc -> m (GClosure C_TestFunc) Source #

Wrap the callback into a GClosure.

mk_TestFunc :: C_TestFunc -> IO (FunPtr C_TestFunc) Source #

Generate a function pointer callable from C code, from a C_TestFunc.

noTestFunc :: Maybe TestFunc Source #

A convenience synonym for Nothing :: Maybe TestFunc.

TestLogFatalFunc

type C_TestLogFatalFunc = CString -> CInt -> CString -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type TestLogFatalFunc Source #

Arguments

 = Text

logDomain: the log domain of the message

-> [LogLevelFlags]

logLevel: the log level of the message (including the fatal and recursion flags)

-> Text

message: the message to process

-> IO Bool

Returns: True if the program should abort, False otherwise

Specifies the prototype of fatal log handler functions.

Since: 2.22

type TestLogFatalFunc_WithClosures Source #

Arguments

 = Text

logDomain: the log domain of the message

-> [LogLevelFlags]

logLevel: the log level of the message (including the fatal and recursion flags)

-> Text

message: the message to process

-> Ptr ()

userData: user data, set in g_test_log_set_fatal_handler()

-> IO Bool

Returns: True if the program should abort, False otherwise

Specifies the prototype of fatal log handler functions.

Since: 2.22

drop_closures_TestLogFatalFunc :: TestLogFatalFunc -> TestLogFatalFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_TestLogFatalFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_TestLogFatalFunc 
-> Text

logDomain: the log domain of the message

-> [LogLevelFlags]

logLevel: the log level of the message (including the fatal and recursion flags)

-> Text

message: the message to process

-> Ptr ()

userData: user data, set in g_test_log_set_fatal_handler()

-> m Bool

Returns: True if the program should abort, False otherwise

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_TestLogFatalFunc :: C_TestLogFatalFunc -> IO (FunPtr C_TestLogFatalFunc) Source #

Generate a function pointer callable from C code, from a C_TestLogFatalFunc.

ThreadFunc

type C_ThreadFunc = Ptr () -> IO (Ptr ()) Source #

Type for the callback on the (unwrapped) C side.

type ThreadFunc Source #

Arguments

 = Ptr ()

data: data passed to the thread

-> IO (Ptr ())

Returns: the return value of the thread

Specifies the type of the func functions passed to g_thread_new() or g_thread_try_new().

dynamic_ThreadFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_ThreadFunc 
-> Ptr ()

data: data passed to the thread

-> m (Ptr ())

Returns: the return value of the thread

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_ThreadFunc :: C_ThreadFunc -> IO (FunPtr C_ThreadFunc) Source #

Generate a function pointer callable from C code, from a C_ThreadFunc.

noThreadFunc :: Maybe ThreadFunc Source #

A convenience synonym for Nothing :: Maybe ThreadFunc.

TranslateFunc

type C_TranslateFunc = CString -> Ptr () -> IO CString Source #

Type for the callback on the (unwrapped) C side.

type TranslateFunc Source #

Arguments

 = Text

str: the untranslated string

-> Ptr ()

data: user data specified when installing the function, e.g. in optionGroupSetTranslateFunc

-> IO Text

Returns: a translation of the string for the current locale. The returned string is owned by GLib and must not be freed.

The type of functions which are used to translate user-visible strings, for <option>--help</option> output.

dynamic_TranslateFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_TranslateFunc 
-> Text

str: the untranslated string

-> Ptr ()

data: user data specified when installing the function, e.g. in optionGroupSetTranslateFunc

-> m Text

Returns: a translation of the string for the current locale. The returned string is owned by GLib and must not be freed.

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_TranslateFunc :: C_TranslateFunc -> IO (FunPtr C_TranslateFunc) Source #

Generate a function pointer callable from C code, from a C_TranslateFunc.

TraverseFunc

type C_TraverseFunc = Ptr () -> Ptr () -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type TraverseFunc Source #

Arguments

 = Ptr ()

key: a key of a Tree node

-> Ptr ()

value: the value corresponding to the key

-> Ptr ()

data: user data passed to g_tree_traverse()

-> IO Bool

Returns: True to stop the traversal

Specifies the type of function passed to g_tree_traverse(). It is passed the key and value of each node, together with the userData parameter passed to g_tree_traverse(). If the function returns True, the traversal is stopped.

dynamic_TraverseFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_TraverseFunc 
-> Ptr ()

key: a key of a Tree node

-> Ptr ()

value: the value corresponding to the key

-> Ptr ()

data: user data passed to g_tree_traverse()

-> m Bool

Returns: True to stop the traversal

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_TraverseFunc :: C_TraverseFunc -> IO (FunPtr C_TraverseFunc) Source #

Generate a function pointer callable from C code, from a C_TraverseFunc.

UnixFDSourceFunc

type C_UnixFDSourceFunc = Int32 -> CUInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type UnixFDSourceFunc Source #

Arguments

 = Int32

fd: the fd that triggered the event

-> [IOCondition]

condition: the IO conditions reported on fd

-> IO Bool

Returns: False if the source should be removed

The type of functions to be called when a UNIX fd watch source triggers.

type UnixFDSourceFunc_WithClosures Source #

Arguments

 = Int32

fd: the fd that triggered the event

-> [IOCondition]

condition: the IO conditions reported on fd

-> Ptr ()

userData: user data passed to g_unix_fd_add()

-> IO Bool

Returns: False if the source should be removed

The type of functions to be called when a UNIX fd watch source triggers.

drop_closures_UnixFDSourceFunc :: UnixFDSourceFunc -> UnixFDSourceFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_UnixFDSourceFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_UnixFDSourceFunc 
-> Int32

fd: the fd that triggered the event

-> [IOCondition]

condition: the IO conditions reported on fd

-> Ptr ()

userData: user data passed to g_unix_fd_add()

-> m Bool

Returns: False if the source should be removed

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_UnixFDSourceFunc :: C_UnixFDSourceFunc -> IO (FunPtr C_UnixFDSourceFunc) Source #

Generate a function pointer callable from C code, from a C_UnixFDSourceFunc.

VoidFunc

type C_VoidFunc = IO () Source #

Type for the callback on the (unwrapped) C side.

type VoidFunc = IO () Source #

Declares a type of function which takes no arguments and has no return value. It is used to specify the type function passed to atexit.

dynamic_VoidFunc :: (HasCallStack, MonadIO m) => FunPtr C_VoidFunc -> m () Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_VoidFunc :: MonadIO m => VoidFunc -> m (GClosure C_VoidFunc) Source #

Wrap the callback into a GClosure.

mk_VoidFunc :: C_VoidFunc -> IO (FunPtr C_VoidFunc) Source #

Generate a function pointer callable from C code, from a C_VoidFunc.

noVoidFunc :: Maybe VoidFunc Source #

A convenience synonym for Nothing :: Maybe VoidFunc.