|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21585/root/usr/share/gtk-doc/html/cairo/ |
Upload File : |
<!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.7 (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="index" href="ix02.html" title="Index of new symbols in 1.2">
<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="#id2559230" class="shortcut">Top</a>
 | 
<a href="#id2606146" 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>
<a name="id2559230"></a><span class="refentrytitle">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">
<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="id2606146"></a><h2>Description</h2>
<p>
Cairo has a three-part version number scheme. In this scheme, we use
even vs. odd numbers to distinguish fixed points in the software
vs. 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 release
1.0.2 - A subsequent maintenance release
1.2.0 - Another major release
Snapshots
---------
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="id2606197"></a><h3>Compatibility</h3>
<p>
The API/ABI compatibility guarantees for various versions are as
follows. First, let's assume some cairo-using application code that is
successfully using the API/ABI "from" one version of cairo. Then let's
ask the question whether this same code can be moved "to" the API/ABI
of 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 to
provide compatibility, since snapshots may introduce new API that ends
up being removed before the next release.
</p>
<p>
Moving from an in-development version (odd micro component) to any
later version is not guaranteed to provide compatibility. In fact,
there's not even a guarantee that the code will even continue to work
with the same in-development version number. This is because these
numbers don't correspond to any fixed state of the software, but
rather the many states between snapshots and releases.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2606236"></a><h3>Examining the version</h3>
<p>
Cairo provides the ability to examine the version at either
compile-time or run-time and in both a human-readable form as well as
an encoded form suitable for direct comparison. Cairo also provides a
macro (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 comparison
Run-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 equal
to 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="id2610377"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2610388"></a><h3>
<a name="CAIRO-VERSION:CAPS"></a>CAIRO_VERSION</h3>
<a class="indexterm" name="id2610400"></a><pre class="programlisting">#define CAIRO_VERSION</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2610416"></a><h3>
<a name="CAIRO-VERSION-MAJOR:CAPS"></a>CAIRO_VERSION_MAJOR</h3>
<a class="indexterm" name="id2610427"></a><pre class="programlisting">#define CAIRO_VERSION_MAJOR 1
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2610443"></a><h3>
<a name="CAIRO-VERSION-MINOR:CAPS"></a>CAIRO_VERSION_MINOR</h3>
<a class="indexterm" name="id2610454"></a><pre class="programlisting">#define CAIRO_VERSION_MINOR 2
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2610470"></a><h3>
<a name="CAIRO-VERSION-MICRO:CAPS"></a>CAIRO_VERSION_MICRO</h3>
<a class="indexterm" name="id2610481"></a><pre class="programlisting">#define CAIRO_VERSION_MICRO 4
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2610607"></a><h3>
<a name="CAIRO-VERSION-STRING:CAPS"></a>CAIRO_VERSION_STRING</h3>
<a class="indexterm" name="id2610618"></a><pre class="programlisting">#define CAIRO_VERSION_STRING "1.2.4"
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2610633"></a><h3>
<a name="CAIRO-VERSION-ENCODE:CAPS"></a>CAIRO_VERSION_ENCODE()</h3>
<a class="indexterm" name="id2610644"></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="id2610708"></a><h3>
<a name="cairo-version"></a>cairo_version ()</h3>
<a class="indexterm" name="id2610720"></a><pre class="programlisting">int cairo_version (void);</pre>
<p>
Returns the version of the cairo library encoded in a single
integer as per CAIRO_VERSION_ENCODE. The encoding ensures that
later versions compare greater than earlier versions.
</p>
<p>
A run-time comparison to check that cairo's version is greater than
or equal to version X.Y.Z could be performed as follows:
</p>
<p>
</p>
<div class="informalexample"><pre class="programlisting">
if (<a href="cairo-Version-Information.html#cairo-version"><code class="function">cairo_version()</code></a> >= CAIRO_VERSION_ENCODE(X,Y,Z)) {...}
</pre></div>
<p>
</p>
<p>
See also <a href="cairo-Version-Information.html#cairo-version-string"><code class="function">cairo_version_string()</code></a> as well as the compile-time
equivalents <a href="cairo-Version-Information.html#CAIRO-VERSION:CAPS"><code class="literal">CAIRO_VERSION</code></a> and <a href="cairo-Version-Information.html#CAIRO-VERSION-STRING:CAPS"><code class="literal">CAIRO_VERSION_STRING</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> the encoded version.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2610820"></a><h3>
<a name="cairo-version-string"></a>cairo_version_string ()</h3>
<a class="indexterm" name="id2610831"></a><pre class="programlisting">const char* cairo_version_string (void);</pre>
<p>
Returns the version of the cairo library as a human-readable string
of the form "X.Y.Z".
</p>
<p>
See also <a href="cairo-Version-Information.html#cairo-version"><code class="function">cairo_version()</code></a> as well as the compile-time equivalents
<a href="cairo-Version-Information.html#CAIRO-VERSION-STRING:CAPS"><code class="literal">CAIRO_VERSION_STRING</code></a> and <a href="cairo-Version-Information.html#CAIRO-VERSION:CAPS"><code class="literal">CAIRO_VERSION</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> a string containing the version.
</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>