Top |
#define | CAIRO_VERSION_ENCODE() |
#define | CAIRO_VERSION_STRINGIZE() |
int | cairo_version () |
const char * | cairo_version_string () |
#define | CAIRO_VERSION |
#define | CAIRO_VERSION_MAJOR |
#define | CAIRO_VERSION_MINOR |
#define | CAIRO_VERSION_MICRO |
#define | CAIRO_VERSION_STRING |
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 git instead of a tar file, or as a "snapshot" tar file as opposed to a "release" tar file).
_____ Major. Always 1, until we invent a new scheme. / ___ Minor. Even/Odd = Release/Snapshot (tar files) or Branch/Head (git) | / _ Micro. Even/Odd = Tar-file/git | | / 1.0.0
Here are a few examples of versions that one might see.
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 git) -------------------------------------- 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)
CAIRO_VERSION_ENCODE()
to perform the encoding.
Compile-time ------------ CAIRO_VERSION_STRING Human-readable CAIRO_VERSION Encoded, suitable for comparison Run-time --------cairo_version_string()
Human-readablecairo_version()
Encoded, suitable for comparison
1 2 3 4 5 6 |
##if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 0, 0) printf ("Compiling with suitable cairo version: %s\n", %CAIRO_VERSION_STRING); ##endif if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 0, 0)) printf ("Running with suitable cairo version: %s\n", cairo_version_string ()); |
#define CAIRO_VERSION_ENCODE(major, minor, micro)
This macro encodes the given cairo version into an integer. The numbers
returned by CAIRO_VERSION
and cairo_version()
are encoded using this macro.
Two encoded version numbers can be compared as integers. The encoding ensures
that later versions compare greater than earlier versions.
major |
the major component of the version number |
|
minor |
the minor component of the version number |
|
micro |
the micro component of the version number |
Since: 1.0
#define CAIRO_VERSION_STRINGIZE(major, minor, micro)
This macro encodes the given cairo version into an string. The numbers
returned by CAIRO_VERSION_STRING
and cairo_version_string()
are encoded using this macro.
The parameters to this macro must expand to numerical literals.
major |
the major component of the version number |
|
minor |
the minor component of the version number |
|
micro |
the micro component of the version number |
Since: 1.8
int
cairo_version (void
);
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.
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:
1 |
if (cairo_version() >= CAIRO_VERSION_ENCODE(X,Y,Z)) {...} |
See also cairo_version_string()
as well as the compile-time
equivalents CAIRO_VERSION
and CAIRO_VERSION_STRING
.
Since: 1.0
const char *
cairo_version_string (void
);
Returns the version of the cairo library as a human-readable string of the form "X.Y.Z".
See also cairo_version()
as well as the compile-time equivalents
CAIRO_VERSION_STRING
and CAIRO_VERSION
.
Since: 1.0
#define CAIRO_VERSION
The version of cairo available at compile-time, encoded using
CAIRO_VERSION_ENCODE()
.
Since: 1.0
#define CAIRO_VERSION_MAJOR 1
The major component of the version of cairo available at compile-time.
Since: 1.0
#define CAIRO_VERSION_MINOR 18
The minor component of the version of cairo available at compile-time.
Since: 1.0
#define CAIRO_VERSION_MICRO 2
The micro component of the version of cairo available at compile-time.
Since: 1.0
#define CAIRO_VERSION_STRING
A human-readable string literal containing the version of cairo available at compile-time, in the form of "X.Y.Z".
Since: 1.8