<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>GObject_introspection__Repository (gobject-introspection.GObject_introspection__Repository)</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__Repository</nav><h1>Module <code>GObject_introspection__Repository</code></h1><p>Repository — GObject Introspection repository manager module Repository is used to manage repositories of namespaces. Namespaces are represented on disk by type libraries (.typelib files).</p></header><aside><p>Repository — GObject Introspection repository manager module Repository is used to manage repositories of namespaces. Namespaces are represented on disk by type libraries (.typelib files).</p></aside><dl><dt class="spec type" id="type-repository"><a href="#type-repository" class="anchor"></a><code><span class="keyword">type</span> repository</code></dt><dt class="spec type" id="type-typelib"><a href="#type-typelib" class="anchor"></a><code><span class="keyword">type</span> typelib</code></dt></dl><dl><dt class="spec value" id="val-get_default"><a href="#val-get_default" class="anchor"></a><code><span class="keyword">val</span> get_default : unit <span>&#45;&gt;</span> <a href="index.html#type-repository">repository</a></code></dt><dd><p>Returns the singleton process-global default Repository.</p></dd></dl><dl><dt class="spec value" id="val-require"><a href="#val-require" class="anchor"></a><code><span class="keyword">val</span> require : <span>?&#8288;repository:<a href="index.html#type-repository">repository</a></span> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> <span>?&#8288;version:string</span> <span>&#45;&gt;</span> unit <span>&#45;&gt;</span> <span><span>(<a href="index.html#type-typelib">typelib</a>, string)</span> Stdlib.result</span></code></dt><dd><p>Force the namespace namespace_ to be loaded if it isn't already. If namespace_ is not loaded, this function will search for a &quot;.typelib&quot; file using the repository search path. In addition, a version version of namespace may be specified. If version is not specified, the latest will be used).</p></dd></dl><dl><dt class="spec value" id="val-get_loaded_namespaces"><a href="#val-get_loaded_namespaces" class="anchor"></a><code><span class="keyword">val</span> get_loaded_namespaces : <span>?&#8288;repository:<a href="index.html#type-repository">repository</a></span> <span>&#45;&gt;</span> unit <span>&#45;&gt;</span> <span>string list</span></code></dt><dd><p>Return the list of currently loaded namespaces.</p></dd></dl><dl><dt class="spec value" id="val-get_dependencies"><a href="#val-get_dependencies" class="anchor"></a><code><span class="keyword">val</span> get_dependencies : <span>?&#8288;repository:<a href="index.html#type-repository">repository</a></span> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> <span>string list</span></code></dt><dd><p>Return an list of all (transitive) versioned dependencies for namespace_ . Returned strings are of the form namespace-version. Note: namespace_ must have already been loaded using a function such as Repository.require before calling this function. To get only the immediate dependencies for namespace_ , use Repository.get_immediate_dependencies.</p></dd></dl><dl><dt class="spec value" id="val-get_c_prefix"><a href="#val-get_c_prefix" class="anchor"></a><code><span class="keyword">val</span> get_c_prefix : <span>?&#8288;repository:<a href="index.html#type-repository">repository</a></span> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> string</code></dt><dd><p>This function returns the &quot;C prefix&quot;, or the C level namespace associated with the given introspection namespace. Each C symbol starts with this prefix, as well each GType in the library. Note: The namespace must have already been loaded using a function such as Repository.require before calling this function.</p></dd></dl><dl><dt class="spec value" id="val-get_version"><a href="#val-get_version" class="anchor"></a><code><span class="keyword">val</span> get_version : <span>?&#8288;repository:<a href="index.html#type-repository">repository</a></span> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> string</code></dt><dd><p>This function returns the loaded version associated with the given namespace namespace_ . Note: The namespace must have already been loaded using a function such as Repository.require before calling this function.</p></dd></dl><dl><dt class="spec value" id="val-get_typelib_path"><a href="#val-get_typelib_path" class="anchor"></a><code><span class="keyword">val</span> get_typelib_path : <span>?&#8288;repository:<a href="index.html#type-repository">repository</a></span> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> string</code></dt><dd><p>If namespace namespace_ is loaded, return the full path to the .typelib file it was loaded from. If the typelib for namespace namespace_ was included in a shared library, return the special string &quot;&lt;builtin&gt;&quot;.</p></dd></dl><dl><dt class="spec value" id="val-enumerate_versions"><a href="#val-enumerate_versions" class="anchor"></a><code><span class="keyword">val</span> enumerate_versions : <span>?&#8288;repository:<a href="index.html#type-repository">repository</a></span> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> <span>string list</span></code></dt><dd><p>Obtain an unordered list of versions (either currently loaded or available) for namespace_ in this repository .</p></dd></dl><dl><dt class="spec value" id="val-get_search_path"><a href="#val-get_search_path" class="anchor"></a><code><span class="keyword">val</span> get_search_path : unit <span>&#45;&gt;</span> <span>string list</span></code></dt><dd><p>Returns the current search path Repository will use when loading typelib files. The list is internal to GIRespository and should not be freed, nor should its string elements.</p></dd></dl><dl><dt class="spec value" id="val-prepend_search_path"><a href="#val-prepend_search_path" class="anchor"></a><code><span class="keyword">val</span> prepend_search_path : string <span>&#45;&gt;</span> unit</code></dt><dd><p>Prepends directory to the typelib search path. See Repository.get_search_path.</p></dd></dl><dl><dt class="spec value" id="val-find_by_name"><a href="#val-find_by_name" class="anchor"></a><code><span class="keyword">val</span> find_by_name : <span>?&#8288;repository:<a href="index.html#type-repository">repository</a></span> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> string <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>Searches for a particular entry in a namespace. Before calling this function for a particular namespace, you must call Repository.require once to load the namespace, or otherwise ensure the namespace has already been loaded.</p></dd></dl><dl><dt class="spec value" id="val-get_n_infos"><a href="#val-get_n_infos" class="anchor"></a><code><span class="keyword">val</span> get_n_infos : <span>?&#8288;repository:<a href="index.html#type-repository">repository</a></span> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> int</code></dt><dd><p>This function returns the number of metadata entries in given namespace namespace_ . The namespace must have already been loaded before calling this function.</p></dd></dl><dl><dt class="spec value" id="val-get_info"><a href="#val-get_info" class="anchor"></a><code><span class="keyword">val</span> get_info : <span>?&#8288;repository:<a href="index.html#type-repository">repository</a></span> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> int <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>This function returns a particular metadata entry in the given namespace namespace_ . The namespace must have already been loaded before calling this function. See Repository.get_n_infos to find the maximum number of entries.</p></dd></dl><dl><dt class="spec value" id="val-get_shared_library"><a href="#val-get_shared_library" class="anchor"></a><code><span class="keyword">val</span> get_shared_library : <span>?&#8288;repository:<a href="index.html#type-repository">repository</a></span> <span>&#45;&gt;</span> string <span>&#45;&gt;</span> <span>string option</span></code></dt><dd><p>This function returns a comma-separated list of paths to the shared C libraries associated with the given namespace namespace_ . There may be no shared library path associated, in which case this function will return NULL. Note: The namespace must have already been loaded using a function such as Repository.require before calling this function.</p></dd></dl><dl><dt class="spec value" id="val-prepend_library_path"><a href="#val-prepend_library_path" class="anchor"></a><code><span class="keyword">val</span> prepend_library_path : string <span>&#45;&gt;</span> unit</code></dt><dd><p>Prepends directory to the search path that is used to search shared libraries referenced by imported namespaces. Multiple calls to this function all contribute to the final list of paths. The list of paths is unique and shared for all Repository instances across the process, but it doesn't affect namespaces imported before the call. If the library is not found in the directories configured in this way, loading will fall back to the system library path (ie. LD_LIBRARY_PATH and DT_RPATH in ELF systems). See the documentation of your dynamic linker for full details.</p></dd></dl><dl><dt class="spec type" id="type-gtype"><a href="#type-gtype" class="anchor"></a><code><span class="keyword">type</span> gtype</code><code> = int64</code></dt></dl><dl><dt class="spec value" id="val-gtype"><a href="#val-gtype" class="anchor"></a><code><span class="keyword">val</span> gtype : <span>int64 Ctypes.typ</span></code></dt><dt class="spec value" id="val-find_by_gtype"><a href="#val-find_by_gtype" class="anchor"></a><code><span class="keyword">val</span> find_by_gtype : <span>?&#8288;repository:<a href="index.html#type-repository">repository</a></span> <span>&#45;&gt;</span> <a href="index.html#type-gtype">gtype</a> <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>Searches all loaded namespaces for a particular #GType. Note that in order to locate the metadata, the namespace corresponding to the type must first have been loaded. There is currently no mechanism for determining the namespace which corresponds to an arbitrary GType - thus, this function will operate most reliably when you know the GType to originate from be from a loaded namespace.</p></dd></dl></div></body></html>