Method

GIRepositoryFunctionInfoinvoke

since: 2.80

Declaration

gboolean
gi_function_info_invoke (
  GIFunctionInfo* info,
  const GIArgument* in_args,
  size_t n_in_args,
  GIArgument* out_args,
  size_t n_out_args,
  GIArgument* return_value,
  GError** error
)

Description

Invokes the function described in info with the given arguments.

Note that ‘inout’ parameters must appear in both argument lists. This function uses dlsym() to obtain a pointer to the function, so the library or shared object containing the described function must either be linked to the caller, or must have been loaded with g_module_symbol() before calling this function.

Available since: 2.80

This method is not directly available to language bindings.

Parameters

in_args

Type: An array of GIArgument

An array of GIArguments, one for each ‘in’ parameter of info. If there are no ‘in’ parameters, in_args can be NULL.

The argument can be NULL.
The length of the array is specified in the n_in_args argument.
The data is owned by the caller of the function.
n_in_args

Type: size_t

The length of the in_args array.

out_args

Type: An array of GIArgument

An array of GIArguments, one for each ‘out’ parameter of info. If there are no ‘out’ parameters, out_args may be NULL.

The argument can be NULL.
The length of the array is specified in the n_out_args argument.
The data is owned by the caller of the function.
n_out_args

Type: size_t

The length of the out_args array.

return_value

Type: GIArgument

Return location for the return value of the function.

The argument will be set by the function.
The data is owned by the caller of the function.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will left initialized to NULL by the method if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

TRUE if the function has been invoked, FALSE if an error occurred.