G-Golf Callable Info low level API.
GICallableInfo — Struct representing a callable.
g-callable-info-can-throw-gerror
g-callable-info-get-n-args
g-callable-info-get-arg
g-callable-info-get-caller-owns
g-callable-info-get-instance-ownership-transfer
g-callable-info-get-return-type
g-callable-info-invoke
g-callable-info-is-method
g-callable-info-may-return-null
g-callable-info-create-closure
g-callable-info-get-closure-native-address
GIBaseInfoInfo
+— GICallableInfo
+— GIFunctionInfo
+— GICallbackInfo
+— GISignalInfo
+— GIVFuncInfo
GICallableInfo
represents an entity which is callable. Examples
of callable are: functions (GIFunctionInfo
), virtual functions,
(GIVFuncInfo
), callbacks (GICallbackInfo
).
A callable has a list of arguments (GIArgInfo
), a return type,
direction and a flag which decides if it returns null.
Note: in this section, the info argument is [must be] a pointer to
a GICallableInfo
.
Returns #t
if the callable info can throw a GError,
otherwise it returns #f
.
Returns the number of arguments this info expects.
Obtain the number of arguments (both IN and OUT) for this info.
Returns a pointer to the nth GIArgInfo
of info.
It must be freed by calling g-base-info-unref when done accessing the data.
Returns a GITransfer
enumerated value.
See whether the caller owns the return value of this callable. See %gi-transfer for the list of possible values.
Returns a GITransfer
enumerated value.
Obtains the ownership transfer for the instance argument. See %gi-transfer for the list of possible values.
Returns a pointer to the GITypeInfo
.
It must be freed by calling g-base-info-unref when done accessing the data.
Returns #t
if the function has been invoked, #f
if an
error occured.
Invokes the function described in info with the given
arguments. Note that inout
parameters must appear in both
argument lists. The arguments are:
info
a pointer to a
GIFunctionInfo
describing the function to invoke.function
a pointer to the function to invoke.
in-args
a pointer to an array of
GIArguments
, one for eachin
andinout
parameter of info. If there are noin
parameter, in-args must be the%null-pointer
.n-in
the length of the in-args array.
out-args
a pointer to an array of
GIArguments
, one for eachout
andinout
parameter of info. If there are noout
parameter, out-args must be the%null-pointer
.n-out
the length of the out-args array.
r-val
a pointer to a
GIArguments
, the return location for the return value of the function. If the function returnsvoid
, r-val must be the%null-pointer
.is-method
is the callable info is a method.
throws
can the callable throw a
GError
.g-error
a pointer to a newly allocated (and ‘empty’)
GError
(the recommended way for procedure calls that need such a pointer is to ‘surround’ the call using with-gerror).
Returns #t
if the callable info is a method, otherwise it
return #f
.
Determines if the callable info is a method. For
GIVFuncInfo
and GISignalInfo
, 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.
Returns #t
if the callable info could return NULL
.
See if a callable could return NULL.
Returns the ffi-closure or #f
on error.
The return value should be freed by calling
g-callable-info-destroy-closure
.
Returns a pointer.
Obtain and return the callable code from ffi-closure prepared by
g-callable-info-create-closure. The return value should be freed
by calling g-callable-info-destroy-closure
.