📄 cairo-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.68.1"><link rel="start" href="index.html" title="Cairo: A Vector Graphics Library"><link rel="up" href="Support.html" title="Utilities"><link rel="prev" href="cairo-Error-handling.html" title="Error handling"><link rel="next" href="cairo-Types.html" title="Types"><meta name="generator" content="GTK-Doc V1.6 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="part" href="pt01.html" title="Part I. Tutorial"><link rel="part" href="pt02.html" title="Part II. Reference"><link rel="chapter" href="Drawing.html" title="Drawing"><link rel="chapter" href="Fonts.html" title="Fonts"><link rel="chapter" href="Surfaces.html" title="Surfaces"><link rel="chapter" href="Support.html" title="Utilities"><link rel="index" href="ix01.html" title="Index"><link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo"></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="cairo-Error-handling.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="Support.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">Cairo: A Vector Graphics Library</th><td><a accesskey="n" href="cairo-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="#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="cairo-Version-Information"></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 Information</span></h2><p>Version Information — Compile-time and run-time version checks.</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="cairo-Version-Information.html#CAIRO-VERSION:CAPS">CAIRO_VERSION</a>#define <a href="cairo-Version-Information.html#CAIRO-VERSION-MAJOR:CAPS">CAIRO_VERSION_MAJOR</a>#define <a href="cairo-Version-Information.html#CAIRO-VERSION-MINOR:CAPS">CAIRO_VERSION_MINOR</a>#define <a href="cairo-Version-Information.html#CAIRO-VERSION-MICRO:CAPS">CAIRO_VERSION_MICRO</a>#define <a href="cairo-Version-Information.html#CAIRO-VERSION-STRING:CAPS">CAIRO_VERSION_STRING</a>#define <a href="cairo-Version-Information.html#CAIRO-VERSION-ENCODE:CAPS">CAIRO_VERSION_ENCODE</a> (major, minor, micro)int <a href="cairo-Version-Information.html#cairo-version">cairo_version</a> (void);const char* <a href="cairo-Version-Information.html#cairo-version-string">cairo_version_string</a> (void);</pre></div><div class="refsect1" lang="en"><a name="desc"></a><h2>Description</h2><p>Cairo has a three-part version number scheme. In this scheme, we useeven vs. odd numbers to distinguish fixed points in the softwarevs. in-progress development, (such as from CVS instead of a tar file,or as a "snapshot" tar file as opposed to a "release" tar file).</p><p></p><div class="informalexample"><pre class="programlisting"> _____ Major. Always 1, until we invent a new scheme./ ___ Minor. Even/Odd = Release/Snapshot (tar files) or Branch/Head (CVS)| / _ Micro. Even/Odd = Tar-file/CVS| | /1.0.0</pre></div><p></p><p>Here are a few examples of versions that one might see.</p><div class="informalexample"><pre class="programlisting">Releases--------1.0.0 - A major release1.0.2 - A subsequent maintenance release1.2.0 - Another major releaseSnapshots---------1.1.2 - A snapshot (working toward the 1.2.0 release)In-progress development (eg. from CVS)--------------------------------------1.0.1 - Development on a maintenance branch (toward 1.0.2 release)1.1.1 - Development on head (toward 1.1.2 snapshot and 1.2.0 release)</pre></div><p></p><div class="refsect2" lang="en"><a name="id2589447"></a><h3>Compatibility</h3><p>The API/ABI compatibility guarantees for various versions are asfollows. First, let's assume some cairo-using application code that issuccessfully using the API/ABI "from" one version of cairo. Then let'sask the question whether this same code can be moved "to" the API/ABIof another version of cairo.</p><p>Moving from a release to any later version (release, snapshot,development) is always guaranteed to provide compatibility.</p><p>Moving from a snapshot to any later version is not guaranteed toprovide compatibility, since snapshots may introduce new API that endsup being removed before the next release.</p><p>Moving from an in-development version (odd micro component) to anylater version is not guaranteed to provide compatibility. In fact,there's not even a guarantee that the code will even continue to workwith the same in-development version number. This is because thesenumbers don't correspond to any fixed state of the software, butrather the many states between snapshots and releases.</p></div><hr><div class="refsect2" lang="en"><a name="id2590714"></a><h3>Examining the version</h3><p>Cairo provides the ability to examine the version at eithercompile-time or run-time and in both a human-readable form as well asan encoded form suitable for direct comparison. Cairo also provides amacro (CAIRO_VERSION_ENCODE) to perform the encoding.</p><p></p><div class="informalexample"><pre class="programlisting">Compile-time------------<a href="cairo-Version-Information.html#CAIRO-VERSION-STRING:CAPS"><code class="literal">CAIRO_VERSION_STRING</code></a> Human-readable<a href="cairo-Version-Information.html#CAIRO-VERSION:CAPS"><code class="literal">CAIRO_VERSION</code></a> Encoded, suitable for comparisonRun-time--------<a href="cairo-Version-Information.html#cairo-version-string"><code class="function">cairo_version_string()</code></a> Human-readable<a href="cairo-Version-Information.html#cairo-version"><code class="function">cairo_version()</code></a> Encoded, suitable for comparison</pre></div><p></p><p>For example, checking that the cairo version is greater than or equalto 1.0.0 could be achieved at compile-time or run-time as follows:</p><div class="informalexample"><pre class="programlisting">#<span class="type">if</span> <a href="cairo-Version-Information.html#CAIRO-VERSION:CAPS"><code class="literal">CAIRO_VERSION</code></a> >= <a href="cairo-Version-Information.html#CAIRO-VERSION-ENCODE:CAPS"><code class="literal">CAIRO_VERSION_ENCODE</code></a>(1, 0, 0)printf ("Compiling with suitable cairo version: %<code class="literal">s</code>\n", CAIRO_VERSION_STRING);#<span class="type">endif</span>if (<a href="cairo-Version-Information.html#cairo-version"><code class="function">cairo_version()</code></a> >= <a href="cairo-Version-Information.html#CAIRO-VERSION-ENCODE:CAPS"><code class="literal">CAIRO_VERSION_ENCODE</code></a>(1, 0, 0)) printf ("Running with suitable cairo version: %<code class="literal">s</code>\n", <a href="cairo-Version-Information.html#cairo-version-string"><code class="function">cairo_version_string()</code></a>);</pre></div><p></p></div></div><div class="refsect1" lang="en"><a name="details"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2587108"></a><h3><a name="CAIRO-VERSION:CAPS"></a>CAIRO_VERSION</h3><a class="indexterm" name="id2587119"></a><pre class="programlisting">#define CAIRO_VERSION</pre><p></p></div><hr><div class="refsect2" lang="en"><a name="id2587135"></a><h3><a name="CAIRO-VERSION-MAJOR:CAPS"></a>CAIRO_VERSION_MAJOR</h3><a class="indexterm" name="id2587146"></a><pre class="programlisting">#define CAIRO_VERSION_MAJOR 1</pre></div><hr><div class="refsect2" lang="en"><a name="id2587159"></a><h3><a name="CAIRO-VERSION-MINOR:CAPS"></a>CAIRO_VERSION_MINOR</h3><a class="indexterm" name="id2587171"></a><pre class="programlisting">#define CAIRO_VERSION_MINOR 2</pre></div><hr><div class="refsect2" lang="en"><a name="id2587184"></a><h3><a name="CAIRO-VERSION-MICRO:CAPS"></a>CAIRO_VERSION_MICRO</h3><a class="indexterm" name="id2587196"></a><pre class="programlisting">#define CAIRO_VERSION_MICRO 0</pre></div><hr><div class="refsect2" lang="en"><a name="id2587209"></a><h3><a name="CAIRO-VERSION-STRING:CAPS"></a>CAIRO_VERSION_STRING</h3><a class="indexterm" name="id2587220"></a><pre class="programlisting">#define CAIRO_VERSION_STRING "1.2.0"</pre><p></p></div><hr><div class="refsect2" lang="en"><a name="id2587235"></a><h3><a name="CAIRO-VERSION-ENCODE:CAPS"></a>CAIRO_VERSION_ENCODE()</h3><a class="indexterm" name="id2587246"></a><pre class="programlisting">#define CAIRO_VERSION_ENCODE(major, minor, micro)</pre><p></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></td></tr><tr><td><span class="term"><em class="parameter"><code>minor</code></em> :</span></td><td></td></tr><tr><td><span class="term"><em class="parameter"><code>micro</code></em> :</span></td><td></td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2587310"></a><h3><a name="cairo-version"></a>cairo_version ()</h3><a class="indexterm" name="id2587322"></a><pre class="programlisting">int cairo_version (void);</pre></div><hr><div class="refsect2" lang="en"><a name="id2587341"></a><h3><a name="cairo-version-string"></a>cairo_version_string ()</h3><a class="indexterm" name="id2587352"></a><pre class="programlisting">const char* cairo_version_string (void);</pre></div></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -