GICallableInfo

GICallableInfo — Struct representing a callable

Synopsis

typedef             GICallableInfo;
GITypeInfo *        g_callable_info_get_return_type     (GICallableInfo *info);
GITransfer          g_callable_info_get_caller_owns     (GICallableInfo *info);
gboolean            g_callable_info_may_return_null     (GICallableInfo *info);
gint                g_callable_info_get_n_args          (GICallableInfo *info);
GIArgInfo *         g_callable_info_get_arg             (GICallableInfo *info,
                                                         gint n);
void                g_callable_info_load_arg            (GICallableInfo *info,
                                                         gint n,
                                                         GIArgInfo *arg);
void                g_callable_info_load_return_type    (GICallableInfo *info,
                                                         GITypeInfo *type);

Description

GICallableInfo represents an entity which is callable. Currently a function (GIFunctionInfo), virtual function, (GIVirtualFunc) or callback (GICallbackInfo).

A callable has a list of arguments (GIArgInfo), a return type, direction and a flag which decides if it returns null.

Details

GICallableInfo

typedef GIBaseInfo GICallableInfo;

Represents a callable, either GIFunctionInfo, GICallbackInfo or GIVFuncInfo.


g_callable_info_get_return_type ()

GITypeInfo *        g_callable_info_get_return_type     (GICallableInfo *info);

Obtain the return type of a callable item as a GITypeInfo.

info :

a GICallableInfo

Returns :

the GITypeInfo. Free the struct by calling g_base_info_unref() when done. [transfer full]

g_callable_info_get_caller_owns ()

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.

info :

a GICallableInfo

Returns :

TRUE if the caller owns the return value, FALSE otherwise.

g_callable_info_may_return_null ()

gboolean            g_callable_info_may_return_null     (GICallableInfo *info);

See if a callable could return NULL.

info :

a GICallableInfo

Returns :

TRUE if callable could return NULL

g_callable_info_get_n_args ()

gint                g_callable_info_get_n_args          (GICallableInfo *info);

Obtain the number of arguments (both IN and OUT) for this callable.

info :

a GICallableInfo

Returns :

The number of arguments this callable expects.

g_callable_info_get_arg ()

GIArgInfo *         g_callable_info_get_arg             (GICallableInfo *info,
                                                         gint n);

Obtain information about a particular argument of this callable.

info :

a GICallableInfo

n :

the argument index to fetch

Returns :

the GIArgInfo. Free it with g_base_info_unref() when done. [transfer full]

g_callable_info_load_arg ()

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.

info :

a GICallableInfo

n :

the argument index to fetch

arg :

Initialize with argument number n. [out caller-allocates]

g_callable_info_load_return_type ()

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.

info :

a GICallableInfo

type :

Initialized with return type of info. [out caller-allocates]