G-Golf Arg Info low level API.
GIArgInfo — Struct representing an argument.
GIBaseInfo
+— GIArgInfo
GIArgInfo
represents an argument. An argument is always part of a
GICallableInfo
.
Note: in this section, the info argument is [must be] a pointer to
a GIArgInfo
.
Returns the index of the user data argument or -1 if there is none.
Obtains the index of the user data argument. This is only valid for arguments which are callbacks.
Returns the index of the GDestroyNotify
argument or -1 if there
is none.
Obtains the index of the GDestroyNotify
argument. This is only
valid for arguments which are callbacks.
Returns a symbol.
Obtains and returns the %gi-direction of the argument.
Returns a symbol.
Obtains and returns the %gi-transfer for this argument.
Returns a symbol.
Obtains and returns the %gi-scope-type for this argument. The scope type explains how a callback is going to be invoked, most importantly when the resources required to invoke it can be freed.
Returns a pointer.
Obtains the GITypeInfo
holding the type information for
info. Free it using g-base-info-unref when done.
Returns #t
or #f
.
Obtains if the type of the argument includes the possibility of
NULL
. For ’in’ values this means that NULL
is a valid
value. For ’out’ values, this means that NULL
may be returned.
Returns #t
or #f
.
Obtain if the argument is a pointer to a struct or object that will
receive an output of a function. The default assumption for
out
arguments which have allocation is that the callee
allocates; if this is TRUE, then the caller must allocate.
Returns #t
or #f
.
Obtains if the argument is optional. For ’out’ arguments this means that
you can pass NULL
in order to ignore the result.
Returns #t
or #f
.
Obtains if the argument is a retur value. It can either be a parameter or a return value.
Returns #t
or #f
.
Obtains if an argument is only useful in C.
<gi-enum>
: %gi-direction ¶An instance of <gi-enum>
, who’s members are the scheme
representation of the direction of a GIArgInfo
:
g-name: GIDirection
name: gi-direction
enum-set:
in
in argument.
out
out argument.
inout
in and out argument.
<gi-enum>
: %gi-scope-type ¶An instance of <gi-enum>
, who’s members are the scheme
representation of the scope of a GIArgInfo
. Scope type of a
GIArgInfo
representing callback, determines how the callback is
invoked and is used to decide when the invoke structs can be freed.
g-name: GIScopeType
name: gi-scope-type
enum-set:
invalid
The argument is not of callback type.
call
The callback and associated user_data is only used during the call to this function.
async
The callback and associated user_data is only used until the callback is invoked, and the callback. is invoked always exactly once.
notified
The callback and and associated user_data is used until the caller is notfied via the destroy_notify.
<gi-enum>
: %gi-transfer ¶The transfer is the exchange of data between two parts, from the callee
to the caller. The callee is either a function/method/signal or an
object/interface where a property is defined. The caller is the side
accessing a property or calling a function. GITransfer
specifies
who’s responsible for freeing the resources after the ownership transfer
is complete. In case of a containing type such as a list, an array or a
hash table the container itself is specified differently from the items
within the container itself. Each container is freed differently, check
the documentation for the types themselves for information on how to
free them.
An instance of <gi-enum>
, who’s members are the scheme
representation of the GITransfer
:
g-name: GITransfer
name: gi-transfer
enum-set:
nothing
transfer nothing from the callee (function or the type instance the property belongs to) to the caller. The callee retains the ownership of the transfer and the caller doesn’t need to do anything to free up the resources of this transfer
container
transfer the container (list, array, hash table) from the callee to the caller. The callee retains the ownership of the individual items in the container and the caller has to free up the container resources
g_list_free
,g_hash_table_destroy
, … of this transfereverything
transfer everything, eg the container and its contents from the callee to the caller. This is the case when the callee creates a copy of all the data it returns. The caller is responsible for cleaning up the container and item resources of this transfer