Top |
Types and Values
typedef | GIFunctionInfo |
enum | GIFunctionInfoFlags |
#define | G_INVOKE_ERROR |
enum | GInvokeError |
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.
Struct hierarchy
GIBaseInfo +----GICallableInfo +----GIFunctionInfo +----GISignalInfo +----GIVFuncInfo
Functions
g_function_info_get_flags ()
GIFunctionInfoFlags
g_function_info_get_flags (GIFunctionInfo *info
);
Obtain the GIFunctionInfoFlags for the info
.
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
have a property set. For other cases,
NULL
will be returned.
Returns
the property or NULL
if not set. Free it with
g_base_info_unref()
when done.
[transfer full]
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()
.
g_function_info_get_vfunc ()
GIVFuncInfo *
g_function_info_get_vfunc (GIFunctionInfo *info
);
Obtain the virtual function associated with this GIFunctionInfo.
Only GIFunctionInfo with the flag GI_FUNCTION_WRAPS_VFUNC
has
a virtual function set. For other cases, NULL
will be returned.
Returns
the virtual function or NULL
if not set.
Free it by calling g_base_info_unref()
when done.
[transfer full]
g_function_info_invoke ()
gboolean g_function_info_invoke (GIFunctionInfo *info
,const GIArgument *in_args
,int n_in_args
,const GIArgument *out_args
,int n_out_args
,GIArgument *return_value
,GError **error
);
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 g_module_symbol()
ed before calling this function.
[skip]
Parameters
info |
a GIFunctionInfo describing the function to invoke |
|
in_args |
an array of GIArguments, one for each in
parameter of |
[array length=n_in_args] |
n_in_args |
the length of the |
|
out_args |
an array of GIArguments, one for each out
parameter of |
[array length=n_out_args] |
n_out_args |
the length of the |
|
return_value |
return location for the return value of the
function. If the function returns void, |
|
error |
return location for detailed error information, or |
Types and Values
GIFunctionInfo
typedef GIBaseInfo GIFunctionInfo;
Represents a function, eg arguments and return value.
enum GIFunctionInfoFlags
Flags for a GIFunctionInfo struct.
Members
is a method. |
||
is a constructor. |
||
is a getter of a GIPropertyInfo. |
||
is a setter of a GIPropertyInfo. |
||
represents a virtual function. |
||
the function may throw an error. |
enum GInvokeError
An error occuring while invoking a function via
g_function_info_invoke()
.