## Version Information and Compatibility Checks

Version Information and Compatibility Checks

## Synopsis

    #include <tumbler/tumbler.h>

    #define             G_GNUC_NULL_TERMINATED
    #define             G_GNUC_WARN_UNUSED_RESULT
    #define             TUMBLER_CHECK_VERSION               (major,
                                                             minor,
                                                             micro)
    #define             TUMBLER_MAJOR_VERSION
    #define             TUMBLER_MICRO_VERSION
    #define             TUMBLER_MINOR_VERSION
    const gchar *       tumbler_check_version               (guint required_major,
                                                             guint required_minor,
                                                             guint required_micro);
    extern const guint  tumbler_major_version;
    extern const guint  tumbler_micro_version;
    extern const guint  tumbler_minor_version;

## Description

## Details

### G_GNUC_NULL_TERMINATED

    #define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__))

### G_GNUC_WARN_UNUSED_RESULT

    #define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))

### TUMBLER_CHECK_VERSION()

    #define             TUMBLER_CHECK_VERSION(major,minor,micro)

### TUMBLER_MAJOR_VERSION

    #define TUMBLER_MAJOR_VERSION 0

### TUMBLER_MICRO_VERSION

    #define TUMBLER_MICRO_VERSION 27

### TUMBLER_MINOR_VERSION

    #define TUMBLER_MINOR_VERSION 1

### tumbler_check_version ()

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

Checks that the `tumbler` library in use is compatible with the given version. Generally you would pass in the constants TUMBLER_MAJOR_VERSION, TUMBLER_MINOR_VERSION and TUMBLER_MICRO_VERSION as the three arguments to this function; that produces a check that the library in use is compatible with the version of `tumbler` the application was compiled against.

Example 1. Checking the runtime version of the tumbler library

    const gchar *mismatch;
    mismatch = tumbler_check_version (TUMBLER_VERSION_MAJOR,
                                      TUMBLER_VERSION_MINOR,
                                      TUMBLER_VERSION_MICRO);
    if (G_UNLIKELY (mismatch != NULL))
      g_error ("Version mismatch: %s", mismatch);

`required_major` : | the required major version.
`required_minor` : | the required minor version.
`required_micro` : | the required micro version.
Returns : | `NULL` if the library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by the library and must not be freed or modified by the caller.

### tumbler_major_version

    extern const guint tumbler_major_version;

### tumbler_micro_version

    extern const guint tumbler_micro_version;

### tumbler_minor_version

    extern const guint tumbler_minor_version;