mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-25 18:39:00 +02:00
New function to check the version of GLib at runtime. (#149175, Michael
Tue Aug 3 14:58:20 2004 Matthias Clasen <maclas@gmx.de> * glib/gutils.h: * glib/gutils.c (glib_check_version): New function to check the version of GLib at runtime. (#149175, Michael Natterer)
This commit is contained in:
committed by
Matthias Clasen
parent
247843302a
commit
a62fd5ec60
@@ -1,3 +1,10 @@
|
||||
Tue Aug 3 15:34:16 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* glib/glib-sections.txt: Add a separate section for
|
||||
version information.
|
||||
* glib/glib-docs.sgml: Include version section.
|
||||
* glib/tmpl/version.sgml: New template.
|
||||
|
||||
2004-08-02 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* glib/glib-sections.txt:
|
||||
|
@@ -55,6 +55,7 @@
|
||||
<!ENTITY glib-Shell SYSTEM "xml/shell.xml">
|
||||
<!ENTITY glib-Markup SYSTEM "xml/markup.xml">
|
||||
<!ENTITY glib-i18n SYSTEM "xml/i18n.xml">
|
||||
<!ENTITY glib-Version SYSTEM "xml/version.xml">
|
||||
|
||||
<!ENTITY glib-Compiling SYSTEM "compiling.sgml">
|
||||
<!ENTITY glib-Building SYSTEM "building.sgml">
|
||||
@@ -100,6 +101,7 @@ synchronize their operation.
|
||||
|
||||
<chapter id="glib-fundamentals">
|
||||
<title>GLib Fundamentals</title>
|
||||
&glib-Version;
|
||||
&glib-Basic-Types;
|
||||
&glib-Limits-of-Basic-Types;
|
||||
&glib-Standard-Macros;
|
||||
|
@@ -95,20 +95,30 @@ G_MAXDOUBLE
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE>Standard Macros</TITLE>
|
||||
<FILE>macros</FILE>
|
||||
<TITLE>Version Information</TITLE>
|
||||
<FILE>version</FILE>
|
||||
glib_major_version
|
||||
glib_minor_version
|
||||
glib_micro_version
|
||||
glib_binary_age
|
||||
glib_interface_age
|
||||
glib_check_version
|
||||
|
||||
<SUBSECTION>
|
||||
GLIB_MAJOR_VERSION
|
||||
GLIB_MINOR_VERSION
|
||||
GLIB_MICRO_VERSION
|
||||
GLIB_CHECK_VERSION
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE>Standard Macros</TITLE>
|
||||
<FILE>macros</FILE>
|
||||
<SUBSECTION>
|
||||
G_OS_WIN32
|
||||
G_OS_BEOS
|
||||
G_OS_UNIX
|
||||
|
||||
<SUBSECTION>
|
||||
GLIB_CHECK_VERSION
|
||||
|
||||
<SUBSECTION>
|
||||
G_DIR_SEPARATOR
|
||||
G_DIR_SEPARATOR_S
|
||||
@@ -141,12 +151,6 @@ G_MEM_ALIGN
|
||||
<SUBSECTION>
|
||||
G_CONST_RETURN
|
||||
|
||||
<SUBSECTION Private>
|
||||
glib_major_version
|
||||
glib_micro_version
|
||||
glib_minor_version
|
||||
glib_interface_age
|
||||
glib_binary_age
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@@ -14,27 +14,6 @@ These macros provide a few commonly-used features.
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### MACRO GLIB_MAJOR_VERSION ##### -->
|
||||
<para>
|
||||
The major version number of the GLib library.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GLIB_MINOR_VERSION ##### -->
|
||||
<para>
|
||||
The minor version number of the GLib library.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GLIB_MICRO_VERSION ##### -->
|
||||
<para>
|
||||
The micro version number of the GLib library.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO G_OS_WIN32 ##### -->
|
||||
<para>
|
||||
This macro is defined only on Windows. So you can bracket
|
||||
@@ -59,26 +38,6 @@ UNIX-specific code in "#ifdef G_OS_UNIX".
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GLIB_CHECK_VERSION ##### -->
|
||||
<para>
|
||||
Checks the version of the GLib library.
|
||||
It returns %TRUE if the GLib library is the same or newer than the given
|
||||
version.
|
||||
|
||||
<example>
|
||||
<title>Checking the version of the GLib library</title>
|
||||
<programlisting>
|
||||
if (!GLIB_CHECK_VERSION (1, 2, 0))
|
||||
g_error ("GLib version 1.2.0 or above is needed");
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
@major: the major version number.
|
||||
@minor: the minor version number.
|
||||
@micro: the micro version number.
|
||||
|
||||
|
||||
<!-- ##### MACRO G_DIR_SEPARATOR ##### -->
|
||||
<para>
|
||||
The directory separator character.
|
||||
|
136
docs/reference/glib/tmpl/version.sgml
Normal file
136
docs/reference/glib/tmpl/version.sgml
Normal file
@@ -0,0 +1,136 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Version Information
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Variables and functions to check the GLib version
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
GLib 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>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### VARIABLE glib_major_version ##### -->
|
||||
<para>
|
||||
The major version number of the GLib library.
|
||||
(e.g. in GLib version 1.2.5 this is 1.)
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This variable is in the library, so represents the
|
||||
GLib library you have linked against. Contrast with the
|
||||
#GLIB_MAJOR_VERSION macro, which represents the major version of the
|
||||
GLib headers you have included.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### VARIABLE glib_minor_version ##### -->
|
||||
<para>
|
||||
The minor version number of the GLib library.
|
||||
(e.g. in GLib version 1.2.5 this is 2.)
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This variable is in the library, so represents the
|
||||
GLib library you have linked against. Contrast with the
|
||||
#GLIB_MINOR_VERSION macro, which represents the minor version of the
|
||||
GLib headers you have included.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### VARIABLE glib_micro_version ##### -->
|
||||
<para>
|
||||
The micro version number of the GLib library.
|
||||
(e.g. in GLib version 1.2.5 this is 5.)
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This variable is in the library, so represents the GLib library you
|
||||
have linked against. Contrast with the #GLIB_MICRO_VERSION macro, which
|
||||
represents the micro version of the GLib headers you have included.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### VARIABLE glib_binary_age ##### -->
|
||||
<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>
|
||||
|
||||
|
||||
<!-- ##### VARIABLE glib_interface_age ##### -->
|
||||
<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>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION glib_check_version ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@required_major:
|
||||
@required_minor:
|
||||
@required_micro:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### MACRO GLIB_MAJOR_VERSION ##### -->
|
||||
<para>
|
||||
The major version number of the GLib library.
|
||||
Like #glib_major_version, but from the headers used at
|
||||
application compile time, rather than from the library linked against
|
||||
at application run time.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GLIB_MINOR_VERSION ##### -->
|
||||
<para>
|
||||
The minor version number of the GLib library.
|
||||
Like #gtk_minor_version, but from the headers used at
|
||||
application compile time, rather than from the library linked against
|
||||
at application run time.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GLIB_MICRO_VERSION ##### -->
|
||||
<para>
|
||||
The micro version number of the GLib library.
|
||||
Like #gtk_micro_version, but from the headers used at
|
||||
application compile time, rather than from the library linked against
|
||||
at application run time.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GLIB_CHECK_VERSION ##### -->
|
||||
<para>
|
||||
Checks the version of the GLib library.
|
||||
It returns %TRUE if the GLib library is the same or newer than the given
|
||||
version.
|
||||
|
||||
<example>
|
||||
<title>Checking the version of the GLib library</title>
|
||||
<programlisting>
|
||||
if (!GLIB_CHECK_VERSION (1, 2, 0))
|
||||
g_error ("GLib version 1.2.0 or above is needed");
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
@major: the major version number.
|
||||
@minor: the minor version number.
|
||||
@micro: the micro version number.
|
||||
|
||||
|
Reference in New Issue
Block a user