Version Information

Version Information — Variables and functions to check the LunarDate version

Synopsis

#include <lunar-date/lunar-date.h>

extern const guint  lunar_date_major_version;
extern const guint  lunar_date_minor_version;
extern const guint  lunar_date_micro_version;
#define             LUNAR_DATE_MAJOR_VERSION
#define             LUNAR_DATE_MINOR_VERSION
#define             LUNAR_DATE_MICRO_VERSION
const gchar *       lunar_date_check_version            (guint required_major,
                                                         guint required_minor,
                                                         guint required_micro);
#define             LUNAR_DATE_CHECK_VERSION            (major,
                                                         minor,
                                                         micro)
void                lunar_init                          (int *argc,
                                                         char ***argv);

Description

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

Details

lunar_date_major_version

extern const guint lunar_date_major_version;

The major version number of the LunarDate library (e.g. in version 2.4.0 this is 2). Used for runtime.

Since 2.4.0


lunar_date_minor_version

extern const guint lunar_date_minor_version;

The minor version number of the LunarDate library (e.g. in version 2.4.0 this is 4). Used for runtime.

Since 2.4.0


lunar_date_micro_version

extern const guint lunar_date_micro_version;

The micro version number of the LunarDate library (e.g. in version 2.4.0 this is 0). Used for runtime.

Since 2.4.0


LUNAR_DATE_MAJOR_VERSION

#define LUNAR_DATE_MAJOR_VERSION 2

The major version number of the LunarDate library (e.g. in version 2.4.0 this is 2).

Since 2.4.0


LUNAR_DATE_MINOR_VERSION

#define LUNAR_DATE_MINOR_VERSION 4

The minor version number of the LunarDate library (e.g. in version 2.4.0 this is 4).

Since 2.4.0


LUNAR_DATE_MICRO_VERSION

#define LUNAR_DATE_MICRO_VERSION 0

The macro version number of the LunarDate library (e.g. in version 2.4.0 this is 0).

Since 2.4.0


lunar_date_check_version ()

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

Checks that the LunarDate library in use is compatible with the given version. Generally you would pass in the constants LUNAR_DATE_MAJOR_VERSION, LUNAR_DATE_MINOR_VERSION, LUNAR_DATE_MICRO_VERSION as the three arguments to this function; that produces a check that the library in use is compatible with the version of LunarDate 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.)

required_major :

the required major version.

required_minor :

the required minor version.

required_micro :

the required micro version.

Returns :

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

Since 2.4.0


LUNAR_DATE_CHECK_VERSION()

#define             LUNAR_DATE_CHECK_VERSION(major,minor,micro)

Checks the version of the LunarDate library.

Checking the version of the LunarDate library:

1
2
if (!LUNAR_DATE_CHECK_VERSION (2, 4, 0))
    g_error ("LunarDate version 2.4.0 or above is needed");

major :

required major version

minor :

required minor version

micro :

required micro version

Returns :

TRUE if the version of the LunarDate header files is the same as or newer than the passed-in version.

Since 2.4.0


lunar_init ()

void                lunar_init                          (int *argc,
                                                         char ***argv);

Warning

lunar_init is deprecated and should not be used in newly-written code. 2.4.0

Call this function before using any other lunar functions in your applications. It will initialize lunar.

argc :

The number of arguments in argv.

argv :

A pointer to an array of arguments.