<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Struct_info (gobject-introspection.GObject_introspection.Struct_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; <a href="../index.html">GObject_introspection</a> &#x00BB; Struct_info</nav><h1>Module <code>GObject_introspection.Struct_info</code></h1></header><aside><p>Struct_info — Module representing a C structure</p></aside><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>Struct_info represents a generic C structure type. A structure has methods and fields.</p></dd></dl><dl><dt class="spec value" id="val-structinfo"><a href="#val-structinfo" class="anchor"></a><code><span class="keyword">val</span> structinfo : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.typ</span></code></dt><dt class="spec value" id="val-is_gtype_struct"><a href="#val-is_gtype_struct" class="anchor"></a><code><span class="keyword">val</span> is_gtype_struct : <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>Return true if this structure represents the &quot;class structure&quot; for some GObject or GInterface. This function is mainly useful to hide this kind of structure from generated public APIs.</p></dd></dl><dl><dt class="spec value" id="val-get_alignment"><a href="#val-get_alignment" class="anchor"></a><code><span class="keyword">val</span> get_alignment : <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 required alignment of the structure.</p></dd></dl><dl><dt class="spec value" id="val-get_size"><a href="#val-get_size" class="anchor"></a><code><span class="keyword">val</span> get_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 total size of the structure.</p></dd></dl><dl><dt class="spec value" id="val-is_foreign"><a href="#val-is_foreign" class="anchor"></a><code><span class="keyword">val</span> is_foreign : <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>No doc yet</p></dd></dl><dl><dt class="spec value" id="val-get_n_fields"><a href="#val-get_n_fields" class="anchor"></a><code><span class="keyword">val</span> get_n_fields : <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 number of fields this structure has.</p></dd></dl><dl><dt class="spec value" id="val-get_n_methods"><a href="#val-get_n_methods" class="anchor"></a><code><span class="keyword">val</span> get_n_methods : <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 number of methods this structure has.</p></dd></dl><dl><dt class="spec value" id="val-get_field"><a href="#val-get_field" class="anchor"></a><code><span class="keyword">val</span> get_field : <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="../Field_info/index.html#type-t">Field_info.t</a> Ctypes.structure</span> Ctypes.ptr</span></code></dt><dd><p>Obtain the type information for field with specified index.</p></dd></dl><dl><dt class="spec value" id="val-get_method"><a href="#val-get_method" class="anchor"></a><code><span class="keyword">val</span> get_method : <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="../Function_info/index.html#type-t">Function_info.t</a> Ctypes.structure</span> Ctypes.ptr</span></code></dt><dd><p>Obtain the type information for method with specified index.</p></dd></dl><dl><dt class="spec value" id="val-find_method"><a href="#val-find_method" class="anchor"></a><code><span class="keyword">val</span> find_method : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> <span><span><span><a href="../Function_info/index.html#type-t">Function_info.t</a> Ctypes.structure</span> Ctypes.ptr</span> option</span></code></dt><dd><p>Obtain the type information for method named name .</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="../Base_info/index.html#type-t">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 Struct_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="../Base_info/index.html#type-t">Base_info.t</a> Ctypes.structure</span> Ctypes.ptr</span></code></dt><dd><p>Return a Base_info.t form a Struct_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><dl><dt class="spec value" id="val-cast_from_registeredtypeinfo"><a href="#val-cast_from_registeredtypeinfo" class="anchor"></a><code><span class="keyword">val</span> cast_from_registeredtypeinfo : <span><span><a href="../Registered_type_info/index.html#type-t">Registered_type_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 registeredtype info to struct info.</p></dd></dl><dl><dt class="spec value" id="val-cast_to_registeredtypeinfo"><a href="#val-cast_to_registeredtypeinfo" class="anchor"></a><code><span class="keyword">val</span> cast_to_registeredtypeinfo : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> <span><span><a href="../Registered_type_info/index.html#type-t">Registered_type_info.t</a> Ctypes.structure</span> Ctypes.ptr</span></code></dt><dd><p>Just cast OCaml Ctypes struct info to registeredtype info</p></dd></dl><dl><dt class="spec value" id="val-from_registeredtypeinfo"><a href="#val-from_registeredtypeinfo" class="anchor"></a><code><span class="keyword">val</span> from_registeredtypeinfo : <span><span><a href="../Registered_type_info/index.html#type-t">Registered_type_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 Struct_info.t from a Registered_type_info.t, the underlying C structure ref count is increased and the value is Gc.finalis&quot;ed&quot; with Registered_type_info.registeredtypeinfo_unref.</p></dd></dl><dl><dt class="spec value" id="val-to_registeredtypeinfo"><a href="#val-to_registeredtypeinfo" class="anchor"></a><code><span class="keyword">val</span> to_registeredtypeinfo : <span><span><a href="index.html#type-t">t</a> Ctypes.structure</span> Ctypes.ptr</span> <span>&#45;&gt;</span> <span><span><a href="../Registered_type_info/index.html#type-t">Registered_type_info.t</a> Ctypes.structure</span> Ctypes.ptr</span></code></dt><dd><p>Return a Registered_type_info.t form a Struct_info, the underlying C structure ref count is increased and the value is Gc.finalis&quot;ed&quot; with Registered_type_info.registeredtypeinfo_unref.</p></dd></dl></div></body></html>