📄 pango-version-checking.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 Checking</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1"><link rel="start" href="index.html" title="Pango Reference Manual"><link rel="up" href="lowlevel.html" title="Low Level Functionality"><link rel="prev" href="pango-Miscellaneous-Utilities.html" title="Miscellaneous Utilities"><link rel="next" href="tools.html" title="Pango Tools"><meta name="generator" content="GTK-Doc V1.6 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="chapter" href="pango.html" title="Basic Pango Interfaces"><link rel="chapter" href="rendering.html" title="Rendering with Pango"><link rel="chapter" href="lowlevel.html" title="Low Level Functionality"><link rel="chapter" href="tools.html" title="Pango 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 1.2"><link rel="index" href="ix04.html" title="Index of new symbols in 1.4"><link rel="index" href="ix05.html" title="Index of new symbols in 1.6"><link rel="index" href="ix06.html" title="Index of new symbols in 1.8"><link rel="index" href="ix07.html" title="Index of new symbols in 1.10"><link rel="index" href="ix08.html" title="Index of new symbols in 1.12"><link rel="index" href="ix09.html" title="Index of new symbols in 1.14"><link rel="index" href="ix10.html" title="Index of new symbols in 1.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="pango-Miscellaneous-Utilities.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="lowlevel.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">Pango Reference Manual</th><td><a accesskey="n" href="tools.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="#top_of_page" class="shortcut">Top</a>  |  <a href="#desc" class="shortcut">Description</a></nobr></td></tr></table><div class="refentry" lang="en"><a name="pango-Version-Checking"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><span class="refentrytitle"><a name="top_of_page"></a>Version Checking</span></h2><p>Version Checking — Tools for checking Pango version at compile- and run-time.</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><a name="synopsis"></a><h2>Synopsis</h2><pre class="synopsis">#define <a href="pango-Version-Checking.html#PANGO-VERSION-ENCODE:CAPS">PANGO_VERSION_ENCODE</a> (major, minor, micro)#define <a href="pango-Version-Checking.html#PANGO-VERSION:CAPS">PANGO_VERSION</a>#define <a href="pango-Version-Checking.html#PANGO-VERSION-MAJOR:CAPS">PANGO_VERSION_MAJOR</a>#define <a href="pango-Version-Checking.html#PANGO-VERSION-MINOR:CAPS">PANGO_VERSION_MINOR</a>#define <a href="pango-Version-Checking.html#PANGO-VERSION-MICRO:CAPS">PANGO_VERSION_MICRO</a>#define <a href="pango-Version-Checking.html#PANGO-VERSION-STRING:CAPS">PANGO_VERSION_STRING</a>#define <a href="pango-Version-Checking.html#PANGO-VERSION-CHECK:CAPS">PANGO_VERSION_CHECK</a> (major,minor,micro)int <a href="pango-Version-Checking.html#pango-version">pango_version</a> (void);const char* <a href="pango-Version-Checking.html#pango-version-string">pango_version_string</a> (void);const char* <a href="pango-Version-Checking.html#pango-version-check">pango_version_check</a> (int required_major, int required_minor, int required_micro);</pre></div><div class="refsect1" lang="en"><a name="desc"></a><h2>Description</h2><p>The capital-letter macros defined here can be used to check the version ofPango at compile-time, and to <em class="firstterm">encode</em> Pango versions intointegers.The functions can be used to check the version of the linked Pango libraryat run-time.</p></div><div class="refsect1" lang="en"><a name="details"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2949051"></a><h3><a name="PANGO-VERSION-ENCODE:CAPS"></a>PANGO_VERSION_ENCODE()</h3><a class="indexterm" name="id2949063"></a><pre class="programlisting">#define PANGO_VERSION_ENCODE(major, minor, micro)</pre><p>This macro encodes the given Pango version into an integer. The numbersreturned by <a href="pango-Version-Checking.html#PANGO-VERSION:CAPS"><code class="literal">PANGO_VERSION</code></a> and <a href="pango-Version-Checking.html#pango-version"><code class="function">pango_version()</code></a> are encoded using this macro.Two encoded version numbers can be compared as integers.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>major</code></em> :</span></td><td>the major component of the version number</td></tr><tr><td><span class="term"><em class="parameter"><code>minor</code></em> :</span></td><td>the minor component of the version number</td></tr><tr><td><span class="term"><em class="parameter"><code>micro</code></em> :</span></td><td>the micro component of the version number</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2949150"></a><h3><a name="PANGO-VERSION:CAPS"></a>PANGO_VERSION</h3><a class="indexterm" name="id2949163"></a><pre class="programlisting">#define PANGO_VERSION</pre><p>The version of Pango available at compile-time, encoded using<a href="pango-Version-Checking.html#PANGO-VERSION-ENCODE:CAPS"><code class="function">PANGO_VERSION_ENCODE()</code></a>.</p></div><hr><div class="refsect2" lang="en"><a name="id2949190"></a><h3><a name="PANGO-VERSION-MAJOR:CAPS"></a>PANGO_VERSION_MAJOR</h3><a class="indexterm" name="id2949204"></a><pre class="programlisting">#define PANGO_VERSION_MAJOR 1</pre><p>The major component of the version of Pango available at compile-time.</p></div><hr><div class="refsect2" lang="en"><a name="id2949220"></a><h3><a name="PANGO-VERSION-MINOR:CAPS"></a>PANGO_VERSION_MINOR</h3><a class="indexterm" name="id2949234"></a><pre class="programlisting">#define PANGO_VERSION_MINOR 15</pre><p>The minor component of the version of Pango available at compile-time.</p></div><hr><div class="refsect2" lang="en"><a name="id2949250"></a><h3><a name="PANGO-VERSION-MICRO:CAPS"></a>PANGO_VERSION_MICRO</h3><a class="indexterm" name="id2949264"></a><pre class="programlisting">#define PANGO_VERSION_MICRO 5</pre><p>The micro component of the version of Pango available at compile-time.</p></div><hr><div class="refsect2" lang="en"><a name="id2949280"></a><h3><a name="PANGO-VERSION-STRING:CAPS"></a>PANGO_VERSION_STRING</h3><a class="indexterm" name="id2949293"></a><pre class="programlisting">#define PANGO_VERSION_STRING "1.15.5"</pre><p>A string literal containing the version of Pango available at compile-time.</p></div><hr><div class="refsect2" lang="en"><a name="id2949310"></a><h3><a name="PANGO-VERSION-CHECK:CAPS"></a>PANGO_VERSION_CHECK()</h3><a class="indexterm" name="id2949323"></a><pre class="programlisting">#define PANGO_VERSION_CHECK(major,minor,micro)</pre><p>Checks that the version of Pango available at compile-time is not older thanthe provided version number.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>major</code></em> :</span></td><td>the major component of the version number</td></tr><tr><td><span class="term"><em class="parameter"><code>minor</code></em> :</span></td><td>the minor component of the version number</td></tr><tr><td><span class="term"><em class="parameter"><code>micro</code></em> :</span></td><td>the micro component of the version number</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2949388"></a><h3><a name="pango-version"></a>pango_version ()</h3><a class="indexterm" name="id2949403"></a><pre class="programlisting">int pango_version (void);</pre><p>This is similar to the macro <a href="pango-Version-Checking.html#PANGO-VERSION:CAPS"><code class="literal">PANGO_VERSION</code></a> except thatit returns the encoded version of Pango available at run-time,as opposed to the version available at compile-time.</p><p>A version number can be encoded into an integer using<a href="pango-Version-Checking.html#PANGO-VERSION-ENCODE:CAPS"><code class="function">PANGO_VERSION_ENCODE()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>value: The encoded version of Pango library available at run time.</td></tr></tbody></table></div><p>Since 1.16</p></div><hr><div class="refsect2" lang="en"><a name="id2949476"></a><h3><a name="pango-version-string"></a>pango_version_string ()</h3><a class="indexterm" name="id2949491"></a><pre class="programlisting">const char* pango_version_string (void);</pre><p>This is similar to the macro <a href="pango-Version-Checking.html#PANGO-VERSION-STRING:CAPS"><code class="literal">PANGO_VERSION_STRING</code></a> except thatit returns the version of Pango available at run-time, as opposed tothe version available at compile-time.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td>value: A string containing the version of Pango library available at run time. The returned string is owned by Pango and should not be modified or freed.</td></tr></tbody></table></div><p>Since 1.16</p></div><hr><div class="refsect2" lang="en"><a name="id2949553"></a><h3><a name="pango-version-check"></a>pango_version_check ()</h3><a class="indexterm" name="id2949569"></a><pre class="programlisting">const char* pango_version_check (int required_major, int required_minor, int required_micro);</pre><p>Checks that the Pango library in use is compatible with thegiven version. Generally you would pass in the constants<a href="pango-Version-Checking.html#PANGO-VERSION-MAJOR:CAPS"><code class="literal">PANGO_VERSION_MAJOR</code></a>, <a href="pango-Version-Checking.html#PANGO-VERSION-MINOR:CAPS"><code class="literal">PANGO_VERSION_MINOR</code></a>, <a href="pango-Version-Checking.html#PANGO-VERSION-MICRO:CAPS"><code class="literal">PANGO_VERSION_MICRO</code></a>as the three arguments to this function; that producesa check that the library in use at run-time is compatible withthe version of Pango the application or module was compiled against.</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>For compile-time version checking use <a href="pango-Version-Checking.html#PANGO-VERSION-CHECK:CAPS"><code class="function">PANGO_VERSION_CHECK()</code></a>.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>required_major</code></em> :</span></td><td> the required major version.</td></tr><tr><td><span class="term"><em class="parameter"><code>required_minor</code></em> :</span></td><td> the required minor version.</td></tr><tr><td><span class="term"><em class="parameter"><code>required_micro</code></em> :</span></td><td> the required major version.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> <ahref="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the Pango library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by Pango and should not be modified or freed.</td></tr></tbody></table></div><p>Since 1.16</p></div></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -