MGtk Reference Manual | ||||
---|---|---|---|---|
Top | Description |
#include <mgtk.h> mconstchars mgtk_check_version (muint required_major
,muint required_minor
,muint required_micro
); extern const muint mgtk_major_version; extern const muint mgtk_minor_version; extern const muint mgtk_micro_version; extern const muint mgtk_interface_age; extern const muint mgtk_binary_age; #define MGTK_CHECK_VERSION (major, minor, micro)
MGtk provides version information, primarily useful in configure checks for builds that have a configure script. Applications will not typically use the features described here.
mconstchars mgtk_check_version (muint required_major
,muint required_minor
,muint required_micro
);
stability
: Unstable
Checks that the MGtk library in use is compatible with the given version. Generally you would pass in the constants MGTK_MAJOR_VERSION, MGTK_MINOR_VERSION, MGTK_MICRO_VERSION as the three arguments to this function; that produces a check that the library in use is compatible with the version of MGtk 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.)
|
the required major version. |
|
the required minor version. |
|
the required micro version. |
Returns : |
NULL if the MGtk library is compatible with the
given version, or a string describing the version mismatch.
The returned string is owned by MGtk and must not be modified
or freed.
Example 2. Using a #include <mgtk.h> #include <glib/gprintf.h> int mgtk_main ( argc, argv ) { mgtk_main_init ( argc, argv ); g_printf ( "\n mgtk_check_version: %s ", ifelse ( mgtk_check_version ( 0,0,0 ) == NULL, "is compatible", mgtk_check_version ( 0,0,0 ) ) ); return MCORRECT; } |
Since 0.0.1
extern const muint mgtk_major_version;
The major version number of the MGtk library. (e.g. in MGtk version 1.2.5 this is 1.)
This variable is in the library,
so represents the MGtk library you have linked against.
Contrast with the MGTK_MAJOR_VERSION
macro,
which represents the major version of the MGtk headers you have included.
extern const muint mgtk_minor_version;
The minor version number of the MGtk library. (e.g. in MGtk version 1.2.5 this is 2.)
This variable is in the library,
so represents the MGtk library you have linked against.
Contrast with the MGTK_MINOR_VERSION
macro,
which represents the minor version of the MGtk headers you have included.
extern const muint mgtk_micro_version;
The micro version number of the MGtk library. (e.g. in MGtk version 1.2.5 this is 5.)
This variable is in the library,
so represents the MGtk library you have linked against.
Contrast with the MGTK_MICRO_VERSION
macro,
which represents the micro version of the MGtk headers you have included.
extern const muint mgtk_interface_age;
This is the interface age passed to libtool. If libtool means nothing to you, don't worry about it. ;-)
extern const muint mgtk_binary_age;
This is the binary age passed to libtool. If libtool means nothing to you, don't worry about it. ;-)
#define MGTK_CHECK_VERSION(major,minor,micro)
stability
: Unstable
Checks the version of the MGtk library.
|
the major version number. |
|
the minor version number. |
|
the micro version number. |
Returns : |
TRUE if the version of the MGtk header files is the same as or
newer than the passed-in version.
Example 3. Checking the version of the MGtk library if (!MGTK_CHECK_VERSION (1, 2, 0)) g_error ("MGtk version 1.2.0 or above is needed"); |