Top | Description | ![]() |
![]() |
![]() |
![]() |
#define GI_IS_CALLABLE_INFO (info) typedef GICallableInfo; gboolean g_callable_info_can_throw_gerror (GICallableInfo *info
); gint g_callable_info_get_n_args (GICallableInfo *info
); GIArgInfo * g_callable_info_get_arg (GICallableInfo *info
,gint n
); GITransfer g_callable_info_get_caller_owns (GICallableInfo *info
); const gchar * g_callable_info_get_return_attribute (GICallableInfo *info
,const gchar *name
); GITypeInfo * g_callable_info_get_return_type (GICallableInfo *info
); gboolean g_callable_info_invoke (GICallableInfo *info
,gpointer function
,const GIArgument *in_args
,int n_in_args
,const GIArgument *out_args
,int n_out_args
,GIArgument *return_value
,gboolean is_method
,gboolean throws
,GError **error
); gboolean g_callable_info_is_method (GICallableInfo *info
); gboolean g_callable_info_iterate_return_attributes (GICallableInfo *info
,GIAttributeIter *iterator
,char **name
,char **value
); void g_callable_info_load_arg (GICallableInfo *info
,gint n
,GIArgInfo *arg
); void g_callable_info_load_return_type (GICallableInfo *info
,GITypeInfo *type
); gboolean g_callable_info_may_return_null (GICallableInfo *info
); gboolean g_callable_info_skip_return (GICallableInfo *info
);
GICallableInfo represents an entity which is callable. Currently a function (GIFunctionInfo), virtual function, (GIVFuncInfo) or callback (GICallbackInfo).
A callable has a list of arguments (GIArgInfo), a return type, direction and a flag which decides if it returns null.
GIBaseInfo +----GICallableInfo +----GIFunctionInfo +----GISignalInfo +----GIVFuncInfo
#define GI_IS_CALLABLE_INFO(info)
Checks if info
is a GICallableInfo or derived from it.
|
an info structure |
typedef GIBaseInfo GICallableInfo;
Represents a callable, either GIFunctionInfo, GICallbackInfo or GIVFuncInfo.
gboolean g_callable_info_can_throw_gerror (GICallableInfo *info
);
TODO
|
a GICallableInfo |
Returns : |
TRUE if this GICallableInfo can throw a GError
|
Since 1.34
gint g_callable_info_get_n_args (GICallableInfo *info
);
Obtain the number of arguments (both IN and OUT) for this callable.
|
a GICallableInfo |
Returns : |
The number of arguments this callable expects. |
GIArgInfo * g_callable_info_get_arg (GICallableInfo *info
,gint n
);
Obtain information about a particular argument of this callable.
|
a GICallableInfo |
|
the argument index to fetch |
Returns : |
the GIArgInfo. Free it with
g_base_info_unref() when done. [transfer full]
|
GITransfer g_callable_info_get_caller_owns (GICallableInfo *info
);
See whether the caller owns the return value of this callable. GITransfer contains a list of possible transfer values.
|
a GICallableInfo |
Returns : |
TRUE if the caller owns the return value, FALSE otherwise. |
const gchar * g_callable_info_get_return_attribute (GICallableInfo *info
,const gchar *name
);
Retrieve an arbitrary attribute associated with the return value.
|
a GICallableInfo |
|
a freeform string naming an attribute |
Returns : |
The value of the attribute, or NULL if no such attribute exists |
GITypeInfo * g_callable_info_get_return_type (GICallableInfo *info
);
Obtain the return type of a callable item as a GITypeInfo.
|
a GICallableInfo |
Returns : |
the GITypeInfo. Free the struct by calling
g_base_info_unref() when done. [transfer full]
|
gboolean g_callable_info_invoke (GICallableInfo *info
,gpointer function
,const GIArgument *in_args
,int n_in_args
,const GIArgument *out_args
,int n_out_args
,GIArgument *return_value
,gboolean is_method
,gboolean throws
,GError **error
);
TODO
|
TODO |
|
TODO |
|
TODO |
|
TODO |
|
TODO |
|
TODO |
|
TODO |
|
TODO |
|
TODO |
|
TODO |
gboolean g_callable_info_is_method (GICallableInfo *info
);
Determines if the callable info is a method. For GIVFuncInfos,
GICallbackInfos, and GISignalInfos,
this is always true. Otherwise, this looks at the GI_FUNCTION_IS_METHOD
flag on the GIFunctionInfo.
Concretely, this function returns whether g_callable_info_get_n_args()
matches the number of arguments in the raw C method. For methods, there
is one more C argument than is exposed by introspection: the "self"
or "this" object.
|
a GICallableInfo |
Returns : |
TRUE if info is a method, FALSE otherwise |
Since 1.34
gboolean g_callable_info_iterate_return_attributes (GICallableInfo *info
,GIAttributeIter *iterator
,char **name
,char **value
);
Iterate over all attributes associated with the return value. The
iterator structure is typically stack allocated, and must have its
first member initialized to NULL
.
Both the name
and value
should be treated as constants
and must not be freed.
See g_base_info_iterate_attributes()
for an example of how to use a
similar API.
|
a GICallableInfo |
|
a GIAttributeIter structure, must be initialized; see below |
|
Returned name, must not be freed. [out][transfer none] |
|
Returned name, must not be freed. [out][transfer none] |
Returns : |
TRUE if there are more attributes |
void g_callable_info_load_arg (GICallableInfo *info
,gint n
,GIArgInfo *arg
);
Obtain information about a particular argument of this callable; this
function is a variant of g_callable_info_get_arg()
designed for stack
allocation.
The initialized arg
must not be referenced after info
is deallocated.
|
a GICallableInfo |
|
the argument index to fetch |
|
Initialize with argument number n . [out caller-allocates]
|
void g_callable_info_load_return_type (GICallableInfo *info
,GITypeInfo *type
);
Obtain information about a return value of callable; this
function is a variant of g_callable_info_get_return_type()
designed for stack
allocation.
The initialized type
must not be referenced after info
is deallocated.
|
a GICallableInfo |
|
Initialized with return type of info . [out caller-allocates]
|
gboolean g_callable_info_may_return_null (GICallableInfo *info
);
See if a callable could return NULL
.
|
a GICallableInfo |
Returns : |
TRUE if callable could return NULL
|
gboolean g_callable_info_skip_return (GICallableInfo *info
);
See if a callable's return value is only useful in C.
|
a GICallableInfo |
Returns : |
TRUE if return value is only useful in C. |