?? glib-version-information.html
字號:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"><title>Version Information</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="GLib Reference Manual"><link rel="up" href="glib-fundamentals.html" title="GLib Fundamentals"><link rel="prev" href="glib-fundamentals.html" title="GLib Fundamentals"><link rel="next" href="glib-Basic-Types.html" title="Basic Types"><meta name="generator" content="GTK-Doc V1.9 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="chapter" href="glib.html" title="GLib Overview"><link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals"><link rel="chapter" href="glib-core.html" title="GLib Core Application Support"><link rel="chapter" href="glib-utilities.html" title="GLib Utilities"><link rel="chapter" href="glib-data-types.html" title="GLib Data Types"><link rel="chapter" href="tools.html" title="GLib Tools"><link rel="index" href="ix01.html" title="Index"><link rel="index" href="ix02.html" title="Index of deprecated symbols"><link rel="index" href="ix03.html" title="Index of new symbols in 2.2"><link rel="index" href="ix04.html" title="Index of new symbols in 2.4"><link rel="index" href="ix05.html" title="Index of new symbols in 2.6"><link rel="index" href="ix06.html" title="Index of new symbols in 2.8"><link rel="index" href="ix07.html" title="Index of new symbols in 2.10"><link rel="index" href="ix08.html" title="Index of new symbols in 2.12"><link rel="index" href="ix09.html" title="Index of new symbols in 2.14"><link rel="index" href="ix10.html" title="Index of new symbols in 2.16"></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="2"><tr valign="middle"><td><a accesskey="p" href="glib-fundamentals.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="glib-fundamentals.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GLib Reference Manual</th><td><a accesskey="n" href="glib-Basic-Types.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr><tr><td colspan="5" class="shortcuts"><nobr><a href="#id2821645" class="shortcut">Top</a>  |  <a href="#id2822347" class="shortcut">Description</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="glib-Version-Information"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><a name="id2821645"></a><span class="refentrytitle">Version Information</span></h2><p>Version Information — Variables and functions to check the GLib version</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">#include <glib.h>extern const guint <a class="link" href="glib-Version-Information.html#glib-major-version">glib_major_version</a>;extern const guint <a class="link" href="glib-Version-Information.html#glib-minor-version">glib_minor_version</a>;extern const guint <a class="link" href="glib-Version-Information.html#glib-micro-version">glib_micro_version</a>;extern const guint <a class="link" href="glib-Version-Information.html#glib-binary-age">glib_binary_age</a>;extern const guint <a class="link" href="glib-Version-Information.html#glib-interface-age">glib_interface_age</a>;const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* <a class="link" href="glib-Version-Information.html#glib-check-version">glib_check_version</a> (<a class="link" href="glib-Basic-Types.html#guint">guint</a> required_major, <a class="link" href="glib-Basic-Types.html#guint">guint</a> required_minor, <a class="link" href="glib-Basic-Types.html#guint">guint</a> required_micro);#define <a class="link" href="glib-Version-Information.html#GLIB-MAJOR-VERSION:CAPS">GLIB_MAJOR_VERSION</a>#define <a class="link" href="glib-Version-Information.html#GLIB-MINOR-VERSION:CAPS">GLIB_MINOR_VERSION</a>#define <a class="link" href="glib-Version-Information.html#GLIB-MICRO-VERSION:CAPS">GLIB_MICRO_VERSION</a>#define <a class="link" href="glib-Version-Information.html#GLIB-CHECK-VERSION:CAPS">GLIB_CHECK_VERSION</a> (major,minor,micro)</pre></div><div class="refsect1" lang="en"><a name="id2822347"></a><h2>Description</h2><p>GLib provides version information, primarily useful in configure checksfor builds that have a configure script. Applications will nottypically use the features described here.</p></div><div class="refsect1" lang="en"><a name="id2822364"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2822373"></a><h3><a name="glib-major-version"></a>glib_major_version</h3><a class="indexterm" name="id2822384"></a><pre class="programlisting">extern const guint glib_major_version;</pre><p>The major version number of the GLib library. (e.g. in GLib version 1.2.5 this is 1.)</p><p>This variable is in the library, so represents theGLib library you have linked against. Contrast with the<a class="link" href="glib-Version-Information.html#GLIB-MAJOR-VERSION:CAPS"><span class="type">GLIB_MAJOR_VERSION</span></a> macro, which represents the major version of theGLib headers you have included.</p></div><hr><div class="refsect2" lang="en"><a name="id2822412"></a><h3><a name="glib-minor-version"></a>glib_minor_version</h3><a class="indexterm" name="id2822423"></a><pre class="programlisting">extern const guint glib_minor_version;</pre><p>The minor version number of the GLib library.(e.g. in GLib version 1.2.5 this is 2.)</p><p>This variable is in the library, so represents theGLib library you have linked against. Contrast with the<a class="link" href="glib-Version-Information.html#GLIB-MINOR-VERSION:CAPS"><span class="type">GLIB_MINOR_VERSION</span></a> macro, which represents the minor version of theGLib headers you have included.</p></div><hr><div class="refsect2" lang="en"><a name="id2822452"></a><h3><a name="glib-micro-version"></a>glib_micro_version</h3><a class="indexterm" name="id2822462"></a><pre class="programlisting">extern const guint glib_micro_version;</pre><p>The micro version number of the GLib library.(e.g. in GLib version 1.2.5 this is 5.)</p><p>This variable is in the library, so represents the GLib library youhave linked against. Contrast with the <a class="link" href="glib-Version-Information.html#GLIB-MICRO-VERSION:CAPS"><span class="type">GLIB_MICRO_VERSION</span></a> macro, whichrepresents the micro version of the GLib headers you have included.</p></div><hr><div class="refsect2" lang="en"><a name="id2822491"></a><h3><a name="glib-binary-age"></a>glib_binary_age</h3><a class="indexterm" name="id2822502"></a><pre class="programlisting">extern const guint glib_binary_age;</pre><p>This is the binary age passed to <span class="application">libtool</span>. If <span class="application">libtool</span> means nothing to you, don't worry about it. ;-)</p></div><hr><div class="refsect2" lang="en"><a name="id2822528"></a><h3><a name="glib-interface-age"></a>glib_interface_age</h3><a class="indexterm" name="id2822538"></a><pre class="programlisting">extern const guint glib_interface_age;</pre><p>This is the interface age passed to <span class="application">libtool</span>. If <span class="application">libtool</span> means nothing to you, don't worry about it. ;-)</p></div><hr><div class="refsect2" lang="en"><a name="id2822565"></a><h3><a name="glib-check-version"></a>glib_check_version ()</h3><a class="indexterm" name="id2822577"></a><pre class="programlisting">const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a>* glib_check_version (<a class="link" href="glib-Basic-Types.html#guint">guint</a> required_major, <a class="link" href="glib-Basic-Types.html#guint">guint</a> required_minor, <a class="link" href="glib-Basic-Types.html#guint">guint</a> required_micro);</pre><p>Checks that the GLib library in use is compatible with thegiven version. Generally you would pass in the constants<a class="link" href="glib-Version-Information.html#GLIB-MAJOR-VERSION:CAPS"><span class="type">GLIB_MAJOR_VERSION</span></a>, <a class="link" href="glib-Version-Information.html#GLIB-MINOR-VERSION:CAPS"><span class="type">GLIB_MINOR_VERSION</span></a>, <a class="link" href="glib-Version-Information.html#GLIB-MICRO-VERSION:CAPS"><span class="type">GLIB_MICRO_VERSION</span></a>as the three arguments to this function; that producesa check that the library in use is compatible withthe version of GLib the application or module was compiledagainst.</p><p>Compatibility is defined by two things: first the versionof the running library is newer than the version<em class="parameter"><code>required_major.required_minor</code></em>.<em class="parameter"><code>required_micro</code></em>. Secondthe running library must be binary compatible with theversion <em class="parameter"><code>required_major.required_minor</code></em>.<em class="parameter"><code>required_micro</code></em>(same major version.)</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>required_major</code></em> :</span></p></td><td> the required major version.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>required_minor</code></em> :</span></p></td><td> the required minor version.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>required_micro</code></em> :</span></p></td><td> the required micro version.</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td> <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the GLib library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by GLib and must not be modified or freed.</td></tr></tbody></table></div><p class="since">Since 2.6</p></div><hr><div class="refsect2" lang="en"><a name="id2822750"></a><h3><a name="GLIB-MAJOR-VERSION:CAPS"></a>GLIB_MAJOR_VERSION</h3><a class="indexterm" name="id2822761"></a><pre class="programlisting">#define GLIB_MAJOR_VERSION 2</pre><p>The major version number of the GLib library.Like <a class="link" href="glib-Version-Information.html#glib-major-version"><span class="type">glib_major_version</span></a>, but from the headers used atapplication compile time, rather than from the library linked againstat application run time.</p></div><hr><div class="refsect2" lang="en"><a name="id2822788"></a><h3><a name="GLIB-MINOR-VERSION:CAPS"></a>GLIB_MINOR_VERSION</h3><a class="indexterm" name="id2822799"></a><pre class="programlisting">#define GLIB_MINOR_VERSION 16</pre><p>The minor version number of the GLib library.Like <ahref="/usr/share/gtk-doc/html/gtk/gtk-Feature-Test-Macros.html#gtk-minor-version"><span class="type">gtk_minor_version</span></a>, but from the headers used atapplication compile time, rather than from the library linked againstat application run time.</p></div><hr><div class="refsect2" lang="en"><a name="id2822827"></a><h3><a name="GLIB-MICRO-VERSION:CAPS"></a>GLIB_MICRO_VERSION</h3><a class="indexterm" name="id2822838"></a><pre class="programlisting">#define GLIB_MICRO_VERSION 1</pre><p>The micro version number of the GLib library.Like <ahref="/usr/share/gtk-doc/html/gtk/gtk-Feature-Test-Macros.html#gtk-micro-version"><span class="type">gtk_micro_version</span></a>, but from the headers used atapplication compile time, rather than from the library linked againstat application run time.</p></div><hr><div class="refsect2" lang="en"><a name="id2822866"></a><h3><a name="GLIB-CHECK-VERSION:CAPS"></a>GLIB_CHECK_VERSION()</h3><a class="indexterm" name="id2822877"></a><pre class="programlisting">#define GLIB_CHECK_VERSION(major,minor,micro)</pre><p>Checks the version of the GLib library.Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the version of the GLib header files is the same as or newer than the passed-in version.</p><div class="example"><a name="id2822902"></a><p class="title"><b>Example 1. Checking the version of the GLib library</b></p><div class="example-contents"><pre class="programlisting"> if (!GLIB_CHECK_VERSION (1, 2, 0)) g_error ("GLib version 1.2.0 or above is needed");</pre></div></div><p><br class="example-break"></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>major</code></em> :</span></p></td><td>the major version number.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>minor</code></em> :</span></p></td><td>the minor version number.</td></tr><tr><td><p><span class="term"><em class="parameter"><code>micro</code></em> :</span></p></td><td>the micro version number.</td></tr></tbody></table></div></div></div><div class="refsect1" lang="en"><a name="id2822960"></a><div class="refsect2" lang="en"><a name="id2822961"></a></div><hr><div class="refsect2" lang="en"><a name="id2822729"></a></div></div></div></body></html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -