<refentry id="gtk-Feature-Test-Macros">
<refmeta>
<refentrytitle>Version Information</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Version Information</refname><refpurpose>variables and functions to check the GTK+ version.</refpurpose>
</refnamediv>

<refsynopsisdiv><title>Synopsis</title>
<synopsis>

#include &lt;gtk/gtk.h&gt;


extern      const guint <link linkend="gtk-major-version">gtk_major_version</link>;
extern      const guint <link linkend="gtk-minor-version">gtk_minor_version</link>;
extern      const guint <link linkend="gtk-micro-version">gtk_micro_version</link>;
extern      const guint <link linkend="gtk-binary-age">gtk_binary_age</link>;
extern      const guint <link linkend="gtk-interface-age">gtk_interface_age</link>;
<link linkend="gchar">gchar</link>*      <link linkend="gtk-check-version">gtk_check_version</link>               (<link linkend="guint">guint</link> required_major,
                                             <link linkend="guint">guint</link> required_minor,
                                             <link linkend="guint">guint</link> required_micro);

#define     <link linkend="GTK-MAJOR-VERSION-CAPS">GTK_MAJOR_VERSION</link>
#define     <link linkend="GTK-MINOR-VERSION-CAPS">GTK_MINOR_VERSION</link>
#define     <link linkend="GTK-MICRO-VERSION-CAPS">GTK_MICRO_VERSION</link>
#define     <link linkend="GTK-BINARY-AGE-CAPS">GTK_BINARY_AGE</link>
#define     <link linkend="GTK-INTERFACE-AGE-CAPS">GTK_INTERFACE_AGE</link>
#define     <link linkend="GTK-CHECK-VERSION-CAPS">GTK_CHECK_VERSION</link>               (major,minor,micro)
</synopsis>
</refsynopsisdiv>





<refsect1>
<title>Description</title>
<para>
GTK+ provides version information, primarily useful in configure checks
for builds that have a configure script. Applications will not
typically use the features described here.
</para>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="gtk-major-version">gtk_major_version</title>
<programlisting>extern const guint gtk_major_version;
</programlisting>
<para>
The major version number of the GTK+ library.  (e.g. in GTK+ version
1.2.5 this is 1.) 
</para>

<para>
This variable is in the library, so represents the
GTK+ library you have linked against. Contrast with the
<link linkend="GTK-MAJOR-VERSION-CAPS">GTK_MAJOR_VERSION</link> macro, which represents the major version of the
GTK+ headers you have included.
</para></refsect2>
<refsect2>
<title><anchor id="gtk-minor-version">gtk_minor_version</title>
<programlisting>extern const guint gtk_minor_version;
</programlisting>
<para>
The minor version number of the GTK+ library.
(e.g. in GTK+ version 1.2.5 this is 2.)
</para>

<para>
This variable is in the library, so represents the
GTK+ library you have linked against. Contrast with the
<link linkend="GTK-MINOR-VERSION-CAPS">GTK_MINOR_VERSION</link> macro, which represents the minor version of the
GTK+ headers you have included.
</para></refsect2>
<refsect2>
<title><anchor id="gtk-micro-version">gtk_micro_version</title>
<programlisting>extern const guint gtk_micro_version;
</programlisting>
<para>
The micro version number of the GTK+ library.
(e.g. in GTK+ version 1.2.5 this is 5.)
</para>


<para>
This variable is in the library, so represents the GTK+ library you
have linked against. Contrast with the <link linkend="GTK-MICRO-VERSION-CAPS">GTK_MICRO_VERSION</link> macro, which
represents the micro version of the GTK+ headers you have included.
</para></refsect2>
<refsect2>
<title><anchor id="gtk-binary-age">gtk_binary_age</title>
<programlisting>extern const guint gtk_binary_age;
</programlisting>
<para>
This is the binary age passed to <application>libtool</application>. If 
<application>libtool</application> means nothing to you, don't worry 
about it. ;-)
</para></refsect2>
<refsect2>
<title><anchor id="gtk-interface-age">gtk_interface_age</title>
<programlisting>extern const guint gtk_interface_age;
</programlisting>
<para>
This is the interface age passed to <application>libtool</application>. If 
<application>libtool</application> means nothing to you, don't worry 
about it. ;-)
</para></refsect2>
<refsect2>
<title><anchor id="gtk-check-version">gtk_check_version ()</title>
<programlisting><link linkend="gchar">gchar</link>*      gtk_check_version               (<link linkend="guint">guint</link> required_major,
                                             <link linkend="guint">guint</link> required_minor,
                                             <link linkend="guint">guint</link> required_micro);</programlisting>
<para>
Checks that the GTK+ library in use is equal to the given 
version. Primarily useful to compare the header file version 
(from <link linkend="GTK-MAJOR-VERSION-CAPS">GTK_MAJOR_VERSION</link>, <link linkend="GTK-MINOR-VERSION-CAPS">GTK_MINOR_VERSION</link>, <link linkend="GTK-MICRO-VERSION-CAPS">GTK_MICRO_VERSION</link>) 
the the runtime library version. This should only be done 
in the build for your application, to check that the user's libraries
and header files are the same. Applications should not do this 
when deployed, because it's OK for applications to use a different
micro version of GTK+ than the one they were compiled against.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>required_major</parameter>&nbsp;:</entry>
<entry>the required major version.
</entry></row>
<row><entry align="right"><parameter>required_minor</parameter>&nbsp;:</entry>
<entry>the required major version.
</entry></row>
<row><entry align="right"><parameter>required_micro</parameter>&nbsp;:</entry>
<entry>the required major version.
</entry></row>
<row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry><literal>NULL</literal> if the GTK+ library is compatible with the given version, or
a string describing the version mismatch.


</entry></row>
</tbody></tgroup></informaltable></refsect2>
<refsect2>
<title><anchor id="GTK-MAJOR-VERSION-CAPS">GTK_MAJOR_VERSION</title>
<programlisting>#define GTK_MAJOR_VERSION				(2)
</programlisting>
<para>
Like <link linkend="gtk-major-version">gtk_major_version</link>, but from the headers used at
application compile time, rather than from the library linked against
at application run time.
</para></refsect2>
<refsect2>
<title><anchor id="GTK-MINOR-VERSION-CAPS">GTK_MINOR_VERSION</title>
<programlisting>#define GTK_MINOR_VERSION				(0)
</programlisting>
<para>
Like <link linkend="gtk-minor-version">gtk_minor_version</link>, but from the headers used at
application compile time, rather than from the library linked against
at application run time.
</para></refsect2>
<refsect2>
<title><anchor id="GTK-MICRO-VERSION-CAPS">GTK_MICRO_VERSION</title>
<programlisting>#define GTK_MICRO_VERSION				(6)
</programlisting>
<para>
Like <link linkend="gtk-micro-version">gtk_micro_version</link>, but from the headers used at
application compile time, rather than from the library linked against
at application run time.
</para></refsect2>
<refsect2>
<title><anchor id="GTK-BINARY-AGE-CAPS">GTK_BINARY_AGE</title>
<programlisting>#define GTK_BINARY_AGE					(6)
</programlisting>
<para>
Like <link linkend="gtk-binary-age">gtk_binary_age</link>, but from the headers used at
application compile time, rather than from the library linked against
at application run time.
</para></refsect2>
<refsect2>
<title><anchor id="GTK-INTERFACE-AGE-CAPS">GTK_INTERFACE_AGE</title>
<programlisting>#define GTK_INTERFACE_AGE				(6)
</programlisting>
<para>
Like <link linkend="gtk-interface-age">gtk_interface_age</link>, but from the headers used at
application compile time, rather than from the library linked against
at application run time.
</para></refsect2>
<refsect2>
<title><anchor id="GTK-CHECK-VERSION-CAPS">GTK_CHECK_VERSION()</title>
<programlisting>#define     GTK_CHECK_VERSION(major,minor,micro)</programlisting>
<para>
Returns <literal>TRUE</literal> if the version of the GTK+ header files is the same
as the passed-in version.
</para><informaltable pgwide="1" frame="none" role="params">
<tgroup cols="2">
<colspec colwidth="2*">
<colspec colwidth="8*">
<tbody>
<row><entry align="right"><parameter>major</parameter>&nbsp;:</entry>
<entry>major version (e.g. 1 for version 1.2.5)
</entry></row>
<row><entry align="right"><parameter>minor</parameter>&nbsp;:</entry>
<entry>minor version (e.g. 2 for version 1.2.5)
</entry></row>
<row><entry align="right"><parameter>micro</parameter>&nbsp;:</entry>
<entry>micro version (e.g. 5 for version 1.2.5)


</entry></row>
</tbody></tgroup></informaltable></refsect2>

</refsect1>




</refentry>
