<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>GObject_introspection__Type_info (gobject-introspection.GObject_introspection__Type_info)</title><link rel="stylesheet" href="../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc %%VERSION%%"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../index.html">gobject-introspection</a> &#x00BB; GObject_introspection__Type_info</nav><h1>Module <code>GObject_introspection__Type_info</code></h1><p>Type_info — Struct representing a type</p></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code></dt><dd><p>Type_info represents a type. You can retrieve a type info from an argument (see Arg_info), a function return value (see Function_info), a field (see Field_info), a property (see Property_info), a constant (see Constant_info) or for a union discriminator (see Union_info). A type can either be a of a basic type which is a standard C primitive type or an interface type. For interface types you need to call Type_info.get_interface to get a reference to the base info for that interface.</p></dd></dl><dl><dt class="spec value" id="val-typeinfo"><a href="#val-typeinfo" class="anchor"></a><code><span class="keyword">val</span> typeinfo : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.typ</span></code></dt><dt class="spec value" id="val-to_string"><a href="#val-to_string" class="anchor"></a><code><span class="keyword">val</span> to_string : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> string</code></dt><dd><p>Obtain a string representation of type.</p></dd></dl><dl><dt class="spec value" id="val-is_pointer"><a href="#val-is_pointer" class="anchor"></a><code><span class="keyword">val</span> is_pointer : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> bool</code></dt><dd><p>Obtain if the type is passed as a reference. Note that the types of GI_DIRECTION_OUT and GI_DIRECTION_INOUT parameters will only be pointers if the underlying type being transferred is a pointer (i.e. only if the type of the C function’s formal parameter is a pointer to a pointer).</p></dd></dl><dl><dt class="spec value" id="val-get_tag"><a href="#val-get_tag" class="anchor"></a><code><span class="keyword">val</span> get_tag : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> <a href="../Bindings/Types/index.html#type-tag">Bindings.Types.tag</a></code></dt><dd><p>Obtain the type tag for the type. See GITypeTag for a list of type tags.</p></dd></dl><dl><dt class="spec value" id="val-get_array_length"><a href="#val-get_array_length" class="anchor"></a><code><span class="keyword">val</span> get_array_length : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> int</code></dt><dd><p>Obtain the array length of the type. The type tag must be a GIType.array or -1 will returned.</p></dd></dl><dl><dt class="spec value" id="val-get_array_fixed_size"><a href="#val-get_array_fixed_size" class="anchor"></a><code><span class="keyword">val</span> get_array_fixed_size : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> int</code></dt><dd><p>Obtain the fixed array size of the type. The type tag must be a GIType.array or -1 will returned.</p></dd></dl><dl><dt class="spec value" id="val-is_zero_terminated"><a href="#val-is_zero_terminated" class="anchor"></a><code><span class="keyword">val</span> is_zero_terminated : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> bool</code></dt><dd><p>Obtain if the last element of the array is NULL. The type tag must be a GIType.array or FALSE will returned.</p></dd></dl><dl><dt class="spec value" id="val-get_array_type"><a href="#val-get_array_type" class="anchor"></a><code><span class="keyword">val</span> get_array_type : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> <span><a href="../Bindings/Types/index.html#type-array_type">Bindings.Types.array_type</a> option</span></code></dt><dd><p>Obtain the array type for this type. See GIArrayType for a list of possible values. If the type tag of this type is not array, None will be returned.</p></dd></dl><dl><dt class="spec value" id="val-unsafe_get_param_type"><a href="#val-unsafe_get_param_type" class="anchor"></a><code><span class="keyword">val</span> unsafe_get_param_type : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> int <span>&#45;&gt;</span> <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span></code></dt><dd><p>Obtain the parameter type n. It is used to get the parameter type of generic * container. For example if the current Type_info.t is an array, a GList, a * GSList or an Hash, you have to use this in order to get the Type_info.t of * the data of the container. * Basicaly it is done with Type_info.get_param_type type_info 0 . * https://github.com/GNOME/pygobject/blob/288bd2957916568666c3d5d27e8c868d67b7e8c9/gi/pygi-argument.c#L526 * https://github.com/ruby-gnome2/ruby-gnome2/blob/ec4160b4f4c5432c6ff8a9e962e7ffeacfd48869/gobject-introspection/ext/gobject-introspection/rb-gi-argument.c#L928 * This function is unsafe meanings that it is your responsability to not use * a number out of bounds.</p></dd></dl><dl><dt class="spec value" id="val-get_param_type"><a href="#val-get_param_type" class="anchor"></a><code><span class="keyword">val</span> get_param_type : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span></code></dt><dd><p>This is just an alias to Type_info.unsage_get_param_type with the index set to 0.</p></dd></dl><dl><dt class="spec value" id="val-get_interface"><a href="#val-get_interface" class="anchor"></a><code><span class="keyword">val</span> get_interface : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> <span><span><span><a href="../GObject_introspection/Base_info/index.html#type-t">GObject_introspection.Base_info.t</a> Ctypes.structure</span> Ctypes.ptr</span> option</span></code></dt><dd><p>For types which have Types.Interface such as GObjects and boxed values, this function returns full information about the referenced type. You can then inspect the type of the returned Base_info to further query whether it is a concrete GObject, a GInterface, a structure, etc. using Base_info.get_type.</p></dd></dl><dl><dt class="spec value" id="val-cast_from_baseinfo"><a href="#val-cast_from_baseinfo" class="anchor"></a><code><span class="keyword">val</span> cast_from_baseinfo : <span><span><a href="../GObject_introspection/Base_info/index.html#type-t">GObject_introspection.Base_info.t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span></code></dt><dd><p>Just cast OCaml Ctypes base info to typeinfo.</p></dd></dl><dl><dt class="spec value" id="val-cast_to_baseinfo"><a href="#val-cast_to_baseinfo" class="anchor"></a><code><span class="keyword">val</span> cast_to_baseinfo : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> <span><span><a href="../GObject_introspection/Base_info/index.html#type-t">GObject_introspection.Base_info.t</a> Ctypes.structure</span> Ctypes.ptr</span></code></dt><dd><p>Just cast OCaml Ctypes typeinfo to base info</p></dd></dl><dl><dt class="spec value" id="val-add_unref_finaliser"><a href="#val-add_unref_finaliser" class="anchor"></a><code><span class="keyword">val</span> add_unref_finaliser : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span></code></dt><dd><p>Add unref of the C underlying structure whith Gc.finalise.</p></dd></dl><dl><dt class="spec value" id="val-from_baseinfo"><a href="#val-from_baseinfo" class="anchor"></a><code><span class="keyword">val</span> from_baseinfo : <span><span><a href="../GObject_introspection/Base_info/index.html#type-t">GObject_introspection.Base_info.t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span></code></dt><dd><p>Return a Type_info.t from a Base_info.t, the underlying C structure ref count is increased and the value is Gc.finalis&quot;ed&quot; with Base_info.baseinfo_unref.</p></dd></dl><dl><dt class="spec value" id="val-to_baseinfo"><a href="#val-to_baseinfo" class="anchor"></a><code><span class="keyword">val</span> to_baseinfo : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> <span><span><a href="../GObject_introspection/Base_info/index.html#type-t">GObject_introspection.Base_info.t</a> Ctypes.structure</span> Ctypes.ptr</span></code></dt><dd><p>Return a Base_info.t form a Type_info, the underlying C structure ref count is increased and the value is Gc.finalis&quot;ed&quot; with Base_info.baseinfo_unref.</p></dd></dl></div></body></html>