<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Version Information and Compatibility Checks: tumbler Reference Manual</title> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="index.html" title="tumbler Reference Manual"> <link rel="up" href="miscellaneous.html" title="Part II. Miscellaneous"> <link rel="prev" href="tumbler-Various-Enumeration-Types.html" title="Various Enumeration Types"> <link rel="next" href="thumbnails.html" title="Part III. Querying and Generating Thumbnails"> <meta name="generator" content="GTK-Doc V1.25 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> <td width="100%" align="left" class="shortcuts"> <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> <a href="#tumbler-Version-Information-and-Compatibility-Checks.description" class="shortcut">Description</a></span> </td> <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> <td><a accesskey="u" href="miscellaneous.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> <td><a accesskey="p" href="tumbler-Various-Enumeration-Types.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> <td><a accesskey="n" href="thumbnails.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> </tr></table> <div class="refentry"> <a name="tumbler-Version-Information-and-Compatibility-Checks"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle"><a name="tumbler-Version-Information-and-Compatibility-Checks.top_of_page"></a>Version Information and Compatibility Checks</span></h2> <p>Version Information and Compatibility Checks</p> </td> <td class="gallery_image" valign="top" align="right"></td> </tr></table></div> <div class="refsect1"> <a name="tumbler-Version-Information-and-Compatibility-Checks.functions"></a><h2>Functions</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="functions_return"> <col class="functions_name"> </colgroup> <tbody> <tr> <td class="define_keyword">#define</td> <td class="function_name"> <a class="link" href="tumbler-Version-Information-and-Compatibility-Checks.html#TUMBLER-CHECK-VERSION:CAPS" title="TUMBLER_CHECK_VERSION()">TUMBLER_CHECK_VERSION</a><span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type">const <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * </td> <td class="function_name"> <a class="link" href="tumbler-Version-Information-and-Compatibility-Checks.html#tumbler-check-version" title="tumbler_check_version ()">tumbler_check_version</a> <span class="c_punctuation">()</span> </td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="tumbler-Version-Information-and-Compatibility-Checks.other"></a><h2>Types and Values</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="name"> <col class="description"> </colgroup> <tbody> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="tumbler-Version-Information-and-Compatibility-Checks.html#TUMBLER-MAJOR-VERSION:CAPS" title="TUMBLER_MAJOR_VERSION">TUMBLER_MAJOR_VERSION</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="tumbler-Version-Information-and-Compatibility-Checks.html#TUMBLER-MINOR-VERSION:CAPS" title="TUMBLER_MINOR_VERSION">TUMBLER_MINOR_VERSION</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="tumbler-Version-Information-and-Compatibility-Checks.html#TUMBLER-MICRO-VERSION:CAPS" title="TUMBLER_MICRO_VERSION">TUMBLER_MICRO_VERSION</a></td> </tr> <tr> <td class="variable_type">extern const guint </td> <td class="function_name"><a class="link" href="tumbler-Version-Information-and-Compatibility-Checks.html#tumbler-major-version" title="tumbler_major_version">tumbler_major_version</a></td> </tr> <tr> <td class="variable_type">extern const guint </td> <td class="function_name"><a class="link" href="tumbler-Version-Information-and-Compatibility-Checks.html#tumbler-minor-version" title="tumbler_minor_version">tumbler_minor_version</a></td> </tr> <tr> <td class="variable_type">extern const guint </td> <td class="function_name"><a class="link" href="tumbler-Version-Information-and-Compatibility-Checks.html#tumbler-micro-version" title="tumbler_micro_version">tumbler_micro_version</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="tumbler-Version-Information-and-Compatibility-Checks.html#G-GNUC-NULL-TERMINATED:CAPS" title="G_GNUC_NULL_TERMINATED">G_GNUC_NULL_TERMINATED</a></td> </tr> <tr> <td class="define_keyword">#define</td> <td class="function_name"><a class="link" href="tumbler-Version-Information-and-Compatibility-Checks.html#G-GNUC-WARN-UNUSED-RESULT:CAPS" title="G_GNUC_WARN_UNUSED_RESULT">G_GNUC_WARN_UNUSED_RESULT</a></td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="tumbler-Version-Information-and-Compatibility-Checks.includes"></a><h2>Includes</h2> <pre class="synopsis">#include <tumbler/tumbler.h> </pre> </div> <div class="refsect1"> <a name="tumbler-Version-Information-and-Compatibility-Checks.description"></a><h2>Description</h2> </div> <div class="refsect1"> <a name="tumbler-Version-Information-and-Compatibility-Checks.functions_details"></a><h2>Functions</h2> <div class="refsect2"> <a name="TUMBLER-CHECK-VERSION:CAPS"></a><h3>TUMBLER_CHECK_VERSION()</h3> <pre class="programlisting">#define TUMBLER_CHECK_VERSION(major,minor,micro)</pre> </div> <hr> <div class="refsect2"> <a name="tumbler-check-version"></a><h3>tumbler_check_version ()</h3> <pre class="programlisting">const <a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * tumbler_check_version (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#guint"><span class="type">guint</span></a> required_major</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#guint"><span class="type">guint</span></a> required_minor</code></em>, <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glibglib-Basic-Types.html#guint"><span class="type">guint</span></a> required_micro</code></em>);</pre> <p>Checks that the <code class="systemitem">tumbler</code> library in use is compatible with the given version. Generally you would pass in the constants <a class="link" href="tumbler-Version-Information-and-Compatibility-Checks.html#TUMBLER-MAJOR-VERSION:CAPS" title="TUMBLER_MAJOR_VERSION"><span class="type">TUMBLER_MAJOR_VERSION</span></a>, <a class="link" href="tumbler-Version-Information-and-Compatibility-Checks.html#TUMBLER-MINOR-VERSION:CAPS" title="TUMBLER_MINOR_VERSION"><span class="type">TUMBLER_MINOR_VERSION</span></a> and <a class="link" href="tumbler-Version-Information-and-Compatibility-Checks.html#TUMBLER-MICRO-VERSION:CAPS" title="TUMBLER_MICRO_VERSION"><span class="type">TUMBLER_MICRO_VERSION</span></a> as the three arguments to this function; that produces a check that the library in use is compatible with the version of <code class="systemitem">tumbler</code> the application was compiled against.</p> <div class="example"> <a name="id-1.3.4.7.3.5"></a><p class="title"><b>Example 1. Checking the runtime version of the tumbler library</b></p> <div class="example-contents"> <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listing_lines" align="right"><pre>1 2 3 4 5 6</pre></td> <td class="listing_code"><pre class="programlisting"><span class="gtkdoc kwb">const</span> gchar <span class="gtkdoc opt">*</span>mismatch<span class="gtkdoc opt">;</span> mismatch <span class="gtkdoc opt">=</span> <span class="function"><a href="tumbler-Version-Information-and-Compatibility-Checks.html#tumbler-check-version">tumbler_check_version</a></span> <span class="gtkdoc opt">(</span>TUMBLER_VERSION_MAJOR<span class="gtkdoc opt">,</span> TUMBLER_VERSION_MINOR<span class="gtkdoc opt">,</span> TUMBLER_VERSION_MICRO<span class="gtkdoc opt">);</span> <span class="keyword">if</span> <span class="gtkdoc opt">(</span><span class="function"><a href="/usr/share/gtk-doc/html/glibglib-Miscellaneous-Macros.html#G-UNLIKELY:CAPS">G_UNLIKELY</a></span> <span class="gtkdoc opt">(</span>mismatch <span class="gtkdoc opt">!=</span> NULL<span class="gtkdoc opt">))</span> <span class="function"><a href="/usr/share/gtk-doc/html/glibglib-Message-Logging.html#g-error">g_error</a></span> <span class="gtkdoc opt">(</span><span class="string">"Version mismatch: %s"</span><span class="gtkdoc opt">,</span> mismatch<span class="gtkdoc opt">);</span></pre></td> </tr> </tbody> </table> </div> </div> <br class="example-break"><div class="refsect3"> <a name="tumbler-check-version.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>required_major</p></td> <td class="parameter_description"><p>the required major version.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>required_minor</p></td> <td class="parameter_description"><p>the required minor version.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>required_micro</p></td> <td class="parameter_description"><p>the required micro version.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="tumbler-check-version.returns"></a><h4>Returns</h4> <p> <a href="/usr/share/gtk-doc/html/glibglib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by the library and must not be freed or modified by the caller.</p> </div> </div> </div> <div class="refsect1"> <a name="tumbler-Version-Information-and-Compatibility-Checks.other_details"></a><h2>Types and Values</h2> <div class="refsect2"> <a name="TUMBLER-MAJOR-VERSION:CAPS"></a><h3>TUMBLER_MAJOR_VERSION</h3> <pre class="programlisting">#define TUMBLER_MAJOR_VERSION 0 </pre> </div> <hr> <div class="refsect2"> <a name="TUMBLER-MINOR-VERSION:CAPS"></a><h3>TUMBLER_MINOR_VERSION</h3> <pre class="programlisting">#define TUMBLER_MINOR_VERSION 2 </pre> </div> <hr> <div class="refsect2"> <a name="TUMBLER-MICRO-VERSION:CAPS"></a><h3>TUMBLER_MICRO_VERSION</h3> <pre class="programlisting">#define TUMBLER_MICRO_VERSION 1 </pre> </div> <hr> <div class="refsect2"> <a name="tumbler-major-version"></a><h3>tumbler_major_version</h3> <pre class="programlisting">extern const guint tumbler_major_version; </pre> </div> <hr> <div class="refsect2"> <a name="tumbler-minor-version"></a><h3>tumbler_minor_version</h3> <pre class="programlisting">extern const guint tumbler_minor_version; </pre> </div> <hr> <div class="refsect2"> <a name="tumbler-micro-version"></a><h3>tumbler_micro_version</h3> <pre class="programlisting">extern const guint tumbler_micro_version; </pre> </div> <hr> <div class="refsect2"> <a name="G-GNUC-NULL-TERMINATED:CAPS"></a><h3>G_GNUC_NULL_TERMINATED</h3> <pre class="programlisting">#define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__)) </pre> </div> <hr> <div class="refsect2"> <a name="G-GNUC-WARN-UNUSED-RESULT:CAPS"></a><h3>G_GNUC_WARN_UNUSED_RESULT</h3> <pre class="programlisting">#define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) </pre> </div> </div> </div> <div class="footer"> <hr>Generated by GTK-Doc V1.25</div> </body> </html>