Version Information

Version Information — variables and functions to check Tracker version

Stability Level

Stable, unless otherwise indicated

Functions

const gchar * tracker_check_version ()
#define TRACKER_CHECK_VERSION()

Types and Values

extern const guint tracker_major_version
extern const guint tracker_minor_version
extern const guint tracker_micro_version
extern const guint tracker_binary_age
extern const guint tracker_interface_age

Includes

#include <tracker-sparql.h>

Description

Tracker provides version information, primarily useful in configure checks for builds that have a configure script. Applications will not typically use the features described here.

Functions

tracker_check_version ()

const gchar *
tracker_check_version (guint required_major,
                       guint required_minor,
                       guint required_micro);

Checks that the Tracker library in use is compatible with the given version. Generally you would pass in the constants TRACKER_MAJOR_VERSION, TRACKER_MINOR_VERSION, TRACKER_MICRO_VERSION as the three arguments to this function; that produces a check that the library in use is compatible with the version of Tracker the application or module was compiled against.

Compatibility is defined by two things: first the version of the running library is newer than the version required_major.required_minor .required_micro . Second the running library must be binary compatible with the version required_major.required_minor .required_micro (same major version.)

Parameters

required_major

the required major version.

 

required_minor

the required minor version.

 

required_micro

the required micro version.

 

Returns

NULL if the Tracker library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by Tracker and must not be modified or freed.

Since: 0.10


TRACKER_CHECK_VERSION()

#define             TRACKER_CHECK_VERSION(major,minor,micro)

This macro essentially does the same thing as tracker_check_version() but as a pre-processor operation rather than a run-time operation. It will evaluate true or false based the version passed in and the version available.

Example 2. Simple version check example

An example of how to make sure you have the version of Tracker installed to run your code.
if (!TRACKER_CHECK_VERSION (0, 10, 7)) {
        g_error ("Tracker version 0.10.7 or above is needed");
}

Parameters

major

the required major version.

 

minor

the required minor version.

 

micro

the required micro version.

 

Since: 0.10

Types and Values

tracker_major_version

extern const guint tracker_major_version;

The major version of the Tracker library.

An integer variable exported from the library linked against at application run time.


tracker_minor_version

extern const guint tracker_minor_version;

The minor version of the Tracker library.

An integer variable exported from the library linked against at application run time.


tracker_micro_version

extern const guint tracker_micro_version;

The micro version of the Tracker library.

An integer variable exported from the library linked against at application run time.


tracker_binary_age

extern const guint tracker_binary_age;

The binary age of the Tracker library. Defines how far back backwards compatibility reaches.

An integer variable exported from the library linked against at application run time.


tracker_interface_age

extern const guint tracker_interface_age;

The interface age of the Tracker library. Defines how far back the API has last been extended.

An integer variable exported from the library linked against at application run time.