GIFunctionInfo

GIFunctionInfo — Struct representing a function

Synopsis

typedef             GIFunctionInfo;
enum                GInvokeError;
enum                GIFunctionInfoFlags;
#define             G_INVOKE_ERROR
const gchar *       g_function_info_get_symbol          (GIFunctionInfo *info);
GIFunctionInfoFlags  g_function_info_get_flags          (GIFunctionInfo *info);
GIPropertyInfo *    g_function_info_get_property        (GIFunctionInfo *info);
GIVFuncInfo *       g_function_info_get_vfunc           (GIFunctionInfo *info);
gboolean            g_function_info_invoke              (GIFunctionInfo *info,
                                                         const GArgument *in_args,
                                                         int n_in_args,
                                                         const GArgument *out_args,
                                                         int n_out_args,
                                                         GArgument *return_value,
                                                         GError **error);

Description

GIFunctionInfo represents a function, method or constructor. To find out what kind of entity a GIFunctionInfo represents, call g_function_info_get_flags().

See also GICallableInfo for information on how to retreive arguments and other metadata.

Details

GIFunctionInfo

typedef GIBaseInfo GIFunctionInfo;

Represents a function, eg arguments and return value.


enum GInvokeError

typedef enum
{
  G_INVOKE_ERROR_FAILED,
  G_INVOKE_ERROR_SYMBOL_NOT_FOUND,
  G_INVOKE_ERROR_ARGUMENT_MISMATCH
} GInvokeError;

An error occuring while invoking a function via g_function_info_invoke().

G_INVOKE_ERROR_FAILED

invokation failed, unknown error.

G_INVOKE_ERROR_SYMBOL_NOT_FOUND

symbol couldn't be found in any of the libraries associated with the typelib of the function.

G_INVOKE_ERROR_ARGUMENT_MISMATCH

the arguments provided didn't match the expected arguments for the functions type signature.

enum GIFunctionInfoFlags

typedef enum
{
  GI_FUNCTION_IS_METHOD      = 1 << 0,
  GI_FUNCTION_IS_CONSTRUCTOR = 1 << 1,
  GI_FUNCTION_IS_GETTER      = 1 << 2,
  GI_FUNCTION_IS_SETTER      = 1 << 3,
  GI_FUNCTION_WRAPS_VFUNC    = 1 << 4,
  GI_FUNCTION_THROWS         = 1 << 5
} GIFunctionInfoFlags;

Flags for a GIFunctionInfo struct.

GI_FUNCTION_IS_METHOD

is a method.

GI_FUNCTION_IS_CONSTRUCTOR

is a constructor.

GI_FUNCTION_IS_GETTER

is a getter of a GIPropertyInfo.

GI_FUNCTION_IS_SETTER

is a setter of a GIPropertyInfo.

GI_FUNCTION_WRAPS_VFUNC

represents a virtual function.

GI_FUNCTION_THROWS

the function may throw an error.

G_INVOKE_ERROR

#define G_INVOKE_ERROR (g_invoke_error_quark ())


g_function_info_get_symbol ()

const gchar *       g_function_info_get_symbol          (GIFunctionInfo *info);

Obtain the symbol of the function. The symbol is the name of the exported function, suitable to be used as an argument to g_module_symbol().

info :

a GIFunctionInfo

Returns :

the symbol

g_function_info_get_flags ()

GIFunctionInfoFlags  g_function_info_get_flags          (GIFunctionInfo *info);

Obtain the GIFunctionInfoFlags for the info.

info :

a GIFunctionInfo

Returns :

the flags

g_function_info_get_property ()

GIPropertyInfo *    g_function_info_get_property        (GIFunctionInfo *info);

Obtain the property associated with this GIFunctionInfo. Only GIFunctionInfo with the flag GI_FUNCTION_IS_GETTER or GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">GI_FUNCTION_IS_SETTER 2ER:CAPS">