docs: Move the version SECTION

Move it to a separate documentation file, since most of what’s covered
isn’t introspectable.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
This commit is contained in:
Philip Withnall 2023-11-21 17:16:12 +00:00
parent 194db3f096
commit 229b76a388
4 changed files with 48 additions and 22 deletions

View File

@ -71,6 +71,7 @@ content_files = [
"data-structures.md",
"uuid.md",
"unicode.md",
"version.md",
"threads-deprecated.md",
]

View File

@ -170,6 +170,7 @@ expand_content_files = [
'data-structures.md',
'unicode.md',
'uuid.md',
'version.md',
]
glib_toml = configure_file(input: 'glib.toml.in', output: 'glib.toml', configuration: toml_conf)

View File

@ -0,0 +1,46 @@
Title: Version Information
SPDX-License-Identifier: LGPL-2.1-or-later
SPDX-FileCopyrightText: 2004 Matthias Clasen
SPDX-FileCopyrightText: 2012 Emmanuele Bassi
# Version Information
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.
## Run-time Version Numbers
The variables `glib_major_version`, `glib_minor_version`, `glib_micro_version`,
`glib_binary_age` and `glib_interface_age` are all available to check.
They can be compared using the function [func@GLib.check_version].
## Compile-time Version Numbers
* [const@GLib.MAJOR_VERSION]
* [const@GLib.MINOR_VERSION]
* [const@GLib.MICRO_VERSION]
* [func@GLib.CHECK_VERSION]
## Version Numbers
The GLib headers annotate deprecated APIs in a way that produces
compiler warnings if these deprecated APIs are used. The warnings
can be turned off by defining the macro `GLIB_DISABLE_DEPRECATION_WARNINGS`
before including the `glib.h` header.
GLib also provides support for building applications against
defined subsets of deprecated or new GLib APIs. Define the macro
`GLIB_VERSION_MIN_REQUIRED` to specify up to what version of GLib
you want to receive warnings about deprecated APIs. Define the
macro `GLIB_VERSION_MAX_ALLOWED` to specify the newest version of
GLib whose API you want to use.
The macros `GLIB_VERSION_2_2`, `GLIB_VERSION_2_4`, …, `GLIB_VERSION_2_80`, etc.
are defined automatically in each release, and can be used to set the value
of macros like `GLIB_VERSION_MIN_REQUIRED`.
The macros `GLIB_VERSION_CUR_STABLE` and `GLIB_VERSION_PREV_STABLE` are also
automatically defined to point to the right version definitions.

View File

@ -28,28 +28,6 @@
#include "gversion.h"
/**
* SECTION:version
* @Title: Version Information
* @Short_description: variables and functions to check the GLib version
*
* 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.
*
* The GLib headers annotate deprecated APIs in a way that produces
* compiler warnings if these deprecated APIs are used. The warnings
* can be turned off by defining the macro %GLIB_DISABLE_DEPRECATION_WARNINGS
* before including the glib.h header.
*
* GLib also provides support for building applications against
* defined subsets of deprecated or new GLib APIs. Define the macro
* %GLIB_VERSION_MIN_REQUIRED to specify up to what version of GLib
* you want to receive warnings about deprecated APIs. Define the
* macro %GLIB_VERSION_MAX_ALLOWED to specify the newest version of
* GLib whose API you want to use.
*/
/**
* glib_major_version:
*